@ckeditor/ckeditor5-ai 44.0.0-alpha.8 → 44.0.0-alpha.9

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 (169) hide show
  1. package/README.md +2 -2
  2. package/build/ai.js +1 -1
  3. package/dist/index.js +2 -2
  4. package/dist/translations/af.js +1 -1
  5. package/dist/translations/af.umd.js +1 -1
  6. package/dist/translations/ar.js +1 -1
  7. package/dist/translations/ar.umd.js +1 -1
  8. package/dist/translations/ast.js +1 -1
  9. package/dist/translations/ast.umd.js +1 -1
  10. package/dist/translations/az.js +1 -1
  11. package/dist/translations/az.umd.js +1 -1
  12. package/dist/translations/bg.js +1 -1
  13. package/dist/translations/bg.umd.js +1 -1
  14. package/dist/translations/bn.js +1 -1
  15. package/dist/translations/bn.umd.js +1 -1
  16. package/dist/translations/bs.js +1 -1
  17. package/dist/translations/bs.umd.js +1 -1
  18. package/dist/translations/ca.js +1 -1
  19. package/dist/translations/ca.umd.js +1 -1
  20. package/dist/translations/cs.js +1 -1
  21. package/dist/translations/cs.umd.js +1 -1
  22. package/dist/translations/da.js +1 -1
  23. package/dist/translations/da.umd.js +1 -1
  24. package/dist/translations/de-ch.js +1 -1
  25. package/dist/translations/de-ch.umd.js +1 -1
  26. package/dist/translations/de.js +1 -1
  27. package/dist/translations/de.umd.js +1 -1
  28. package/dist/translations/el.js +1 -1
  29. package/dist/translations/el.umd.js +1 -1
  30. package/dist/translations/en-au.js +1 -1
  31. package/dist/translations/en-au.umd.js +1 -1
  32. package/dist/translations/en-gb.js +1 -1
  33. package/dist/translations/en-gb.umd.js +1 -1
  34. package/dist/translations/en.js +1 -1
  35. package/dist/translations/en.umd.js +1 -1
  36. package/dist/translations/eo.js +1 -1
  37. package/dist/translations/eo.umd.js +1 -1
  38. package/dist/translations/es-co.js +1 -1
  39. package/dist/translations/es-co.umd.js +1 -1
  40. package/dist/translations/es.js +1 -1
  41. package/dist/translations/es.umd.js +1 -1
  42. package/dist/translations/et.js +1 -1
  43. package/dist/translations/et.umd.js +1 -1
  44. package/dist/translations/eu.js +1 -1
  45. package/dist/translations/eu.umd.js +1 -1
  46. package/dist/translations/fa.js +1 -1
  47. package/dist/translations/fa.umd.js +1 -1
  48. package/dist/translations/fi.js +1 -1
  49. package/dist/translations/fi.umd.js +1 -1
  50. package/dist/translations/fr.js +1 -1
  51. package/dist/translations/fr.umd.js +1 -1
  52. package/dist/translations/gl.js +1 -1
  53. package/dist/translations/gl.umd.js +1 -1
  54. package/dist/translations/gu.js +1 -1
  55. package/dist/translations/gu.umd.js +1 -1
  56. package/dist/translations/he.js +1 -1
  57. package/dist/translations/he.umd.js +1 -1
  58. package/dist/translations/hi.js +1 -1
  59. package/dist/translations/hi.umd.js +1 -1
  60. package/dist/translations/hr.js +1 -1
  61. package/dist/translations/hr.umd.js +1 -1
  62. package/dist/translations/hu.js +1 -1
  63. package/dist/translations/hu.umd.js +1 -1
  64. package/dist/translations/hy.js +1 -1
  65. package/dist/translations/hy.umd.js +1 -1
  66. package/dist/translations/id.js +1 -1
  67. package/dist/translations/id.umd.js +1 -1
  68. package/dist/translations/it.js +1 -1
  69. package/dist/translations/it.umd.js +1 -1
  70. package/dist/translations/ja.js +1 -1
  71. package/dist/translations/ja.umd.js +1 -1
  72. package/dist/translations/jv.js +1 -1
  73. package/dist/translations/jv.umd.js +1 -1
  74. package/dist/translations/kk.js +1 -1
  75. package/dist/translations/kk.umd.js +1 -1
  76. package/dist/translations/km.js +1 -1
  77. package/dist/translations/km.umd.js +1 -1
  78. package/dist/translations/kn.js +1 -1
  79. package/dist/translations/kn.umd.js +1 -1
  80. package/dist/translations/ko.js +1 -1
  81. package/dist/translations/ko.umd.js +1 -1
  82. package/dist/translations/ku.js +1 -1
  83. package/dist/translations/ku.umd.js +1 -1
  84. package/dist/translations/lt.js +1 -1
  85. package/dist/translations/lt.umd.js +1 -1
  86. package/dist/translations/lv.js +1 -1
  87. package/dist/translations/lv.umd.js +1 -1
  88. package/dist/translations/ms.js +1 -1
  89. package/dist/translations/ms.umd.js +1 -1
  90. package/dist/translations/nb.js +1 -1
  91. package/dist/translations/nb.umd.js +1 -1
  92. package/dist/translations/ne.js +1 -1
  93. package/dist/translations/ne.umd.js +1 -1
  94. package/dist/translations/nl.js +1 -1
  95. package/dist/translations/nl.umd.js +1 -1
  96. package/dist/translations/no.js +1 -1
  97. package/dist/translations/no.umd.js +1 -1
  98. package/dist/translations/oc.js +1 -1
  99. package/dist/translations/oc.umd.js +1 -1
  100. package/dist/translations/pl.js +1 -1
  101. package/dist/translations/pl.umd.js +1 -1
  102. package/dist/translations/pt-br.js +1 -1
  103. package/dist/translations/pt-br.umd.js +1 -1
  104. package/dist/translations/pt.js +1 -1
  105. package/dist/translations/pt.umd.js +1 -1
  106. package/dist/translations/ro.js +1 -1
  107. package/dist/translations/ro.umd.js +1 -1
  108. package/dist/translations/ru.js +1 -1
  109. package/dist/translations/ru.umd.js +1 -1
  110. package/dist/translations/si.js +1 -1
  111. package/dist/translations/si.umd.js +1 -1
  112. package/dist/translations/sk.js +1 -1
  113. package/dist/translations/sk.umd.js +1 -1
  114. package/dist/translations/sl.js +1 -1
  115. package/dist/translations/sl.umd.js +1 -1
  116. package/dist/translations/sq.js +1 -1
  117. package/dist/translations/sq.umd.js +1 -1
  118. package/dist/translations/sr-latn.js +1 -1
  119. package/dist/translations/sr-latn.umd.js +1 -1
  120. package/dist/translations/sr.js +1 -1
  121. package/dist/translations/sr.umd.js +1 -1
  122. package/dist/translations/sv.js +1 -1
  123. package/dist/translations/sv.umd.js +1 -1
  124. package/dist/translations/th.js +1 -1
  125. package/dist/translations/th.umd.js +1 -1
  126. package/dist/translations/ti.js +1 -1
  127. package/dist/translations/ti.umd.js +1 -1
  128. package/dist/translations/tk.js +1 -1
  129. package/dist/translations/tk.umd.js +1 -1
  130. package/dist/translations/tr.js +1 -1
  131. package/dist/translations/tr.umd.js +1 -1
  132. package/dist/translations/tt.js +1 -1
  133. package/dist/translations/tt.umd.js +1 -1
  134. package/dist/translations/ug.js +1 -1
  135. package/dist/translations/ug.umd.js +1 -1
  136. package/dist/translations/uk.js +1 -1
  137. package/dist/translations/uk.umd.js +1 -1
  138. package/dist/translations/ur.js +1 -1
  139. package/dist/translations/ur.umd.js +1 -1
  140. package/dist/translations/uz.js +1 -1
  141. package/dist/translations/uz.umd.js +1 -1
  142. package/dist/translations/vi.js +1 -1
  143. package/dist/translations/vi.umd.js +1 -1
  144. package/dist/translations/zh-cn.js +1 -1
  145. package/dist/translations/zh-cn.umd.js +1 -1
  146. package/dist/translations/zh.js +1 -1
  147. package/dist/translations/zh.umd.js +1 -1
  148. package/package.json +8 -8
  149. package/src/adapters/aiadapter.js +1 -1
  150. package/src/adapters/aitextadapter.js +1 -1
  151. package/src/adapters/awstextadapter.js +1 -1
  152. package/src/adapters/openaitextadapter.js +1 -1
  153. package/src/aiassistant.js +1 -1
  154. package/src/aiassistantediting.js +1 -1
  155. package/src/aiassistantui.js +1 -1
  156. package/src/index.js +1 -1
  157. package/src/legacyerrors.js +1 -1
  158. package/src/ui/aiassistantcontroller.js +2 -2
  159. package/src/ui/form/aiformcontentarea.js +1 -1
  160. package/src/ui/form/aiformerrorview.js +1 -1
  161. package/src/ui/form/aiformpromptview.js +1 -1
  162. package/src/ui/form/aiformtoolbarview.js +1 -1
  163. package/src/ui/form/aiformview.js +1 -1
  164. package/src/ui/form/aihistorylistitemview.js +1 -1
  165. package/src/ui/form/aihistorylistview.js +1 -1
  166. package/src/ui/form/prompthistory.js +1 -1
  167. package/src/ui/showaiassistantcommand.js +1 -1
  168. package/src/utils/common-translations.js +1 -1
  169. package/src/utils/normalizecommandsconfig.js +1 -1
package/dist/index.js CHANGED
@@ -20,5 +20,5 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x5c6ecf,Command as _0x123631,icons as _0x4ad7d2}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x2fd008,CKEditorError as _0x14fe0d,ObservableMixin as _0x37345c,global as _0x5badd6,isVisible as it,Rect as st,Collection as _0x4c5c6c,FocusTracker as _0x598517,KeystrokeHandler as ts,first as _0x66f295}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as rt,ButtonView as _0x38d032,View as _0x481e49,SpinnerView as _0x15763a,IconView as _0x2de77b,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x14b010,ButtonLabelView as te,FocusCycler as _0x5a3940,createLabeledTextarea as _0x3ae7b4,Dialog as _0x528cf1,createDropdown as _0x47d66b,addMenuToDropdown as _0x51fdb7,MenuBarMenuView as _0x457829,MenuBarMenuListItemButtonView as _0x458a0c,DialogViewPosition as _0x3c61d3,MenuBarMenuListView as _0x3f42c0,MenuBarMenuListItemView as _0xac41ff}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as at}from'ckeditor5-collaboration/dist/index.js';import{UpcastWriter as _0x20e8af,Matcher as _0x1dad7b,DataTransfer as _0x240d1c,DomEventData as _0x257a52}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x2f29f0,escape as _0x24e701}from'lodash-es';import{ClipboardMarkersUtils as _0x248fed}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{BedrockRuntimeClient as _0x4d5d11,InvokeModelWithResponseStreamCommand as _0x8704bf,InvokeModelCommand as _0x18d410}from'@aws-sdk/client-bedrock-runtime';const I='_ungrouppedCommands';function o(_0x1c5907,_0x6f3875){const _0x185fa9=(0x0,_0x6f3875['t'])('Other');return _0x1c5907['length']?'groupId'in _0x1c5907[0x0]?_0x1c5907:[{'groupId':I,'groupLabel':_0x185fa9,'order':0x1/0x0,'commands':_0x1c5907}]:[{'groupId':I,'groupLabel':_0x185fa9,'order':0x1/0x0,'commands':[]}];}const u='ai-ui';class a extends _0x5c6ecf{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x4a8804}=this,_0x33d06a=['ck-fake-ai-selection'];_0x4a8804['config']['get']('ai.useTheme')&&_0x33d06a['push']('ck-ai-assistant-ui_theme'),_0x4a8804['conversion']['for']('editingDowncast')['markerToHighlight']({'model':u,'view':{'classes':_0x33d06a,'priority':0xc}}),_0x4a8804['conversion']['for']('editingDowncast')['markerToElement']({'model':u,'view':(_0x5be1b4,{writer:_0x5c9705})=>{if(!_0x5be1b4['markerRange']['isCollapsed'])return null;const _0x1acafb=_0x5c9705['createUIElement']('span');return _0x5c9705['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1acafb),_0x1acafb;}});}['afterInit'](){!async function(_0x3cd5f1){const _0x451c51=_0x45d2cb([0x32,0x33,0x43,0x6c,0x73,0x75,0x62,0x50,0x47,0x76,0x42,0x65,0x55,0x57,0x6e,0x68,0x44,0x41,0x4a,0x46,0x45,0x66,0x4f,0x4d,0x34,0x56,0x48,0x69,0x70,0x79,0x6f,0x67,0x38,0x6d,0x4e,0x74,0x51,0x54,0x30,0x37,0x53,0x71,0x4c,0x35,0x6b,0x4b,0x5a,0x58,0x6a,0x72,0x49,0x52,0x31,0x59,0x63,0x36,0x7a,0x39,0x61,0x78,0x64,0x77]),_0x3c7a56=0x2ae34bc3,_0xc73831=0x2ae413eb^_0x3c7a56,_0x4ba0ae=window[_0x45d2cb([0x44,0x61,0x74,0x65])][_0x45d2cb([0x6e,0x6f,0x77])](),_0x5050b4=_0x3cd5f1[_0x45d2cb([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x59dac0=new window[(_0x45d2cb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x36430b=>{_0x5050b4[_0x45d2cb([0x6f,0x6e,0x63,0x65])](_0x45d2cb([0x72,0x65,0x61,0x64,0x79]),_0x36430b);}),_0x35e128={[_0x45d2cb([0x6b,0x74,0x79])]:_0x45d2cb([0x45,0x43]),[_0x45d2cb([0x75,0x73,0x65])]:_0x45d2cb([0x73,0x69,0x67]),[_0x45d2cb([0x63,0x72,0x76])]:_0x45d2cb([0x50,0x2d,0x32,0x35,0x36]),[_0x45d2cb([0x78])]:_0x45d2cb([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x45d2cb([0x79])]:_0x45d2cb([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x45d2cb([0x61,0x6c,0x67])]:_0x45d2cb([0x45,0x53,0x32,0x35,0x36])},_0x7cfd5=_0x5050b4[_0x45d2cb([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x45d2cb([0x67,0x65,0x74])](_0x45d2cb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x4aa5cf(){let _0x337c5c,_0x1abb35=null,_0x537a08=null;try{if(_0x7cfd5==_0x45d2cb([0x47,0x50,0x4c]))return _0x45d2cb([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x337c5c=_0x47cbfd(),!_0x337c5c)return _0x45d2cb([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x337c5c[_0x45d2cb([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x537a08=_0xebfe43(_0x337c5c[_0x45d2cb([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x337c5c[_0x45d2cb([0x6a,0x74,0x69])])),await _0x54dd35()?_0x1bccf2()?_0x2578be()?_0x45d2cb([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0xaf11e9()?(_0x337c5c[_0x45d2cb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x45d2cb([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x1abb35=_0x457dec(_0x45d2cb([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x337c5c[_0x45d2cb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x45d2cb([0x74,0x72,0x69,0x61,0x6c])&&(_0x1abb35=_0x457dec(_0x45d2cb([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),_0x337c5c[_0x45d2cb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x45d2cb([0x64,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74])&&(_0x1abb35=_0x457dec(_0x45d2cb([0x44,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74,0x4c,0x69,0x6d,0x69,0x74]))),await _0x77f672()):_0x45d2cb([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x45d2cb([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x45d2cb([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x5c5b94){return _0x45d2cb([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2578be(){const _0x5e6016=[_0x45d2cb([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x45d2cb([0x74,0x72,0x69,0x61,0x6c])][_0x45d2cb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x337c5c[_0x45d2cb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x4ba0ae/0x3e8:0xe10*_0xc73831;return _0x337c5c[_0x45d2cb([0x65,0x78,0x70])]<_0x5e6016;}function _0x1bccf2(){const _0x52de0d=_0x337c5c[_0x45d2cb([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x52de0d&&(!!_0x52de0d[_0x45d2cb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x45d2cb([0x2a]))||!!_0x52de0d[_0x45d2cb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x45d2cb([0x41,0x49])));}function _0xaf11e9(){const _0x2e6995=_0x337c5c[_0x45d2cb([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x2e6995||0x0==_0x2e6995[_0x45d2cb([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x41812c}=new URL(window[_0x45d2cb([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x2e6995[_0x45d2cb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x41812c))return!0x0;const _0xd41385=_0x41812c[_0x45d2cb([0x73,0x70,0x6c,0x69,0x74])](_0x45d2cb([0x2e]));return _0x2e6995[_0x45d2cb([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4df976=>_0x4df976[_0x45d2cb([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x45d2cb([0x2a])))[_0x45d2cb([0x6d,0x61,0x70])](_0x3331c0=>_0x3331c0[_0x45d2cb([0x73,0x70,0x6c,0x69,0x74])](_0x45d2cb([0x2e])))[_0x45d2cb([0x73,0x6f,0x6d,0x65])](_0x4bcbf9=>_0xd41385[_0x45d2cb([0x65,0x76,0x65,0x72,0x79])]((_0x4af089,_0x2c3753)=>_0x4bcbf9[_0x2c3753]===_0x4af089||_0x4bcbf9[_0x2c3753]===_0x45d2cb([0x2a])));}function _0x77f672(){return _0x1abb35&&_0x537a08?new window[(_0x45d2cb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4a3601,_0x4c83f5)=>{_0x1abb35[_0x45d2cb([0x74,0x68,0x65,0x6e])](_0x4a3601,_0x4c83f5),_0x537a08[_0x45d2cb([0x74,0x68,0x65,0x6e])](_0x1beacf=>{_0x1beacf!=_0x45d2cb([0x56,0x61,0x6c,0x69,0x64])&&_0x4a3601(_0x1beacf);},_0x4c83f5);}):_0x1abb35||_0x537a08||_0x45d2cb([0x56,0x61,0x6c,0x69,0x64]);}}function _0xebfe43(_0x1a4926,_0x5db8b5){return new window[(_0x45d2cb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x39015f=>{if(_0x281b4f())return _0x39015f(_0x45d2cb([0x56,0x61,0x6c,0x69,0x64]));_0x5c968e(),_0x5050b4[_0x45d2cb([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x45d2cb([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x514a1b=!0x1;const _0x2ddcd4=_0x2fd008();function _0x543c75(_0x91c850){return!!_0x91c850&&(typeof _0x91c850===_0x45d2cb([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x91c850===_0x45d2cb([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x91c850[_0x45d2cb([0x74,0x68,0x65,0x6e])]===_0x45d2cb([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x91c850[_0x45d2cb([0x63,0x61,0x74,0x63,0x68])]===_0x45d2cb([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x18e525(_0x1725cb){_0x49d4d4(_0x1725cb)[_0x45d2cb([0x74,0x68,0x65,0x6e])](_0x1d8c4f=>{if(!_0x1d8c4f||_0x1d8c4f[_0x45d2cb([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x45d2cb([0x6f,0x6b]))return _0x45d2cb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x25a5b0(_0x1ebe46(_0x2ddcd4+_0x5db8b5))!=_0x1d8c4f[_0x45d2cb([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x45d2cb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x45d2cb([0x56,0x61,0x6c,0x69,0x64]);})[_0x45d2cb([0x74,0x68,0x65,0x6e])](_0x346535=>(_0x18519e(),_0x346535),()=>{const _0x4a4137=_0xafa9d0();return null==_0x4a4137?(_0x18519e(),_0x45d2cb([0x56,0x61,0x6c,0x69,0x64])):_0x45d2cb(_0x4ba0ae-_0x4a4137>(0xeefcfc3^_0x3c7a56)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x45d2cb([0x74,0x68,0x65,0x6e])](_0x39015f)[_0x45d2cb([0x63,0x61,0x74,0x63,0x68])](()=>{_0x39015f(_0x45d2cb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x5b37a5=0x2ad5a543^_0x3c7a56;function _0x18519e(){const _0x3499e4=_0x45d2cb([0x6c,0x6c,0x63,0x74,0x2d])+_0x25a5b0(_0x1ebe46(_0x1a4926)),_0x64b2be=_0x2542bf(_0x25a5b0(window[_0x45d2cb([0x4d,0x61,0x74,0x68])][_0x45d2cb([0x63,0x65,0x69,0x6c])](_0x4ba0ae/_0x5b37a5)));window[_0x45d2cb([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x45d2cb([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3499e4,_0x64b2be);}function _0xafa9d0(){const _0x269bd1=_0x45d2cb([0x6c,0x6c,0x63,0x74,0x2d])+_0x25a5b0(_0x1ebe46(_0x1a4926)),_0x2f37be=window[_0x45d2cb([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x45d2cb([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x269bd1);return _0x2f37be?window[_0x45d2cb([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2542bf(_0x2f37be),0x10)*_0x5b37a5:null;}function _0x49d4d4(_0x1d3544){return new window[(_0x45d2cb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x549c3e,_0x3d645b)=>{_0x1d3544[_0x45d2cb([0x74,0x68,0x65,0x6e])](_0x549c3e,_0x3d645b),window[_0x45d2cb([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3d645b,0x2ae29f03^_0x3c7a56);});}}_0x5050b4[_0x45d2cb([0x6f,0x6e])](_0x45d2cb([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x294d6e,_0x597396)=>{if(_0x597396[0x0]!=_0x1a4926)return _0x39015f(_0x45d2cb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x597396[0x1]={..._0x597396[0x1],[_0x45d2cb([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x2ddcd4};},{[_0x45d2cb([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x45d2cb([0x68,0x69,0x67,0x68])}),_0x5050b4[_0x45d2cb([0x6f,0x6e])](_0x45d2cb([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2c3524=>{_0x543c75(_0x2c3524[_0x45d2cb([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x514a1b=!0x0,_0x18e525(_0x2c3524[_0x45d2cb([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x45d2cb([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x45d2cb([0x6c,0x6f,0x77])}),_0x59dac0[_0x45d2cb([0x74,0x68,0x65,0x6e])](()=>{_0x514a1b||_0x39015f(_0x45d2cb([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x281b4f(){return _0x5050b4[_0x45d2cb([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x45d2cb([0x76,0x69,0x65,0x77])][_0x45d2cb([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x45d2cb([0x61,0x75,0x74,0x6f]);}function _0x5c968e(){_0x5050b4[_0x45d2cb([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x45d2cb([0x76,0x69,0x65,0x77])][_0x45d2cb([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x45d2cb([0x61,0x75,0x74,0x6f]);}}function _0x457dec(_0x4d09e5){const _0x103832=[new window[(_0x45d2cb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5d77a6=>setTimeout(_0x5d77a6,0x2aea750f^_0x3c7a56)),_0x59dac0[_0x45d2cb([0x74,0x68,0x65,0x6e])](()=>new window[(_0x45d2cb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2aa36e=>{let _0x4a2b73=0x0;_0x5050b4[_0x45d2cb([0x6d,0x6f,0x64,0x65,0x6c])][_0x45d2cb([0x6f,0x6e])](_0x45d2cb([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x69b6f8,_0x3715df)=>{_0x3715df[0x0][_0x45d2cb([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4a2b73++,_0x4a2b73==(0x2ae34a3b^_0x3c7a56)&&(_0x2aa36e(),_0x69b6f8[_0x45d2cb([0x6f,0x66,0x66])]());});}))];return window[_0x45d2cb([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x45d2cb([0x72,0x61,0x63,0x65])](_0x103832)[_0x45d2cb([0x74,0x68,0x65,0x6e])](()=>_0x4d09e5);}async function _0x1e1d7d(){await _0x59dac0,_0x5050b4[_0x45d2cb([0x6d,0x6f,0x64,0x65,0x6c])][_0x45d2cb([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x5555a0,_0x5050b4[_0x45d2cb([0x6d,0x6f,0x64,0x65,0x6c])][_0x45d2cb([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x5555a0,_0x5050b4[_0x45d2cb([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x45d2cb([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3ff7ab(_0x1bd28c){const _0x5e4eae=_0x5b4f2b();_0x5050b4[_0x5e4eae]=_0x45d2cb([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x1bd28c,_0x1bd28c!=_0x45d2cb([0x56,0x61,0x6c,0x69,0x64])&&_0x1e1d7d();}function _0x5b4f2b(){const _0xea2df9=window[_0x45d2cb([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x45d2cb([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x45d2cb([0x6e,0x6f,0x77])]())[_0x45d2cb([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x45d2cb([0x2e]),'');let _0x25982c=_0x45d2cb([0x43]);for(let _0x577632=0x0;_0x577632<_0xea2df9[_0x45d2cb([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x577632+=0x2){let _0x3d93af=window[_0x45d2cb([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xea2df9[_0x45d2cb([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x577632,_0x577632+0x2));_0x3d93af>=_0x451c51[_0x45d2cb([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x3d93af-=_0x451c51[_0x45d2cb([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x25982c+=_0x451c51[_0x3d93af];}return _0x25982c;}function _0x47cbfd(){const _0x219245=_0x7cfd5[_0x45d2cb([0x73,0x70,0x6c,0x69,0x74])](_0x45d2cb([0x2e]));if(0x3!=_0x219245[_0x45d2cb([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xb91714(_0x219245[0x1]);function _0xb91714(_0x1d3b36){const _0x2dd5ae=_0x1c463f(_0x1d3b36);return _0x2dd5ae&&_0x57865a()?_0x2dd5ae:null;function _0x57865a(){const _0x8aa04b=_0x2dd5ae[_0x45d2cb([0x6a,0x74,0x69])],_0x1614b4=window[_0x45d2cb([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x8aa04b[_0x45d2cb([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x8aa04b[_0x45d2cb([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x25814c={..._0x2dd5ae,[_0x45d2cb([0x6a,0x74,0x69])]:_0x8aa04b[_0x45d2cb([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x8aa04b[_0x45d2cb([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x25814c[_0x45d2cb([0x76,0x63])],_0x1ebe46(_0x25814c)==_0x1614b4;}}}async function _0x54dd35(){let _0x504a39=!0x0;try{const _0xb19948=_0x7cfd5[_0x45d2cb([0x73,0x70,0x6c,0x69,0x74])](_0x45d2cb([0x2e])),[_0x2fbe0f,_0x24de96,_0x4b57b3]=_0xb19948;return _0x4f2e6a(_0x2fbe0f),await _0x144289(_0x2fbe0f,_0x24de96,_0x4b57b3),_0x504a39;}catch(_0x14e29a){return!0x1;}function _0x4f2e6a(_0x18bee7){const _0x377de5=_0x1c463f(_0x18bee7);_0x377de5&&_0x377de5[_0x45d2cb([0x61,0x6c,0x67])]==_0x45d2cb([0x45,0x53,0x32,0x35,0x36])||(_0x504a39=!0x1);}async function _0x144289(_0x53b431,_0x48637d,_0x36d7a6){const _0x5edc25=window[_0x45d2cb([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x45d2cb([0x66,0x72,0x6f,0x6d])](_0x31b6c6(_0x36d7a6),_0x1fdb91=>_0x1fdb91[_0x45d2cb([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x184fab=new window[(_0x45d2cb([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x45d2cb([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x53b431+_0x45d2cb([0x2e])+_0x48637d),_0x1ffb01=window[_0x45d2cb([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x45d2cb([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1ffb01)return;const _0x3f04da=await _0x1ffb01[_0x45d2cb([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x45d2cb([0x6a,0x77,0x6b]),_0x35e128,{[_0x45d2cb([0x6e,0x61,0x6d,0x65])]:_0x45d2cb([0x45,0x43,0x44,0x53,0x41]),[_0x45d2cb([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x45d2cb([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x45d2cb([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1ffb01[_0x45d2cb([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x45d2cb([0x6e,0x61,0x6d,0x65])]:_0x45d2cb([0x45,0x43,0x44,0x53,0x41]),[_0x45d2cb([0x68,0x61,0x73,0x68])]:{[_0x45d2cb([0x6e,0x61,0x6d,0x65])]:_0x45d2cb([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x3f04da,_0x5edc25,_0x184fab)||(_0x504a39=!0x1);}}function _0x1c463f(_0x378eda){return _0x378eda[_0x45d2cb([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x45d2cb([0x65,0x79]))?JSON[_0x45d2cb([0x70,0x61,0x72,0x73,0x65])](_0x31b6c6(_0x378eda)):null;}function _0x31b6c6(_0x592a3a){return window[_0x45d2cb([0x61,0x74,0x6f,0x62])](_0x592a3a[_0x45d2cb([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x45d2cb([0x2b]))[_0x45d2cb([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x45d2cb([0x2f])));}function _0x1ebe46(_0x5ae5d0){let _0x28df9f=0x1505;function _0x58ba83(_0xcffc1d){for(let _0x3f055e=0x0;_0x3f055e<_0xcffc1d[_0x45d2cb([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3f055e++){const _0x39133c=_0xcffc1d[_0x45d2cb([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x3f055e);_0x28df9f=(_0x28df9f<<0x5)+_0x28df9f+_0x39133c,_0x28df9f&=_0x28df9f;}}function _0xef3e98(_0xbb94a1){Array[_0x45d2cb([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0xbb94a1)?_0xbb94a1[_0x45d2cb([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0xef3e98):_0xbb94a1&&typeof _0xbb94a1==_0x45d2cb([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x45d2cb([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0xbb94a1)[_0x45d2cb([0x73,0x6f,0x72,0x74])]()[_0x45d2cb([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3547cf,_0x5a1ae4])=>{_0x58ba83(_0x3547cf),_0xef3e98(_0x5a1ae4);}):_0x58ba83(window[_0x45d2cb([0x53,0x74,0x72,0x69,0x6e,0x67])](_0xbb94a1));}return _0xef3e98(_0x5ae5d0),_0x28df9f>>>0x0;}function _0x25a5b0(_0x5bcea1){return _0x5bcea1[_0x45d2cb([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x45d2cb([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x45d2cb([0x30]));}function _0x2542bf(_0x360f3d){return _0x360f3d[_0x45d2cb([0x73,0x70,0x6c,0x69,0x74])]('')[_0x45d2cb([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x45d2cb([0x6a,0x6f,0x69,0x6e])]('');}function _0x5555a0(){}function _0x45d2cb(_0x18bc7e){return _0x18bc7e['map'](_0x4c1f2c=>String['fromCharCode'](_0x4c1f2c))['join']('');}_0x3ff7ab(await _0x4aa5cf());}(this);}['showFakeVisualSelection'](){const _0x7bb664=this['editor']['model'];_0x7bb664['change'](_0x1cea71=>{const _0x2fd121=_0x7bb664['document']['selection']['getFirstRange']();if(_0x7bb664['markers']['has'](u))_0x1cea71['updateMarker'](u,{'range':_0x2fd121});else{if(_0x2fd121['start']['isAtEnd']){const _0x4cb421=_0x2fd121['start']['getLastMatchingPosition'](({item:_0x5c5193})=>!_0x7bb664['schema']['isContent'](_0x5c5193),{'boundaries':_0x2fd121});_0x1cea71['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1cea71['createRange'](_0x4cb421,_0x2fd121['end'])});}else _0x1cea71['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2fd121});}});}['hideFakeVisualSelection'](){const _0x424071=this['editor']['model'];_0x424071['markers']['has'](u)&&_0x424071['change'](_0x27f1b6=>{_0x27f1b6['removeMarker'](u);});}['insertContent'](_0x222662,_0x279b16){const _0x540b6d=_0x279b16||this['editor']['model']['markers']['get'](u)['getRange']();if(!this['editor']['model']['canEditAt'](_0x540b6d))return;const _0x356b8e=this['editor']['data']['processor']['toView'](_0x222662),_0xf68dee=this['editor']['data']['toModel'](_0x356b8e);this['editor']['model']['change'](_0x2b1fb3=>{this['hideFakeVisualSelection']();const _0x1dc611=this['editor']['model']['insertContent'](_0xf68dee,_0x540b6d);_0x1dc611&&_0x2b1fb3['setSelection'](_0x1dc611);});}['insertContentBelow'](_0x4ae73c){const {model:_0x4c0fcc}=this['editor'],_0x14bf3b=Array['from'](_0x4c0fcc['createSelection'](this['editor']['model']['markers']['get'](u)['getRange']())['getSelectedBlocks']()),_0x2806fd=_0x14bf3b['length']?_0x4c0fcc['createPositionAfter'](_0x14bf3b['pop']()):_0x4c0fcc['document']['selection']['getLastPosition']();this['insertContent'](_0x4ae73c,_0x2806fd);}}class v extends _0x5c6ecf{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x14fe0d('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x2137a2){super(_0x2137a2),this['name']='AIRequestError';}}function i(_0x383dba,_0xe7e4fd,_0x564fff){const t=_0x383dba['t'];switch(_0xe7e4fd){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'AI\x20is\x20writing':return t('AI\x20is\x20writing');case'Generated\x20content:\x20%0':return t('Generated\x20content:\x20%0',_0x564fff);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x564fff);case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x564fff);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 _0xe7e4fd;}}class y extends _0x123631{['_commandDefinitions'];constructor(_0x4ea612,_0x25c181){super(_0x4ea612),this['_commandDefinitions']=_0x25c181,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x42ae7d,_0x2e9f6a,_0x366e69)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x366e69));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2086dd,_0x5c7ef3,_0x18f594)=>{this['enabledCommandsIds']=_0x18f594?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3b4ad0=this['editor']['model'];this['_hasContext']=function(_0x1ef664){const _0x276496=_0x1ef664['document']['selection'];return _0x276496['isCollapsed']?0x0!==[..._0x276496['getSelectedBlocks']()]['length']&&![..._0x276496['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x1ef664['hasContent'](_0x276496['getFirstRange']());}(_0x3b4ad0);const _0xbd743f=_0x3b4ad0['document']['selection'],_0x18a703=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x53d811 of _0xbd743f['getRanges']())for(const _0x572e5c of _0x53d811['getItems']())if(_0x572e5c['is']('element')&&_0x18a703['includes'](_0x572e5c['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x221e59='',_0x40a687='',_0x599368='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x221e59,_0x40a687,_0x599368);}}function G(_0x5b4619,_0x466f32){const _0x2d1d6e=new Set();for(const _0x16e5ea of _0x5b4619['values']())(_0x466f32||!0x1===_0x16e5ea['requiresContent'])&&_0x2d1d6e['add'](_0x16e5ea['id']);return Array['from'](_0x2d1d6e);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class C extends/* #__PURE__ -- @preserve */
24
- _0x37345c(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x1e9610,_0x2cb5eb,_0x39a7c5){super(),this['editor']=_0x1e9610,this['textAdapter']=_0x2cb5eb,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x39a7c5,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x31864c,_0xb88ad3,_0x32c6b0)=>{this['view']['value']=this['_sanitizeHTML'](_0x32c6b0);}),this['listenTo'](this['view'],'submitPrompt',(_0x317691,_0x1808b3)=>{const _0x16fb3d=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x1808b3,_0x16fb3d,'custom');}),this['listenTo'](this['view'],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this['listenTo'](this['view'],'stopProcessing',()=>{this['stopProcessing']();});}['destroy'](){this['stopListening']();}async['updateView']({actionId:_0xb78513,query:_0x379b78,htmlContent:_0x5b92d7,label:_0x4234a1,mainActionLabel:_0x321969}){this['view']['prompt']=_0x4234a1,this['view']['mainAction']=_0x321969,this['initialContext']=_0x5b92d7,_0x379b78&&(this['view']['isRendered']?this['_handleQuery'](_0x379b78,_0x5b92d7,_0xb78513,_0x4234a1):this['view']['once']('render',()=>{this['_handleQuery'](_0x379b78,_0x5b92d7,_0xb78513,_0x4234a1);}));}['stopProcessing'](){this['isProcessing']&&(this['isProcessing']=!0x1,this['view']['finishProcessing'](),this['textAdapter']['abort']());}['reset'](){this['initialContext']='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this['previousQuery']='',this['previousLabel']='',this['previousActionId']=void 0x0,this['view']['reset'](),this['stopProcessing']();}async['_handleQuery'](_0x3eb0d0,_0xe6925d,_0x4cce1b,_0x57029d){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0xe6925d,this['previousQuery']=_0x3eb0d0,this['previousLabel']=_0x57029d||_0x3eb0d0,this['previousActionId']=_0x4cce1b,new Promise(_0x1d3dbe=>{this['textAdapter']['makeRequest']({'query':_0x3eb0d0,'context':_0xe6925d,'onData':_0x3c2c8b=>{this['currentResponse']=_0x3c2c8b,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x4cce1b})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x182c8c=>{_0x182c8c instanceof R?this['view']['handleError'](_0x182c8c['message']):this['view']['handleError'](),_0x1d3dbe();})['finally'](()=>{this['stopProcessing'](),_0x1d3dbe();});});}['_parseAndNormalizeContent'](_0x9fd880,_0x57dfaf=!0x1){const _0x3539e6=Z['exec'](_0x9fd880);_0x9fd880=_0x3539e6?_0x9fd880['substring'](_0x3539e6[0x1]['length']):_0x9fd880['length']<0x64&&!_0x57dfaf?'':this['_stripMarkdownSyntax'](_0x9fd880);const _0x3dd804=this['_domParser']['parseFromString'](_0x9fd880,'text/html');if(_0x3539e6){const _0x444681=Array['from'](_0x3dd804['body']['childNodes']);_0x444681['reverse']();for(const _0x4be365 of _0x444681){if(_0x4be365['nodeType']==Node['ELEMENT_NODE'])break;_0x4be365['remove']();}}const _0x2e9e29=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x3dd804['body']));return this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x2e9e29),this['editor']['data']['stringify'](this['editor']['data']['toModel'](_0x2e9e29));}['_normalizeResponseHeadings'](_0x320157){const _0x4d96a2=new _0x20e8af(this['editor']['editing']['view']['document']),_0xe16c0=new _0x1dad7b({'name':/^h[1-5]$/}),_0x39d131=[];let _0x1c2513=!0x1;for(const _0x4021ff of _0x320157)_0x4021ff['is']('element')&&_0xe16c0['match'](_0x4021ff)&&(_0x39d131['push'](_0x4021ff),'h1'==_0x4021ff['name']&&(_0x1c2513=!0x0));if(_0x1c2513){for(const _0x1b76eb of _0x39d131)_0x4d96a2['rename']('h'+(parseInt(_0x1b76eb['name'][0x1])+0x1),_0x1b76eb);}}['_isH1TagSupportEnabled'](){const {data:_0x3549ce,editing:_0x28e9a9}=this['editor'],_0x3e31c8=_0x3549ce['htmlProcessor']['toView']('<h1></h1>'),_0x413d8b=_0x3549ce['toView'](_0x3549ce['toModel'](_0x3e31c8));return!!_0x28e9a9['view']['domConverter']['viewToDom'](_0x413d8b)['querySelector']('h1');}['_sanitizeHTML'](_0x3c3e01){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3c3e01),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x1c0484){const _0x2dfbd9=_0x1c0484['trim']();return _0x2dfbd9['startsWith']('```html')?_0x2dfbd9['endsWith']('```')?_0x2dfbd9['substring'](0x7,_0x2dfbd9['length']-0x3):_0x2dfbd9['substring'](0x7):_0x1c0484;}}const x={'REPLACE':'replace','INSERT':'insert'};class nt extends rt{constructor(_0x58f6cd){super(_0x58f6cd),this['set']('isVisible',!0x1),this['set']('mainAction',x['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x450da9=>i(_0x58f6cd,'AI_'+_0x450da9['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x58f6cd,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x58f6cd,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x58f6cd,'Stop'));const _0x17168c=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x17168c['if']('isVisible','ck-hidden',_0xda245e=>!_0xda245e)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x13928f,_0x13b2b6){const _0x14320d=new _0x38d032(this['locale']);return _0x14320d['set']({'label':_0x13928f,'class':_0x13b2b6||'','isVisible':!0x0,'withText':!0x0}),_0x14320d;}}var U='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class W extends _0x481e49{['contentFieldView'];['copyButtonView'];constructor(_0x838fd2,_0x90f460=''){super(_0x838fd2),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2217ec=this['bindTemplate'];this['contentFieldView']=new ct(_0x838fd2,_0x90f460),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x2217ec['if']('isVisible','ck-hidden',_0x5d17e5=>!_0x5d17e5)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x2217ec['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']);let _0x4475d5=!0x1;this['on']('change:value',(_0x19ff35,_0x44eeb1,_0xaad3a2)=>{const _0x247111=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0xaad3a2),this['isProcessing']&&_0x247111&&!_0x4475d5&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x2c8d2e,_0x1ec59d,_0xce10d7)=>{_0x4475d5=!0x1,_0xce10d7?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4475d5=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4475d5=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x4bd8a1=this['locale'],_0x47df1d=new _0x38d032(this['locale']),_0x9972b9='ck-ai-form__copy-button';return _0x47df1d['set']({'label':i(_0x4bd8a1,'Copy'),'icon':U,'class':_0x9972b9,'tooltip':!0x0}),_0x47df1d['bind']('isVisible')['to'](this,'value',_0x413eca=>!!_0x413eca),_0x47df1d['bind']('isEnabled')['to'](this,'isProcessing',_0x17f09a=>!_0x17f09a),_0x47df1d['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x47df1d['icon']=_0x4ad7d2['check'],_0x47df1d['class']=_0x9972b9+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x47df1d['icon']=U,_0x47df1d['class']=_0x9972b9;},0x3e8);}),_0x47df1d;}['_copyHTMLToClipboard'](_0x4ce73f){const {window:_0x41332b,document:_0x4eaf27}=_0x5badd6;if(_0x41332b['ClipboardItem']){const {Blob:_0x3e0cbe,ClipboardItem:_0x50cbd2}=_0x41332b,_0x5ea802=[new _0x50cbd2({'text/html':new _0x3e0cbe([_0x4ce73f['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3e0cbe([_0x4ce73f['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x5ea802);}else{const _0x3c5a6d=_0x4eaf27['createElement']('div');_0x3c5a6d['style']['position']='absolute',_0x3c5a6d['style']['left']='-9999px',_0x3c5a6d['innerHTML']='<span>[</span>'+_0x4ce73f['innerHTML']+'<span>]</span>',_0x4eaf27['body']['appendChild'](_0x3c5a6d);const _0x433c4e=_0x4eaf27['createRange']();_0x433c4e['setStartAfter'](_0x3c5a6d['firstElementChild']),_0x433c4e['setEndBefore'](_0x3c5a6d['lastElementChild']);const _0x326e38=_0x41332b['getSelection']();_0x326e38['removeAllRanges'](),_0x326e38['addRange'](_0x433c4e),_0x4eaf27['execCommand']('copy'),_0x3c5a6d['remove']();}}}class ct extends _0x481e49{constructor(_0x141951,_0x522952=''){super(_0x141951),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x522952,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2371e5){this['element']['innerHTML']=_0x2371e5;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x5a592d=new _0x481e49(),_0x50760e=this['locale'],_0x1b99eb=new _0x15763a();return _0x1b99eb['isVisible']=!0x0,_0x5a592d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1b99eb,{'text':i(_0x50760e,'AI\x20is\x20writing...')}]}),_0x5a592d['render'](),_0x5a592d;}}class tt extends _0x481e49{constructor(_0x1f72f8,_0x2a53bb=''){super(_0x1f72f8);const _0x38649c=new _0x2de77b(),_0x18db50=this['bindTemplate'];this['set']('text',_0x2a53bb),_0x38649c['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x38649c,{'text':_0x18db50['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4cb44d,_0x33d8ca){super(_0x4cb44d,_0x33d8ca),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x215462,_0x5a4218)=>{_0x215462['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5a4218());});}['_createSubmitButton'](){const _0x5beccd=new _0x38d032(this['locale']),_0x460568=this['locale'];return _0x5beccd['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x460568,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x5beccd['on']('execute',()=>{this['submit']();}),_0x5beccd['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0xb88fa2,_0x512c50)=>!_0xb88fa2&&_0x512c50),_0x5beccd;}['_createShowHistoryButton'](){const _0x2a7506=new _0x38d032(this['locale']),_0x1d1408=this['resultsView'],_0x4b14ed=this['locale'];_0x2a7506['set']({'label':i(_0x4b14ed,'History'),'withText':!0x1,'icon':_0x4ad7d2['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x2a7506['bind']('isOn')['to'](_0x1d1408,'isVisible'),_0x2a7506['bind']('isEnabled')['to'](this,'isEnabled'),_0x2a7506['on']('execute',()=>{_0x1d1408['isVisible']=!_0x1d1408['isVisible'],_0x1d1408['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x32e9d1=()=>{_0x5badd6['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x5e332e=new st(this['queryView']['fieldView']['element']),_0x504e6e=_0x5e332e['width'],_0x21bfdf='rtl'===_0x4b14ed['uiLanguageDirection']?'left':'right';_0x5e332e['excludeScrollbarsAndBorders'](),_0x2a7506['element']['style'][_0x21bfdf]=_0x504e6e-_0x5e332e['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x32e9d1),this['on']('render',_0x32e9d1),_0x2a7506;}['submit'](){const _0x5f136f=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x5f136f);}['focus'](_0x47913a){-0x1===_0x47913a?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x1bd2a3){super(_0x1bd2a3),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x1bd2a3,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x55a8ef=0x0;for(const _0x244b97 of this['items'])_0x55a8ef+=_0x244b97['items']['length'];return{'resultsCount':_0x55a8ef,'totalItemsCount':_0x55a8ef};}['_createClearHistoryButton'](){const _0x120b8d=this['locale'],_0x591395=new _0x38d032(this['locale']);return _0x591395['set']({'label':'('+i(_0x120b8d,'Clear')+')','withText':!0x0}),_0x591395['on']('execute',()=>this['fire']('clearHistory')),_0x591395;}}class hs extends _0x14b010{constructor(_0x302a25){super();const _0x2d002e=new te(),_0x42f1b2=new _0x38d032(this['locale'],_0x2d002e);this['children']['add'](_0x42f1b2),_0x42f1b2['set']({'label':_0x302a25['prompt'],'withText':!0x0}),_0x42f1b2['on']('execute',()=>{this['fire']('execute',{'value':_0x2f29f0(_0x302a25['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x4c5c6c{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4cad8e,_0x23402e)=>{const _0x160f6c=Ss(_0x23402e['prompt']);for(const _0x320497 of this)if(_0x320497!=_0x23402e&&Ss(_0x320497['prompt'])===_0x160f6c){this['remove'](_0x320497);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x57c008=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x57c008));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x288074=>_0x288074)));}}function Ss(_0x2c8e38){return _0x2c8e38['toLowerCase']()['trim']();}class K extends _0x481e49{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0xd8ff69,_0x28fbff,_0x29baca=''){super(_0xd8ff69),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',x['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new tt(_0xd8ff69),this['contentArea']=new W(_0xd8ff69,_0x29baca),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new _0x598517(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x5a3940({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x45fa43=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x28fbff],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x45fa43['if']('isError','ck-hidden',_0x56f1bf=>!_0x56f1bf)]},'children':[this['errorView']]},this['contentArea'],this['toolbar'],this['promptView']]}]});}['render'](){super['render'](),this['focusTracker']['add'](this['contentArea']['element']),this['focusTracker']['add'](this['contentArea']['copyButtonView']['element']),this['focusTracker']['add'](this['toolbar']['element']),this['focusTracker']['add'](this['promptView']['element']),this['keystrokes']['listenTo'](this['element']);}['focus'](_0x1f5a75=0x1){-0x1===_0x1f5a75?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['reset'](){this['prompt']='',this['value']='',this['isError']=!0x1,this['promptView']['reset'](),this['contentArea']['isVisible']=!0x1,this['toolbar']['isVisible']=!0x1;}['_createPromptView'](){const _0x34a092=this['locale'],_0x57979a=new ht(_0x34a092,{'queryView':{'label':i(_0x34a092,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x3ae7b4,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x34a092,'Empty\x20history'),'secondary':i(_0x34a092,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x57979a['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xdd0d80,_0x43debb)=>_0xdd0d80&&!_0x43debb),this['listenTo'](_0x57979a,'submit',(_0x5c64c4,_0x5b7fde)=>{this['prompt']=_0x5b7fde;const _0x19a710=_0x24e701(_0x5b7fde);this['fire']('submitPrompt',_0x19a710),_0x5b7fde['trim']()&&this['_promptHistory']['add']({'prompt':_0x19a710},0x0);},{'priority':'high'}),_0x57979a;}['_createHistoryView'](){const _0x1d287b=new rs(this['locale']);return _0x1d287b['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x1d287b['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x1d287b;}['_createToolbar'](){const _0x4959d2=new nt(this['locale']);return _0x4959d2['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1bb437,_0x2b301a,_0x2bfe3b)=>_0x1bb437&&!_0x2b301a&&!!_0x2bfe3b),_0x4959d2['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4959d2['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5ef9dc,_0x5b99d5,_0x5a0ca2)=>_0x5ef9dc&&!_0x5b99d5&&!!_0x5a0ca2),_0x4959d2['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4959d2['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2c5dc3,_0x2ab3da)=>_0x2c5dc3&&!_0x2ab3da),_0x4959d2['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4959d2['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4959d2['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4959d2;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x38e917=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x38e917,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x613840){const _0x137ea6=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x613840||i(_0x137ea6,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var E='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const j=globalThis['DataTransfer'];class n extends _0x5c6ecf{['licenseKey'];['_licenseKeyCheckInterval'];['_dialog'];['_formView'];['_aiAdapter'];['_aiAssistantController'];['_uiCssClasses']='';static get['pluginName'](){return'AIAssistantUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[_0x248fed,a,v,_0x528cf1];}constructor(_0x2b0368){super(_0x2b0368),_0x2b0368['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2b0368['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2b0368['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2b0368['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0xe511b0}=this;this['_aiAdapter']=_0xe511b0['plugins']['get'](v),this['_dialog']=_0xe511b0['plugins']['get'](_0x528cf1),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x949309=new y(_0xe511b0,Array['from'](this['_commandDefinitions']['values']()));_0xe511b0['commands']['add']('showAIAssistant',_0x949309),_0xe511b0['ui']['componentFactory']['add']('aiCommands',_0x409b05=>{const _0x30c767=_0x47d66b(_0x409b05);return _0x30c767['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x30c767['buttonView']['set']({'label':i(_0x409b05,'AI\x20Commands'),'icon':E,'tooltip':!0x0}),_0x30c767['on']('execute',_0x4fcba7=>this['_onExecute'](_0x4fcba7['source']['id'])),_0x51fdb7(_0x30c767,_0xe511b0['ui']['view']['body'],function(_0x271d3a){const _0x478be8=o(_0x271d3a['config']['get']('ai.aiAssistant.commands'),_0x271d3a['locale']),_0xb1ee03=B(_0x271d3a,_0x478be8)['filter'](_0x2de5c6=>_0x2de5c6['commands']['length']);if(0x1===_0xb1ee03['length'])return B(_0x271d3a,_0xb1ee03[0x0]['commands'])['map'](_0xdc0b1c=>({'id':_0xdc0b1c['id'],'label':_0xdc0b1c['label']}));return _0xb1ee03['map'](_0x1e49f1=>{const {groupId:_0x1dbdd3,groupLabel:_0x1b7c35,commands:_0x165e89}=_0x1e49f1,_0x2423a3=B(_0x271d3a,_0x165e89)['map'](_0x5d0920=>({'id':_0x5d0920['id'],'label':_0x5d0920['label']}));return{'id':_0x1dbdd3,'menu':_0x1b7c35||_0x1dbdd3,'children':_0x2423a3};});}(_0xe511b0),{'ariaLabel':i(_0x409b05,'AI\x20Commands')}),_0x30c767['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x949309['on']('change:enabledCommandsIds',_0x509f98),_0x30c767['menuView']['once']('render',_0x509f98),_0x30c767;function _0x509f98(){_0x30c767['isEnabled']=_0x949309['enabledCommandsIds']['length']>0x0;for(const _0x347a6a of _0x30c767['menuView']['buttons'])_0x347a6a['isEnabled']=_0x949309['enabledCommandsIds']['includes'](_0x347a6a['id']);}}),_0xe511b0['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3c7876=>{const _0xea25e9=new _0x457829(_0x3c7876);_0xea25e9['buttonView']['set']({'label':i(_0x3c7876,'AI\x20Commands'),'icon':E}),_0xea25e9['bind']('isEnabled')['to'](_0x949309,'enabledCommandsIds',_0x4e1bf2=>_0x4e1bf2['length']>0x0);const _0x444c40=o(_0xe511b0['config']['get']('ai.aiAssistant.commands'),_0x3c7876);return this['_populateMenuBarMenu'](_0x949309,_0xea25e9,_0x444c40,_0x30e237=>this['_onExecute'](_0x30e237)),_0xea25e9;}),_0xe511b0['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x32b2e7=this['_createAIAssistantUIButton'](_0x38d032);return _0x32b2e7['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x32b2e7;}),_0xe511b0['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x5b3e7e=this['_createAIAssistantUIButton'](_0x458a0c);return _0x5b3e7e['set']({'role':'menuitemcheckbox'}),_0x5b3e7e;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x23042c=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x198a8d;for(const _0x2b7bcb in _0x23042c){const _0x510d07=_0x2b7bcb,_0x1611ee=_0x23042c[_0x510d07];if('aiLicenseKeyValid'==_0x1611ee||'aiLicenseKeyInvalid'==_0x1611ee||'aiLicenseKeyExpired'==_0x1611ee||'aiLicenseKeyDomainLimit'==_0x1611ee||'aiLicenseKeyNotAllowed'==_0x1611ee||'aiLicenseKeyEvaluationLimit'==_0x1611ee||'aiLicenseKeyTrialLimit'==_0x1611ee||'aiLicenseKeyDevelopmentLimit'==_0x1611ee||'aiLicenseKeyUsageLimit'==_0x1611ee){delete _0x23042c[_0x510d07],_0x198a8d=_0x1611ee,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x198a8d&&_0x23042c['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x198a8d&&_0x23042c['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x198a8d&&_0x23042c['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x198a8d&&_0x23042c['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x198a8d&&_0x23042c['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x198a8d&&_0x23042c['_showLicenseError']('trialLimit'),'aiLicenseKeyDevelopmentLimit'==_0x198a8d&&_0x23042c['_showLicenseError']('developmentLimit'),'aiLicenseKeyUsageLimit'==_0x198a8d&&_0x23042c['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x4f596d='',_0x17f8ed='',_0x41b92d='custom'){const _0x4c7184=this['editor'],_0x19b6c1=_0x4c7184['editing']['view'],_0xe1e6c5=_0x4c7184['plugins']['get'](a),_0x190e82=_0x4c7184['plugins']['get'](_0x248fed);_0xe1e6c5['showFakeVisualSelection']();const _0x4d4d1e=new j(),_0x4f0330=new ClipboardEvent('copy',{'clipboardData':_0x4d4d1e}),_0x292a97=new _0x240d1c(_0x4d4d1e),_0x141cd7=new _0x257a52(_0x19b6c1,_0x4f0330,{'dataTransfer':_0x292a97});_0x190e82['_forceMarkersCopy']('comment',()=>{_0x19b6c1['document']['fire']('copy',_0x141cd7);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new C(_0x4c7184,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x4e61ef=_0x292a97['getData']('text/html');const _0x403bd9=_0x4c7184['model']['document']['selection'],_0x4ced56=Array['from'](_0x403bd9['getRanges']());0x1===_0x4ced56['length']&&_0x4ced56[0x0]['isFlat']&&!_0x403bd9['getSelectedElement']()&&''!==_0x4e61ef['replace'](/&nbsp;/g,'')['trim']()&&(_0x4e61ef='<p>'+_0x4e61ef+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x41b92d,'query':_0x4f596d,'htmlContent':_0x4e61ef,'label':_0x17f8ed,'mainActionLabel':x[_0x4c7184['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':at['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x3c61d3['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0xe1e6c5['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2b24bd=new Map(),_0x536342=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x1a79cf of _0x536342)for(const _0x3f47c3 of _0x1a79cf['commands'])_0x2b24bd['set'](_0x3f47c3['id'],{..._0x3f47c3,'groupId':_0x1a79cf['groupId'],'groupLabel':_0x1a79cf['groupLabel']||_0x1a79cf['groupId']});return _0x2b24bd;}['_createAIAssistantUIButton'](_0x253864){const _0xd2e3e1=this['editor'],_0x51162d=_0xd2e3e1['commands']['get']('showAIAssistant'),_0x3dd03d=new _0x253864(_0xd2e3e1['locale']);return _0x3dd03d['set']({'label':i(_0xd2e3e1['locale'],'AI\x20Assistant'),'icon':at['robotPencil'],'isToggleable':!0x0}),_0x3dd03d['bind']('isEnabled')['to'](_0x51162d),_0x3dd03d['bind']('isOn')['to'](this['_dialog'],'id',_0x495fd7=>'aiAssistant'===_0x495fd7),this['listenTo'](_0x3dd03d,'execute',()=>{_0x3dd03d['isOn']?this['hideUI']():_0x51162d['execute']();}),_0x3dd03d;}['_initView'](){const _0xe8967f=this['editor']['plugins']['get'](a);this['_formView']=new K(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0xe8967f['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0xe8967f['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x42df49,ui:{ariaLiveAnnouncer:_0x4c7466}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5909e0,_0x10a857,_0x23c889)=>{const _0x15738b=this['_aiAssistantController']['currentContext'];_0x23c889?_0x4c7466['announce'](i(_0x42df49,'AI\x20is\x20writing')):_0x15738b&&_0x4c7466['announce'](i(_0x42df49,'Generated\x20content:\x20%0',_0x15738b),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x48429d,_0x13b3a7,_0x22b1de)=>{if(_0x22b1de){const _0x5d9b77=this['_formView']['errorView']['text'];_0x4c7466['announce'](i(_0x42df49,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5d9b77));}});}['_onExecute'](_0xa092a1){const _0x2dd8ec=this['_commandDefinitions']['get'](_0xa092a1),_0x34c106=this['editor'],_0xcc22f1=_0x34c106['model']['document']['selection'],_0x4d5486=_0x34c106['commands']['get']('showAIAssistant'),_0x106c0c=_0x34c106['plugins']['get'](a),_0x1e3bf2=''+(_0x2dd8ec['groupId']!==I?_0x2dd8ec['groupLabel']+':\x20':'')+_0x2dd8ec['label'];if(!0x1!==_0x2dd8ec['requiresContent']&&_0xcc22f1['isCollapsed']){const _0x20a59a=_0x66f295(_0xcc22f1['getSelectedBlocks']())||_0x34c106['model']['schema']['getLimitElement'](_0xcc22f1);_0x34c106['model']['change'](_0x260bb3=>{_0x260bb3['setSelection'](_0x20a59a,'in');});}_0x106c0c['showFakeVisualSelection'](),_0x4d5486['execute'](_0x2dd8ec['prompt'],_0x1e3bf2,'command:'+_0xa092a1);}['_populateMenuBarMenu'](_0x422a40,_0x4a2b89,_0x332f82,_0x3c5dcf){const _0x18cf72=this['editor'],_0x56ba15=_0x18cf72['locale'],_0x221efa=new _0x3f42c0(_0x56ba15),_0x5713fa=B(_0x18cf72,_0x332f82)['filter'](_0x2a1c19=>_0x2a1c19['commands']['length']);0x1===_0x5713fa['length']?this['_getMenuBarGroupButtons']({'command':_0x422a40,'commands':_0x5713fa[0x0]['commands'],'parentMenuView':_0x4a2b89,'onExecute':_0x3c5dcf})['forEach'](_0x2b80bb=>_0x221efa['items']['add'](_0x2b80bb)):_0x5713fa['forEach'](({groupId:_0x31eb79,groupLabel:_0x153104,commands:_0x2ede89})=>{const _0xab9e9c=new _0xac41ff(_0x56ba15,_0x4a2b89),_0x210ad6=new _0x457829(_0x56ba15),_0x994486=new _0x3f42c0(_0x56ba15),_0x3666b1=this['_getMenuBarGroupButtons']({'command':_0x422a40,'commands':_0x2ede89,'parentMenuView':_0x210ad6,'onExecute':_0x3c5dcf});_0x210ad6['buttonView']['set']({'label':_0x153104||_0x31eb79}),_0x210ad6['delegate']('execute')['to'](_0x4a2b89),_0x994486['items']['addMany'](_0x3666b1),_0x210ad6['panelView']['children']['add'](_0x994486),_0xab9e9c['children']['add'](_0x210ad6),_0x221efa['items']['add'](_0xab9e9c);}),_0x4a2b89['panelView']['children']['add'](_0x221efa);}['_getMenuBarGroupButtons']({command:_0x474741,commands:_0x1e57d3,parentMenuView:_0x29a993,onExecute:_0x3e1574}){const _0x501dfc=this['editor'],_0x51eca8=_0x501dfc['locale'];return B(_0x501dfc,_0x1e57d3)['map'](_0x16fe73=>{const _0x5e0b86=new _0xac41ff(_0x51eca8,_0x29a993),_0x309a6a=new _0x458a0c(_0x51eca8);return _0x309a6a['set']({'label':_0x16fe73['label']}),_0x309a6a['delegate']('execute')['to'](_0x29a993),_0x309a6a['on']('execute',()=>_0x3e1574(_0x16fe73['id'])),_0x309a6a['bind']('isEnabled')['to'](_0x474741,'enabledCommandsIds',_0x116c27=>_0x116c27['includes'](_0x16fe73['id'])),_0x5e0b86['children']['add'](_0x309a6a),_0x5e0b86;});}}function _(_0x45ef6c,_0x36983f){return void 0x0!==_0x45ef6c['order']&&void 0x0===_0x36983f['order']?0x1:void 0x0===_0x45ef6c['order']&&void 0x0!==_0x36983f['order']?-0x1:void 0x0!==_0x45ef6c['order']&&void 0x0!==_0x36983f['order']?_0x45ef6c['order']-_0x36983f['order']:0x0;}function B(_0x347290,_0xd9cff4){_0xd9cff4['sort'](_);const _0x50f0ee={},_0x29ceaf=[];for(const _0x451363 of _0xd9cff4)if(void 0x0!==_0x451363['order']){if(_0x451363['order']in _0x50f0ee)throw new _0x14fe0d('ai-commands-config-order-collision',_0x347290,{'conflictingDefinitions':[_0x451363,_0x50f0ee[_0x451363['order']]]});_0x50f0ee[_0x451363['order']]=_0x451363,_0x29ceaf['splice'](_0x451363['order'],0x0,_0x451363);}else _0x29ceaf['push'](_0x451363);return _0x29ceaf;}class r extends _0x5c6ecf{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5a41e2){super(_0x5a41e2);const _0xd6e9d5=_0x5a41e2['config'],_0x24d3f9=_0x5a41e2['locale'];_0xd6e9d5['define']('ai.aiAssistant.commands',function(_0x3c0243){return[{'groupId':'editOrReview','groupLabel':i(_0x3c0243,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x3c0243,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x3c0243,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':i(_0x3c0243,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x3c0243,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':i(_0x3c0243,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x3c0243,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':i(_0x3c0243,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':i(_0x3c0243,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x3c0243,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x3c0243,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x3c0243,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x3c0243,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x3c0243,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x3c0243,'Change\x20style'),'commands':[{'id':'business','label':i(_0x3c0243,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x3c0243,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x3c0243,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x3c0243,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x3c0243,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x3c0243,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x3c0243,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x3c0243,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x3c0243,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x3c0243,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x3c0243,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x3c0243,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x3c0243,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x24d3f9)),_0xd6e9d5['define']('ai.aiAssistant.extraCommandGroups',[]),_0xd6e9d5['define']('ai.aiAssistant.removeCommands',[]);const _0x124d9c=o(_0xd6e9d5['get']('ai.aiAssistant.commands'),_0x24d3f9),_0x515933=_0xd6e9d5['get']('ai.aiAssistant.extraCommandGroups'),_0xe9043f=_0xd6e9d5['get']('ai.aiAssistant.removeCommands');_0x515933['forEach'](_0x3cd4b5=>{const _0x2b7c46=_0x124d9c['find'](_0x5e45a9=>_0x5e45a9['groupId']===_0x3cd4b5['groupId']);_0x2b7c46?_0x2b7c46['commands']=_0x2b7c46['commands']['concat'](_0x3cd4b5['commands']):_0x124d9c['push'](_0x3cd4b5);}),_0x124d9c['forEach'](_0x2c8d07=>{_0x2c8d07['commands']=_0x2c8d07['commands']['filter'](_0x2709b1=>!_0xe9043f['includes'](_0x2709b1['id']));}),_0xd6e9d5['set']('ai.aiAssistant.commands',_0x124d9c);}}class P extends _0x5c6ecf{['abortController'];static get['requires'](){return[v];}constructor(_0x3d3faa){super(_0x3d3faa),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](v)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x21f7d0){return this['sendRequest'](_0x21f7d0)['catch'](_0x174699=>{if(_0x174699 instanceof R)return Promise['reject'](_0x174699);if('AbortError'==_0x174699['name'])return Promise['resolve']();throw console['error'](_0x174699),new _0x14fe0d('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1af4ba,_0xe6e1e2){const _0x4d2d63=this['editor']['locale'],_0x406f4f={'Content-Type':'application/json'};if('object'==typeof _0x1af4ba)Object['assign'](_0x406f4f,_0x1af4ba);else{if(_0x1af4ba)try{const _0x2521d0=await _0x1af4ba(_0xe6e1e2);Object['assign'](_0x406f4f,_0x2521d0);}catch(_0x3e82e8){return Promise['reject'](new R(i(_0x4d2d63,'AI_ERROR_GET_HEADERS')));}}return _0x406f4f;}async['_prepareRequestParameters'](_0x1aea7d,_0x150139){const _0xbd1c40=this['editor']['locale'];if('object'==typeof _0x1aea7d)return _0x1aea7d;try{return await _0x1aea7d(_0x150139);}catch(_0x2ca4a0){return Promise['reject'](new R(i(_0xbd1c40,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x45d55d){super(_0x45d55d),_0x45d55d['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x45d55d['config']['get']('ai.openAI.requestParameters')||_0x45d55d['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x45d55d['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x45d55d['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x45d55d['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x5dd199,context:_0x464f02,onData:_0x50560c,actionId:_0x3fc3b8}){const _0x5a53b7=this['editor']['locale'],_0x59e420=await this['prepareMessages'](_0x5dd199,_0x464f02,_0x3fc3b8),_0x379e0d=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3fc3b8),_0x5e3623=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3fc3b8),_0x3c764e={'messages':_0x59e420,..._0x5e3623},_0x4d7297={'method':'POST','headers':_0x379e0d,'body':JSON['stringify'](_0x3c764e),'signal':this['abortController']['signal']},_0x5ce7d0=await fetch(this['_apiUrl'],_0x4d7297);if(_0x5ce7d0['ok'])return _0x5e3623['stream']?await this['_readStreamableResponse'](_0x5ce7d0,_0x50560c):await this['_readStaticResponse'](_0x5ce7d0,_0x50560c),Promise['resolve']();{const _0x11ea87=await _0x5ce7d0['text']();return _0x11ea87['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x5a53b7,'AI_ERROR_CONTEXT_LENGTH'))):_0x11ea87['includes']('Moderation')?Promise['reject'](new R(i(_0x5a53b7,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x11ea87));}}async['prepareMessages'](_0x3963f7,_0x1f4e48,_0x19a3a0){let _0x3412ad,_0x4fa5e9;return _0x1f4e48?(_0x3412ad='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.',_0x4fa5e9='Instruction:\x0a'+_0x3963f7+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1f4e48):(_0x3412ad='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.',_0x4fa5e9=_0x3963f7),[{'role':'system','content':_0x3412ad},{'role':'user','content':_0x4fa5e9}];}async['_readStreamableResponse'](_0xd5d0a6,_0x21b195){const _0x1a8947=_0xd5d0a6['body']['getReader'](),_0x540c00=new TextDecoder();let _0x5b646e='',_0x3f2a69='',_0x273171='',_0x40b5e0=!0x1;for(;!_0x40b5e0;){const {done:_0x433514,value:_0x38e35a}=await _0x1a8947['read'](),_0x327f8a=_0x5b646e+_0x540c00['decode'](_0x38e35a);let _0x391081='';_0x40b5e0=_0x433514;try{_0x391081=this['_cleanUpData'](_0x327f8a),_0x5b646e='';}catch(_0x194bbd){_0x5b646e=_0x327f8a;continue;}_0x3f2a69+=_0x391081,!_0x40b5e0&&this['_isBufferIncomplete'](_0x3f2a69)||_0x3f2a69&&(_0x273171+=_0x3f2a69,_0x3f2a69='',_0x21b195(_0x273171));}return Promise['resolve']();}async['_readStaticResponse'](_0x49c9bf,_0x507080){return _0x507080((await _0x49c9bf['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x2be66b){const _0x55b922=_0x2be66b['split']('<')['length']!==_0x2be66b['split']('>')['length'],_0x41e14b=_0x2be66b['length']<0x1e;return _0x55b922&&_0x41e14b;}['_cleanUpData'](_0x45935f){return _0x45935f['split'](/\n(?![^{]*\})/g)['map'](_0x337aae=>_0x337aae['replace']('data:\x20',''))['filter'](_0x497c77=>_0x497c77&&_0x497c77['length']>0x0&&'[DONE]'!==_0x497c77)['map'](_0x345359=>{const {choices:_0x27b2de}=JSON['parse'](_0x345359);if(_0x27b2de[0x0]&&_0x27b2de[0x0]['delta']&&_0x27b2de[0x0]['delta']['content'])return _0x27b2de[0x0]['delta']['content'];})['filter'](_0x1aeb33=>_0x1aeb33)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x3036e9){super(_0x3036e9),_0x3036e9['config']['get']('ai.aws.requestParameters')||_0x3036e9['config']['define']('ai.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x3036e9['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x3036e9['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x3036e9['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x3036e9['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x4c8940,context:_0x4d053e,onData:_0x21931e,actionId:_0x5a1bc5}){const {model:_0x24840a,stream:_0xbab78d,..._0x5d7a53}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5a1bc5),_0x4e7f6e={'prompt':await this['preparePrompt'](_0x4c8940,_0x4d053e,_0x24840a,_0x5a1bc5),..._0x5d7a53};this['_apiUrl']?await this['_processProxyRequest'](_0x4e7f6e,_0x24840a,_0xbab78d,_0x21931e,_0x5a1bc5):await this['_processAWSRequest'](_0x4e7f6e,_0x24840a,_0xbab78d,_0x21931e);}async['preparePrompt'](_0x41f5d4,_0x3ef3f4,_0x41ad73,_0x30815e){let _0x1e745e,_0x39393f;return _0x3ef3f4?(_0x1e745e='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.',_0x39393f='Instruction:\x0a'+_0x41f5d4+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3ef3f4):(_0x1e745e='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.',_0x39393f=_0x41f5d4),'meta.llama'==this['getModelFamily'](_0x41ad73)?'<<SYS>>\x0a'+_0x1e745e+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x39393f+'\x0a[/INST]':'Human:\x0a'+_0x1e745e+'\x0a'+_0x39393f+'\x0a\x0aAssistant:';}['getModelFamily'](_0x214d8b){if(/^anthropic\.claude/['test'](_0x214d8b))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x214d8b))return'ai21.j2';if(/^cohere\.command/['test'](_0x214d8b))return'cohere.command';if(/^meta\.llama/['test'](_0x214d8b))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x214d8b));}async['_processProxyRequest'](_0x318d41,_0x2f46d3,_0x51bd5c,_0x47186b,_0x2c741d){const _0x5266ec={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2c741d),'body':JSON['stringify']({..._0x318d41,'model':_0x2f46d3,'stream':_0x51bd5c}),'signal':this['abortController']['signal']},_0x4f2c49=await fetch(this['_apiUrl'],_0x5266ec);_0x51bd5c?await this['_readStreamableResponse'](_0x4f2c49,_0x2f46d3,_0x47186b):await this['_readStaticResponse'](_0x4f2c49,_0x2f46d3,_0x47186b);}async['_processAWSRequest'](_0x109df6,_0x5d2426,_0x334cf7,_0x53905d){const _0x501978=new _0x4d5d11(this['_bedrockClientConfig']),_0x928655={'body':JSON['stringify'](_0x109df6),'contentType':'application/json','accept':'application/json','modelId':_0x5d2426};let _0x5cbd45;if(_0x334cf7){const _0x634e21=new _0x8704bf(_0x928655);_0x5cbd45=await _0x501978['send'](_0x634e21,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x5cbd45,_0x5d2426,_0x53905d);}else{const _0x562a1c=new _0x18d410(_0x928655);_0x5cbd45=await _0x501978['send'](_0x562a1c,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x5cbd45,_0x5d2426,_0x53905d);}}async['_readAsyncIterableResponse'](_0x7f0c13,_0x73d04c,_0x4fcd16){const _0x37ead5=_0x7f0c13['body'],_0x110e57=new TextDecoder('utf-8');let _0x118aa8='';for await(const _0x34c490 of _0x37ead5)if(_0x34c490['chunk']){const _0x1cc36f=_0x110e57['decode'](_0x34c490['chunk']['bytes']),_0x45815e=JSON['parse'](_0x1cc36f);_0x118aa8+=this['_getGeneratedText'](_0x45815e,_0x73d04c),_0x4fcd16(_0x118aa8);}return Promise['resolve']();}async['_readStreamableResponse'](_0xc5ad3d,_0x332d3f,_0x77880b){const _0x286d35=_0xc5ad3d['body'],_0x48074f=new TextDecoder('utf-8'),_0x4787a8=_0x286d35['getReader']();let _0x3e2164='',_0x49aec8='',_0x58a29c=!0x1;for(;!_0x58a29c;){const {done:_0x259489,value:_0x306160}=await _0x4787a8['read']();if(_0x58a29c=_0x259489,_0x58a29c)break;const _0x16a2b2=(_0x3e2164+_0x48074f['decode'](_0x306160))['split']('\x0a')['map'](_0x3210b5=>{try{return _0x3e2164='',JSON['parse'](_0x3210b5);}catch(_0x33522d){return _0x3e2164=_0x3210b5,null;}})['filter'](_0x3e398f=>null!==_0x3e398f);_0x16a2b2['length']&&(_0x49aec8+=_0x16a2b2['map'](_0x1f6c63=>this['_getGeneratedText'](_0x1f6c63,_0x332d3f))['join'](''),_0x77880b(_0x49aec8));}return Promise['resolve']();}async['_readStaticResponse'](_0xdb8756,_0x495b68,_0x48b712){let _0x1a49bd;return _0x1a49bd=_0xdb8756 instanceof Response?await _0xdb8756['json']():JSON['parse'](Buffer['from'](_0xdb8756['body'])['toString']('utf8')),(_0x48b712(this['_getGeneratedText'](_0x1a49bd,_0x495b68)),Promise['resolve']());}['_getGeneratedText'](_0x2af610,_0x31c90a){switch(this['getModelFamily'](_0x31c90a)){case'anthropic.claude':return _0x2af610['completion'];case'ai21.j2':return _0x2af610['completions'][0x0]['data']['text'];case'cohere.command':return _0x2af610['generations'][0x0]['text'];case'meta.llama':return _0x2af610['generation'];}}}export{v as AIAdapter,r as AIAssistant,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
23
+ import{Plugin as _0x452a21,Command as _0x53aeb8,icons as _0xd76b3a}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x1293a6,CKEditorError as _0x5ef33c,ObservableMixin as _0x499d6f,global as _0x4fa47f,isVisible as it,Rect as st,Collection as _0x365ef3,FocusTracker as _0x4195fb,KeystrokeHandler as ts,first as _0x5d7ec1}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as rt,ButtonView as _0x30d17a,View as _0x524e46,SpinnerView as _0x38b1c9,IconView as _0x4f0a9d,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x787930,ButtonLabelView as te,FocusCycler as _0x107677,createLabeledTextarea as _0x3febd2,Dialog as _0x5b885c,createDropdown as _0x1ebb9a,addMenuToDropdown as _0x4054bf,MenuBarMenuView as _0x490302,MenuBarMenuListItemButtonView as _0x1afe6e,DialogViewPosition as _0xaa8cd,MenuBarMenuListView as _0x306a60,MenuBarMenuListItemView as _0x46169e}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as at}from'ckeditor5-collaboration/dist/index.js';import{UpcastWriter as _0x5b6991,Matcher as _0x46ac85,DataTransfer as _0x6397f2,DomEventData as _0x3bee1d}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x5295c1,escape as _0x34c82f}from'lodash-es';import{ClipboardMarkersUtils as _0x2e0dd9}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{BedrockRuntimeClient as _0x2d3a7b,InvokeModelWithResponseStreamCommand as _0x1d5ea6,InvokeModelCommand as _0x5b542d}from'@aws-sdk/client-bedrock-runtime';const I='_ungrouppedCommands';function o(_0x1e3dd3,_0x1bd2a3){const _0x541dab=(0x0,_0x1bd2a3['t'])('Other');return _0x1e3dd3['length']?'groupId'in _0x1e3dd3[0x0]?_0x1e3dd3:[{'groupId':I,'groupLabel':_0x541dab,'order':0x1/0x0,'commands':_0x1e3dd3}]:[{'groupId':I,'groupLabel':_0x541dab,'order':0x1/0x0,'commands':[]}];}const u='ai-ui';class a extends _0x452a21{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x32acde}=this,_0x204f2f=['ck-fake-ai-selection'];_0x32acde['config']['get']('ai.useTheme')&&_0x204f2f['push']('ck-ai-assistant-ui_theme'),_0x32acde['conversion']['for']('editingDowncast')['markerToHighlight']({'model':u,'view':{'classes':_0x204f2f,'priority':0xc}}),_0x32acde['conversion']['for']('editingDowncast')['markerToElement']({'model':u,'view':(_0x5bf197,{writer:_0x2509cb})=>{if(!_0x5bf197['markerRange']['isCollapsed'])return null;const _0x2f1bfe=_0x2509cb['createUIElement']('span');return _0x2509cb['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x2f1bfe),_0x2f1bfe;}});}['afterInit'](){!async function(_0xb7cb61){const _0x321eff=_0x42d307([0x78,0x61,0x69,0x38,0x54,0x6f,0x66,0x52,0x55,0x41,0x42,0x7a,0x43,0x65,0x62,0x75,0x51,0x79,0x72,0x4d,0x59,0x4f,0x36,0x70,0x6b,0x4e,0x57,0x33,0x73,0x6c,0x45,0x47,0x77,0x32,0x37,0x6e,0x74,0x76,0x50,0x4a,0x35,0x64,0x63,0x4c,0x58,0x71,0x6d,0x44,0x53,0x67,0x46,0x68,0x4b,0x56,0x48,0x39,0x6a,0x31,0x5a,0x30,0x49,0x34]),_0x277e4c=0x3685d252,_0x289184=0x36828a12^_0x277e4c,_0x567aeb=window[_0x42d307([0x44,0x61,0x74,0x65])][_0x42d307([0x6e,0x6f,0x77])](),_0x40494d=_0xb7cb61[_0x42d307([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x5e1953=new window[(_0x42d307([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5f90c2=>{_0x40494d[_0x42d307([0x6f,0x6e,0x63,0x65])](_0x42d307([0x72,0x65,0x61,0x64,0x79]),_0x5f90c2);}),_0x538f3a={[_0x42d307([0x6b,0x74,0x79])]:_0x42d307([0x45,0x43]),[_0x42d307([0x75,0x73,0x65])]:_0x42d307([0x73,0x69,0x67]),[_0x42d307([0x63,0x72,0x76])]:_0x42d307([0x50,0x2d,0x32,0x35,0x36]),[_0x42d307([0x78])]:_0x42d307([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x42d307([0x79])]:_0x42d307([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x42d307([0x61,0x6c,0x67])]:_0x42d307([0x45,0x53,0x32,0x35,0x36])},_0x37de1f=_0x40494d[_0x42d307([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x42d307([0x67,0x65,0x74])](_0x42d307([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x308eb0(){let _0x4f4c9e,_0x8b72ca=null,_0x106d0b=null;try{if(_0x37de1f==_0x42d307([0x47,0x50,0x4c]))return _0x42d307([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x4f4c9e=_0x2e4802(),!_0x4f4c9e)return _0x42d307([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x4f4c9e[_0x42d307([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x106d0b=_0x34daeb(_0x4f4c9e[_0x42d307([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x4f4c9e[_0x42d307([0x6a,0x74,0x69])])),await _0x3dabf0()?_0x2984db()?_0x21dff5()?_0x42d307([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x501659()?(_0x4f4c9e[_0x42d307([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x42d307([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x8b72ca=_0x4397b8(_0x42d307([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x4f4c9e[_0x42d307([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x42d307([0x74,0x72,0x69,0x61,0x6c])&&(_0x8b72ca=_0x4397b8(_0x42d307([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),_0x4f4c9e[_0x42d307([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x42d307([0x64,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74])&&(_0x8b72ca=_0x4397b8(_0x42d307([0x44,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74,0x4c,0x69,0x6d,0x69,0x74]))),await _0x213923()):_0x42d307([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x42d307([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x42d307([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x181efc){return _0x42d307([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x21dff5(){const _0x318a0c=[_0x42d307([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x42d307([0x74,0x72,0x69,0x61,0x6c])][_0x42d307([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4f4c9e[_0x42d307([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x567aeb/0x3e8:0xe10*_0x289184;return _0x4f4c9e[_0x42d307([0x65,0x78,0x70])]<_0x318a0c;}function _0x2984db(){const _0x21773d=_0x4f4c9e[_0x42d307([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x21773d&&(!!_0x21773d[_0x42d307([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x42d307([0x2a]))||!!_0x21773d[_0x42d307([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x42d307([0x41,0x49])));}function _0x501659(){const _0x3dd346=_0x4f4c9e[_0x42d307([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3dd346||0x0==_0x3dd346[_0x42d307([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1549a6}=new URL(window[_0x42d307([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3dd346[_0x42d307([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1549a6))return!0x0;const _0x1615ae=_0x1549a6[_0x42d307([0x73,0x70,0x6c,0x69,0x74])](_0x42d307([0x2e]));return _0x3dd346[_0x42d307([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x157f4a=>_0x157f4a[_0x42d307([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x42d307([0x2a])))[_0x42d307([0x6d,0x61,0x70])](_0x31a2fd=>_0x31a2fd[_0x42d307([0x73,0x70,0x6c,0x69,0x74])](_0x42d307([0x2e])))[_0x42d307([0x73,0x6f,0x6d,0x65])](_0x173bb0=>_0x1615ae[_0x42d307([0x65,0x76,0x65,0x72,0x79])]((_0x42aba4,_0x2aa3e8)=>_0x173bb0[_0x2aa3e8]===_0x42aba4||_0x173bb0[_0x2aa3e8]===_0x42d307([0x2a])));}function _0x213923(){return _0x8b72ca&&_0x106d0b?new window[(_0x42d307([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x26b04a,_0x9346ce)=>{_0x8b72ca[_0x42d307([0x74,0x68,0x65,0x6e])](_0x26b04a,_0x9346ce),_0x106d0b[_0x42d307([0x74,0x68,0x65,0x6e])](_0x87a44=>{_0x87a44!=_0x42d307([0x56,0x61,0x6c,0x69,0x64])&&_0x26b04a(_0x87a44);},_0x9346ce);}):_0x8b72ca||_0x106d0b||_0x42d307([0x56,0x61,0x6c,0x69,0x64]);}}function _0x34daeb(_0x1bcb3b,_0x38c9e6){return new window[(_0x42d307([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x102ec0=>{if(_0x5802da())return _0x102ec0(_0x42d307([0x56,0x61,0x6c,0x69,0x64]));_0xb54a77(),_0x40494d[_0x42d307([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x42d307([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x266902=!0x1;const _0x3babe0=_0x1293a6();function _0x3c29ce(_0x2e9a06){return!!_0x2e9a06&&(typeof _0x2e9a06===_0x42d307([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x2e9a06===_0x42d307([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x2e9a06[_0x42d307([0x74,0x68,0x65,0x6e])]===_0x42d307([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x2e9a06[_0x42d307([0x63,0x61,0x74,0x63,0x68])]===_0x42d307([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x330b0e(_0x2676a0){_0x36b2bc(_0x2676a0)[_0x42d307([0x74,0x68,0x65,0x6e])](_0x444605=>{if(!_0x444605||_0x444605[_0x42d307([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x42d307([0x6f,0x6b]))return _0x42d307([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x4727db(_0x1c2aef(_0x3babe0+_0x38c9e6))!=_0x444605[_0x42d307([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x42d307([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x42d307([0x56,0x61,0x6c,0x69,0x64]);})[_0x42d307([0x74,0x68,0x65,0x6e])](_0x25956e=>(_0x4ee666(),_0x25956e),()=>{const _0x32f47d=_0x1975f1();return null==_0x32f47d?(_0x4ee666(),_0x42d307([0x56,0x61,0x6c,0x69,0x64])):_0x42d307(_0x567aeb-_0x32f47d>(0x12895652^_0x277e4c)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x42d307([0x74,0x68,0x65,0x6e])](_0x102ec0)[_0x42d307([0x63,0x61,0x74,0x63,0x68])](()=>{_0x102ec0(_0x42d307([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2649cf=0x36b33cd2^_0x277e4c;function _0x4ee666(){const _0x586e0b=_0x42d307([0x6c,0x6c,0x63,0x74,0x2d])+_0x4727db(_0x1c2aef(_0x1bcb3b)),_0xb49cc9=_0x2b608d(_0x4727db(window[_0x42d307([0x4d,0x61,0x74,0x68])][_0x42d307([0x63,0x65,0x69,0x6c])](_0x567aeb/_0x2649cf)));window[_0x42d307([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x42d307([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x586e0b,_0xb49cc9);}function _0x1975f1(){const _0x59936d=_0x42d307([0x6c,0x6c,0x63,0x74,0x2d])+_0x4727db(_0x1c2aef(_0x1bcb3b)),_0x8924da=window[_0x42d307([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x42d307([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x59936d);return _0x8924da?window[_0x42d307([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2b608d(_0x8924da),0x10)*_0x2649cf:null;}function _0x36b2bc(_0x5651a6){return new window[(_0x42d307([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xa38c86,_0x17520d)=>{_0x5651a6[_0x42d307([0x74,0x68,0x65,0x6e])](_0xa38c86,_0x17520d),window[_0x42d307([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x17520d,0x36840692^_0x277e4c);});}}_0x40494d[_0x42d307([0x6f,0x6e])](_0x42d307([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1ae852,_0x101ac6)=>{if(_0x101ac6[0x0]!=_0x1bcb3b)return _0x102ec0(_0x42d307([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x101ac6[0x1]={..._0x101ac6[0x1],[_0x42d307([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3babe0};},{[_0x42d307([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x42d307([0x68,0x69,0x67,0x68])}),_0x40494d[_0x42d307([0x6f,0x6e])](_0x42d307([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x3a3218=>{_0x3c29ce(_0x3a3218[_0x42d307([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x266902=!0x0,_0x330b0e(_0x3a3218[_0x42d307([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x42d307([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x42d307([0x6c,0x6f,0x77])}),_0x5e1953[_0x42d307([0x74,0x68,0x65,0x6e])](()=>{_0x266902||_0x102ec0(_0x42d307([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5802da(){return _0x40494d[_0x42d307([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x42d307([0x76,0x69,0x65,0x77])][_0x42d307([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x42d307([0x61,0x75,0x74,0x6f]);}function _0xb54a77(){_0x40494d[_0x42d307([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x42d307([0x76,0x69,0x65,0x77])][_0x42d307([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x42d307([0x61,0x75,0x74,0x6f]);}}function _0x4397b8(_0x22805a){const _0xe55bab=[new window[(_0x42d307([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x403c1d=>setTimeout(_0x403c1d,0x368cec9e^_0x277e4c)),_0x5e1953[_0x42d307([0x74,0x68,0x65,0x6e])](()=>new window[(_0x42d307([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3ae4f4=>{let _0x11ca82=0x0;_0x40494d[_0x42d307([0x6d,0x6f,0x64,0x65,0x6c])][_0x42d307([0x6f,0x6e])](_0x42d307([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xc25055,_0x3d0781)=>{_0x3d0781[0x0][_0x42d307([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x11ca82++,_0x11ca82==(0x3685d3aa^_0x277e4c)&&(_0x3ae4f4(),_0xc25055[_0x42d307([0x6f,0x66,0x66])]());});}))];return window[_0x42d307([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x42d307([0x72,0x61,0x63,0x65])](_0xe55bab)[_0x42d307([0x74,0x68,0x65,0x6e])](()=>_0x22805a);}async function _0x4cea82(){await _0x5e1953,_0x40494d[_0x42d307([0x6d,0x6f,0x64,0x65,0x6c])][_0x42d307([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x8229d3,_0x40494d[_0x42d307([0x6d,0x6f,0x64,0x65,0x6c])][_0x42d307([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x8229d3,_0x40494d[_0x42d307([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x42d307([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x501008(_0x314298){const _0x29b837=_0x29db99();_0x40494d[_0x29b837]=_0x42d307([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x314298,_0x314298!=_0x42d307([0x56,0x61,0x6c,0x69,0x64])&&_0x4cea82();}function _0x29db99(){const _0x13554b=window[_0x42d307([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x42d307([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x42d307([0x6e,0x6f,0x77])]())[_0x42d307([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x42d307([0x2e]),'');let _0x286ca5=_0x42d307([0x78]);for(let _0x407292=0x0;_0x407292<_0x13554b[_0x42d307([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x407292+=0x2){let _0x45ed82=window[_0x42d307([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x13554b[_0x42d307([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x407292,_0x407292+0x2));_0x45ed82>=_0x321eff[_0x42d307([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x45ed82-=_0x321eff[_0x42d307([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x286ca5+=_0x321eff[_0x45ed82];}return _0x286ca5;}function _0x2e4802(){const _0x5b9aa5=_0x37de1f[_0x42d307([0x73,0x70,0x6c,0x69,0x74])](_0x42d307([0x2e]));if(0x3!=_0x5b9aa5[_0x42d307([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x479860(_0x5b9aa5[0x1]);function _0x479860(_0x14ebb9){const _0xc674e9=_0x33a668(_0x14ebb9);return _0xc674e9&&_0x577662()?_0xc674e9:null;function _0x577662(){const _0x3a33b1=_0xc674e9[_0x42d307([0x6a,0x74,0x69])],_0x234c93=window[_0x42d307([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3a33b1[_0x42d307([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3a33b1[_0x42d307([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x17c177={..._0xc674e9,[_0x42d307([0x6a,0x74,0x69])]:_0x3a33b1[_0x42d307([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3a33b1[_0x42d307([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x17c177[_0x42d307([0x76,0x63])],_0x1c2aef(_0x17c177)==_0x234c93;}}}async function _0x3dabf0(){let _0x4df71a=!0x0;try{const _0x528dc8=_0x37de1f[_0x42d307([0x73,0x70,0x6c,0x69,0x74])](_0x42d307([0x2e])),[_0x285b51,_0x4f537c,_0x3bb411]=_0x528dc8;return _0x4486be(_0x285b51),await _0x3b3e99(_0x285b51,_0x4f537c,_0x3bb411),_0x4df71a;}catch(_0x35ae6c){return!0x1;}function _0x4486be(_0x56f783){const _0xd91200=_0x33a668(_0x56f783);_0xd91200&&_0xd91200[_0x42d307([0x61,0x6c,0x67])]==_0x42d307([0x45,0x53,0x32,0x35,0x36])||(_0x4df71a=!0x1);}async function _0x3b3e99(_0x239de7,_0x4ffcd4,_0x5de576){const _0x240125=window[_0x42d307([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x42d307([0x66,0x72,0x6f,0x6d])](_0x45734e(_0x5de576),_0x12d966=>_0x12d966[_0x42d307([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x37e19e=new window[(_0x42d307([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x42d307([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x239de7+_0x42d307([0x2e])+_0x4ffcd4),_0x37646a=window[_0x42d307([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x42d307([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x37646a)return;const _0x20d676=await _0x37646a[_0x42d307([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x42d307([0x6a,0x77,0x6b]),_0x538f3a,{[_0x42d307([0x6e,0x61,0x6d,0x65])]:_0x42d307([0x45,0x43,0x44,0x53,0x41]),[_0x42d307([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x42d307([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x42d307([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x37646a[_0x42d307([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x42d307([0x6e,0x61,0x6d,0x65])]:_0x42d307([0x45,0x43,0x44,0x53,0x41]),[_0x42d307([0x68,0x61,0x73,0x68])]:{[_0x42d307([0x6e,0x61,0x6d,0x65])]:_0x42d307([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x20d676,_0x240125,_0x37e19e)||(_0x4df71a=!0x1);}}function _0x33a668(_0x148f0a){return _0x148f0a[_0x42d307([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x42d307([0x65,0x79]))?JSON[_0x42d307([0x70,0x61,0x72,0x73,0x65])](_0x45734e(_0x148f0a)):null;}function _0x45734e(_0x3b4b02){return window[_0x42d307([0x61,0x74,0x6f,0x62])](_0x3b4b02[_0x42d307([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x42d307([0x2b]))[_0x42d307([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x42d307([0x2f])));}function _0x1c2aef(_0x55251a){let _0x11d7cb=0x1505;function _0xa612f9(_0x438f2b){for(let _0x4214e6=0x0;_0x4214e6<_0x438f2b[_0x42d307([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4214e6++){const _0x3b9f0b=_0x438f2b[_0x42d307([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x4214e6);_0x11d7cb=(_0x11d7cb<<0x5)+_0x11d7cb+_0x3b9f0b,_0x11d7cb&=_0x11d7cb;}}function _0x385086(_0x3fc452){Array[_0x42d307([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3fc452)?_0x3fc452[_0x42d307([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x385086):_0x3fc452&&typeof _0x3fc452==_0x42d307([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x42d307([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3fc452)[_0x42d307([0x73,0x6f,0x72,0x74])]()[_0x42d307([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x14b10f,_0x2a1008])=>{_0xa612f9(_0x14b10f),_0x385086(_0x2a1008);}):_0xa612f9(window[_0x42d307([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3fc452));}return _0x385086(_0x55251a),_0x11d7cb>>>0x0;}function _0x4727db(_0x237d69){return _0x237d69[_0x42d307([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x42d307([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x42d307([0x30]));}function _0x2b608d(_0x56e246){return _0x56e246[_0x42d307([0x73,0x70,0x6c,0x69,0x74])]('')[_0x42d307([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x42d307([0x6a,0x6f,0x69,0x6e])]('');}function _0x8229d3(){}function _0x42d307(_0x3c3031){return _0x3c3031['map'](_0x2d78f4=>String['fromCharCode'](_0x2d78f4))['join']('');}_0x501008(await _0x308eb0());}(this);}['showFakeVisualSelection'](){const _0x20dd53=this['editor']['model'];_0x20dd53['change'](_0x5c07d3=>{const _0x2bcb76=_0x20dd53['document']['selection']['getFirstRange']();if(_0x20dd53['markers']['has'](u))_0x5c07d3['updateMarker'](u,{'range':_0x2bcb76});else{if(_0x2bcb76['start']['isAtEnd']){const _0x5bf5eb=_0x2bcb76['start']['getLastMatchingPosition'](({item:_0x5a99fa})=>!_0x20dd53['schema']['isContent'](_0x5a99fa),{'boundaries':_0x2bcb76});_0x5c07d3['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5c07d3['createRange'](_0x5bf5eb,_0x2bcb76['end'])});}else _0x5c07d3['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2bcb76});}});}['hideFakeVisualSelection'](){const _0x1f79e1=this['editor']['model'];_0x1f79e1['markers']['has'](u)&&_0x1f79e1['change'](_0xb47f15=>{_0xb47f15['removeMarker'](u);});}['insertContent'](_0x571d33,_0x50309b){const _0x1a8a19=_0x50309b||this['editor']['model']['markers']['get'](u)['getRange']();if(!this['editor']['model']['canEditAt'](_0x1a8a19))return;const _0x486f46=this['editor']['data']['processor']['toView'](_0x571d33),_0x532e4f=this['editor']['data']['toModel'](_0x486f46);this['editor']['model']['change'](_0x511db2=>{this['hideFakeVisualSelection']();const _0xc02714=this['editor']['model']['insertContent'](_0x532e4f,_0x1a8a19);_0xc02714&&_0x511db2['setSelection'](_0xc02714);});}['insertContentBelow'](_0x3162b0){const {model:_0x35555a}=this['editor'],_0x496282=Array['from'](_0x35555a['createSelection'](this['editor']['model']['markers']['get'](u)['getRange']())['getSelectedBlocks']()),_0x6952a7=_0x496282['length']?_0x35555a['createPositionAfter'](_0x496282['pop']()):_0x35555a['document']['selection']['getLastPosition']();this['insertContent'](_0x3162b0,_0x6952a7);}}class v extends _0x452a21{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x5ef33c('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x45dc4f){super(_0x45dc4f),this['name']='AIRequestError';}}function i(_0x3ebc75,_0x483137,_0x44c82a){const t=_0x3ebc75['t'];switch(_0x483137){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'AI\x20is\x20writing':return t('AI\x20is\x20writing');case'Generated\x20content:\x20%0':return t('Generated\x20content:\x20%0',_0x44c82a);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x44c82a);case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x44c82a);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 _0x483137;}}class y extends _0x53aeb8{['_commandDefinitions'];constructor(_0x427166,_0x349952){super(_0x427166),this['_commandDefinitions']=_0x349952,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0xe5c9a2,_0x1a75a2,_0x4c9140)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x4c9140));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x52715c,_0x4c4322,_0x1e3976)=>{this['enabledCommandsIds']=_0x1e3976?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x515b35=this['editor']['model'];this['_hasContext']=function(_0x34f648){const _0x1be111=_0x34f648['document']['selection'];return _0x1be111['isCollapsed']?0x0!==[..._0x1be111['getSelectedBlocks']()]['length']&&![..._0x1be111['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x34f648['hasContent'](_0x1be111['getFirstRange']());}(_0x515b35);const _0x2e7733=_0x515b35['document']['selection'],_0x50dbea=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x335648 of _0x2e7733['getRanges']())for(const _0x3e286a of _0x335648['getItems']())if(_0x3e286a['is']('element')&&_0x50dbea['includes'](_0x3e286a['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x1d43bd='',_0x38e1a5='',_0x4986e8='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x1d43bd,_0x38e1a5,_0x4986e8);}}function G(_0x366b72,_0x15b289){const _0x39bde5=new Set();for(const _0x2ae25b of _0x366b72['values']())(_0x15b289||!0x1===_0x2ae25b['requiresContent'])&&_0x39bde5['add'](_0x2ae25b['id']);return Array['from'](_0x39bde5);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class C extends/* #__PURE__ -- @preserve */
24
+ _0x499d6f(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0xf3fb62,_0x42b605,_0x3d87a6){super(),this['editor']=_0xf3fb62,this['textAdapter']=_0x42b605,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x3d87a6,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1f0368,_0x92ab38,_0x53a7e4)=>{this['view']['value']=this['_sanitizeHTML'](_0x53a7e4);}),this['listenTo'](this['view'],'submitPrompt',(_0x592eed,_0x3be6e2)=>{const _0x2b5d5c=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x3be6e2,_0x2b5d5c,'custom');}),this['listenTo'](this['view'],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this['listenTo'](this['view'],'stopProcessing',()=>{this['stopProcessing']();});}['destroy'](){this['stopListening']();}async['updateView']({actionId:_0x4782c5,query:_0x3789c4,htmlContent:_0x2a1d66,label:_0x1f947c,mainActionLabel:_0x33288a}){this['view']['prompt']=_0x1f947c,this['view']['mainAction']=_0x33288a,this['initialContext']=_0x2a1d66,_0x3789c4&&(this['view']['isRendered']?this['_handleQuery'](_0x3789c4,_0x2a1d66,_0x4782c5,_0x1f947c):this['view']['once']('render',()=>{this['_handleQuery'](_0x3789c4,_0x2a1d66,_0x4782c5,_0x1f947c);}));}['stopProcessing'](){this['isProcessing']&&(this['isProcessing']=!0x1,this['view']['finishProcessing'](),this['textAdapter']['abort']());}['reset'](){this['initialContext']='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this['previousQuery']='',this['previousLabel']='',this['previousActionId']=void 0x0,this['view']['reset'](),this['stopProcessing']();}async['_handleQuery'](_0x7969eb,_0x1dc582,_0x57cdc0,_0x48cc25){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x1dc582,this['previousQuery']=_0x7969eb,this['previousLabel']=_0x48cc25||_0x7969eb,this['previousActionId']=_0x57cdc0,new Promise(_0x318b9c=>{this['textAdapter']['makeRequest']({'query':_0x7969eb,'context':_0x1dc582,'onData':_0x479762=>{this['currentResponse']=_0x479762,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x57cdc0})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x42ea7b=>{_0x42ea7b instanceof R?this['view']['handleError'](_0x42ea7b['message']):this['view']['handleError'](),_0x318b9c();})['finally'](()=>{this['stopProcessing'](),_0x318b9c();});});}['_parseAndNormalizeContent'](_0x2b3367,_0x225f57=!0x1){const _0x4040c2=Z['exec'](_0x2b3367);_0x2b3367=_0x4040c2?_0x2b3367['substring'](_0x4040c2[0x1]['length']):_0x2b3367['length']<0x64&&!_0x225f57?'':this['_stripMarkdownSyntax'](_0x2b3367);const _0x2921e3=this['_domParser']['parseFromString'](_0x2b3367,'text/html');if(_0x4040c2){const _0x2b0227=Array['from'](_0x2921e3['body']['childNodes']);_0x2b0227['reverse']();for(const _0xeddc5c of _0x2b0227){if(_0xeddc5c['nodeType']==Node['ELEMENT_NODE'])break;_0xeddc5c['remove']();}}const _0x341435=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2921e3['body']));return this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x341435),this['editor']['data']['stringify'](this['editor']['data']['toModel'](_0x341435));}['_normalizeResponseHeadings'](_0xba7bd9){const _0x587c71=new _0x5b6991(this['editor']['editing']['view']['document']),_0x40caef=new _0x46ac85({'name':/^h[1-5]$/}),_0x4075d8=[];let _0x380b8f=!0x1;for(const _0x17d872 of _0xba7bd9)_0x17d872['is']('element')&&_0x40caef['match'](_0x17d872)&&(_0x4075d8['push'](_0x17d872),'h1'==_0x17d872['name']&&(_0x380b8f=!0x0));if(_0x380b8f){for(const _0x41bbd7 of _0x4075d8)_0x587c71['rename']('h'+(parseInt(_0x41bbd7['name'][0x1])+0x1),_0x41bbd7);}}['_isH1TagSupportEnabled'](){const {data:_0x3320f1,editing:_0x28bb84}=this['editor'],_0x20f5e0=_0x3320f1['htmlProcessor']['toView']('<h1></h1>'),_0x565b32=_0x3320f1['toView'](_0x3320f1['toModel'](_0x20f5e0));return!!_0x28bb84['view']['domConverter']['viewToDom'](_0x565b32)['querySelector']('h1');}['_sanitizeHTML'](_0x2dc862){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x2dc862),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x51bd51){const _0x55fef1=_0x51bd51['trim']();return _0x55fef1['startsWith']('```html')?_0x55fef1['endsWith']('```')?_0x55fef1['substring'](0x7,_0x55fef1['length']-0x3):_0x55fef1['substring'](0x7):_0x51bd51;}}const x={'REPLACE':'replace','INSERT':'insert'};class nt extends rt{constructor(_0x4afd70){super(_0x4afd70),this['set']('isVisible',!0x1),this['set']('mainAction',x['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x4bf5f6=>i(_0x4afd70,'AI_'+_0x4bf5f6['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x4afd70,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x4afd70,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x4afd70,'Stop'));const _0x27ad6c=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x27ad6c['if']('isVisible','ck-hidden',_0x6769cc=>!_0x6769cc)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x20278d,_0x1edc19){const _0x5c225a=new _0x30d17a(this['locale']);return _0x5c225a['set']({'label':_0x20278d,'class':_0x1edc19||'','isVisible':!0x0,'withText':!0x0}),_0x5c225a;}}var U='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class W extends _0x524e46{['contentFieldView'];['copyButtonView'];constructor(_0x2b5e68,_0x4417fd=''){super(_0x2b5e68),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x39abe5=this['bindTemplate'];this['contentFieldView']=new ct(_0x2b5e68,_0x4417fd),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x39abe5['if']('isVisible','ck-hidden',_0x30d437=>!_0x30d437)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x39abe5['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']);let _0xafdffd=!0x1;this['on']('change:value',(_0xcfea5d,_0x53d485,_0x496c81)=>{const _0x5bf075=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x496c81),this['isProcessing']&&_0x5bf075&&!_0xafdffd&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x54d238,_0x153a79,_0x3ed685)=>{_0xafdffd=!0x1,_0x3ed685?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0xafdffd=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0xafdffd=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x2b107d=this['locale'],_0x496001=new _0x30d17a(this['locale']),_0x45d1f5='ck-ai-form__copy-button';return _0x496001['set']({'label':i(_0x2b107d,'Copy'),'icon':U,'class':_0x45d1f5,'tooltip':!0x0}),_0x496001['bind']('isVisible')['to'](this,'value',_0x5e1b51=>!!_0x5e1b51),_0x496001['bind']('isEnabled')['to'](this,'isProcessing',_0x3174ca=>!_0x3174ca),_0x496001['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x496001['icon']=_0xd76b3a['check'],_0x496001['class']=_0x45d1f5+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x496001['icon']=U,_0x496001['class']=_0x45d1f5;},0x3e8);}),_0x496001;}['_copyHTMLToClipboard'](_0x139983){const {window:_0x2cc2e7,document:_0x1bfcd2}=_0x4fa47f;if(_0x2cc2e7['ClipboardItem']){const {Blob:_0x46992b,ClipboardItem:_0x3376c1}=_0x2cc2e7,_0x50d0ed=[new _0x3376c1({'text/html':new _0x46992b([_0x139983['innerHTML']],{'type':'text/html'}),'text/plain':new _0x46992b([_0x139983['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x50d0ed);}else{const _0x20336b=_0x1bfcd2['createElement']('div');_0x20336b['style']['position']='absolute',_0x20336b['style']['left']='-9999px',_0x20336b['innerHTML']='<span>[</span>'+_0x139983['innerHTML']+'<span>]</span>',_0x1bfcd2['body']['appendChild'](_0x20336b);const _0xa90e5a=_0x1bfcd2['createRange']();_0xa90e5a['setStartAfter'](_0x20336b['firstElementChild']),_0xa90e5a['setEndBefore'](_0x20336b['lastElementChild']);const _0x9007d2=_0x2cc2e7['getSelection']();_0x9007d2['removeAllRanges'](),_0x9007d2['addRange'](_0xa90e5a),_0x1bfcd2['execCommand']('copy'),_0x20336b['remove']();}}}class ct extends _0x524e46{constructor(_0x190641,_0x237a98=''){super(_0x190641),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x237a98,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0xfe5120){this['element']['innerHTML']=_0xfe5120;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x11e74f=new _0x524e46(),_0x3c5731=this['locale'],_0x1d8e4c=new _0x38b1c9();return _0x1d8e4c['isVisible']=!0x0,_0x11e74f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1d8e4c,{'text':i(_0x3c5731,'AI\x20is\x20writing...')}]}),_0x11e74f['render'](),_0x11e74f;}}class tt extends _0x524e46{constructor(_0x48fb67,_0x5e4d6e=''){super(_0x48fb67);const _0x1a8441=new _0x4f0a9d(),_0x4552fb=this['bindTemplate'];this['set']('text',_0x5e4d6e),_0x1a8441['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x1a8441,{'text':_0x4552fb['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2aceae,_0x1742f2){super(_0x2aceae,_0x1742f2),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x514447,_0x2db76c)=>{_0x514447['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2db76c());});}['_createSubmitButton'](){const _0x187e5f=new _0x30d17a(this['locale']),_0x48ea05=this['locale'];return _0x187e5f['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x48ea05,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x187e5f['on']('execute',()=>{this['submit']();}),_0x187e5f['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x229aa4,_0x3d672f)=>!_0x229aa4&&_0x3d672f),_0x187e5f;}['_createShowHistoryButton'](){const _0x4f81db=new _0x30d17a(this['locale']),_0x30ea69=this['resultsView'],_0x2f4f75=this['locale'];_0x4f81db['set']({'label':i(_0x2f4f75,'History'),'withText':!0x1,'icon':_0xd76b3a['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4f81db['bind']('isOn')['to'](_0x30ea69,'isVisible'),_0x4f81db['bind']('isEnabled')['to'](this,'isEnabled'),_0x4f81db['on']('execute',()=>{_0x30ea69['isVisible']=!_0x30ea69['isVisible'],_0x30ea69['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x3c1f48=()=>{_0x4fa47f['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x452a75=new st(this['queryView']['fieldView']['element']),_0x5d44d8=_0x452a75['width'],_0x229813='rtl'===_0x2f4f75['uiLanguageDirection']?'left':'right';_0x452a75['excludeScrollbarsAndBorders'](),_0x4f81db['element']['style'][_0x229813]=_0x5d44d8-_0x452a75['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x3c1f48),this['on']('render',_0x3c1f48),_0x4f81db;}['submit'](){const _0x1a1417=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x1a1417);}['focus'](_0x4e7b34){-0x1===_0x4e7b34?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x171c8f){super(_0x171c8f),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x171c8f,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x44cbdb=0x0;for(const _0x442cc5 of this['items'])_0x44cbdb+=_0x442cc5['items']['length'];return{'resultsCount':_0x44cbdb,'totalItemsCount':_0x44cbdb};}['_createClearHistoryButton'](){const _0x1d4110=this['locale'],_0x2811e4=new _0x30d17a(this['locale']);return _0x2811e4['set']({'label':'('+i(_0x1d4110,'Clear')+')','withText':!0x0}),_0x2811e4['on']('execute',()=>this['fire']('clearHistory')),_0x2811e4;}}class hs extends _0x787930{constructor(_0x5a7e86){super();const _0x5301bf=new te(),_0x24c419=new _0x30d17a(this['locale'],_0x5301bf);this['children']['add'](_0x24c419),_0x24c419['set']({'label':_0x5a7e86['prompt'],'withText':!0x0}),_0x24c419['on']('execute',()=>{this['fire']('execute',{'value':_0x5295c1(_0x5a7e86['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x365ef3{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x183c64,_0x32e7cb)=>{const _0x18e74f=Ss(_0x32e7cb['prompt']);for(const _0x55df68 of this)if(_0x55df68!=_0x32e7cb&&Ss(_0x55df68['prompt'])===_0x18e74f){this['remove'](_0x55df68);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x5e8142=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x5e8142));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0xa65f09=>_0xa65f09)));}}function Ss(_0x33c60a){return _0x33c60a['toLowerCase']()['trim']();}class K extends _0x524e46{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x3f3523,_0x10e4f8,_0x48a41c=''){super(_0x3f3523),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',x['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new tt(_0x3f3523),this['contentArea']=new W(_0x3f3523,_0x48a41c),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new _0x4195fb(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x107677({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x52b1c9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x10e4f8],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x52b1c9['if']('isError','ck-hidden',_0x3fd10d=>!_0x3fd10d)]},'children':[this['errorView']]},this['contentArea'],this['toolbar'],this['promptView']]}]});}['render'](){super['render'](),this['focusTracker']['add'](this['contentArea']['element']),this['focusTracker']['add'](this['contentArea']['copyButtonView']['element']),this['focusTracker']['add'](this['toolbar']['element']),this['focusTracker']['add'](this['promptView']['element']),this['keystrokes']['listenTo'](this['element']);}['focus'](_0x468931=0x1){-0x1===_0x468931?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['reset'](){this['prompt']='',this['value']='',this['isError']=!0x1,this['promptView']['reset'](),this['contentArea']['isVisible']=!0x1,this['toolbar']['isVisible']=!0x1;}['_createPromptView'](){const _0x4ab3da=this['locale'],_0x543b52=new ht(_0x4ab3da,{'queryView':{'label':i(_0x4ab3da,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x3febd2,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x4ab3da,'Empty\x20history'),'secondary':i(_0x4ab3da,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x543b52['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x473666,_0x4365f3)=>_0x473666&&!_0x4365f3),this['listenTo'](_0x543b52,'submit',(_0x4e76a1,_0xfdcf41)=>{this['prompt']=_0xfdcf41;const _0x3c994f=_0x34c82f(_0xfdcf41);this['fire']('submitPrompt',_0x3c994f),_0xfdcf41['trim']()&&this['_promptHistory']['add']({'prompt':_0x3c994f},0x0);},{'priority':'high'}),_0x543b52;}['_createHistoryView'](){const _0x4afd45=new rs(this['locale']);return _0x4afd45['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x4afd45['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x4afd45;}['_createToolbar'](){const _0x30dde6=new nt(this['locale']);return _0x30dde6['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2a88a6,_0x5ca2e7,_0x14cc8d)=>_0x2a88a6&&!_0x5ca2e7&&!!_0x14cc8d),_0x30dde6['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x30dde6['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x29a3fc,_0x1399e6,_0x1576dd)=>_0x29a3fc&&!_0x1399e6&&!!_0x1576dd),_0x30dde6['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x30dde6['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x913632,_0x5c6a48)=>_0x913632&&!_0x5c6a48),_0x30dde6['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x30dde6['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x30dde6['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x30dde6;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x270bf9=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x270bf9,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x1a6f05){const _0x3b0d4d=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x1a6f05||i(_0x3b0d4d,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var E='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const j=globalThis['DataTransfer'];class n extends _0x452a21{['licenseKey'];['_licenseKeyCheckInterval'];['_dialog'];['_formView'];['_aiAdapter'];['_aiAssistantController'];['_uiCssClasses']='';static get['pluginName'](){return'AIAssistantUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[_0x2e0dd9,a,v,_0x5b885c];}constructor(_0xbcd1a){super(_0xbcd1a),_0xbcd1a['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0xbcd1a['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0xbcd1a['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0xbcd1a['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x301773}=this;this['_aiAdapter']=_0x301773['plugins']['get'](v),this['_dialog']=_0x301773['plugins']['get'](_0x5b885c),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x59b56a=new y(_0x301773,Array['from'](this['_commandDefinitions']['values']()));_0x301773['commands']['add']('showAIAssistant',_0x59b56a),_0x301773['ui']['componentFactory']['add']('aiCommands',_0x3f3c96=>{const _0x2d1480=_0x1ebb9a(_0x3f3c96);return _0x2d1480['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x2d1480['buttonView']['set']({'label':i(_0x3f3c96,'AI\x20Commands'),'icon':E,'tooltip':!0x0}),_0x2d1480['on']('execute',_0x1f2902=>this['_onExecute'](_0x1f2902['source']['id'])),_0x4054bf(_0x2d1480,_0x301773['ui']['view']['body'],function(_0x16d1d1){const _0x12345e=o(_0x16d1d1['config']['get']('ai.aiAssistant.commands'),_0x16d1d1['locale']),_0x407034=B(_0x16d1d1,_0x12345e)['filter'](_0xa8fc75=>_0xa8fc75['commands']['length']);if(0x1===_0x407034['length'])return B(_0x16d1d1,_0x407034[0x0]['commands'])['map'](_0x10ceca=>({'id':_0x10ceca['id'],'label':_0x10ceca['label']}));return _0x407034['map'](_0x2e3a16=>{const {groupId:_0xdf69bc,groupLabel:_0x37189f,commands:_0xb4c87f}=_0x2e3a16,_0x3a9f3e=B(_0x16d1d1,_0xb4c87f)['map'](_0x17e0af=>({'id':_0x17e0af['id'],'label':_0x17e0af['label']}));return{'id':_0xdf69bc,'menu':_0x37189f||_0xdf69bc,'children':_0x3a9f3e};});}(_0x301773),{'ariaLabel':i(_0x3f3c96,'AI\x20Commands')}),_0x2d1480['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x59b56a['on']('change:enabledCommandsIds',_0x392a3f),_0x2d1480['menuView']['once']('render',_0x392a3f),_0x2d1480;function _0x392a3f(){_0x2d1480['isEnabled']=_0x59b56a['enabledCommandsIds']['length']>0x0;for(const _0x4348cd of _0x2d1480['menuView']['buttons'])_0x4348cd['isEnabled']=_0x59b56a['enabledCommandsIds']['includes'](_0x4348cd['id']);}}),_0x301773['ui']['componentFactory']['add']('menuBar:aiCommands',_0x22aa71=>{const _0x320d51=new _0x490302(_0x22aa71);_0x320d51['buttonView']['set']({'label':i(_0x22aa71,'AI\x20Commands'),'icon':E}),_0x320d51['bind']('isEnabled')['to'](_0x59b56a,'enabledCommandsIds',_0xc40270=>_0xc40270['length']>0x0);const _0x2a646d=o(_0x301773['config']['get']('ai.aiAssistant.commands'),_0x22aa71);return this['_populateMenuBarMenu'](_0x59b56a,_0x320d51,_0x2a646d,_0x5f3142=>this['_onExecute'](_0x5f3142)),_0x320d51;}),_0x301773['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x37a7ee=this['_createAIAssistantUIButton'](_0x30d17a);return _0x37a7ee['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x37a7ee;}),_0x301773['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x46e727=this['_createAIAssistantUIButton'](_0x1afe6e);return _0x46e727['set']({'role':'menuitemcheckbox'}),_0x46e727;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2e06a3=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2e429c;for(const _0x32e71a in _0x2e06a3){const _0x30780c=_0x32e71a,_0xb16663=_0x2e06a3[_0x30780c];if('aiLicenseKeyValid'==_0xb16663||'aiLicenseKeyInvalid'==_0xb16663||'aiLicenseKeyExpired'==_0xb16663||'aiLicenseKeyDomainLimit'==_0xb16663||'aiLicenseKeyNotAllowed'==_0xb16663||'aiLicenseKeyEvaluationLimit'==_0xb16663||'aiLicenseKeyTrialLimit'==_0xb16663||'aiLicenseKeyDevelopmentLimit'==_0xb16663||'aiLicenseKeyUsageLimit'==_0xb16663){delete _0x2e06a3[_0x30780c],_0x2e429c=_0xb16663,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2e429c&&_0x2e06a3['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2e429c&&_0x2e06a3['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2e429c&&_0x2e06a3['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2e429c&&_0x2e06a3['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2e429c&&_0x2e06a3['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x2e429c&&_0x2e06a3['_showLicenseError']('trialLimit'),'aiLicenseKeyDevelopmentLimit'==_0x2e429c&&_0x2e06a3['_showLicenseError']('developmentLimit'),'aiLicenseKeyUsageLimit'==_0x2e429c&&_0x2e06a3['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x1ccb08='',_0x2767da='',_0x3078b4='custom'){const _0x47855d=this['editor'],_0x5c9a94=_0x47855d['editing']['view'],_0x280f16=_0x47855d['plugins']['get'](a),_0x33cb01=_0x47855d['plugins']['get'](_0x2e0dd9);_0x280f16['showFakeVisualSelection']();const _0x5b92bb=new j(),_0x126418=new ClipboardEvent('copy',{'clipboardData':_0x5b92bb}),_0x3468d5=new _0x6397f2(_0x5b92bb),_0x4f5a23=new _0x3bee1d(_0x5c9a94,_0x126418,{'dataTransfer':_0x3468d5});_0x33cb01['_forceMarkersCopy']('comment',()=>{_0x5c9a94['document']['fire']('copy',_0x4f5a23);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new C(_0x47855d,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x10b15c=_0x3468d5['getData']('text/html');const _0x38da4e=_0x47855d['model']['document']['selection'],_0x31e5ec=Array['from'](_0x38da4e['getRanges']());0x1===_0x31e5ec['length']&&_0x31e5ec[0x0]['isFlat']&&!_0x38da4e['getSelectedElement']()&&''!==_0x10b15c['replace'](/&nbsp;/g,'')['trim']()&&(_0x10b15c='<p>'+_0x10b15c+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x3078b4,'query':_0x1ccb08,'htmlContent':_0x10b15c,'label':_0x2767da,'mainActionLabel':x[_0x47855d['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':at['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0xaa8cd['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x280f16['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x112c19=new Map(),_0x10bb88=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x23faee of _0x10bb88)for(const _0x59eec2 of _0x23faee['commands'])_0x112c19['set'](_0x59eec2['id'],{..._0x59eec2,'groupId':_0x23faee['groupId'],'groupLabel':_0x23faee['groupLabel']||_0x23faee['groupId']});return _0x112c19;}['_createAIAssistantUIButton'](_0x18c9bd){const _0x2eab4e=this['editor'],_0x2fca6a=_0x2eab4e['commands']['get']('showAIAssistant'),_0x23499e=new _0x18c9bd(_0x2eab4e['locale']);return _0x23499e['set']({'label':i(_0x2eab4e['locale'],'AI\x20Assistant'),'icon':at['robotPencil'],'isToggleable':!0x0}),_0x23499e['bind']('isEnabled')['to'](_0x2fca6a),_0x23499e['bind']('isOn')['to'](this['_dialog'],'id',_0x24ac6d=>'aiAssistant'===_0x24ac6d),this['listenTo'](_0x23499e,'execute',()=>{_0x23499e['isOn']?this['hideUI']():_0x2fca6a['execute']();}),_0x23499e;}['_initView'](){const _0xbe043f=this['editor']['plugins']['get'](a);this['_formView']=new K(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0xbe043f['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0xbe043f['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x29f504,ui:{ariaLiveAnnouncer:_0x524966}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x36160c,_0x24887c,_0x2046e9)=>{const _0x32c9ca=this['_aiAssistantController']['currentContext'];_0x2046e9?_0x524966['announce'](i(_0x29f504,'AI\x20is\x20writing')):_0x32c9ca&&_0x524966['announce'](i(_0x29f504,'Generated\x20content:\x20%0',_0x32c9ca),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x402191,_0x5e459c,_0x95d715)=>{if(_0x95d715){const _0x5e80e7=this['_formView']['errorView']['text'];_0x524966['announce'](i(_0x29f504,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5e80e7));}});}['_onExecute'](_0x37afb3){const _0x3d95b=this['_commandDefinitions']['get'](_0x37afb3),_0x11ca87=this['editor'],_0x4a34bc=_0x11ca87['model']['document']['selection'],_0x329dc6=_0x11ca87['commands']['get']('showAIAssistant'),_0x386458=_0x11ca87['plugins']['get'](a),_0x299a8f=''+(_0x3d95b['groupId']!==I?_0x3d95b['groupLabel']+':\x20':'')+_0x3d95b['label'];if(!0x1!==_0x3d95b['requiresContent']&&_0x4a34bc['isCollapsed']){const _0x3be809=_0x5d7ec1(_0x4a34bc['getSelectedBlocks']())||_0x11ca87['model']['schema']['getLimitElement'](_0x4a34bc);_0x11ca87['model']['change'](_0x5996a4=>{_0x5996a4['setSelection'](_0x3be809,'in');});}_0x386458['showFakeVisualSelection'](),_0x329dc6['execute'](_0x3d95b['prompt'],_0x299a8f,'command:'+_0x37afb3);}['_populateMenuBarMenu'](_0x108630,_0x3fe9bb,_0x4cf436,_0x371341){const _0x12dc5b=this['editor'],_0x167081=_0x12dc5b['locale'],_0x5ad063=new _0x306a60(_0x167081),_0x76822c=B(_0x12dc5b,_0x4cf436)['filter'](_0x22668a=>_0x22668a['commands']['length']);0x1===_0x76822c['length']?this['_getMenuBarGroupButtons']({'command':_0x108630,'commands':_0x76822c[0x0]['commands'],'parentMenuView':_0x3fe9bb,'onExecute':_0x371341})['forEach'](_0x49aaa5=>_0x5ad063['items']['add'](_0x49aaa5)):_0x76822c['forEach'](({groupId:_0x2f51ab,groupLabel:_0x297c0f,commands:_0x1a023e})=>{const _0x15d38c=new _0x46169e(_0x167081,_0x3fe9bb),_0x1c1990=new _0x490302(_0x167081),_0xbece11=new _0x306a60(_0x167081),_0x2b783b=this['_getMenuBarGroupButtons']({'command':_0x108630,'commands':_0x1a023e,'parentMenuView':_0x1c1990,'onExecute':_0x371341});_0x1c1990['buttonView']['set']({'label':_0x297c0f||_0x2f51ab}),_0x1c1990['delegate']('execute')['to'](_0x3fe9bb),_0xbece11['items']['addMany'](_0x2b783b),_0x1c1990['panelView']['children']['add'](_0xbece11),_0x15d38c['children']['add'](_0x1c1990),_0x5ad063['items']['add'](_0x15d38c);}),_0x3fe9bb['panelView']['children']['add'](_0x5ad063);}['_getMenuBarGroupButtons']({command:_0x5a605c,commands:_0x8b533f,parentMenuView:_0x4081ad,onExecute:_0x4b749a}){const _0x113c23=this['editor'],_0x3dc92d=_0x113c23['locale'];return B(_0x113c23,_0x8b533f)['map'](_0x40109a=>{const _0x51eef1=new _0x46169e(_0x3dc92d,_0x4081ad),_0x362d41=new _0x1afe6e(_0x3dc92d);return _0x362d41['set']({'label':_0x40109a['label']}),_0x362d41['delegate']('execute')['to'](_0x4081ad),_0x362d41['on']('execute',()=>_0x4b749a(_0x40109a['id'])),_0x362d41['bind']('isEnabled')['to'](_0x5a605c,'enabledCommandsIds',_0x3cd40d=>_0x3cd40d['includes'](_0x40109a['id'])),_0x51eef1['children']['add'](_0x362d41),_0x51eef1;});}}function _(_0x154731,_0x5a2cbd){return void 0x0!==_0x154731['order']&&void 0x0===_0x5a2cbd['order']?0x1:void 0x0===_0x154731['order']&&void 0x0!==_0x5a2cbd['order']?-0x1:void 0x0!==_0x154731['order']&&void 0x0!==_0x5a2cbd['order']?_0x154731['order']-_0x5a2cbd['order']:0x0;}function B(_0x3beedc,_0x31f1c5){_0x31f1c5['sort'](_);const _0xf17171={},_0x5e0dc9=[];for(const _0x5aaef3 of _0x31f1c5)if(void 0x0!==_0x5aaef3['order']){if(_0x5aaef3['order']in _0xf17171)throw new _0x5ef33c('ai-commands-config-order-collision',_0x3beedc,{'conflictingDefinitions':[_0x5aaef3,_0xf17171[_0x5aaef3['order']]]});_0xf17171[_0x5aaef3['order']]=_0x5aaef3,_0x5e0dc9['splice'](_0x5aaef3['order'],0x0,_0x5aaef3);}else _0x5e0dc9['push'](_0x5aaef3);return _0x5e0dc9;}class r extends _0x452a21{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x652d44){super(_0x652d44);const _0x56744a=_0x652d44['config'],_0x324483=_0x652d44['locale'];_0x56744a['define']('ai.aiAssistant.commands',function(_0x35118f){return[{'groupId':'editOrReview','groupLabel':i(_0x35118f,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x35118f,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x35118f,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':i(_0x35118f,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x35118f,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':i(_0x35118f,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x35118f,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':i(_0x35118f,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':i(_0x35118f,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x35118f,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x35118f,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x35118f,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x35118f,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x35118f,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x35118f,'Change\x20style'),'commands':[{'id':'business','label':i(_0x35118f,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x35118f,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x35118f,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x35118f,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x35118f,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x35118f,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x35118f,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x35118f,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x35118f,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x35118f,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x35118f,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x35118f,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x35118f,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x324483)),_0x56744a['define']('ai.aiAssistant.extraCommandGroups',[]),_0x56744a['define']('ai.aiAssistant.removeCommands',[]);const _0xdbf2b1=o(_0x56744a['get']('ai.aiAssistant.commands'),_0x324483),_0x1839da=_0x56744a['get']('ai.aiAssistant.extraCommandGroups'),_0x2354c2=_0x56744a['get']('ai.aiAssistant.removeCommands');_0x1839da['forEach'](_0x1bfe29=>{const _0x20ae9b=_0xdbf2b1['find'](_0x558bb9=>_0x558bb9['groupId']===_0x1bfe29['groupId']);_0x20ae9b?_0x20ae9b['commands']=_0x20ae9b['commands']['concat'](_0x1bfe29['commands']):_0xdbf2b1['push'](_0x1bfe29);}),_0xdbf2b1['forEach'](_0x191996=>{_0x191996['commands']=_0x191996['commands']['filter'](_0x17d8d4=>!_0x2354c2['includes'](_0x17d8d4['id']));}),_0x56744a['set']('ai.aiAssistant.commands',_0xdbf2b1);}}class P extends _0x452a21{['abortController'];static get['requires'](){return[v];}constructor(_0x218e19){super(_0x218e19),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](v)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x27d312){return this['sendRequest'](_0x27d312)['catch'](_0x1a274e=>{if(_0x1a274e instanceof R)return Promise['reject'](_0x1a274e);if('AbortError'==_0x1a274e['name'])return Promise['resolve']();throw console['error'](_0x1a274e),new _0x5ef33c('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x9d3bbe,_0x50b576){const _0x43cb79=this['editor']['locale'],_0x28998f={'Content-Type':'application/json'};if('object'==typeof _0x9d3bbe)Object['assign'](_0x28998f,_0x9d3bbe);else{if(_0x9d3bbe)try{const _0x43b620=await _0x9d3bbe(_0x50b576);Object['assign'](_0x28998f,_0x43b620);}catch(_0x568249){return Promise['reject'](new R(i(_0x43cb79,'AI_ERROR_GET_HEADERS')));}}return _0x28998f;}async['_prepareRequestParameters'](_0x5bfbc5,_0x510c1c){const _0xc929c1=this['editor']['locale'];if('object'==typeof _0x5bfbc5)return _0x5bfbc5;try{return await _0x5bfbc5(_0x510c1c);}catch(_0xd10f70){return Promise['reject'](new R(i(_0xc929c1,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x48adbc){super(_0x48adbc),_0x48adbc['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x48adbc['config']['get']('ai.openAI.requestParameters')||_0x48adbc['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x48adbc['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x48adbc['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x48adbc['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x16c937,context:_0x5ce360,onData:_0x311d5d,actionId:_0x5a23bb}){const _0x568f19=this['editor']['locale'],_0x2e9d6b=await this['prepareMessages'](_0x16c937,_0x5ce360,_0x5a23bb),_0x132460=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5a23bb),_0x32c3dc=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5a23bb),_0x52f6d5={'messages':_0x2e9d6b,..._0x32c3dc},_0x57fb3e={'method':'POST','headers':_0x132460,'body':JSON['stringify'](_0x52f6d5),'signal':this['abortController']['signal']},_0x493c5a=await fetch(this['_apiUrl'],_0x57fb3e);if(_0x493c5a['ok'])return _0x32c3dc['stream']?await this['_readStreamableResponse'](_0x493c5a,_0x311d5d):await this['_readStaticResponse'](_0x493c5a,_0x311d5d),Promise['resolve']();{const _0x45a1ee=await _0x493c5a['text']();return _0x45a1ee['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x568f19,'AI_ERROR_CONTEXT_LENGTH'))):_0x45a1ee['includes']('Moderation')?Promise['reject'](new R(i(_0x568f19,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x45a1ee));}}async['prepareMessages'](_0x5c35b1,_0x4977af,_0x59563e){let _0x45a4af,_0x3bed47;return _0x4977af?(_0x45a4af='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.',_0x3bed47='Instruction:\x0a'+_0x5c35b1+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4977af):(_0x45a4af='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.',_0x3bed47=_0x5c35b1),[{'role':'system','content':_0x45a4af},{'role':'user','content':_0x3bed47}];}async['_readStreamableResponse'](_0x2987f3,_0x1beb91){const _0x283a33=_0x2987f3['body']['getReader'](),_0x5a8bf9=new TextDecoder();let _0x3dbb2e='',_0x3157fb='',_0x128e87='',_0x587f7d=!0x1;for(;!_0x587f7d;){const {done:_0x4772a5,value:_0x176eaf}=await _0x283a33['read'](),_0x274f10=_0x3dbb2e+_0x5a8bf9['decode'](_0x176eaf);let _0x175a10='';_0x587f7d=_0x4772a5;try{_0x175a10=this['_cleanUpData'](_0x274f10),_0x3dbb2e='';}catch(_0x1ba6f4){_0x3dbb2e=_0x274f10;continue;}_0x3157fb+=_0x175a10,!_0x587f7d&&this['_isBufferIncomplete'](_0x3157fb)||_0x3157fb&&(_0x128e87+=_0x3157fb,_0x3157fb='',_0x1beb91(_0x128e87));}return Promise['resolve']();}async['_readStaticResponse'](_0x1cfc5,_0x2752e3){return _0x2752e3((await _0x1cfc5['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x4b9409){const _0x2f308d=_0x4b9409['split']('<')['length']!==_0x4b9409['split']('>')['length'],_0x323329=_0x4b9409['length']<0x1e;return _0x2f308d&&_0x323329;}['_cleanUpData'](_0x461da1){return _0x461da1['split'](/\n(?![^{]*\})/g)['map'](_0x38776c=>_0x38776c['replace']('data:\x20',''))['filter'](_0x58213f=>_0x58213f&&_0x58213f['length']>0x0&&'[DONE]'!==_0x58213f)['map'](_0x251838=>{const {choices:_0x1beca3}=JSON['parse'](_0x251838);if(_0x1beca3[0x0]&&_0x1beca3[0x0]['delta']&&_0x1beca3[0x0]['delta']['content'])return _0x1beca3[0x0]['delta']['content'];})['filter'](_0x14c2f6=>_0x14c2f6)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0xe411f4){super(_0xe411f4),_0xe411f4['config']['get']('ai.aws.requestParameters')||_0xe411f4['config']['define']('ai.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0xe411f4['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0xe411f4['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0xe411f4['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0xe411f4['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0xf5bc26,context:_0x11e858,onData:_0x3cdef2,actionId:_0x14165f}){const {model:_0x4f2abc,stream:_0x422989,..._0x50bc40}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x14165f),_0x569a5e={'prompt':await this['preparePrompt'](_0xf5bc26,_0x11e858,_0x4f2abc,_0x14165f),..._0x50bc40};this['_apiUrl']?await this['_processProxyRequest'](_0x569a5e,_0x4f2abc,_0x422989,_0x3cdef2,_0x14165f):await this['_processAWSRequest'](_0x569a5e,_0x4f2abc,_0x422989,_0x3cdef2);}async['preparePrompt'](_0x590b0d,_0x211656,_0x4117c4,_0xe05aa1){let _0x347cee,_0x2c6989;return _0x211656?(_0x347cee='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.',_0x2c6989='Instruction:\x0a'+_0x590b0d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x211656):(_0x347cee='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.',_0x2c6989=_0x590b0d),'meta.llama'==this['getModelFamily'](_0x4117c4)?'<<SYS>>\x0a'+_0x347cee+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2c6989+'\x0a[/INST]':'Human:\x0a'+_0x347cee+'\x0a'+_0x2c6989+'\x0a\x0aAssistant:';}['getModelFamily'](_0x150082){if(/^anthropic\.claude/['test'](_0x150082))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x150082))return'ai21.j2';if(/^cohere\.command/['test'](_0x150082))return'cohere.command';if(/^meta\.llama/['test'](_0x150082))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x150082));}async['_processProxyRequest'](_0x4fe933,_0x1d273c,_0x5409ef,_0x503e34,_0x1d4154){const _0x1cae52={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1d4154),'body':JSON['stringify']({..._0x4fe933,'model':_0x1d273c,'stream':_0x5409ef}),'signal':this['abortController']['signal']},_0x236b81=await fetch(this['_apiUrl'],_0x1cae52);_0x5409ef?await this['_readStreamableResponse'](_0x236b81,_0x1d273c,_0x503e34):await this['_readStaticResponse'](_0x236b81,_0x1d273c,_0x503e34);}async['_processAWSRequest'](_0x115397,_0x8ce8f3,_0x15fcd2,_0x22f34){const _0x21974c=new _0x2d3a7b(this['_bedrockClientConfig']),_0x3297f8={'body':JSON['stringify'](_0x115397),'contentType':'application/json','accept':'application/json','modelId':_0x8ce8f3};let _0x484bc6;if(_0x15fcd2){const _0x137903=new _0x1d5ea6(_0x3297f8);_0x484bc6=await _0x21974c['send'](_0x137903,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x484bc6,_0x8ce8f3,_0x22f34);}else{const _0x608b3d=new _0x5b542d(_0x3297f8);_0x484bc6=await _0x21974c['send'](_0x608b3d,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x484bc6,_0x8ce8f3,_0x22f34);}}async['_readAsyncIterableResponse'](_0x59003a,_0x3b0d78,_0x13049c){const _0x1474ab=_0x59003a['body'],_0x1c669c=new TextDecoder('utf-8');let _0x38e57e='';for await(const _0x3874f8 of _0x1474ab)if(_0x3874f8['chunk']){const _0xeb2891=_0x1c669c['decode'](_0x3874f8['chunk']['bytes']),_0x2f7994=JSON['parse'](_0xeb2891);_0x38e57e+=this['_getGeneratedText'](_0x2f7994,_0x3b0d78),_0x13049c(_0x38e57e);}return Promise['resolve']();}async['_readStreamableResponse'](_0x2fa6e5,_0x33ff4c,_0x3d87b1){const _0x438e74=_0x2fa6e5['body'],_0xfc017b=new TextDecoder('utf-8'),_0x3d7848=_0x438e74['getReader']();let _0x376a87='',_0x329783='',_0x3c2316=!0x1;for(;!_0x3c2316;){const {done:_0x4d3e9d,value:_0x5b63a3}=await _0x3d7848['read']();if(_0x3c2316=_0x4d3e9d,_0x3c2316)break;const _0x5e2fb8=(_0x376a87+_0xfc017b['decode'](_0x5b63a3))['split']('\x0a')['map'](_0x39b693=>{try{return _0x376a87='',JSON['parse'](_0x39b693);}catch(_0x354b45){return _0x376a87=_0x39b693,null;}})['filter'](_0x3a2f0d=>null!==_0x3a2f0d);_0x5e2fb8['length']&&(_0x329783+=_0x5e2fb8['map'](_0x5959cd=>this['_getGeneratedText'](_0x5959cd,_0x33ff4c))['join'](''),_0x3d87b1(_0x329783));}return Promise['resolve']();}async['_readStaticResponse'](_0x2ecea7,_0x523359,_0xe0da1b){let _0x124d95;return _0x124d95=_0x2ecea7 instanceof Response?await _0x2ecea7['json']():JSON['parse'](Buffer['from'](_0x2ecea7['body'])['toString']('utf8')),(_0xe0da1b(this['_getGeneratedText'](_0x124d95,_0x523359)),Promise['resolve']());}['_getGeneratedText'](_0x1cc8e7,_0x6abf69){switch(this['getModelFamily'](_0x6abf69)){case'anthropic.claude':return _0x1cc8e7['completion'];case'ai21.j2':return _0x1cc8e7['completions'][0x0]['data']['text'];case'cohere.command':return _0x1cc8e7['generations'][0x0]['text'];case'meta.llama':return _0x1cc8e7['generation'];}}}export{v as AIAdapter,r as AIAssistant,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x337c39=>0x1!=_0x337c39}};
23
+ export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x4f7cd9=>0x1!=_0x4f7cd9}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x2969ae=>{const {af:{dictionary:_0x34704c,getPluralForm:_0x36f391}}={'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x4a9841=>0x1!=_0x4a9841}};_0x2969ae['af']||={'dictionary':{},'getPluralForm':null},_0x2969ae['af']['dictionary']=Object['assign'](_0x2969ae['af']['dictionary'],_0x34704c),_0x2969ae['af']['getPluralForm']=_0x36f391;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x4a5019=>{const {af:{dictionary:_0x3f5911,getPluralForm:_0x5ead04}}={'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x47e8f3=>0x1!=_0x47e8f3}};_0x4a5019['af']||={'dictionary':{},'getPluralForm':null},_0x4a5019['af']['dictionary']=Object['assign'](_0x4a5019['af']['dictionary'],_0x3f5911),_0x4a5019['af']['getPluralForm']=_0x5ead04;})(window['CKEDITOR_TRANSLATIONS']||={});
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export default{'ar':{'dictionary':{'Edit\x20or\x20review':'التحرير\x20أو\x20المراجعة','Improve\x20writing':'قم\x20بتحسين\x20الكتابة','Make\x20shorter':'اجعله\x20أقصر','Make\x20longer':'اجعله\x20أطول','Simplify\x20language':'قم\x20بتبسيط\x20اللغة','Generate\x20from\x20selection':'قم\x20بالإنشاء\x20من\x20التحديد','Summarize':'تلخيص','Continue':'متابعة','Change\x20tone':'تغيير\x20الأسلوب','Professional':'احترافي','Casual':'غير\x20رسمي','Direct':'مباشر','Confident':'لهجة\x20واثقة','Friendly':'ودي','Change\x20style':'تغيير\x20الأسلوب','Business':'تجاري','Legal':'قانوني','Journalism':'الكتابة\x20الصحفية','Poetic':'شِعري','Translate':'ترجِمْ','English':'الإنكليزية','Spanish':'الإسبانية','German':'الألمانية','Portuguese':'البرتغالية','French':'الفرنسية','Simplified\x20Chinese':'الصينية\x20المبسطة','Hindi':'الهندية','Arabic':'العربية','AI\x20Assistant':'مساعد\x20الذكاء\x20الاصطناعي','AI\x20Commands':'أوامر\x20الذكاء\x20الاصطناعي','Ask\x20AI\x20to\x20edit\x20or\x20generate':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بالتحرير\x20أو\x20الإنشاء','Ask\x20AI\x20to\x20improve\x20generated\x20text':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بتحسين\x20النص\x20الذي\x20تم\x20إنشاؤه','Copy':'نسخ','Submit':'إرسال','Insert\x20below':'أدخل\x20أدناه','Try\x20again':'حاول\x20مجددًا','Stop':'إيقاف','AI\x20is\x20writing...':'يقوم\x20الذكاء\x20الاصطناعي\x20بالكتابة...','AI\x20is\x20writing':'يكتب\x20الذكاء\x20الاصطناعي','Generated\x20content:\x20%0':'المحتوى\x20الذي\x20تم\x20إنشاؤه:\x20%0','Error\x20during\x20AI\x20content\x20generation:\x20%0':'حدث\x20خطأ\x20أثناء\x20إنشاء\x20محتوى\x20الذكاء\x20الاصطناعي:\x20%0','History':'سجل\x20المحفوظات','Empty\x20history':'السجل\x20فارغ','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'سيتم\x20إدراج\x20الطلبات\x20التي\x20طلبتها\x20من\x20الذكاء\x20الاصطناعي\x20والتوجيهات\x20الخاصة\x20بك\x20هنا\x20لكي\x20يتم\x20استخدامها\x20لاحقًا.','Prompt\x20history':'سجل\x20التوجيهات','AI_REPLACE_CONTENT':'استبدال','AI_INSERT_CONTENT':'إدراج','AI_ERROR_GET_HEADERS':'فشلت\x20عملية\x20تحضير\x20عناوين\x20الطلبات','AI_ERROR_GET_PARAMETERS':'لقد\x20فشلت\x20عملية\x20إعداد\x20معلمات\x20الطلب','AI_ERROR_UNSUPPORTED_MODEL':'إن\x20نموذج\x20AI\x20المطلوب\x20(\x22%0\x22)\x20غير\x20مدعوم','AI_ERROR_CONTEXT_LENGTH':'المحتوى\x20المحدد\x20طويل\x20جداً','AI_ERROR_MODERATION':'الاستعلام\x20المطلوب\x20لا\x20يجتاز\x20قواعد\x20الإشراف','AI_ERROR_FAILED':'لقد\x20فشل\x20التواصل\x20مع\x20خدمة\x20الذكاء\x20الاصطناعي','Other':'آخر'},'getPluralForm':_0x98bc3=>0x0==_0x98bc3?0x0:0x1==_0x98bc3?0x1:0x2==_0x98bc3?0x2:_0x98bc3%0x64>=0x3&&_0x98bc3%0x64<=0xa?0x3:_0x98bc3%0x64>=0xb?0x4:0x5}};
23
+ export default{'ar':{'dictionary':{'Edit\x20or\x20review':'التحرير\x20أو\x20المراجعة','Improve\x20writing':'قم\x20بتحسين\x20الكتابة','Make\x20shorter':'اجعله\x20أقصر','Make\x20longer':'اجعله\x20أطول','Simplify\x20language':'قم\x20بتبسيط\x20اللغة','Generate\x20from\x20selection':'قم\x20بالإنشاء\x20من\x20التحديد','Summarize':'تلخيص','Continue':'متابعة','Change\x20tone':'تغيير\x20الأسلوب','Professional':'احترافي','Casual':'غير\x20رسمي','Direct':'مباشر','Confident':'لهجة\x20واثقة','Friendly':'ودي','Change\x20style':'تغيير\x20الأسلوب','Business':'تجاري','Legal':'قانوني','Journalism':'الكتابة\x20الصحفية','Poetic':'شِعري','Translate':'ترجِمْ','English':'الإنكليزية','Spanish':'الإسبانية','German':'الألمانية','Portuguese':'البرتغالية','French':'الفرنسية','Simplified\x20Chinese':'الصينية\x20المبسطة','Hindi':'الهندية','Arabic':'العربية','AI\x20Assistant':'مساعد\x20الذكاء\x20الاصطناعي','AI\x20Commands':'أوامر\x20الذكاء\x20الاصطناعي','Ask\x20AI\x20to\x20edit\x20or\x20generate':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بالتحرير\x20أو\x20الإنشاء','Ask\x20AI\x20to\x20improve\x20generated\x20text':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بتحسين\x20النص\x20الذي\x20تم\x20إنشاؤه','Copy':'نسخ','Submit':'إرسال','Insert\x20below':'أدخل\x20أدناه','Try\x20again':'حاول\x20مجددًا','Stop':'إيقاف','AI\x20is\x20writing...':'يقوم\x20الذكاء\x20الاصطناعي\x20بالكتابة...','AI\x20is\x20writing':'يكتب\x20الذكاء\x20الاصطناعي','Generated\x20content:\x20%0':'المحتوى\x20الذي\x20تم\x20إنشاؤه:\x20%0','Error\x20during\x20AI\x20content\x20generation:\x20%0':'حدث\x20خطأ\x20أثناء\x20إنشاء\x20محتوى\x20الذكاء\x20الاصطناعي:\x20%0','History':'سجل\x20المحفوظات','Empty\x20history':'السجل\x20فارغ','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'سيتم\x20إدراج\x20الطلبات\x20التي\x20طلبتها\x20من\x20الذكاء\x20الاصطناعي\x20والتوجيهات\x20الخاصة\x20بك\x20هنا\x20لكي\x20يتم\x20استخدامها\x20لاحقًا.','Prompt\x20history':'سجل\x20التوجيهات','AI_REPLACE_CONTENT':'استبدال','AI_INSERT_CONTENT':'إدراج','AI_ERROR_GET_HEADERS':'فشلت\x20عملية\x20تحضير\x20عناوين\x20الطلبات','AI_ERROR_GET_PARAMETERS':'لقد\x20فشلت\x20عملية\x20إعداد\x20معلمات\x20الطلب','AI_ERROR_UNSUPPORTED_MODEL':'إن\x20نموذج\x20AI\x20المطلوب\x20(\x22%0\x22)\x20غير\x20مدعوم','AI_ERROR_CONTEXT_LENGTH':'المحتوى\x20المحدد\x20طويل\x20جداً','AI_ERROR_MODERATION':'الاستعلام\x20المطلوب\x20لا\x20يجتاز\x20قواعد\x20الإشراف','AI_ERROR_FAILED':'لقد\x20فشل\x20التواصل\x20مع\x20خدمة\x20الذكاء\x20الاصطناعي','Other':'آخر'},'getPluralForm':_0x73f631=>0x0==_0x73f631?0x0:0x1==_0x73f631?0x1:0x2==_0x73f631?0x2:_0x73f631%0x64>=0x3&&_0x73f631%0x64<=0xa?0x3:_0x73f631%0x64>=0xb?0x4:0x5}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x418d7b=>{const {ar:{dictionary:_0x496201,getPluralForm:_0x28394e}}={'ar':{'dictionary':{'Edit\x20or\x20review':'التحرير\x20أو\x20المراجعة','Improve\x20writing':'قم\x20بتحسين\x20الكتابة','Make\x20shorter':'اجعله\x20أقصر','Make\x20longer':'اجعله\x20أطول','Simplify\x20language':'قم\x20بتبسيط\x20اللغة','Generate\x20from\x20selection':'قم\x20بالإنشاء\x20من\x20التحديد','Summarize':'تلخيص','Continue':'متابعة','Change\x20tone':'تغيير\x20الأسلوب','Professional':'احترافي','Casual':'غير\x20رسمي','Direct':'مباشر','Confident':'لهجة\x20واثقة','Friendly':'ودي','Change\x20style':'تغيير\x20الأسلوب','Business':'تجاري','Legal':'قانوني','Journalism':'الكتابة\x20الصحفية','Poetic':'شِعري','Translate':'ترجِمْ','English':'الإنكليزية','Spanish':'الإسبانية','German':'الألمانية','Portuguese':'البرتغالية','French':'الفرنسية','Simplified\x20Chinese':'الصينية\x20المبسطة','Hindi':'الهندية','Arabic':'العربية','AI\x20Assistant':'مساعد\x20الذكاء\x20الاصطناعي','AI\x20Commands':'أوامر\x20الذكاء\x20الاصطناعي','Ask\x20AI\x20to\x20edit\x20or\x20generate':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بالتحرير\x20أو\x20الإنشاء','Ask\x20AI\x20to\x20improve\x20generated\x20text':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بتحسين\x20النص\x20الذي\x20تم\x20إنشاؤه','Copy':'نسخ','Submit':'إرسال','Insert\x20below':'أدخل\x20أدناه','Try\x20again':'حاول\x20مجددًا','Stop':'إيقاف','AI\x20is\x20writing...':'يقوم\x20الذكاء\x20الاصطناعي\x20بالكتابة...','AI\x20is\x20writing':'يكتب\x20الذكاء\x20الاصطناعي','Generated\x20content:\x20%0':'المحتوى\x20الذي\x20تم\x20إنشاؤه:\x20%0','Error\x20during\x20AI\x20content\x20generation:\x20%0':'حدث\x20خطأ\x20أثناء\x20إنشاء\x20محتوى\x20الذكاء\x20الاصطناعي:\x20%0','History':'سجل\x20المحفوظات','Empty\x20history':'السجل\x20فارغ','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'سيتم\x20إدراج\x20الطلبات\x20التي\x20طلبتها\x20من\x20الذكاء\x20الاصطناعي\x20والتوجيهات\x20الخاصة\x20بك\x20هنا\x20لكي\x20يتم\x20استخدامها\x20لاحقًا.','Prompt\x20history':'سجل\x20التوجيهات','AI_REPLACE_CONTENT':'استبدال','AI_INSERT_CONTENT':'إدراج','AI_ERROR_GET_HEADERS':'فشلت\x20عملية\x20تحضير\x20عناوين\x20الطلبات','AI_ERROR_GET_PARAMETERS':'لقد\x20فشلت\x20عملية\x20إعداد\x20معلمات\x20الطلب','AI_ERROR_UNSUPPORTED_MODEL':'إن\x20نموذج\x20AI\x20المطلوب\x20(\x22%0\x22)\x20غير\x20مدعوم','AI_ERROR_CONTEXT_LENGTH':'المحتوى\x20المحدد\x20طويل\x20جداً','AI_ERROR_MODERATION':'الاستعلام\x20المطلوب\x20لا\x20يجتاز\x20قواعد\x20الإشراف','AI_ERROR_FAILED':'لقد\x20فشل\x20التواصل\x20مع\x20خدمة\x20الذكاء\x20الاصطناعي','Other':'آخر'},'getPluralForm':_0x260319=>0x0==_0x260319?0x0:0x1==_0x260319?0x1:0x2==_0x260319?0x2:_0x260319%0x64>=0x3&&_0x260319%0x64<=0xa?0x3:_0x260319%0x64>=0xb?0x4:0x5}};_0x418d7b['ar']||={'dictionary':{},'getPluralForm':null},_0x418d7b['ar']['dictionary']=Object['assign'](_0x418d7b['ar']['dictionary'],_0x496201),_0x418d7b['ar']['getPluralForm']=_0x28394e;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x430a80=>{const {ar:{dictionary:_0x27f38d,getPluralForm:_0x584358}}={'ar':{'dictionary':{'Edit\x20or\x20review':'التحرير\x20أو\x20المراجعة','Improve\x20writing':'قم\x20بتحسين\x20الكتابة','Make\x20shorter':'اجعله\x20أقصر','Make\x20longer':'اجعله\x20أطول','Simplify\x20language':'قم\x20بتبسيط\x20اللغة','Generate\x20from\x20selection':'قم\x20بالإنشاء\x20من\x20التحديد','Summarize':'تلخيص','Continue':'متابعة','Change\x20tone':'تغيير\x20الأسلوب','Professional':'احترافي','Casual':'غير\x20رسمي','Direct':'مباشر','Confident':'لهجة\x20واثقة','Friendly':'ودي','Change\x20style':'تغيير\x20الأسلوب','Business':'تجاري','Legal':'قانوني','Journalism':'الكتابة\x20الصحفية','Poetic':'شِعري','Translate':'ترجِمْ','English':'الإنكليزية','Spanish':'الإسبانية','German':'الألمانية','Portuguese':'البرتغالية','French':'الفرنسية','Simplified\x20Chinese':'الصينية\x20المبسطة','Hindi':'الهندية','Arabic':'العربية','AI\x20Assistant':'مساعد\x20الذكاء\x20الاصطناعي','AI\x20Commands':'أوامر\x20الذكاء\x20الاصطناعي','Ask\x20AI\x20to\x20edit\x20or\x20generate':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بالتحرير\x20أو\x20الإنشاء','Ask\x20AI\x20to\x20improve\x20generated\x20text':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بتحسين\x20النص\x20الذي\x20تم\x20إنشاؤه','Copy':'نسخ','Submit':'إرسال','Insert\x20below':'أدخل\x20أدناه','Try\x20again':'حاول\x20مجددًا','Stop':'إيقاف','AI\x20is\x20writing...':'يقوم\x20الذكاء\x20الاصطناعي\x20بالكتابة...','AI\x20is\x20writing':'يكتب\x20الذكاء\x20الاصطناعي','Generated\x20content:\x20%0':'المحتوى\x20الذي\x20تم\x20إنشاؤه:\x20%0','Error\x20during\x20AI\x20content\x20generation:\x20%0':'حدث\x20خطأ\x20أثناء\x20إنشاء\x20محتوى\x20الذكاء\x20الاصطناعي:\x20%0','History':'سجل\x20المحفوظات','Empty\x20history':'السجل\x20فارغ','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'سيتم\x20إدراج\x20الطلبات\x20التي\x20طلبتها\x20من\x20الذكاء\x20الاصطناعي\x20والتوجيهات\x20الخاصة\x20بك\x20هنا\x20لكي\x20يتم\x20استخدامها\x20لاحقًا.','Prompt\x20history':'سجل\x20التوجيهات','AI_REPLACE_CONTENT':'استبدال','AI_INSERT_CONTENT':'إدراج','AI_ERROR_GET_HEADERS':'فشلت\x20عملية\x20تحضير\x20عناوين\x20الطلبات','AI_ERROR_GET_PARAMETERS':'لقد\x20فشلت\x20عملية\x20إعداد\x20معلمات\x20الطلب','AI_ERROR_UNSUPPORTED_MODEL':'إن\x20نموذج\x20AI\x20المطلوب\x20(\x22%0\x22)\x20غير\x20مدعوم','AI_ERROR_CONTEXT_LENGTH':'المحتوى\x20المحدد\x20طويل\x20جداً','AI_ERROR_MODERATION':'الاستعلام\x20المطلوب\x20لا\x20يجتاز\x20قواعد\x20الإشراف','AI_ERROR_FAILED':'لقد\x20فشل\x20التواصل\x20مع\x20خدمة\x20الذكاء\x20الاصطناعي','Other':'آخر'},'getPluralForm':_0x40e801=>0x0==_0x40e801?0x0:0x1==_0x40e801?0x1:0x2==_0x40e801?0x2:_0x40e801%0x64>=0x3&&_0x40e801%0x64<=0xa?0x3:_0x40e801%0x64>=0xb?0x4:0x5}};_0x430a80['ar']||={'dictionary':{},'getPluralForm':null},_0x430a80['ar']['dictionary']=Object['assign'](_0x430a80['ar']['dictionary'],_0x27f38d),_0x430a80['ar']['getPluralForm']=_0x584358;})(window['CKEDITOR_TRANSLATIONS']||={});