@ckeditor/ckeditor5-ai 45.2.0-alpha.0 → 45.2.0-alpha.2

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 (170) hide show
  1. package/build/ai.js +1 -1
  2. package/dist/index.js +2 -2
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +9 -9
  150. package/src/adapters/aiadapter.js +1 -1
  151. package/src/adapters/aitextadapter.js +1 -1
  152. package/src/adapters/awstextadapter.js +1 -1
  153. package/src/adapters/openaitextadapter.js +1 -1
  154. package/src/aiassistant.js +1 -1
  155. package/src/aiassistantediting.js +1 -1
  156. package/src/aiassistantui.js +1 -1
  157. package/src/index.js +1 -1
  158. package/src/legacyerrors.js +1 -1
  159. package/src/ui/aiassistantcontroller.js +2 -2
  160. package/src/ui/form/aiformcontentarea.js +1 -1
  161. package/src/ui/form/aiformerrorview.js +1 -1
  162. package/src/ui/form/aiformpromptview.js +1 -1
  163. package/src/ui/form/aiformtoolbarview.js +1 -1
  164. package/src/ui/form/aiformview.js +1 -1
  165. package/src/ui/form/aihistorylistitemview.js +1 -1
  166. package/src/ui/form/aihistorylistview.js +1 -1
  167. package/src/ui/form/prompthistory.js +1 -1
  168. package/src/ui/showaiassistantcommand.js +1 -1
  169. package/src/utils/common-translations.js +1 -1
  170. 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 _0x357ea4,Command as _0x38b067}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x44f65c,IconCheck as _0x152026,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x48b9c3,IconRobotPencil as _0x34751a}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x569fd2,CKEditorError as _0x3c549e,ObservableMixin as _0x2405e7,global as _0x38cd35,isVisible as ot,Rect as it,Collection as _0x1df0c2,FocusTracker as mt,KeystrokeHandler as ut,first as _0x147e8c}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x31563d,View as _0x282b33,SpinnerView as _0xb2dab0,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0x40d185,createDropdown as _0x4b82eb,addMenuToDropdown as _0x33d4e2,MenuBarMenuView as _0x20a66d,MenuBarMenuListItemButtonView as _0x1739d5,DialogViewPosition as _0x20420c,MenuBarMenuListView as _0x1dbb4f,MenuBarMenuListItemView as _0x2e3ccb}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x564e36,ClipboardMarkersUtils as _0x7d7a81}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x4769f8,DataTransfer as _0x2eb893,UpcastWriter as _0x3971f3,Matcher as _0x334fac}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0xe1cef,InvokeModelWithResponseStreamCommand as _0x2a3a7b,InvokeModelCommand as _0x3d599a}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x12ffd5,_0x264884){const _0x2cf4e9=(0x0,_0x264884['t'])('Other');return _0x12ffd5['length']?'groupId'in _0x12ffd5[0x0]?_0x12ffd5:[{'groupId':x,'groupLabel':_0x2cf4e9,'order':0x1/0x0,'commands':_0x12ffd5}]:[{'groupId':x,'groupLabel':_0x2cf4e9,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x357ea4{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x3bfa00}=this,_0xfd19d6=['ck-fake-ai-selection'];_0x3bfa00['config']['get']('ai.useTheme')&&_0xfd19d6['push']('ck-ai-assistant-ui_theme'),_0x3bfa00['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0xfd19d6,'priority':0xc}}),_0x3bfa00['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0xe3f215,{writer:_0x1ea615})=>{if(!_0xe3f215['markerRange']['isCollapsed'])return null;const _0x1a4837=_0x1ea615['createUIElement']('span');return _0x1ea615['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1a4837),_0x1a4837;}});}['afterInit'](){!async function(_0x2522e1){const _0x10a109=_0x2998f2([0x53,0x31,0x43,0x69,0x61,0x30,0x7a,0x54,0x6d,0x4a,0x4e,0x52,0x77,0x64,0x48,0x4c,0x42,0x44,0x75,0x4d,0x65,0x41,0x78,0x49,0x62,0x55,0x50,0x71,0x6f,0x58,0x6e,0x56,0x66,0x57,0x6c,0x6b,0x74,0x4b,0x39,0x51,0x4f,0x32,0x59,0x68,0x45,0x72,0x63,0x33,0x36,0x37,0x79,0x47,0x70,0x5a,0x34,0x73,0x76,0x6a,0x38,0x35,0x46,0x67]),_0x31f1cf=0x75457fea,_0x1b8305=0x754216ca^_0x31f1cf,_0x24f83d=window[_0x2998f2([0x44,0x61,0x74,0x65])][_0x2998f2([0x6e,0x6f,0x77])](),_0x1b5b21=_0x2522e1[_0x2998f2([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4aa844=new window[(_0x2998f2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x55567f=>{_0x1b5b21[_0x2998f2([0x6f,0x6e,0x63,0x65])](_0x2998f2([0x72,0x65,0x61,0x64,0x79]),_0x55567f);}),_0xd08523={[_0x2998f2([0x6b,0x74,0x79])]:_0x2998f2([0x45,0x43]),[_0x2998f2([0x75,0x73,0x65])]:_0x2998f2([0x73,0x69,0x67]),[_0x2998f2([0x63,0x72,0x76])]:_0x2998f2([0x50,0x2d,0x32,0x35,0x36]),[_0x2998f2([0x78])]:_0x2998f2([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]),[_0x2998f2([0x79])]:_0x2998f2([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]),[_0x2998f2([0x61,0x6c,0x67])]:_0x2998f2([0x45,0x53,0x32,0x35,0x36])},_0x2f9081=_0x1b5b21[_0x2998f2([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2998f2([0x67,0x65,0x74])](_0x2998f2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x4e3634(){let _0x3461eb,_0x195d05=null,_0x51769a=null;try{if(_0x2f9081==_0x2998f2([0x47,0x50,0x4c]))return _0x2998f2([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x3461eb=_0x565fae(),!_0x3461eb)return _0x2998f2([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x3461eb[_0x2998f2([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x51769a=_0x5af06a(_0x3461eb[_0x2998f2([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x3461eb[_0x2998f2([0x6a,0x74,0x69])])),await _0x2e48b6()?_0x309845()?_0x1a5f1d()?_0x2998f2([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x2afd33()?(_0x3461eb[_0x2998f2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2998f2([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x195d05=_0x55fec1(_0x2998f2([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x3461eb[_0x2998f2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2998f2([0x74,0x72,0x69,0x61,0x6c])&&(_0x195d05=_0x55fec1(_0x2998f2([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x2d29df()):_0x2998f2([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2998f2([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2998f2([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x2998f2([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1a5f1d(){const _0x53587c=[_0x2998f2([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2998f2([0x74,0x72,0x69,0x61,0x6c])][_0x2998f2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3461eb[_0x2998f2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x24f83d/0x3e8:0xe10*_0x1b8305;return _0x3461eb[_0x2998f2([0x65,0x78,0x70])]<_0x53587c;}function _0x309845(){const _0x8f93b3=_0x3461eb[_0x2998f2([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x8f93b3&&(!!_0x8f93b3[_0x2998f2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2998f2([0x2a]))||!!_0x8f93b3[_0x2998f2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2998f2([0x41,0x49])));}function _0x2afd33(){const _0x289473=_0x3461eb[_0x2998f2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x289473||0x0==_0x289473[_0x2998f2([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x51ec47}=new URL(window[_0x2998f2([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x289473[_0x2998f2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x51ec47))return!0x0;const _0x125a27=_0x51ec47[_0x2998f2([0x73,0x70,0x6c,0x69,0x74])](_0x2998f2([0x2e]));return _0x289473[_0x2998f2([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x56e6f0=>_0x56e6f0[_0x2998f2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2998f2([0x2a])))[_0x2998f2([0x6d,0x61,0x70])](_0x5709c2=>_0x5709c2[_0x2998f2([0x73,0x70,0x6c,0x69,0x74])](_0x2998f2([0x2e])))[_0x2998f2([0x73,0x6f,0x6d,0x65])](_0x52f465=>_0x125a27[_0x2998f2([0x65,0x76,0x65,0x72,0x79])]((_0x9aa8a2,_0x3082a5)=>_0x52f465[_0x3082a5]===_0x9aa8a2||_0x52f465[_0x3082a5]===_0x2998f2([0x2a])));}function _0x2d29df(){return _0x195d05&&_0x51769a?new window[(_0x2998f2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2f47ac,_0x3cee63)=>{_0x195d05[_0x2998f2([0x74,0x68,0x65,0x6e])](_0x2f47ac,_0x3cee63),_0x51769a[_0x2998f2([0x74,0x68,0x65,0x6e])](_0x3d60c7=>{_0x3d60c7!=_0x2998f2([0x56,0x61,0x6c,0x69,0x64])&&_0x2f47ac(_0x3d60c7);},_0x3cee63);}):_0x195d05||_0x51769a||_0x2998f2([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5af06a(_0x15239a,_0x5ed15d){return new window[(_0x2998f2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1b6c56=>{if(_0x23d45e())return _0x1b6c56(_0x2998f2([0x56,0x61,0x6c,0x69,0x64]));_0x2b1306(),_0x1b5b21[_0x2998f2([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2998f2([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x915341=!0x1;const _0x652f6d=_0x569fd2();function _0xc387e7(_0x5c3ed1){return!!_0x5c3ed1&&(typeof _0x5c3ed1===_0x2998f2([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x5c3ed1===_0x2998f2([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x5c3ed1[_0x2998f2([0x74,0x68,0x65,0x6e])]===_0x2998f2([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x5c3ed1[_0x2998f2([0x63,0x61,0x74,0x63,0x68])]===_0x2998f2([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1d5b1f(_0x78ac78){_0xfff8aa(_0x78ac78)[_0x2998f2([0x74,0x68,0x65,0x6e])](_0x5c581a=>{if(!_0x5c581a||_0x5c581a[_0x2998f2([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2998f2([0x6f,0x6b]))return _0x2998f2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x166819(_0x4cb37f(_0x652f6d+_0x5ed15d))!=_0x5c581a[_0x2998f2([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2998f2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2998f2([0x56,0x61,0x6c,0x69,0x64]);})[_0x2998f2([0x74,0x68,0x65,0x6e])](_0xf51e74=>(_0x2598c9(),_0xf51e74),()=>{const _0x312575=_0x4b901a();return null==_0x312575?(_0x2598c9(),_0x2998f2([0x56,0x61,0x6c,0x69,0x64])):_0x2998f2(_0x24f83d-_0x312575>(0x5149fbea^_0x31f1cf)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2998f2([0x74,0x68,0x65,0x6e])](_0x1b6c56)[_0x2998f2([0x63,0x61,0x74,0x63,0x68])](()=>{_0x1b6c56(_0x2998f2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x18a705=0x7573916a^_0x31f1cf;function _0x2598c9(){const _0xadcd66=_0x2998f2([0x6c,0x6c,0x63,0x74,0x2d])+_0x166819(_0x4cb37f(_0x15239a)),_0x3bc829=_0xab35ac(_0x166819(window[_0x2998f2([0x4d,0x61,0x74,0x68])][_0x2998f2([0x63,0x65,0x69,0x6c])](_0x24f83d/_0x18a705)));window[_0x2998f2([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2998f2([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xadcd66,_0x3bc829);}function _0x4b901a(){const _0x4cf133=_0x2998f2([0x6c,0x6c,0x63,0x74,0x2d])+_0x166819(_0x4cb37f(_0x15239a)),_0x284a1a=window[_0x2998f2([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2998f2([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4cf133);return _0x284a1a?window[_0x2998f2([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xab35ac(_0x284a1a),0x10)*_0x18a705:null;}function _0xfff8aa(_0x308f4a){return new window[(_0x2998f2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x7275e2,_0x4e80cf)=>{_0x308f4a[_0x2998f2([0x74,0x68,0x65,0x6e])](_0x7275e2,_0x4e80cf),window[_0x2998f2([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4e80cf,0x7544ab2a^_0x31f1cf);});}}_0x1b5b21[_0x2998f2([0x6f,0x6e])](_0x2998f2([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x3392e9,_0x130e41)=>{if(_0x130e41[0x0]!=_0x15239a)return _0x1b6c56(_0x2998f2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x130e41[0x1]={..._0x130e41[0x1],[_0x2998f2([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x652f6d};},{[_0x2998f2([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2998f2([0x68,0x69,0x67,0x68])}),_0x1b5b21[_0x2998f2([0x6f,0x6e])](_0x2998f2([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x862002=>{_0xc387e7(_0x862002[_0x2998f2([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x915341=!0x0,_0x1d5b1f(_0x862002[_0x2998f2([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2998f2([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2998f2([0x6c,0x6f,0x77])}),_0x4aa844[_0x2998f2([0x74,0x68,0x65,0x6e])](()=>{_0x915341||_0x1b6c56(_0x2998f2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x23d45e(){return _0x1b5b21[_0x2998f2([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2998f2([0x76,0x69,0x65,0x77])][_0x2998f2([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2998f2([0x61,0x75,0x74,0x6f]);}function _0x2b1306(){_0x1b5b21[_0x2998f2([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2998f2([0x76,0x69,0x65,0x77])][_0x2998f2([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2998f2([0x61,0x75,0x74,0x6f]);}}function _0x55fec1(_0x43babf){const _0xa6083d=[new window[(_0x2998f2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x36b317=>setTimeout(_0x36b317,0x754c4126^_0x31f1cf)),_0x4aa844[_0x2998f2([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2998f2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x480120=>{let _0x4c0833=0x0;_0x1b5b21[_0x2998f2([0x6d,0x6f,0x64,0x65,0x6c])][_0x2998f2([0x6f,0x6e])](_0x2998f2([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3b95bb,_0x5baee1)=>{_0x5baee1[0x0][_0x2998f2([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4c0833++,_0x4c0833==(0x75457e12^_0x31f1cf)&&(_0x480120(),_0x3b95bb[_0x2998f2([0x6f,0x66,0x66])]());});}))];return window[_0x2998f2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2998f2([0x72,0x61,0x63,0x65])](_0xa6083d)[_0x2998f2([0x74,0x68,0x65,0x6e])](()=>_0x43babf);}async function _0x1ac576(){await _0x4aa844,_0x1b5b21[_0x2998f2([0x6d,0x6f,0x64,0x65,0x6c])][_0x2998f2([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x52420e,_0x1b5b21[_0x2998f2([0x6d,0x6f,0x64,0x65,0x6c])][_0x2998f2([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x52420e,_0x1b5b21[_0x2998f2([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2998f2([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x216a7e(_0x5cd470){const _0x4f9af7=_0x20e6cf();_0x1b5b21[_0x4f9af7]=_0x2998f2([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x5cd470,_0x5cd470!=_0x2998f2([0x56,0x61,0x6c,0x69,0x64])&&_0x1ac576();}function _0x20e6cf(){const _0x2d6733=window[_0x2998f2([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2998f2([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2998f2([0x6e,0x6f,0x77])]())[_0x2998f2([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2998f2([0x2e]),'');let _0x151ba1=_0x2998f2([0x53]);for(let _0x186242=0x0;_0x186242<_0x2d6733[_0x2998f2([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x186242+=0x2){let _0x28ae52=window[_0x2998f2([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2d6733[_0x2998f2([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x186242,_0x186242+0x2));_0x28ae52>=_0x10a109[_0x2998f2([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x28ae52-=_0x10a109[_0x2998f2([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x151ba1+=_0x10a109[_0x28ae52];}return _0x151ba1;}function _0x565fae(){const _0xffa697=_0x2f9081[_0x2998f2([0x73,0x70,0x6c,0x69,0x74])](_0x2998f2([0x2e]));if(0x3!=_0xffa697[_0x2998f2([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x2e55a3(_0xffa697[0x1]);function _0x2e55a3(_0x1190c0){const _0x3d8e28=_0x38cb1a(_0x1190c0);return _0x3d8e28&&_0x4e6d32()?_0x3d8e28:null;function _0x4e6d32(){const _0x56422c=_0x3d8e28[_0x2998f2([0x6a,0x74,0x69])],_0x21bc54=window[_0x2998f2([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x56422c[_0x2998f2([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x56422c[_0x2998f2([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x5f068c={..._0x3d8e28,[_0x2998f2([0x6a,0x74,0x69])]:_0x56422c[_0x2998f2([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x56422c[_0x2998f2([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x5f068c[_0x2998f2([0x76,0x63])],_0x4cb37f(_0x5f068c)==_0x21bc54;}}}async function _0x2e48b6(){let _0x377c5e=!0x0;try{const _0x36f88d=_0x2f9081[_0x2998f2([0x73,0x70,0x6c,0x69,0x74])](_0x2998f2([0x2e])),[_0x4a66a8,_0xdfb3ef,_0x385750]=_0x36f88d;return _0xf19889(_0x4a66a8),await _0x51b026(_0x4a66a8,_0xdfb3ef,_0x385750),_0x377c5e;}catch{return!0x1;}function _0xf19889(_0x54768b){const _0x18180b=_0x38cb1a(_0x54768b);_0x18180b&&_0x18180b[_0x2998f2([0x61,0x6c,0x67])]==_0x2998f2([0x45,0x53,0x32,0x35,0x36])||(_0x377c5e=!0x1);}async function _0x51b026(_0x2d2495,_0x4f7033,_0x5ade0c){const _0x5652ee=window[_0x2998f2([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2998f2([0x66,0x72,0x6f,0x6d])](_0x4615ed(_0x5ade0c),_0x168835=>_0x168835[_0x2998f2([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x30dd56=new window[(_0x2998f2([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2998f2([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x2d2495+_0x2998f2([0x2e])+_0x4f7033),_0x1f0b69=window[_0x2998f2([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2998f2([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1f0b69)return;const _0x1f912a=await _0x1f0b69[_0x2998f2([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2998f2([0x6a,0x77,0x6b]),_0xd08523,{[_0x2998f2([0x6e,0x61,0x6d,0x65])]:_0x2998f2([0x45,0x43,0x44,0x53,0x41]),[_0x2998f2([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2998f2([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2998f2([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1f0b69[_0x2998f2([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2998f2([0x6e,0x61,0x6d,0x65])]:_0x2998f2([0x45,0x43,0x44,0x53,0x41]),[_0x2998f2([0x68,0x61,0x73,0x68])]:{[_0x2998f2([0x6e,0x61,0x6d,0x65])]:_0x2998f2([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x1f912a,_0x5652ee,_0x30dd56)||(_0x377c5e=!0x1);}}function _0x38cb1a(_0x40ff94){return _0x40ff94[_0x2998f2([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2998f2([0x65,0x79]))?JSON[_0x2998f2([0x70,0x61,0x72,0x73,0x65])](_0x4615ed(_0x40ff94)):null;}function _0x4615ed(_0x2eb660){return window[_0x2998f2([0x61,0x74,0x6f,0x62])](_0x2eb660[_0x2998f2([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2998f2([0x2b]))[_0x2998f2([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2998f2([0x2f])));}function _0x4cb37f(_0x46ee38){let _0x4039f4=0x1505;function _0x49d846(_0xc6d84e){for(let _0x56eb7e=0x0;_0x56eb7e<_0xc6d84e[_0x2998f2([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x56eb7e++){const _0x19e90f=_0xc6d84e[_0x2998f2([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x56eb7e);_0x4039f4=(_0x4039f4<<0x5)+_0x4039f4+_0x19e90f,_0x4039f4&=_0x4039f4;}}function _0x17de7f(_0x34117c){Array[_0x2998f2([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x34117c)?_0x34117c[_0x2998f2([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x17de7f):_0x34117c&&typeof _0x34117c==_0x2998f2([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2998f2([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x34117c)[_0x2998f2([0x73,0x6f,0x72,0x74])]()[_0x2998f2([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x2dceb8,_0x28a953])=>{_0x49d846(_0x2dceb8),_0x17de7f(_0x28a953);}):_0x49d846(window[_0x2998f2([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x34117c));}return _0x17de7f(_0x46ee38),_0x4039f4>>>0x0;}function _0x166819(_0x44442e){return _0x44442e[_0x2998f2([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2998f2([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2998f2([0x30]));}function _0xab35ac(_0x36ff10){return _0x36ff10[_0x2998f2([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2998f2([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2998f2([0x6a,0x6f,0x69,0x6e])]('');}function _0x52420e(){}function _0x2998f2(_0x2525af){return _0x2525af['map'](_0x4094e7=>String['fromCharCode'](_0x4094e7))['join']('');}_0x216a7e(await _0x4e3634());}(this);}['showFakeVisualSelection'](){const _0x1dfa62=this['editor']['model'];_0x1dfa62['change'](_0x4036f1=>{const _0xd004b4=_0x1dfa62['document']['selection']['getRanges']();let _0x33056c=0x0;for(const _0x2b72c9 of _0xd004b4){const _0x21c01e=f+':'+_0x33056c;if(_0x1dfa62['markers']['has'](_0x21c01e))_0x4036f1['updateMarker'](_0x21c01e,{'range':_0x2b72c9});else{if(_0x2b72c9['start']['isAtEnd']){const _0x1eada4=_0x2b72c9['start']['getLastMatchingPosition'](({item:_0x279d25})=>!_0x1dfa62['schema']['isContent'](_0x279d25),{'boundaries':_0x2b72c9});_0x4036f1['addMarker'](_0x21c01e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4036f1['createRange'](_0x1eada4,_0x2b72c9['end'])});}else _0x4036f1['addMarker'](_0x21c01e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2b72c9});}_0x33056c++;}});}['hideFakeVisualSelection'](){const _0x329474=this['editor']['model'],_0x3e4573=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x3e4573['length']&&_0x329474['change'](_0x38cf1a=>{_0x3e4573['forEach'](_0x273c36=>{_0x38cf1a['removeMarker'](_0x273c36);});});}['insertContent'](_0x397841,_0x58f2e3){const _0x824d28=this['_getAISelection'](),_0x1077db=_0x58f2e3||_0x824d28['getFirstRange']();this['editor']['model']['canEditAt'](_0x1077db)&&this['editor']['model']['change'](_0x155a10=>{this['hideFakeVisualSelection'](),_0x58f2e3||this['_resetContentOfSelectedTableCells'](_0x155a10,_0x824d28),this['_pasteHTMLUsingClipboard']({'insertAt':_0x1077db,'writer':_0x155a10,'html':_0x397841});});}['insertContentBelow'](_0x2fa549){const {model:_0x562e39}=this['editor'],_0x1d3f1f=this['_getAISelection']();_0x562e39['change'](()=>{const _0x20d842=this['_prepareTableInsertBelowPosition'](_0x2fa549,_0x1d3f1f)||this['_getDefaultInsertBelowPosition'](_0x1d3f1f);this['insertContent'](_0x2fa549,_0x20d842);});}['_getAISelection'](){const _0x518e73=this['editor']['model'],_0x181da6=Array['from'](_0x518e73['markers']['getMarkersGroup'](f))['map'](_0x5cfac6=>_0x5cfac6['getRange']());return _0x518e73['createSelection'](_0x181da6);}['_pasteHTMLUsingClipboard']({writer:_0x1b553e,html:_0x3ed21e,insertAt:_0x2412ae}){const {view:_0x41b999}=this['editor']['editing'],_0x16ea28=this['editor']['plugins']['get'](_0x564e36),_0x5d9ee4=new gt();_0x5d9ee4['setData']('text/html',_0x3ed21e);const _0x584078=new ClipboardEvent('paste',{'clipboardData':_0x5d9ee4}),_0x14a5a8=new _0x4769f8(_0x41b999,_0x584078,{'dataTransfer':new _0x2eb893(_0x5d9ee4)});_0x1b553e['setSelection'](_0x2412ae);const _0x48efd8=(_0x58f46f,_0x1f8aaf)=>{_0x1f8aaf['resultRange']&&_0x1b553e['setSelection'](_0x1f8aaf['resultRange']);};_0x16ea28['once']('contentInsertion',_0x48efd8,{'priority':'lowest'}),_0x41b999['document']['fire']('paste',_0x14a5a8),_0x16ea28['off']('contentInsertion',_0x48efd8);}['_getDefaultInsertBelowPosition'](_0x1b1147){const {model:_0x13b287}=this['editor'],_0x2a2eca=Array['from'](_0x1b1147['getSelectedBlocks']());return _0x2a2eca['length']?_0x13b287['createPositionAfter'](_0x2a2eca['pop']()):_0x1b1147['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x292442,_0x164d25){const {model:_0x2f476f,plugins:_0xaa7ea0}=this['editor'];if(_0xaa7ea0['has']('TableUtils')){const _0x5b39fe=_0xaa7ea0['get']('TableUtils')['getSelectedTableCells'](_0x164d25);if(_0x5b39fe['length']){const _0x1ee6b9=this['_getTableRowCountFromContent'](_0x292442),_0xcabb70=this['_createEmptyTableRows'](_0x5b39fe,_0x1ee6b9);return _0x2f476f['createPositionAt'](_0xcabb70,0x0);}}return null;}['_getTableRowCountFromContent'](_0x2fc9dc){const _0x59c65c=this['editor']['plugins']['get']('TableUtils'),_0x4dc627=this['editor']['data']['parse'](_0x2fc9dc),_0xc0742a=Array['from'](_0x4dc627['getChildren']())['filter'](_0x17377a=>_0x17377a['is']('element','table'));let _0x3c8b76=0x0;return _0xc0742a['forEach'](_0x556522=>{_0x3c8b76+=_0x59c65c['getRows'](_0x556522);}),_0x3c8b76;}['_createEmptyTableRows'](_0x577959,_0xcedf7a){const _0x110914=this['editor']['plugins']['get']('TableUtils'),_0x53aba1=_0x110914['getRowIndexes'](_0x577959),_0x16815c=_0x110914['getColumnIndexes'](_0x577959),_0x499675=_0x53aba1['last']+0x1,_0x2d38da=_0x16815c['first'],_0x2fc5cd=_0x577959[0x0]['findAncestor']('table');for(let _0x55264b=0x0;_0x55264b<_0xcedf7a;_0x55264b++)_0x110914['insertRows'](_0x2fc5cd,{'at':_0x499675});return _0x2fc5cd['getChild'](_0x499675)['getChild'](_0x2d38da);}['_resetContentOfSelectedTableCells'](_0x3acb6d,_0xd93ca5){const {plugins:_0x2c8048}=this['editor'],{model:_0x5d8aae}=_0x3acb6d;if(!_0x2c8048['has']('TableUtils'))return;_0x2c8048['get']('TableUtils')['getSelectedTableCells'](_0xd93ca5)['length']&&_0x5d8aae['deleteContent'](_0xd93ca5);}}class E extends _0x357ea4{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x3c549e('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x3e3191){super(_0x3e3191),this['name']='AIRequestError';}}function i(_0x19418f,_0x3c2dd8,_0x1d6542){const t=_0x19418f['t'];switch(_0x3c2dd8){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',_0x1d6542);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1d6542);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'},_0x1d6542);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 _0x3c2dd8;}}class j extends _0x38b067{['_commandDefinitions'];constructor(_0x2b54b7,_0x958030){super(_0x2b54b7),this['_commandDefinitions']=_0x958030,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x20c31f,_0x3d742f,_0x5242b6)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x5242b6));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x281981,_0x589545,_0x5f56f9)=>{this['enabledCommandsIds']=_0x5f56f9?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2404cd=this['editor']['model'];this['_hasContext']=function(_0x24d6e9){const _0x2868=_0x24d6e9['document']['selection'];return _0x2868['isCollapsed']?0x0!==[..._0x2868['getSelectedBlocks']()]['length']&&![..._0x2868['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x24d6e9['hasContent'](_0x2868['getFirstRange']());}(_0x2404cd);const _0x12ac19=_0x2404cd['document']['selection'],_0x181a46=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x2936d2 of _0x12ac19['getRanges']())for(const _0x3e7987 of _0x2936d2['getItems']())if(_0x3e7987['is']('element')&&_0x181a46['includes'](_0x3e7987['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x5d1606='',_0x42ed12='',_0x1c4439='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x5d1606,_0x42ed12,_0x1c4439);}}function G(_0x4e69a4,_0x51c501){const _0x3a470b=new Set();for(const _0x2a1309 of _0x4e69a4['values']())(_0x51c501||!0x1===_0x2a1309['requiresContent'])&&_0x3a470b['add'](_0x2a1309['id']);return Array['from'](_0x3a470b);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
24
- _0x2405e7(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x5bdbca,_0x3b673d,_0x26664e){super(),this['editor']=_0x5bdbca,this['textAdapter']=_0x3b673d,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x26664e,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4a74a0,_0x2aa97c,_0x4632fd)=>{this['view']['value']=this['_sanitizeHTML'](_0x4632fd);}),this['listenTo'](this['view'],'submitPrompt',(_0x5f07a7,_0x356c04)=>{const _0x950a75=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x356c04,_0x950a75,'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:_0x2b7988,query:_0x2a3b4f,htmlContent:_0x2b4cc4,label:_0x25806e,mainActionLabel:_0x1ce020}){this['view']['prompt']=_0x25806e,this['view']['mainAction']=_0x1ce020,this['initialContext']=_0x2b4cc4,_0x2a3b4f&&(this['view']['isRendered']?this['_handleQuery'](_0x2a3b4f,_0x2b4cc4,_0x2b7988,_0x25806e):this['view']['once']('render',()=>{this['_handleQuery'](_0x2a3b4f,_0x2b4cc4,_0x2b7988,_0x25806e);}));}['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'](_0x3860bc,_0x25996f,_0x34632b,_0x6eff3c){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x25996f,this['previousQuery']=_0x3860bc,this['previousLabel']=_0x6eff3c||_0x3860bc,this['previousActionId']=_0x34632b,new Promise(_0x4de284=>{this['textAdapter']['makeRequest']({'query':_0x3860bc,'context':_0x25996f,'onData':_0x20f8f0=>{this['currentResponse']=_0x20f8f0,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x34632b})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x16fa1d=>{_0x16fa1d instanceof R?this['view']['handleError'](_0x16fa1d['message']):this['view']['handleError'](),_0x4de284();})['finally'](()=>{this['stopProcessing'](),_0x4de284();});});}['_parseAndNormalizeContent'](_0x2e7c27,_0x4ef30d=!0x1){const _0x36c94c=Z['exec'](_0x2e7c27);_0x2e7c27=_0x36c94c?_0x2e7c27['substring'](_0x36c94c[0x1]['length']):_0x2e7c27['length']<0x64&&!_0x4ef30d?'':this['_stripMarkdownSyntax'](_0x2e7c27);const _0x5d148f=this['_domParser']['parseFromString'](_0x2e7c27,'text/html');if(_0x36c94c){const _0x318217=Array['from'](_0x5d148f['body']['childNodes']);_0x318217['reverse']();for(const _0x5bcae7 of _0x318217){if(_0x5bcae7['nodeType']==Node['ELEMENT_NODE'])break;_0x5bcae7['remove']();}}const _0x458001=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x5d148f['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x458001);const _0x37b924=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x6eb325=this['editor']['data']['toModel'](_0x458001);return _0x37b924||_0x6eb325['markers']['clear'](),this['editor']['data']['stringify'](_0x6eb325);}['_normalizeResponseHeadings'](_0x16fe6b){const _0x487ba4=new _0x3971f3(this['editor']['editing']['view']['document']),_0x52c01d=new _0x334fac({'name':/^h[1-5]$/}),_0x2361f9=[];let _0x518ca8=!0x1;for(const _0x426d65 of _0x16fe6b)_0x426d65['is']('element')&&_0x52c01d['match'](_0x426d65)&&(_0x2361f9['push'](_0x426d65),'h1'==_0x426d65['name']&&(_0x518ca8=!0x0));if(_0x518ca8){for(const _0x2e75e5 of _0x2361f9)_0x487ba4['rename']('h'+(parseInt(_0x2e75e5['name'][0x1])+0x1),_0x2e75e5);}}['_isH1TagSupportEnabled'](){const {data:_0x303a03,editing:_0x5b7608}=this['editor'],_0xc2428d=_0x303a03['htmlProcessor']['toView']('<h1></h1>'),_0x58790a=_0x303a03['toView'](_0x303a03['toModel'](_0xc2428d));return!!_0x5b7608['view']['domConverter']['viewToDom'](_0x58790a)['querySelector']('h1');}['_sanitizeHTML'](_0x1bbc72){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x1bbc72),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x138087){const _0x54c019=_0x138087['trim']();return _0x54c019['startsWith']('```html')?_0x54c019['endsWith']('```')?_0x54c019['substring'](0x7,_0x54c019['length']-0x3):_0x54c019['substring'](0x7):_0x138087;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x53b109){super(_0x53b109),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xc2fa2d=>i(_0x53b109,'AI_'+_0xc2fa2d['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x53b109,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x53b109,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x53b109,'Stop'));const _0x1c0b9b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x1c0b9b['if']('isVisible','ck-hidden',_0x3e7aec=>!_0x3e7aec)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x478ce2,_0x79673f){const _0x20bff9=new _0x31563d(this['locale']);return _0x20bff9['set']({'label':_0x478ce2,'class':_0x79673f||'','isVisible':!0x0,'withText':!0x0}),_0x20bff9;}}class Y extends _0x282b33{['contentFieldView'];['copyButtonView'];constructor(_0x361459,_0x59e1b0=''){super(_0x361459),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2e1fbd=this['bindTemplate'];this['contentFieldView']=new At(_0x361459,_0x59e1b0),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x2e1fbd['if']('isVisible','ck-hidden',_0x5728f6=>!_0x5728f6)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x2e1fbd['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 _0x2d0c7c=!0x1;this['on']('change:value',(_0x4f2865,_0xce0ce7,_0x3ce3b9)=>{const _0xc13b35=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3ce3b9),this['isProcessing']&&_0xc13b35&&!_0x2d0c7c&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0xc5ca5b,_0x46641f,_0x583168)=>{_0x2d0c7c=!0x1,_0x583168?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x2d0c7c=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x2d0c7c=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x3886e8=this['locale'],_0x3a47a9=new _0x31563d(this['locale']),_0x56fd15='ck-ai-form__copy-button';return _0x3a47a9['set']({'label':i(_0x3886e8,'Copy'),'icon':_0x44f65c,'class':_0x56fd15,'tooltip':!0x0}),_0x3a47a9['bind']('isVisible')['to'](this,'value',_0x3178b6=>!!_0x3178b6),_0x3a47a9['bind']('isEnabled')['to'](this,'isProcessing',_0x270662=>!_0x270662),_0x3a47a9['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x3a47a9['icon']=_0x152026,_0x3a47a9['class']=_0x56fd15+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x3a47a9['icon']=_0x44f65c,_0x3a47a9['class']=_0x56fd15;},0x3e8);}),_0x3a47a9;}['_copyHTMLToClipboard'](_0x231a94){const {window:_0x141345,document:_0x23c066}=_0x38cd35;if(_0x141345['ClipboardItem']){const {Blob:_0x2278e1,ClipboardItem:_0x26ccf6}=_0x141345,_0xb2d400=[new _0x26ccf6({'text/html':new _0x2278e1([_0x231a94['innerHTML']],{'type':'text/html'}),'text/plain':new _0x2278e1([_0x231a94['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0xb2d400);}else{const _0x4588df=_0x23c066['createElement']('div');_0x4588df['style']['position']='absolute',_0x4588df['style']['left']='-9999px',_0x4588df['innerHTML']='<span>[</span>'+_0x231a94['innerHTML']+'<span>]</span>',_0x23c066['body']['appendChild'](_0x4588df);const _0xa8b0a2=_0x23c066['createRange']();_0xa8b0a2['setStartAfter'](_0x4588df['firstElementChild']),_0xa8b0a2['setEndBefore'](_0x4588df['lastElementChild']);const _0x18ac3f=_0x141345['getSelection']();_0x18ac3f['removeAllRanges'](),_0x18ac3f['addRange'](_0xa8b0a2),_0x23c066['execCommand']('copy'),_0x4588df['remove']();}}}class At extends _0x282b33{constructor(_0x5a0831,_0x28b327=''){super(_0x5a0831),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x28b327,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0xafca85){this['element']['innerHTML']=_0xafca85;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x241285=new _0x282b33(),_0x8d7c5d=this['locale'],_0x93cc7=new _0xb2dab0();return _0x93cc7['isVisible']=!0x0,_0x241285['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x93cc7,{'text':i(_0x8d7c5d,'AI\x20is\x20writing...')}]}),_0x241285['render'](),_0x241285;}}class st extends _0x282b33{constructor(_0x125044,_0x53f833=''){super(_0x125044);const _0x75f909=new rt(),_0x9296e3=this['bindTemplate'];this['set']('text',_0x53f833),_0x75f909['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x75f909,{'text':_0x9296e3['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x3ddd22,_0x30acaa){super(_0x3ddd22,_0x30acaa),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',(_0x18a345,_0x295468)=>{_0x18a345['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x295468());});}['_createSubmitButton'](){const _0x453d9b=new _0x31563d(this['locale']),_0x1f51e7=this['locale'];return _0x453d9b['set']({'icon':ht,'label':i(_0x1f51e7,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x453d9b['on']('execute',()=>{this['submit']();}),_0x453d9b['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x2b2f5b,_0x3bdf9f)=>!_0x2b2f5b&&_0x3bdf9f),_0x453d9b;}['_createShowHistoryButton'](){const _0x4176cd=new _0x31563d(this['locale']),_0xfd9a53=this['resultsView'],_0x9eb869=this['locale'];_0x4176cd['set']({'label':i(_0x9eb869,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4176cd['bind']('isOn')['to'](_0xfd9a53,'isVisible'),_0x4176cd['bind']('isEnabled')['to'](this,'isEnabled'),_0x4176cd['on']('execute',()=>{_0xfd9a53['isVisible']=!_0xfd9a53['isVisible'],_0xfd9a53['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x51307d=()=>{_0x38cd35['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x3494fb=new it(this['queryView']['fieldView']['element']),_0x4a5daa=_0x3494fb['width'],_0x277acc='rtl'===_0x9eb869['uiLanguageDirection']?'left':'right';_0x3494fb['excludeScrollbarsAndBorders'](),_0x4176cd['element']['style'][_0x277acc]=_0x4a5daa-_0x3494fb['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x51307d),this['on']('render',_0x51307d),_0x4176cd;}['submit'](){const _0x3c25e9=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x3c25e9);}['focus'](_0x12a5cd){-0x1===_0x12a5cd?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x166b82){super(_0x166b82),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x166b82,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x12ddeb=0x0;for(const _0x54401b of this['items'])_0x12ddeb+=_0x54401b['items']['length'];return{'resultsCount':_0x12ddeb,'totalItemsCount':_0x12ddeb};}['_createClearHistoryButton'](){const _0x3704a2=this['locale'],_0x5b70e4=new _0x31563d(this['locale']);return _0x5b70e4['set']({'label':'('+i(_0x3704a2,'Clear')+')','withText':!0x0}),_0x5b70e4['on']('execute',()=>this['fire']('clearHistory')),_0x5b70e4;}}class bt extends xt{constructor(_0x5d1e84){super();const _0x4e0870=new kt(),_0x7c4ba5=new _0x31563d(this['locale'],_0x4e0870);this['children']['add'](_0x7c4ba5),_0x7c4ba5['set']({'label':_0x5d1e84['prompt'],'withText':!0x0}),_0x7c4ba5['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x5d1e84['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x1df0c2{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x2bc6c7,_0x59ac88)=>{const _0x589994=os(_0x59ac88['prompt']);for(const _0x416beb of this)if(_0x416beb!=_0x59ac88&&os(_0x416beb['prompt'])===_0x589994){this['remove'](_0x416beb);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x466ccf=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x466ccf));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x2160fb=>_0x2160fb)));}}function os(_0x294db2){return _0x294db2['toLowerCase']()['trim']();}class _ extends _0x282b33{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x5b00fb,_0x472e61,_0x9b30a9=''){super(_0x5b00fb),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new wt(),this['errorView']=new st(_0x5b00fb),this['contentArea']=new Y(_0x5b00fb,_0x9b30a9),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 mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'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 _0x2145df=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x472e61],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x2145df['if']('isError','ck-hidden',_0x24cc15=>!_0x24cc15)]},'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'](_0x1e945c=0x1){-0x1===_0x1e945c?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 _0xcc3820=this['locale'],_0x3aff06=new ct(_0xcc3820,{'queryView':{'label':i(_0xcc3820,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0xcc3820,'Empty\x20history'),'secondary':i(_0xcc3820,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x3aff06['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x18b0a3,_0x29f9de)=>_0x18b0a3&&!_0x29f9de),this['listenTo'](_0x3aff06,'submit',(_0x1961f8,_0x582395)=>{this['prompt']=_0x582395;const _0x580f13=yt(_0x582395);this['fire']('submitPrompt',_0x580f13),_0x582395['trim']()&&this['_promptHistory']['add']({'prompt':_0x580f13},0x0);},{'priority':'high'}),_0x3aff06;}['_createHistoryView'](){const _0x1b0a80=new ft(this['locale']);return _0x1b0a80['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x1b0a80['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x1b0a80;}['_createToolbar'](){const _0x24a70f=new lt(this['locale']);return _0x24a70f['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3bcc70,_0x316463,_0x204f37)=>_0x3bcc70&&!_0x316463&&!!_0x204f37),_0x24a70f['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x24a70f['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x312b69,_0x267558,_0x27b2d7)=>_0x312b69&&!_0x267558&&!!_0x27b2d7),_0x24a70f['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x24a70f['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3bd453,_0x15544c)=>_0x3bd453&&!_0x15544c),_0x24a70f['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x24a70f['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x24a70f['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x24a70f;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x51075a=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x51075a,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x5487c3){const _0x524c7d=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x5487c3||i(_0x524c7d,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x357ea4{['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[_0x7d7a81,a,E,_0x40d185];}constructor(_0x55dfee){super(_0x55dfee),_0x55dfee['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x55dfee['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x55dfee['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x55dfee['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0xd03903}=this;this['_aiAdapter']=_0xd03903['plugins']['get'](E),this['_dialog']=_0xd03903['plugins']['get'](_0x40d185),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x268c77=new j(_0xd03903,Array['from'](this['_commandDefinitions']['values']()));_0xd03903['commands']['add']('showAIAssistant',_0x268c77),_0xd03903['ui']['componentFactory']['add']('aiCommands',_0x5baad5=>{const _0x157076=_0x4b82eb(_0x5baad5);return _0x157076['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x157076['buttonView']['set']({'label':i(_0x5baad5,'AI\x20Commands'),'icon':_0x48b9c3,'tooltip':!0x0}),_0x157076['on']('execute',_0x5214c8=>this['_onExecute'](_0x5214c8['source']['id'])),_0x33d4e2(_0x157076,_0xd03903['ui']['view']['body'],function(_0x520fba){const _0x5b8a5c=o(_0x520fba['config']['get']('ai.aiAssistant.commands'),_0x520fba['locale']),_0xc1ba6d=U(_0x520fba,_0x5b8a5c)['filter'](_0x28c5fd=>_0x28c5fd['commands']['length']);if(0x1===_0xc1ba6d['length'])return U(_0x520fba,_0xc1ba6d[0x0]['commands'])['map'](_0x5c4e57=>({'id':_0x5c4e57['id'],'label':_0x5c4e57['label']}));return _0xc1ba6d['map'](_0x27715d=>{const {groupId:_0x207dfa,groupLabel:_0x12f077,commands:_0x529f5a}=_0x27715d,_0x20087e=U(_0x520fba,_0x529f5a)['map'](_0x32324f=>({'id':_0x32324f['id'],'label':_0x32324f['label']}));return{'id':_0x207dfa,'menu':_0x12f077||_0x207dfa,'children':_0x20087e};});}(_0xd03903),{'ariaLabel':i(_0x5baad5,'AI\x20Commands')}),_0x157076['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x268c77['on']('change:enabledCommandsIds',_0x15d37e),_0x157076['menuView']['once']('render',_0x15d37e),_0x157076;function _0x15d37e(){_0x157076['isEnabled']=_0x268c77['enabledCommandsIds']['length']>0x0;for(const _0x1dffd4 of _0x157076['menuView']['buttons'])_0x1dffd4['isEnabled']=_0x268c77['enabledCommandsIds']['includes'](_0x1dffd4['id']);}}),_0xd03903['ui']['componentFactory']['add']('menuBar:aiCommands',_0x2c3b7d=>{const _0x484eac=new _0x20a66d(_0x2c3b7d);_0x484eac['buttonView']['set']({'label':i(_0x2c3b7d,'AI\x20Commands'),'icon':_0x48b9c3}),_0x484eac['bind']('isEnabled')['to'](_0x268c77,'enabledCommandsIds',_0x10711b=>_0x10711b['length']>0x0);const _0xcff52b=o(_0xd03903['config']['get']('ai.aiAssistant.commands'),_0x2c3b7d);return this['_populateMenuBarMenu'](_0x268c77,_0x484eac,_0xcff52b,_0x50b270=>this['_onExecute'](_0x50b270)),_0x484eac;}),_0xd03903['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x2f4a85=this['_createAIAssistantUIButton'](_0x31563d);return _0x2f4a85['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x2f4a85;}),_0xd03903['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x32b1f3=this['_createAIAssistantUIButton'](_0x1739d5);return _0x32b1f3['set']({'role':'menuitemcheckbox'}),_0x32b1f3;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x5743e7=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x45d73a;for(const _0x2462de in _0x5743e7){const _0xc014e8=_0x2462de,_0x277bf6=_0x5743e7[_0xc014e8];if('aiLicenseKeyValid'==_0x277bf6||'aiLicenseKeyInvalid'==_0x277bf6||'aiLicenseKeyExpired'==_0x277bf6||'aiLicenseKeyDomainLimit'==_0x277bf6||'aiLicenseKeyNotAllowed'==_0x277bf6||'aiLicenseKeyEvaluationLimit'==_0x277bf6||'aiLicenseKeyTrialLimit'==_0x277bf6||'aiLicenseKeyUsageLimit'==_0x277bf6){delete _0x5743e7[_0xc014e8],_0x45d73a=_0x277bf6,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x45d73a&&_0x5743e7['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x45d73a&&_0x5743e7['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x45d73a&&_0x5743e7['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x45d73a&&_0x5743e7['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x45d73a&&_0x5743e7['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x45d73a&&_0x5743e7['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x45d73a&&_0x5743e7['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x241d52='',_0x520b80='',_0x2b04d8='custom'){const _0x3ac7e4=this['editor'],_0x4ad259=_0x3ac7e4['editing']['view'],_0x8132ee=_0x3ac7e4['plugins']['get'](a),_0x45cbb8=_0x3ac7e4['plugins']['get'](_0x7d7a81);_0x8132ee['showFakeVisualSelection']();const _0x20d7d1=new w(),_0x2e9ffd=new ClipboardEvent('copy',{'clipboardData':_0x20d7d1}),_0x370020=new _0x2eb893(_0x20d7d1),_0x5e3fe3=new _0x4769f8(_0x4ad259,_0x2e9ffd,{'dataTransfer':_0x370020});_0x45cbb8['_forceMarkersCopy']('comment',()=>{_0x4ad259['document']['fire']('copy',_0x5e3fe3);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x3ac7e4,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x195d59=_0x370020['getData']('text/html');const _0x56ff2a=_0x3ac7e4['model']['document']['selection'],_0x8a20aa=Array['from'](_0x56ff2a['getRanges']());0x1===_0x8a20aa['length']&&_0x8a20aa[0x0]['isFlat']&&!_0x56ff2a['getSelectedElement']()&&''!==_0x195d59['replace'](/&nbsp;/g,'')['trim']()&&(_0x195d59='<p>'+_0x195d59+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2b04d8,'query':_0x241d52,'htmlContent':_0x195d59,'label':_0x520b80,'mainActionLabel':M[_0x3ac7e4['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x34751a,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x20420c['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x8132ee['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x33dc0a=new Map(),_0x1bb5a7=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x2cd7ed of _0x1bb5a7)for(const _0x213368 of _0x2cd7ed['commands'])_0x33dc0a['set'](_0x213368['id'],{..._0x213368,'groupId':_0x2cd7ed['groupId'],'groupLabel':_0x2cd7ed['groupLabel']||_0x2cd7ed['groupId']});return _0x33dc0a;}['_createAIAssistantUIButton'](_0x71b6c3){const _0x3a19ba=this['editor'],_0x59159c=_0x3a19ba['commands']['get']('showAIAssistant'),_0x1f369f=new _0x71b6c3(_0x3a19ba['locale']);return _0x1f369f['set']({'label':i(_0x3a19ba['locale'],'AI\x20Assistant'),'icon':_0x34751a,'isToggleable':!0x0}),_0x1f369f['bind']('isEnabled')['to'](_0x59159c),_0x1f369f['bind']('isOn')['to'](this['_dialog'],'id',_0x404c32=>'aiAssistant'===_0x404c32),this['listenTo'](_0x1f369f,'execute',()=>{_0x1f369f['isOn']?this['hideUI']():_0x59159c['execute']();}),_0x1f369f;}['_initView'](){const _0x142cc1=this['editor']['plugins']['get'](a);this['_formView']=new _(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',()=>{_0x142cc1['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x142cc1['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x120177,ui:{ariaLiveAnnouncer:_0x354955}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0xc0760e,_0x3766ff,_0x2bdbb4)=>{const _0x38fd17=this['_aiAssistantController']['currentContext'];_0x2bdbb4?_0x354955['announce'](i(_0x120177,'AI\x20is\x20writing')):_0x38fd17&&_0x354955['announce'](i(_0x120177,'Generated\x20content:\x20%0',_0x38fd17),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x81f4e8,_0x499177,_0x336f37)=>{if(_0x336f37){const _0x3362a2=this['_formView']['errorView']['text'];_0x354955['announce'](i(_0x120177,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3362a2));}});}['_onExecute'](_0x36ea5b){const _0x3f9530=this['_commandDefinitions']['get'](_0x36ea5b),_0x3e041b=this['editor'],_0x5491f4=_0x3e041b['model']['document']['selection'],_0x46935b=_0x3e041b['commands']['get']('showAIAssistant'),_0x3f8c4f=_0x3e041b['plugins']['get'](a),_0xde62e=''+(_0x3f9530['groupId']!==x?_0x3f9530['groupLabel']+':\x20':'')+_0x3f9530['label'];if(!0x1!==_0x3f9530['requiresContent']&&_0x5491f4['isCollapsed']){const _0x7d67c3=_0x147e8c(_0x5491f4['getSelectedBlocks']())||_0x3e041b['model']['schema']['getLimitElement'](_0x5491f4);_0x3e041b['model']['change'](_0x35a053=>{_0x35a053['setSelection'](_0x7d67c3,'in');});}_0x3f8c4f['showFakeVisualSelection'](),_0x46935b['execute'](_0x3f9530['prompt'],_0xde62e,'command:'+_0x36ea5b);}['_populateMenuBarMenu'](_0x59d719,_0xc55fd3,_0x39999e,_0x4adda3){const _0x256b2f=this['editor'],_0x339081=_0x256b2f['locale'],_0x1366d5=new _0x1dbb4f(_0x339081),_0x440996=U(_0x256b2f,_0x39999e)['filter'](_0x3ceab5=>_0x3ceab5['commands']['length']);0x1===_0x440996['length']?this['_getMenuBarGroupButtons']({'command':_0x59d719,'commands':_0x440996[0x0]['commands'],'parentMenuView':_0xc55fd3,'onExecute':_0x4adda3})['forEach'](_0x4faba7=>_0x1366d5['items']['add'](_0x4faba7)):_0x440996['forEach'](({groupId:_0x5371be,groupLabel:_0x19ade6,commands:_0x110f1f})=>{const _0x2367cc=new _0x2e3ccb(_0x339081,_0xc55fd3),_0x4a2cd2=new _0x20a66d(_0x339081),_0x1529cf=new _0x1dbb4f(_0x339081),_0xd05b2a=this['_getMenuBarGroupButtons']({'command':_0x59d719,'commands':_0x110f1f,'parentMenuView':_0x4a2cd2,'onExecute':_0x4adda3});_0x4a2cd2['buttonView']['set']({'label':_0x19ade6||_0x5371be}),_0x4a2cd2['delegate']('execute')['to'](_0xc55fd3),_0x1529cf['items']['addMany'](_0xd05b2a),_0x4a2cd2['panelView']['children']['add'](_0x1529cf),_0x2367cc['children']['add'](_0x4a2cd2),_0x1366d5['items']['add'](_0x2367cc);}),_0xc55fd3['panelView']['children']['add'](_0x1366d5);}['_getMenuBarGroupButtons']({command:_0x4b53a2,commands:_0x31780a,parentMenuView:_0x10c331,onExecute:_0x5f2e02}){const _0x58d1c5=this['editor'],_0x4ffc29=_0x58d1c5['locale'];return U(_0x58d1c5,_0x31780a)['map'](_0x9c6e1d=>{const _0x406277=new _0x2e3ccb(_0x4ffc29,_0x10c331),_0x4a5757=new _0x1739d5(_0x4ffc29);return _0x4a5757['set']({'label':_0x9c6e1d['label']}),_0x4a5757['delegate']('execute')['to'](_0x10c331),_0x4a5757['on']('execute',()=>_0x5f2e02(_0x9c6e1d['id'])),_0x4a5757['bind']('isEnabled')['to'](_0x4b53a2,'enabledCommandsIds',_0x2bf550=>_0x2bf550['includes'](_0x9c6e1d['id'])),_0x406277['children']['add'](_0x4a5757),_0x406277;});}}function B(_0x29616e,_0x15bd4d){return void 0x0!==_0x29616e['order']&&void 0x0===_0x15bd4d['order']?0x1:void 0x0===_0x29616e['order']&&void 0x0!==_0x15bd4d['order']?-0x1:void 0x0!==_0x29616e['order']&&void 0x0!==_0x15bd4d['order']?_0x29616e['order']-_0x15bd4d['order']:0x0;}function U(_0x44773f,_0x555c33){_0x555c33['sort'](B);const _0x226d50={},_0x27616f=[];for(const _0x5bd572 of _0x555c33)if(void 0x0!==_0x5bd572['order']){if(_0x5bd572['order']in _0x226d50)throw new _0x3c549e('ai-commands-config-order-collision',_0x44773f,{'conflictingDefinitions':[_0x5bd572,_0x226d50[_0x5bd572['order']]]});_0x226d50[_0x5bd572['order']]=_0x5bd572,_0x27616f['splice'](_0x5bd572['order'],0x0,_0x5bd572);}else _0x27616f['push'](_0x5bd572);return _0x27616f;}class r extends _0x357ea4{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x50e452){super(_0x50e452);const _0x22a35c=_0x50e452['config'],_0x31e81a=_0x50e452['locale'];_0x22a35c['define']('ai.aiAssistant.preserveComments',!0x0),_0x22a35c['define']('ai.aiAssistant.commands',function(_0x24a89a){return[{'groupId':'editOrReview','groupLabel':i(_0x24a89a,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x24a89a,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x24a89a,'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(_0x24a89a,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x24a89a,'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(_0x24a89a,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x24a89a,'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(_0x24a89a,'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(_0x24a89a,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x24a89a,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x24a89a,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x24a89a,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x24a89a,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x24a89a,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x24a89a,'Change\x20style'),'commands':[{'id':'business','label':i(_0x24a89a,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x24a89a,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x24a89a,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x24a89a,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x24a89a,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x24a89a,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x24a89a,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x24a89a,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x24a89a,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x24a89a,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x24a89a,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x24a89a,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x24a89a,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x31e81a)),_0x22a35c['define']('ai.aiAssistant.extraCommandGroups',[]),_0x22a35c['define']('ai.aiAssistant.removeCommands',[]);let _0x481ee2=o(_0x22a35c['get']('ai.aiAssistant.commands'),_0x31e81a);const _0x22a5f9=_0x22a35c['get']('ai.aiAssistant.extraCommandGroups'),_0xb4fae8=_0x22a35c['get']('ai.aiAssistant.removeCommands');_0x22a5f9['forEach'](_0x4f1547=>{const _0x4bbfd9=_0x481ee2['find'](_0x34029d=>_0x34029d['groupId']===_0x4f1547['groupId']);_0x4bbfd9?_0x4bbfd9['commands']=_0x4bbfd9['commands']['concat'](_0x4f1547['commands']):_0x481ee2['push'](_0x4f1547);}),_0x481ee2=_0x481ee2['filter'](_0x11f66e=>!_0xb4fae8['includes'](_0x11f66e['groupId'])),_0x481ee2['forEach'](_0x1e9aa5=>{_0x1e9aa5['commands']=_0x1e9aa5['commands']['filter'](_0xbfdfd9=>!_0xb4fae8['includes'](_0xbfdfd9['id']));}),_0x22a35c['set']('ai.aiAssistant.commands',_0x481ee2);}}class P extends _0x357ea4{['abortController'];static get['requires'](){return[E];}constructor(_0xc51b4a){super(_0xc51b4a),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x39882e){return this['sendRequest'](_0x39882e)['catch'](_0xf0c225=>{if(_0xf0c225 instanceof R)return Promise['reject'](_0xf0c225);if('AbortError'==_0xf0c225['name'])return Promise['resolve']();throw console['error'](_0xf0c225),new _0x3c549e('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x34b070,_0x1b49b8){const _0x53a861=this['editor']['locale'],_0x4433a6={'Content-Type':'application/json'};if('object'==typeof _0x34b070)Object['assign'](_0x4433a6,_0x34b070);else{if(_0x34b070)try{const _0x524c3a=await _0x34b070(_0x1b49b8);Object['assign'](_0x4433a6,_0x524c3a);}catch{return Promise['reject'](new R(i(_0x53a861,'AI_ERROR_GET_HEADERS')));}}return _0x4433a6;}async['_prepareRequestParameters'](_0x3a0370,_0x25691b){const _0x1406e0=this['editor']['locale'];if('object'==typeof _0x3a0370)return _0x3a0370;try{return await _0x3a0370(_0x25691b);}catch{return Promise['reject'](new R(i(_0x1406e0,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x3a75d1){super(_0x3a75d1),_0x3a75d1['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x3a75d1['config']['get']('ai.openAI.requestParameters')||_0x3a75d1['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x3a75d1['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x3a75d1['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x3a75d1['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x508aa8,context:_0x5ebaee,onData:_0x2659e0,actionId:_0x28bdf8}){const _0x5df13a=this['editor']['locale'],_0x547b9e=await this['prepareMessages'](_0x508aa8,_0x5ebaee,_0x28bdf8),_0x4cda9c=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x28bdf8),_0x3c921c=await this['_prepareRequestParameters'](this['_requestParameters'],_0x28bdf8),_0x2c80bd={'messages':_0x547b9e,..._0x3c921c},_0x4399e1={'method':'POST','headers':_0x4cda9c,'body':JSON['stringify'](_0x2c80bd),'signal':this['abortController']['signal']},_0x4dd7d4=await fetch(this['_apiUrl'],_0x4399e1);if(_0x4dd7d4['ok'])return _0x3c921c['stream']?await this['_readStreamableResponse'](_0x4dd7d4,_0x2659e0):await this['_readStaticResponse'](_0x4dd7d4,_0x2659e0),Promise['resolve']();{const _0x217694=await _0x4dd7d4['text']();return _0x217694['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x5df13a,'AI_ERROR_CONTEXT_LENGTH'))):_0x217694['includes']('Moderation')?Promise['reject'](new R(i(_0x5df13a,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x217694));}}async['prepareMessages'](_0xd2c4c9,_0x5b2a9c,_0x521736){let _0x10f8b6,_0x2a0712;return _0x5b2a9c?(_0x10f8b6='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.',_0x2a0712='Instruction:\x0a'+_0xd2c4c9+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5b2a9c):(_0x10f8b6='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.',_0x2a0712=_0xd2c4c9),[{'role':'system','content':_0x10f8b6},{'role':'user','content':_0x2a0712}];}async['_readStreamableResponse'](_0x1a31e5,_0x4a8813){const _0x2293c0=_0x1a31e5['body']['getReader'](),_0x5425dd=new TextDecoder();let _0x48dde1='',_0x2e3259='',_0x27f6ed='',_0x4d9dd9=!0x1;for(;!_0x4d9dd9;){const {done:_0x377f55,value:_0x1ee2fa}=await _0x2293c0['read'](),_0x4dcafb=_0x48dde1+_0x5425dd['decode'](_0x1ee2fa);let _0x480a5d='';_0x4d9dd9=_0x377f55;try{_0x480a5d=this['_cleanUpData'](_0x4dcafb),_0x48dde1='';}catch{_0x48dde1=_0x4dcafb;continue;}_0x2e3259+=_0x480a5d,!_0x4d9dd9&&this['_isBufferIncomplete'](_0x2e3259)||_0x2e3259&&(_0x27f6ed+=_0x2e3259,_0x2e3259='',_0x4a8813(_0x27f6ed));}return Promise['resolve']();}async['_readStaticResponse'](_0xd73689,_0xdc709e){return _0xdc709e((await _0xd73689['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x31105f){const _0x322f25=_0x31105f['split']('<')['length']!==_0x31105f['split']('>')['length'],_0xfb7035=_0x31105f['length']<0x1e;return _0x322f25&&_0xfb7035;}['_cleanUpData'](_0x17d83c){return _0x17d83c['split'](/\n(?![^{]*\})/g)['map'](_0x155def=>_0x155def['replace']('data:\x20',''))['filter'](_0x3610fc=>_0x3610fc&&_0x3610fc['length']>0x0&&'[DONE]'!==_0x3610fc)['map'](_0x115086=>{const {choices:_0x3e4439}=JSON['parse'](_0x115086);if(_0x3e4439[0x0]?.['delta']?.['content'])return _0x3e4439[0x0]['delta']['content'];})['filter'](_0x481acf=>_0x481acf)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x43da95){super(_0x43da95),_0x43da95['config']['get']('ai.aws.requestParameters')||_0x43da95['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']=_0x43da95['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x43da95['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x43da95['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x43da95['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x26cbc5,context:_0x3f7cbe,onData:_0x27fcf3,actionId:_0x5b305f}){const {model:_0x9a1036,stream:_0x10e123,..._0xaafae9}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5b305f),_0x5d49ef={'prompt':await this['preparePrompt'](_0x26cbc5,_0x3f7cbe,_0x9a1036,_0x5b305f),..._0xaafae9};this['_apiUrl']?await this['_processProxyRequest'](_0x5d49ef,_0x9a1036,_0x10e123,_0x27fcf3,_0x5b305f):await this['_processAWSRequest'](_0x5d49ef,_0x9a1036,_0x10e123,_0x27fcf3);}async['preparePrompt'](_0xf108d6,_0x4a954b,_0x375b4d,_0x34ace7){let _0x4a4cec,_0x5c95b0;return _0x4a954b?(_0x4a4cec='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.',_0x5c95b0='Instruction:\x0a'+_0xf108d6+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4a954b):(_0x4a4cec='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.',_0x5c95b0=_0xf108d6),'meta.llama'==this['getModelFamily'](_0x375b4d)?'<<SYS>>\x0a'+_0x4a4cec+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x5c95b0+'\x0a[/INST]':'Human:\x0a'+_0x4a4cec+'\x0a'+_0x5c95b0+'\x0a\x0aAssistant:';}['getModelFamily'](_0x146268){if(/^anthropic\.claude/['test'](_0x146268))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x146268))return'ai21.j2';if(/^cohere\.command/['test'](_0x146268))return'cohere.command';if(/^meta\.llama/['test'](_0x146268))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x146268));}async['_processProxyRequest'](_0x26b6ab,_0x3c188e,_0xecf4c1,_0x4bdbde,_0x2f51b9){const _0x48f7b1={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2f51b9),'body':JSON['stringify']({..._0x26b6ab,'model':_0x3c188e,'stream':_0xecf4c1}),'signal':this['abortController']['signal']},_0x3fd261=await fetch(this['_apiUrl'],_0x48f7b1);_0xecf4c1?await this['_readStreamableResponse'](_0x3fd261,_0x3c188e,_0x4bdbde):await this['_readStaticResponse'](_0x3fd261,_0x3c188e,_0x4bdbde);}async['_processAWSRequest'](_0x2ff4e9,_0x5253bb,_0x3957a6,_0x2600ad){const _0x57711d=new _0xe1cef(this['_bedrockClientConfig']),_0x4dddfc={'body':JSON['stringify'](_0x2ff4e9),'contentType':'application/json','accept':'application/json','modelId':_0x5253bb};let _0x207c6d;if(_0x3957a6){const _0x57bf32=new _0x2a3a7b(_0x4dddfc);_0x207c6d=await _0x57711d['send'](_0x57bf32,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x207c6d,_0x5253bb,_0x2600ad);}else{const _0x23b73b=new _0x3d599a(_0x4dddfc);_0x207c6d=await _0x57711d['send'](_0x23b73b,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x207c6d,_0x5253bb,_0x2600ad);}}async['_readAsyncIterableResponse'](_0x47d62c,_0x56d2fa,_0x3ace6e){const _0x4e1c00=_0x47d62c['body'],_0x25bc8c=new TextDecoder('utf-8');let _0xebfe33='';for await(const _0x10cd42 of _0x4e1c00)if(_0x10cd42['chunk']){const _0x157149=_0x25bc8c['decode'](_0x10cd42['chunk']['bytes']),_0x5d710f=JSON['parse'](_0x157149);_0xebfe33+=this['_getGeneratedText'](_0x5d710f,_0x56d2fa),_0x3ace6e(_0xebfe33);}return Promise['resolve']();}async['_readStreamableResponse'](_0x3ba98e,_0x4c89f4,_0x4bb6fc){const _0x53425f=_0x3ba98e['body'],_0x37e0c7=new TextDecoder('utf-8'),_0x3ea064=_0x53425f['getReader']();let _0x2775c8='',_0x48108b='',_0x5bdd71=!0x1;for(;!_0x5bdd71;){const {done:_0x7c8db1,value:_0x4b4709}=await _0x3ea064['read']();if(_0x5bdd71=_0x7c8db1,_0x5bdd71)break;const _0x42ecd5=(_0x2775c8+_0x37e0c7['decode'](_0x4b4709))['split']('\x0a')['map'](_0x5cb2cb=>{try{return _0x2775c8='',JSON['parse'](_0x5cb2cb);}catch{return _0x2775c8=_0x5cb2cb,null;}})['filter'](_0x11395a=>null!==_0x11395a);_0x42ecd5['length']&&(_0x48108b+=_0x42ecd5['map'](_0x3b626c=>this['_getGeneratedText'](_0x3b626c,_0x4c89f4))['join'](''),_0x4bb6fc(_0x48108b));}return Promise['resolve']();}async['_readStaticResponse'](_0xf0553a,_0x349978,_0x407a4a){let _0x562fb2;return _0x562fb2=_0xf0553a instanceof Response?await _0xf0553a['json']():JSON['parse'](Buffer['from'](_0xf0553a['body'])['toString']('utf8')),(_0x407a4a(this['_getGeneratedText'](_0x562fb2,_0x349978)),Promise['resolve']());}['_getGeneratedText'](_0x1533ee,_0x137909){switch(this['getModelFamily'](_0x137909)){case'anthropic.claude':return _0x1533ee['completion'];case'ai21.j2':return _0x1533ee['completions'][0x0]['data']['text'];case'cohere.command':return _0x1533ee['generations'][0x0]['text'];case'meta.llama':return _0x1533ee['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O as OpenAITextAdapter};
23
+ import{Plugin as _0x2ff2b4,Command as _0x24897b}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x49ca06,IconCheck as _0x2201d3,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x3fe608,IconRobotPencil as _0x2e8dc7}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x185018,CKEditorError as _0x286c33,ObservableMixin as _0x5b9ccd,global as _0x2dd121,isVisible as ot,Rect as it,Collection as _0x184f2a,FocusTracker as mt,KeystrokeHandler as ut,first as _0x19c61a}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x445947,View as _0x219631,SpinnerView as _0x4e1106,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0x1df39b,createDropdown as _0x5dcd82,addMenuToDropdown as _0x2a483d,MenuBarMenuView as _0x1c02be,MenuBarMenuListItemButtonView as _0x2d66ee,DialogViewPosition as _0x4d9161,MenuBarMenuListView as _0x1aca70,MenuBarMenuListItemView as _0x275a7d}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0xe27caf,ClipboardMarkersUtils as _0x4d799e}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x41600e,DataTransfer as _0xcf33dd,UpcastWriter as _0x19895c,Matcher as _0x24290c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x814e00,InvokeModelWithResponseStreamCommand as _0x266f1d,InvokeModelCommand as _0x139fab}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x37ed7b,_0x1a7bbf){const _0x205941=(0x0,_0x1a7bbf['t'])('Other');return _0x37ed7b['length']?'groupId'in _0x37ed7b[0x0]?_0x37ed7b:[{'groupId':x,'groupLabel':_0x205941,'order':0x1/0x0,'commands':_0x37ed7b}]:[{'groupId':x,'groupLabel':_0x205941,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x2ff2b4{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x4b4140}=this,_0x54ab3f=['ck-fake-ai-selection'];_0x4b4140['config']['get']('ai.useTheme')&&_0x54ab3f['push']('ck-ai-assistant-ui_theme'),_0x4b4140['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x54ab3f,'priority':0xc}}),_0x4b4140['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0xeb193c,{writer:_0x7a87a})=>{if(!_0xeb193c['markerRange']['isCollapsed'])return null;const _0x42a9a2=_0x7a87a['createUIElement']('span');return _0x7a87a['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x42a9a2),_0x42a9a2;}});}['afterInit'](){!async function(_0xacd5a2){const _0x2eacc3=_0x35ec1c([0x71,0x32,0x35,0x73,0x34,0x61,0x6c,0x63,0x56,0x57,0x47,0x48,0x42,0x77,0x31,0x4a,0x52,0x70,0x55,0x33,0x41,0x49,0x4d,0x39,0x67,0x59,0x4c,0x6b,0x58,0x69,0x74,0x54,0x6d,0x46,0x4e,0x38,0x51,0x79,0x43,0x6f,0x7a,0x78,0x6e,0x50,0x36,0x66,0x68,0x64,0x44,0x5a,0x75,0x4b,0x37,0x30,0x76,0x45,0x72,0x4f,0x53,0x65,0x6a,0x62]),_0x5bd154=0x63c279b2,_0x26d1fb=0x63c510e2^_0x5bd154,_0x320857=window[_0x35ec1c([0x44,0x61,0x74,0x65])][_0x35ec1c([0x6e,0x6f,0x77])](),_0x2d630b=_0xacd5a2[_0x35ec1c([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x317c09=new window[(_0x35ec1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x15b388=>{_0x2d630b[_0x35ec1c([0x6f,0x6e,0x63,0x65])](_0x35ec1c([0x72,0x65,0x61,0x64,0x79]),_0x15b388);}),_0x44d858={[_0x35ec1c([0x6b,0x74,0x79])]:_0x35ec1c([0x45,0x43]),[_0x35ec1c([0x75,0x73,0x65])]:_0x35ec1c([0x73,0x69,0x67]),[_0x35ec1c([0x63,0x72,0x76])]:_0x35ec1c([0x50,0x2d,0x32,0x35,0x36]),[_0x35ec1c([0x78])]:_0x35ec1c([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]),[_0x35ec1c([0x79])]:_0x35ec1c([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]),[_0x35ec1c([0x61,0x6c,0x67])]:_0x35ec1c([0x45,0x53,0x32,0x35,0x36])},_0x2e3a9e=_0x2d630b[_0x35ec1c([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x35ec1c([0x67,0x65,0x74])](_0x35ec1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x52c5f8(){let _0x496e6c,_0x29406e=null,_0x383d2b=null;try{if(_0x2e3a9e==_0x35ec1c([0x47,0x50,0x4c]))return _0x35ec1c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x496e6c=_0x127ba5(),!_0x496e6c)return _0x35ec1c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x496e6c[_0x35ec1c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x383d2b=_0x45d760(_0x496e6c[_0x35ec1c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x496e6c[_0x35ec1c([0x6a,0x74,0x69])])),await _0x27a911()?_0x23cf8e()?_0x332640()?_0x35ec1c([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4c6482()?(_0x496e6c[_0x35ec1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x35ec1c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x29406e=_0x515d13(_0x35ec1c([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x496e6c[_0x35ec1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x35ec1c([0x74,0x72,0x69,0x61,0x6c])&&(_0x29406e=_0x515d13(_0x35ec1c([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x47c379()):_0x35ec1c([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x35ec1c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x35ec1c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x35ec1c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x332640(){const _0x194e62=[_0x35ec1c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x35ec1c([0x74,0x72,0x69,0x61,0x6c])][_0x35ec1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x496e6c[_0x35ec1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x320857/0x3e8:0xe10*_0x26d1fb;return _0x496e6c[_0x35ec1c([0x65,0x78,0x70])]<_0x194e62;}function _0x23cf8e(){const _0x7a39c6=_0x496e6c[_0x35ec1c([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x7a39c6&&(!!_0x7a39c6[_0x35ec1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x35ec1c([0x2a]))||!!_0x7a39c6[_0x35ec1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x35ec1c([0x41,0x49])));}function _0x4c6482(){const _0x472aed=_0x496e6c[_0x35ec1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x472aed||0x0==_0x472aed[_0x35ec1c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x572fbb}=new URL(window[_0x35ec1c([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x472aed[_0x35ec1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x572fbb))return!0x0;const _0x431eff=_0x572fbb[_0x35ec1c([0x73,0x70,0x6c,0x69,0x74])](_0x35ec1c([0x2e]));return _0x472aed[_0x35ec1c([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3f3f4b=>_0x3f3f4b[_0x35ec1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x35ec1c([0x2a])))[_0x35ec1c([0x6d,0x61,0x70])](_0x3a9fd5=>_0x3a9fd5[_0x35ec1c([0x73,0x70,0x6c,0x69,0x74])](_0x35ec1c([0x2e])))[_0x35ec1c([0x73,0x6f,0x6d,0x65])](_0x2885ca=>_0x431eff[_0x35ec1c([0x65,0x76,0x65,0x72,0x79])]((_0x567471,_0x3ef2b)=>_0x2885ca[_0x3ef2b]===_0x567471||_0x2885ca[_0x3ef2b]===_0x35ec1c([0x2a])));}function _0x47c379(){return _0x29406e&&_0x383d2b?new window[(_0x35ec1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3ebe21,_0x264979)=>{_0x29406e[_0x35ec1c([0x74,0x68,0x65,0x6e])](_0x3ebe21,_0x264979),_0x383d2b[_0x35ec1c([0x74,0x68,0x65,0x6e])](_0x5cab33=>{_0x5cab33!=_0x35ec1c([0x56,0x61,0x6c,0x69,0x64])&&_0x3ebe21(_0x5cab33);},_0x264979);}):_0x29406e||_0x383d2b||_0x35ec1c([0x56,0x61,0x6c,0x69,0x64]);}}function _0x45d760(_0x3f5065,_0x1086de){return new window[(_0x35ec1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5b224a=>{if(_0x106457())return _0x5b224a(_0x35ec1c([0x56,0x61,0x6c,0x69,0x64]));_0x3f8a17(),_0x2d630b[_0x35ec1c([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x35ec1c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x31f4f5=!0x1;const _0x9e952f=_0x185018();function _0x299343(_0x17408e){return!!_0x17408e&&(typeof _0x17408e===_0x35ec1c([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x17408e===_0x35ec1c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x17408e[_0x35ec1c([0x74,0x68,0x65,0x6e])]===_0x35ec1c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x17408e[_0x35ec1c([0x63,0x61,0x74,0x63,0x68])]===_0x35ec1c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x436e8e(_0x5aa9a5){_0x368c5e(_0x5aa9a5)[_0x35ec1c([0x74,0x68,0x65,0x6e])](_0x39df2b=>{if(!_0x39df2b||_0x39df2b[_0x35ec1c([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x35ec1c([0x6f,0x6b]))return _0x35ec1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x5d9026(_0x3c4f46(_0x9e952f+_0x1086de))!=_0x39df2b[_0x35ec1c([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x35ec1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x35ec1c([0x56,0x61,0x6c,0x69,0x64]);})[_0x35ec1c([0x74,0x68,0x65,0x6e])](_0x1b730d=>(_0x28f10b(),_0x1b730d),()=>{const _0x5cf80b=_0x11baf4();return null==_0x5cf80b?(_0x28f10b(),_0x35ec1c([0x56,0x61,0x6c,0x69,0x64])):_0x35ec1c(_0x320857-_0x5cf80b>(0x47cefdb2^_0x5bd154)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x35ec1c([0x74,0x68,0x65,0x6e])](_0x5b224a)[_0x35ec1c([0x63,0x61,0x74,0x63,0x68])](()=>{_0x5b224a(_0x35ec1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xfa8f2=0x63f49732^_0x5bd154;function _0x28f10b(){const _0x446ed7=_0x35ec1c([0x6c,0x6c,0x63,0x74,0x2d])+_0x5d9026(_0x3c4f46(_0x3f5065)),_0x1a6280=_0x45df50(_0x5d9026(window[_0x35ec1c([0x4d,0x61,0x74,0x68])][_0x35ec1c([0x63,0x65,0x69,0x6c])](_0x320857/_0xfa8f2)));window[_0x35ec1c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x35ec1c([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x446ed7,_0x1a6280);}function _0x11baf4(){const _0x386fb9=_0x35ec1c([0x6c,0x6c,0x63,0x74,0x2d])+_0x5d9026(_0x3c4f46(_0x3f5065)),_0x495a5c=window[_0x35ec1c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x35ec1c([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x386fb9);return _0x495a5c?window[_0x35ec1c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x45df50(_0x495a5c),0x10)*_0xfa8f2:null;}function _0x368c5e(_0x3b75b1){return new window[(_0x35ec1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1946f9,_0x5b9209)=>{_0x3b75b1[_0x35ec1c([0x74,0x68,0x65,0x6e])](_0x1946f9,_0x5b9209),window[_0x35ec1c([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x5b9209,0x63c3ad72^_0x5bd154);});}}_0x2d630b[_0x35ec1c([0x6f,0x6e])](_0x35ec1c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x7309b4,_0x15c226)=>{if(_0x15c226[0x0]!=_0x3f5065)return _0x5b224a(_0x35ec1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x15c226[0x1]={..._0x15c226[0x1],[_0x35ec1c([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x9e952f};},{[_0x35ec1c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x35ec1c([0x68,0x69,0x67,0x68])}),_0x2d630b[_0x35ec1c([0x6f,0x6e])](_0x35ec1c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x258c17=>{_0x299343(_0x258c17[_0x35ec1c([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x31f4f5=!0x0,_0x436e8e(_0x258c17[_0x35ec1c([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x35ec1c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x35ec1c([0x6c,0x6f,0x77])}),_0x317c09[_0x35ec1c([0x74,0x68,0x65,0x6e])](()=>{_0x31f4f5||_0x5b224a(_0x35ec1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x106457(){return _0x2d630b[_0x35ec1c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x35ec1c([0x76,0x69,0x65,0x77])][_0x35ec1c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x35ec1c([0x61,0x75,0x74,0x6f]);}function _0x3f8a17(){_0x2d630b[_0x35ec1c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x35ec1c([0x76,0x69,0x65,0x77])][_0x35ec1c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x35ec1c([0x61,0x75,0x74,0x6f]);}}function _0x515d13(_0x1fe672){const _0x5af3fe=[new window[(_0x35ec1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x43a54b=>setTimeout(_0x43a54b,0x63cb477e^_0x5bd154)),_0x317c09[_0x35ec1c([0x74,0x68,0x65,0x6e])](()=>new window[(_0x35ec1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1f1f5f=>{let _0x333d7d=0x0;_0x2d630b[_0x35ec1c([0x6d,0x6f,0x64,0x65,0x6c])][_0x35ec1c([0x6f,0x6e])](_0x35ec1c([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xd83cfd,_0x3b5c54)=>{_0x3b5c54[0x0][_0x35ec1c([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x333d7d++,_0x333d7d==(0x63c2784a^_0x5bd154)&&(_0x1f1f5f(),_0xd83cfd[_0x35ec1c([0x6f,0x66,0x66])]());});}))];return window[_0x35ec1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x35ec1c([0x72,0x61,0x63,0x65])](_0x5af3fe)[_0x35ec1c([0x74,0x68,0x65,0x6e])](()=>_0x1fe672);}async function _0x4167fe(){await _0x317c09,_0x2d630b[_0x35ec1c([0x6d,0x6f,0x64,0x65,0x6c])][_0x35ec1c([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x4003f8,_0x2d630b[_0x35ec1c([0x6d,0x6f,0x64,0x65,0x6c])][_0x35ec1c([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x4003f8,_0x2d630b[_0x35ec1c([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x35ec1c([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5b8ec8(_0x32c769){const _0x2eba33=_0x4d4a8e();_0x2d630b[_0x2eba33]=_0x35ec1c([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x32c769,_0x32c769!=_0x35ec1c([0x56,0x61,0x6c,0x69,0x64])&&_0x4167fe();}function _0x4d4a8e(){const _0x326d87=window[_0x35ec1c([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x35ec1c([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x35ec1c([0x6e,0x6f,0x77])]())[_0x35ec1c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x35ec1c([0x2e]),'');let _0x54f473=_0x35ec1c([0x71]);for(let _0x3542fd=0x0;_0x3542fd<_0x326d87[_0x35ec1c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3542fd+=0x2){let _0x5f0a56=window[_0x35ec1c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x326d87[_0x35ec1c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3542fd,_0x3542fd+0x2));_0x5f0a56>=_0x2eacc3[_0x35ec1c([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5f0a56-=_0x2eacc3[_0x35ec1c([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x54f473+=_0x2eacc3[_0x5f0a56];}return _0x54f473;}function _0x127ba5(){const _0x52fce7=_0x2e3a9e[_0x35ec1c([0x73,0x70,0x6c,0x69,0x74])](_0x35ec1c([0x2e]));if(0x3!=_0x52fce7[_0x35ec1c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x20c70d(_0x52fce7[0x1]);function _0x20c70d(_0x9fe1dd){const _0x45e0d1=_0x11665e(_0x9fe1dd);return _0x45e0d1&&_0x35de6d()?_0x45e0d1:null;function _0x35de6d(){const _0x1cf750=_0x45e0d1[_0x35ec1c([0x6a,0x74,0x69])],_0x1a574e=window[_0x35ec1c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1cf750[_0x35ec1c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1cf750[_0x35ec1c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x41ba84={..._0x45e0d1,[_0x35ec1c([0x6a,0x74,0x69])]:_0x1cf750[_0x35ec1c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x1cf750[_0x35ec1c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x41ba84[_0x35ec1c([0x76,0x63])],_0x3c4f46(_0x41ba84)==_0x1a574e;}}}async function _0x27a911(){let _0x4be8a7=!0x0;try{const _0xcbe529=_0x2e3a9e[_0x35ec1c([0x73,0x70,0x6c,0x69,0x74])](_0x35ec1c([0x2e])),[_0x16010d,_0x29bc88,_0x3f781d]=_0xcbe529;return _0x4b4148(_0x16010d),await _0xf85650(_0x16010d,_0x29bc88,_0x3f781d),_0x4be8a7;}catch{return!0x1;}function _0x4b4148(_0x3c80b1){const _0x1776f7=_0x11665e(_0x3c80b1);_0x1776f7&&_0x1776f7[_0x35ec1c([0x61,0x6c,0x67])]==_0x35ec1c([0x45,0x53,0x32,0x35,0x36])||(_0x4be8a7=!0x1);}async function _0xf85650(_0x291a80,_0x380445,_0x393ed7){const _0x58dafd=window[_0x35ec1c([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x35ec1c([0x66,0x72,0x6f,0x6d])](_0x3d7185(_0x393ed7),_0x1b3479=>_0x1b3479[_0x35ec1c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4e4281=new window[(_0x35ec1c([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x35ec1c([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x291a80+_0x35ec1c([0x2e])+_0x380445),_0x410075=window[_0x35ec1c([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x35ec1c([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x410075)return;const _0xb82ad5=await _0x410075[_0x35ec1c([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x35ec1c([0x6a,0x77,0x6b]),_0x44d858,{[_0x35ec1c([0x6e,0x61,0x6d,0x65])]:_0x35ec1c([0x45,0x43,0x44,0x53,0x41]),[_0x35ec1c([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x35ec1c([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x35ec1c([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x410075[_0x35ec1c([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x35ec1c([0x6e,0x61,0x6d,0x65])]:_0x35ec1c([0x45,0x43,0x44,0x53,0x41]),[_0x35ec1c([0x68,0x61,0x73,0x68])]:{[_0x35ec1c([0x6e,0x61,0x6d,0x65])]:_0x35ec1c([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0xb82ad5,_0x58dafd,_0x4e4281)||(_0x4be8a7=!0x1);}}function _0x11665e(_0x57559d){return _0x57559d[_0x35ec1c([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x35ec1c([0x65,0x79]))?JSON[_0x35ec1c([0x70,0x61,0x72,0x73,0x65])](_0x3d7185(_0x57559d)):null;}function _0x3d7185(_0x1e6da7){return window[_0x35ec1c([0x61,0x74,0x6f,0x62])](_0x1e6da7[_0x35ec1c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x35ec1c([0x2b]))[_0x35ec1c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x35ec1c([0x2f])));}function _0x3c4f46(_0x5d4182){let _0x5c1b0b=0x1505;function _0x362ab8(_0x16e1cf){for(let _0x296f6c=0x0;_0x296f6c<_0x16e1cf[_0x35ec1c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x296f6c++){const _0x12c5d4=_0x16e1cf[_0x35ec1c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x296f6c);_0x5c1b0b=(_0x5c1b0b<<0x5)+_0x5c1b0b+_0x12c5d4,_0x5c1b0b&=_0x5c1b0b;}}function _0x38d505(_0x4d8819){Array[_0x35ec1c([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x4d8819)?_0x4d8819[_0x35ec1c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x38d505):_0x4d8819&&typeof _0x4d8819==_0x35ec1c([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x35ec1c([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x4d8819)[_0x35ec1c([0x73,0x6f,0x72,0x74])]()[_0x35ec1c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x338500,_0x117c32])=>{_0x362ab8(_0x338500),_0x38d505(_0x117c32);}):_0x362ab8(window[_0x35ec1c([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x4d8819));}return _0x38d505(_0x5d4182),_0x5c1b0b>>>0x0;}function _0x5d9026(_0x297484){return _0x297484[_0x35ec1c([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x35ec1c([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x35ec1c([0x30]));}function _0x45df50(_0x43df39){return _0x43df39[_0x35ec1c([0x73,0x70,0x6c,0x69,0x74])]('')[_0x35ec1c([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x35ec1c([0x6a,0x6f,0x69,0x6e])]('');}function _0x4003f8(){}function _0x35ec1c(_0x2e2f8e){return _0x2e2f8e['map'](_0x1cf48b=>String['fromCharCode'](_0x1cf48b))['join']('');}_0x5b8ec8(await _0x52c5f8());}(this);}['showFakeVisualSelection'](){const _0x8965d4=this['editor']['model'];_0x8965d4['change'](_0x104773=>{const _0x52388a=_0x8965d4['document']['selection']['getRanges']();let _0x43c592=0x0;for(const _0x1ade6b of _0x52388a){const _0x491e65=f+':'+_0x43c592;if(_0x8965d4['markers']['has'](_0x491e65))_0x104773['updateMarker'](_0x491e65,{'range':_0x1ade6b});else{if(_0x1ade6b['start']['isAtEnd']){const _0x46e4e9=_0x1ade6b['start']['getLastMatchingPosition'](({item:_0x430376})=>!_0x8965d4['schema']['isContent'](_0x430376),{'boundaries':_0x1ade6b});_0x104773['addMarker'](_0x491e65,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x104773['createRange'](_0x46e4e9,_0x1ade6b['end'])});}else _0x104773['addMarker'](_0x491e65,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1ade6b});}_0x43c592++;}});}['hideFakeVisualSelection'](){const _0x94b33f=this['editor']['model'],_0x5f19b3=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x5f19b3['length']&&_0x94b33f['change'](_0x174000=>{_0x5f19b3['forEach'](_0x405a03=>{_0x174000['removeMarker'](_0x405a03);});});}['insertContent'](_0x155168,_0x236481){const _0x46d655=this['_getAISelection'](),_0x599b8b=_0x236481||_0x46d655['getFirstRange']();this['editor']['model']['canEditAt'](_0x599b8b)&&this['editor']['model']['change'](_0x2a042c=>{this['hideFakeVisualSelection'](),_0x236481||this['_resetContentOfSelectedTableCells'](_0x2a042c,_0x46d655),this['_pasteHTMLUsingClipboard']({'insertAt':_0x599b8b,'writer':_0x2a042c,'html':_0x155168});});}['insertContentBelow'](_0x35eeaa){const {model:_0x45adee}=this['editor'],_0xe258f0=this['_getAISelection']();_0x45adee['change'](()=>{const _0x29c952=this['_prepareTableInsertBelowPosition'](_0x35eeaa,_0xe258f0)||this['_getDefaultInsertBelowPosition'](_0xe258f0);this['insertContent'](_0x35eeaa,_0x29c952);});}['_getAISelection'](){const _0x5974d9=this['editor']['model'],_0x26fc5e=Array['from'](_0x5974d9['markers']['getMarkersGroup'](f))['map'](_0x40c109=>_0x40c109['getRange']());return _0x5974d9['createSelection'](_0x26fc5e);}['_pasteHTMLUsingClipboard']({writer:_0x401dc6,html:_0x3b34c3,insertAt:_0x160ad6}){const {view:_0x4eb331}=this['editor']['editing'],_0x4a438b=this['editor']['plugins']['get'](_0xe27caf),_0xe07489=new gt();_0xe07489['setData']('text/html',_0x3b34c3);const _0x1d30c1=new ClipboardEvent('paste',{'clipboardData':_0xe07489}),_0x373c47=new _0x41600e(_0x4eb331,_0x1d30c1,{'dataTransfer':new _0xcf33dd(_0xe07489)});_0x401dc6['setSelection'](_0x160ad6);const _0x3ec5aa=(_0x3866db,_0x40e91b)=>{_0x40e91b['resultRange']&&_0x401dc6['setSelection'](_0x40e91b['resultRange']);};_0x4a438b['once']('contentInsertion',_0x3ec5aa,{'priority':'lowest'}),_0x4eb331['document']['fire']('paste',_0x373c47),_0x4a438b['off']('contentInsertion',_0x3ec5aa);}['_getDefaultInsertBelowPosition'](_0x528fdf){const {model:_0x6f3eec}=this['editor'],_0x3cc4b3=Array['from'](_0x528fdf['getSelectedBlocks']());return _0x3cc4b3['length']?_0x6f3eec['createPositionAfter'](_0x3cc4b3['pop']()):_0x528fdf['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x23cf6e,_0x126107){const {model:_0xb42880,plugins:_0x53f1b0}=this['editor'];if(_0x53f1b0['has']('TableUtils')){const _0x276d44=_0x53f1b0['get']('TableUtils')['getSelectedTableCells'](_0x126107);if(_0x276d44['length']){const _0x249dcc=this['_getTableRowCountFromContent'](_0x23cf6e),_0x971cb8=this['_createEmptyTableRows'](_0x276d44,_0x249dcc);return _0xb42880['createPositionAt'](_0x971cb8,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1261c8){const _0x136de3=this['editor']['plugins']['get']('TableUtils'),_0x44e6ab=this['editor']['data']['parse'](_0x1261c8),_0x4fb0d0=Array['from'](_0x44e6ab['getChildren']())['filter'](_0x3ab77d=>_0x3ab77d['is']('element','table'));let _0x4450f0=0x0;return _0x4fb0d0['forEach'](_0x156a80=>{_0x4450f0+=_0x136de3['getRows'](_0x156a80);}),_0x4450f0;}['_createEmptyTableRows'](_0x517e41,_0x3c4a89){const _0x5d3cfa=this['editor']['plugins']['get']('TableUtils'),_0x28523b=_0x5d3cfa['getRowIndexes'](_0x517e41),_0xf0af16=_0x5d3cfa['getColumnIndexes'](_0x517e41),_0x320e9f=_0x28523b['last']+0x1,_0x5970f9=_0xf0af16['first'],_0x245220=_0x517e41[0x0]['findAncestor']('table');for(let _0x500581=0x0;_0x500581<_0x3c4a89;_0x500581++)_0x5d3cfa['insertRows'](_0x245220,{'at':_0x320e9f});return _0x245220['getChild'](_0x320e9f)['getChild'](_0x5970f9);}['_resetContentOfSelectedTableCells'](_0x202da5,_0x1f0042){const {plugins:_0x211786}=this['editor'],{model:_0x1890ff}=_0x202da5;if(!_0x211786['has']('TableUtils'))return;_0x211786['get']('TableUtils')['getSelectedTableCells'](_0x1f0042)['length']&&_0x1890ff['deleteContent'](_0x1f0042);}}class E extends _0x2ff2b4{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x286c33('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x4068e0){super(_0x4068e0),this['name']='AIRequestError';}}function i(_0x1c7386,_0x2080e5,_0x5693ec){const t=_0x1c7386['t'];switch(_0x2080e5){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',_0x5693ec);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5693ec);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'},_0x5693ec);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 _0x2080e5;}}class j extends _0x24897b{['_commandDefinitions'];constructor(_0x497467,_0xcff9c1){super(_0x497467),this['_commandDefinitions']=_0xcff9c1,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x2f9eaf,_0x10ff29,_0x2f15d6)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x2f15d6));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x556c1c,_0x5517d0,_0x524014)=>{this['enabledCommandsIds']=_0x524014?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x22b1a6=this['editor']['model'];this['_hasContext']=function(_0x1852aa){const _0x58081d=_0x1852aa['document']['selection'];return _0x58081d['isCollapsed']?0x0!==[..._0x58081d['getSelectedBlocks']()]['length']&&![..._0x58081d['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x1852aa['hasContent'](_0x58081d['getFirstRange']());}(_0x22b1a6);const _0x5c5d4a=_0x22b1a6['document']['selection'],_0x4e0aef=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x4b7f17 of _0x5c5d4a['getRanges']())for(const _0x312640 of _0x4b7f17['getItems']())if(_0x312640['is']('element')&&_0x4e0aef['includes'](_0x312640['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x38a5ea='',_0x8fd17f='',_0x335405='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x38a5ea,_0x8fd17f,_0x335405);}}function G(_0x1e25b8,_0x2191fc){const _0xe4371d=new Set();for(const _0x4659b2 of _0x1e25b8['values']())(_0x2191fc||!0x1===_0x4659b2['requiresContent'])&&_0xe4371d['add'](_0x4659b2['id']);return Array['from'](_0xe4371d);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
24
+ _0x5b9ccd(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x332ba2,_0x2788b5,_0x475fed){super(),this['editor']=_0x332ba2,this['textAdapter']=_0x2788b5,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x475fed,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4ca2ac,_0x103187,_0x5e9adf)=>{this['view']['value']=this['_sanitizeHTML'](_0x5e9adf);}),this['listenTo'](this['view'],'submitPrompt',(_0x470c3a,_0x5f22bb)=>{const _0x4d5e5f=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x5f22bb,_0x4d5e5f,'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:_0x3acac0,query:_0x518f93,htmlContent:_0x4ca4cf,label:_0xffa62b,mainActionLabel:_0x5600db}){this['view']['prompt']=_0xffa62b,this['view']['mainAction']=_0x5600db,this['initialContext']=_0x4ca4cf,_0x518f93&&(this['view']['isRendered']?this['_handleQuery'](_0x518f93,_0x4ca4cf,_0x3acac0,_0xffa62b):this['view']['once']('render',()=>{this['_handleQuery'](_0x518f93,_0x4ca4cf,_0x3acac0,_0xffa62b);}));}['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'](_0x4d788d,_0x3bf2fe,_0xb4317b,_0x36d77b){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3bf2fe,this['previousQuery']=_0x4d788d,this['previousLabel']=_0x36d77b||_0x4d788d,this['previousActionId']=_0xb4317b,new Promise(_0x55e7af=>{this['textAdapter']['makeRequest']({'query':_0x4d788d,'context':_0x3bf2fe,'onData':_0x23ae38=>{this['currentResponse']=_0x23ae38,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0xb4317b})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x30d098=>{_0x30d098 instanceof R?this['view']['handleError'](_0x30d098['message']):this['view']['handleError'](),_0x55e7af();})['finally'](()=>{this['stopProcessing'](),_0x55e7af();});});}['_parseAndNormalizeContent'](_0x3c06e5,_0x64a257=!0x1){const _0x27563f=Z['exec'](_0x3c06e5);_0x3c06e5=_0x27563f?_0x3c06e5['substring'](_0x27563f[0x1]['length']):_0x3c06e5['length']<0x64&&!_0x64a257?'':this['_stripMarkdownSyntax'](_0x3c06e5);const _0x2bac3b=this['_domParser']['parseFromString'](_0x3c06e5,'text/html');if(_0x27563f){const _0x5837ec=Array['from'](_0x2bac3b['body']['childNodes']);_0x5837ec['reverse']();for(const _0x29402f of _0x5837ec){if(_0x29402f['nodeType']==Node['ELEMENT_NODE'])break;_0x29402f['remove']();}}const _0x1e8497=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2bac3b['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1e8497);const _0x2dc844=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x1eb4f1=this['editor']['data']['toModel'](_0x1e8497);return _0x2dc844||_0x1eb4f1['markers']['clear'](),this['editor']['data']['stringify'](_0x1eb4f1);}['_normalizeResponseHeadings'](_0x3e39ca){const _0x6f746a=new _0x19895c(this['editor']['editing']['view']['document']),_0x3a956c=new _0x24290c({'name':/^h[1-5]$/}),_0x5ee028=[];let _0x5365a6=!0x1;for(const _0x44f171 of _0x3e39ca)_0x44f171['is']('element')&&_0x3a956c['match'](_0x44f171)&&(_0x5ee028['push'](_0x44f171),'h1'==_0x44f171['name']&&(_0x5365a6=!0x0));if(_0x5365a6){for(const _0x46dc36 of _0x5ee028)_0x6f746a['rename']('h'+(parseInt(_0x46dc36['name'][0x1])+0x1),_0x46dc36);}}['_isH1TagSupportEnabled'](){const {data:_0x1f763f,editing:_0x1c3c6d}=this['editor'],_0xaa361e=_0x1f763f['htmlProcessor']['toView']('<h1></h1>'),_0x1cbb3c=_0x1f763f['toView'](_0x1f763f['toModel'](_0xaa361e));return!!_0x1c3c6d['view']['domConverter']['viewToDom'](_0x1cbb3c)['querySelector']('h1');}['_sanitizeHTML'](_0x8b3510){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x8b3510),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x397c6e){const _0x4c10d3=_0x397c6e['trim']();return _0x4c10d3['startsWith']('```html')?_0x4c10d3['endsWith']('```')?_0x4c10d3['substring'](0x7,_0x4c10d3['length']-0x3):_0x4c10d3['substring'](0x7):_0x397c6e;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x14f0d9){super(_0x14f0d9),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x250c88=>i(_0x14f0d9,'AI_'+_0x250c88['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x14f0d9,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x14f0d9,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x14f0d9,'Stop'));const _0x5c3ace=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x5c3ace['if']('isVisible','ck-hidden',_0x2ccd66=>!_0x2ccd66)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x1cd682,_0x231066){const _0x58dd4a=new _0x445947(this['locale']);return _0x58dd4a['set']({'label':_0x1cd682,'class':_0x231066||'','isVisible':!0x0,'withText':!0x0}),_0x58dd4a;}}class Y extends _0x219631{['contentFieldView'];['copyButtonView'];constructor(_0x560d11,_0x48f9bb=''){super(_0x560d11),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x46672d=this['bindTemplate'];this['contentFieldView']=new At(_0x560d11,_0x48f9bb),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x46672d['if']('isVisible','ck-hidden',_0x4de0c9=>!_0x4de0c9)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x46672d['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 _0x27bbbe=!0x1;this['on']('change:value',(_0x355098,_0x55f726,_0x37e8e4)=>{const _0x5bb3e9=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x37e8e4),this['isProcessing']&&_0x5bb3e9&&!_0x27bbbe&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x24266c,_0x2f631d,_0x3b9058)=>{_0x27bbbe=!0x1,_0x3b9058?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x27bbbe=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x27bbbe=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x35a3d2=this['locale'],_0x365381=new _0x445947(this['locale']),_0x3de0ca='ck-ai-form__copy-button';return _0x365381['set']({'label':i(_0x35a3d2,'Copy'),'icon':_0x49ca06,'class':_0x3de0ca,'tooltip':!0x0}),_0x365381['bind']('isVisible')['to'](this,'value',_0x523174=>!!_0x523174),_0x365381['bind']('isEnabled')['to'](this,'isProcessing',_0x4bb6e4=>!_0x4bb6e4),_0x365381['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x365381['icon']=_0x2201d3,_0x365381['class']=_0x3de0ca+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x365381['icon']=_0x49ca06,_0x365381['class']=_0x3de0ca;},0x3e8);}),_0x365381;}['_copyHTMLToClipboard'](_0x367a63){const {window:_0xab4e1a,document:_0x59cab2}=_0x2dd121;if(_0xab4e1a['ClipboardItem']){const {Blob:_0x3331f5,ClipboardItem:_0x1232d0}=_0xab4e1a,_0x3217fa=[new _0x1232d0({'text/html':new _0x3331f5([_0x367a63['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3331f5([_0x367a63['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x3217fa);}else{const _0xd235b3=_0x59cab2['createElement']('div');_0xd235b3['style']['position']='absolute',_0xd235b3['style']['left']='-9999px',_0xd235b3['innerHTML']='<span>[</span>'+_0x367a63['innerHTML']+'<span>]</span>',_0x59cab2['body']['appendChild'](_0xd235b3);const _0x62c4af=_0x59cab2['createRange']();_0x62c4af['setStartAfter'](_0xd235b3['firstElementChild']),_0x62c4af['setEndBefore'](_0xd235b3['lastElementChild']);const _0x7b1ccd=_0xab4e1a['getSelection']();_0x7b1ccd['removeAllRanges'](),_0x7b1ccd['addRange'](_0x62c4af),_0x59cab2['execCommand']('copy'),_0xd235b3['remove']();}}}class At extends _0x219631{constructor(_0x499f03,_0x127a9b=''){super(_0x499f03),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x127a9b,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3cf1c5){this['element']['innerHTML']=_0x3cf1c5;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x455500=new _0x219631(),_0x32fb19=this['locale'],_0x4b7bbc=new _0x4e1106();return _0x4b7bbc['isVisible']=!0x0,_0x455500['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x4b7bbc,{'text':i(_0x32fb19,'AI\x20is\x20writing...')}]}),_0x455500['render'](),_0x455500;}}class st extends _0x219631{constructor(_0x389ff0,_0x4bb9b9=''){super(_0x389ff0);const _0x33fdd4=new rt(),_0x432aaf=this['bindTemplate'];this['set']('text',_0x4bb9b9),_0x33fdd4['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x33fdd4,{'text':_0x432aaf['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x3a489d,_0x35c6e7){super(_0x3a489d,_0x35c6e7),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',(_0xbb72a8,_0x1a2bec)=>{_0xbb72a8['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1a2bec());});}['_createSubmitButton'](){const _0x266af0=new _0x445947(this['locale']),_0x127718=this['locale'];return _0x266af0['set']({'icon':ht,'label':i(_0x127718,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x266af0['on']('execute',()=>{this['submit']();}),_0x266af0['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x196ba4,_0xa7c2fe)=>!_0x196ba4&&_0xa7c2fe),_0x266af0;}['_createShowHistoryButton'](){const _0x3b1d48=new _0x445947(this['locale']),_0xd60b71=this['resultsView'],_0x334d46=this['locale'];_0x3b1d48['set']({'label':i(_0x334d46,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x3b1d48['bind']('isOn')['to'](_0xd60b71,'isVisible'),_0x3b1d48['bind']('isEnabled')['to'](this,'isEnabled'),_0x3b1d48['on']('execute',()=>{_0xd60b71['isVisible']=!_0xd60b71['isVisible'],_0xd60b71['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x294cea=()=>{_0x2dd121['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x57bca4=new it(this['queryView']['fieldView']['element']),_0x7ee7ce=_0x57bca4['width'],_0x4dc800='rtl'===_0x334d46['uiLanguageDirection']?'left':'right';_0x57bca4['excludeScrollbarsAndBorders'](),_0x3b1d48['element']['style'][_0x4dc800]=_0x7ee7ce-_0x57bca4['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x294cea),this['on']('render',_0x294cea),_0x3b1d48;}['submit'](){const _0x4a2dce=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x4a2dce);}['focus'](_0x3cfc4f){-0x1===_0x3cfc4f?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x188370){super(_0x188370),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x188370,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x779a83=0x0;for(const _0x87f3b0 of this['items'])_0x779a83+=_0x87f3b0['items']['length'];return{'resultsCount':_0x779a83,'totalItemsCount':_0x779a83};}['_createClearHistoryButton'](){const _0x54b42c=this['locale'],_0x3d47d4=new _0x445947(this['locale']);return _0x3d47d4['set']({'label':'('+i(_0x54b42c,'Clear')+')','withText':!0x0}),_0x3d47d4['on']('execute',()=>this['fire']('clearHistory')),_0x3d47d4;}}class bt extends xt{constructor(_0x4e07b1){super();const _0x2a8e7a=new kt(),_0x3cb625=new _0x445947(this['locale'],_0x2a8e7a);this['children']['add'](_0x3cb625),_0x3cb625['set']({'label':_0x4e07b1['prompt'],'withText':!0x0}),_0x3cb625['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x4e07b1['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x184f2a{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1290b8,_0xa0573b)=>{const _0x3bdb08=os(_0xa0573b['prompt']);for(const _0x1eb0ca of this)if(_0x1eb0ca!=_0xa0573b&&os(_0x1eb0ca['prompt'])===_0x3bdb08){this['remove'](_0x1eb0ca);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0xad285e=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0xad285e));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x27c7b2=>_0x27c7b2)));}}function os(_0x3497b1){return _0x3497b1['toLowerCase']()['trim']();}class _ extends _0x219631{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2891f0,_0x1006e4,_0x3d5698=''){super(_0x2891f0),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new wt(),this['errorView']=new st(_0x2891f0),this['contentArea']=new Y(_0x2891f0,_0x3d5698),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 mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'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 _0x458f97=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x1006e4],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x458f97['if']('isError','ck-hidden',_0x3988ff=>!_0x3988ff)]},'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'](_0x8f3d3e=0x1){-0x1===_0x8f3d3e?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 _0x286155=this['locale'],_0x210408=new ct(_0x286155,{'queryView':{'label':i(_0x286155,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x286155,'Empty\x20history'),'secondary':i(_0x286155,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x210408['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x595bb6,_0x3ebe47)=>_0x595bb6&&!_0x3ebe47),this['listenTo'](_0x210408,'submit',(_0x3c9824,_0x2456e4)=>{this['prompt']=_0x2456e4;const _0x30c0e2=yt(_0x2456e4);this['fire']('submitPrompt',_0x30c0e2),_0x2456e4['trim']()&&this['_promptHistory']['add']({'prompt':_0x30c0e2},0x0);},{'priority':'high'}),_0x210408;}['_createHistoryView'](){const _0x5c2f4b=new ft(this['locale']);return _0x5c2f4b['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x5c2f4b['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x5c2f4b;}['_createToolbar'](){const _0xebcad9=new lt(this['locale']);return _0xebcad9['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xdacdff,_0x4353b0,_0x3c5eba)=>_0xdacdff&&!_0x4353b0&&!!_0x3c5eba),_0xebcad9['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0xebcad9['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xd02845,_0x299eaf,_0x5983d9)=>_0xd02845&&!_0x299eaf&&!!_0x5983d9),_0xebcad9['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0xebcad9['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x350258,_0x1e0149)=>_0x350258&&!_0x1e0149),_0xebcad9['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0xebcad9['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0xebcad9['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0xebcad9;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2e970d=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x2e970d,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2f7374){const _0x55be24=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2f7374||i(_0x55be24,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x2ff2b4{['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[_0x4d799e,a,E,_0x1df39b];}constructor(_0x2d4d40){super(_0x2d4d40),_0x2d4d40['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2d4d40['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2d4d40['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2d4d40['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x2ee771}=this;this['_aiAdapter']=_0x2ee771['plugins']['get'](E),this['_dialog']=_0x2ee771['plugins']['get'](_0x1df39b),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0xbf76c0=new j(_0x2ee771,Array['from'](this['_commandDefinitions']['values']()));_0x2ee771['commands']['add']('showAIAssistant',_0xbf76c0),_0x2ee771['ui']['componentFactory']['add']('aiCommands',_0x4e65c9=>{const _0x2759fe=_0x5dcd82(_0x4e65c9);return _0x2759fe['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x2759fe['buttonView']['set']({'label':i(_0x4e65c9,'AI\x20Commands'),'icon':_0x3fe608,'tooltip':!0x0}),_0x2759fe['on']('execute',_0x47872c=>this['_onExecute'](_0x47872c['source']['id'])),_0x2a483d(_0x2759fe,_0x2ee771['ui']['view']['body'],function(_0x357f3a){const _0x2fff32=o(_0x357f3a['config']['get']('ai.aiAssistant.commands'),_0x357f3a['locale']),_0x5ee47b=U(_0x357f3a,_0x2fff32)['filter'](_0x3c208e=>_0x3c208e['commands']['length']);if(0x1===_0x5ee47b['length'])return U(_0x357f3a,_0x5ee47b[0x0]['commands'])['map'](_0x3585c7=>({'id':_0x3585c7['id'],'label':_0x3585c7['label']}));return _0x5ee47b['map'](_0x8ac7f0=>{const {groupId:_0x28a4e0,groupLabel:_0x125c22,commands:_0x2e88cd}=_0x8ac7f0,_0x305c66=U(_0x357f3a,_0x2e88cd)['map'](_0x1a55aa=>({'id':_0x1a55aa['id'],'label':_0x1a55aa['label']}));return{'id':_0x28a4e0,'menu':_0x125c22||_0x28a4e0,'children':_0x305c66};});}(_0x2ee771),{'ariaLabel':i(_0x4e65c9,'AI\x20Commands')}),_0x2759fe['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0xbf76c0['on']('change:enabledCommandsIds',_0x1eebd0),_0x2759fe['menuView']['once']('render',_0x1eebd0),_0x2759fe;function _0x1eebd0(){_0x2759fe['isEnabled']=_0xbf76c0['enabledCommandsIds']['length']>0x0;for(const _0x334528 of _0x2759fe['menuView']['buttons'])_0x334528['isEnabled']=_0xbf76c0['enabledCommandsIds']['includes'](_0x334528['id']);}}),_0x2ee771['ui']['componentFactory']['add']('menuBar:aiCommands',_0x172b3b=>{const _0x332c73=new _0x1c02be(_0x172b3b);_0x332c73['buttonView']['set']({'label':i(_0x172b3b,'AI\x20Commands'),'icon':_0x3fe608}),_0x332c73['bind']('isEnabled')['to'](_0xbf76c0,'enabledCommandsIds',_0x13042f=>_0x13042f['length']>0x0);const _0x48a9cf=o(_0x2ee771['config']['get']('ai.aiAssistant.commands'),_0x172b3b);return this['_populateMenuBarMenu'](_0xbf76c0,_0x332c73,_0x48a9cf,_0x1a7f15=>this['_onExecute'](_0x1a7f15)),_0x332c73;}),_0x2ee771['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1c6b49=this['_createAIAssistantUIButton'](_0x445947);return _0x1c6b49['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1c6b49;}),_0x2ee771['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x5c51a9=this['_createAIAssistantUIButton'](_0x2d66ee);return _0x5c51a9['set']({'role':'menuitemcheckbox'}),_0x5c51a9;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x5ba2a3=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x30d14b;for(const _0x261e09 in _0x5ba2a3){const _0x59e941=_0x261e09,_0x41ffa1=_0x5ba2a3[_0x59e941];if('aiLicenseKeyValid'==_0x41ffa1||'aiLicenseKeyInvalid'==_0x41ffa1||'aiLicenseKeyExpired'==_0x41ffa1||'aiLicenseKeyDomainLimit'==_0x41ffa1||'aiLicenseKeyNotAllowed'==_0x41ffa1||'aiLicenseKeyEvaluationLimit'==_0x41ffa1||'aiLicenseKeyTrialLimit'==_0x41ffa1||'aiLicenseKeyUsageLimit'==_0x41ffa1){delete _0x5ba2a3[_0x59e941],_0x30d14b=_0x41ffa1,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x30d14b&&_0x5ba2a3['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x30d14b&&_0x5ba2a3['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x30d14b&&_0x5ba2a3['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x30d14b&&_0x5ba2a3['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x30d14b&&_0x5ba2a3['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x30d14b&&_0x5ba2a3['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x30d14b&&_0x5ba2a3['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x5f7264='',_0x519d83='',_0x194c47='custom'){const _0xe14440=this['editor'],_0x5413fb=_0xe14440['editing']['view'],_0x839a3=_0xe14440['plugins']['get'](a),_0x5beff1=_0xe14440['plugins']['get'](_0x4d799e);_0x839a3['showFakeVisualSelection']();const _0x21f822=new w(),_0x3af1f0=new ClipboardEvent('copy',{'clipboardData':_0x21f822}),_0x3051c8=new _0xcf33dd(_0x21f822),_0x26253c=new _0x41600e(_0x5413fb,_0x3af1f0,{'dataTransfer':_0x3051c8});_0x5beff1['_forceMarkersCopy']('comment',()=>{_0x5413fb['document']['fire']('copy',_0x26253c);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0xe14440,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x4c1ac7=_0x3051c8['getData']('text/html');const _0x19cc8e=_0xe14440['model']['document']['selection'],_0x4263a1=Array['from'](_0x19cc8e['getRanges']());0x1===_0x4263a1['length']&&_0x4263a1[0x0]['isFlat']&&!_0x19cc8e['getSelectedElement']()&&''!==_0x4c1ac7['replace'](/&nbsp;/g,'')['trim']()&&(_0x4c1ac7='<p>'+_0x4c1ac7+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x194c47,'query':_0x5f7264,'htmlContent':_0x4c1ac7,'label':_0x519d83,'mainActionLabel':M[_0xe14440['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x2e8dc7,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x4d9161['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x839a3['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x1c193e=new Map(),_0x240994=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x3c3d89 of _0x240994)for(const _0x35a7ae of _0x3c3d89['commands'])_0x1c193e['set'](_0x35a7ae['id'],{..._0x35a7ae,'groupId':_0x3c3d89['groupId'],'groupLabel':_0x3c3d89['groupLabel']||_0x3c3d89['groupId']});return _0x1c193e;}['_createAIAssistantUIButton'](_0x18ebb1){const _0x354bc1=this['editor'],_0x1a45e1=_0x354bc1['commands']['get']('showAIAssistant'),_0x1ae094=new _0x18ebb1(_0x354bc1['locale']);return _0x1ae094['set']({'label':i(_0x354bc1['locale'],'AI\x20Assistant'),'icon':_0x2e8dc7,'isToggleable':!0x0}),_0x1ae094['bind']('isEnabled')['to'](_0x1a45e1),_0x1ae094['bind']('isOn')['to'](this['_dialog'],'id',_0x54d361=>'aiAssistant'===_0x54d361),this['listenTo'](_0x1ae094,'execute',()=>{_0x1ae094['isOn']?this['hideUI']():_0x1a45e1['execute']();}),_0x1ae094;}['_initView'](){const _0x586c62=this['editor']['plugins']['get'](a);this['_formView']=new _(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',()=>{_0x586c62['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x586c62['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x48ace3,ui:{ariaLiveAnnouncer:_0x58a548}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x410a7c,_0x485357,_0x4b89f4)=>{const _0x29a381=this['_aiAssistantController']['currentContext'];_0x4b89f4?_0x58a548['announce'](i(_0x48ace3,'AI\x20is\x20writing')):_0x29a381&&_0x58a548['announce'](i(_0x48ace3,'Generated\x20content:\x20%0',_0x29a381),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x43cb27,_0x27b25b,_0x483cf5)=>{if(_0x483cf5){const _0x2b4c3f=this['_formView']['errorView']['text'];_0x58a548['announce'](i(_0x48ace3,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2b4c3f));}});}['_onExecute'](_0x3c9c84){const _0x2535f9=this['_commandDefinitions']['get'](_0x3c9c84),_0x37866c=this['editor'],_0x5b5624=_0x37866c['model']['document']['selection'],_0x195c91=_0x37866c['commands']['get']('showAIAssistant'),_0x13492b=_0x37866c['plugins']['get'](a),_0xf9845e=''+(_0x2535f9['groupId']!==x?_0x2535f9['groupLabel']+':\x20':'')+_0x2535f9['label'];if(!0x1!==_0x2535f9['requiresContent']&&_0x5b5624['isCollapsed']){const _0x28c7a6=_0x19c61a(_0x5b5624['getSelectedBlocks']())||_0x37866c['model']['schema']['getLimitElement'](_0x5b5624);_0x37866c['model']['change'](_0x173ee1=>{_0x173ee1['setSelection'](_0x28c7a6,'in');});}_0x13492b['showFakeVisualSelection'](),_0x195c91['execute'](_0x2535f9['prompt'],_0xf9845e,'command:'+_0x3c9c84);}['_populateMenuBarMenu'](_0x47ae76,_0x5f4549,_0x5e32df,_0x1b7ef0){const _0x19be46=this['editor'],_0x406c73=_0x19be46['locale'],_0x487da3=new _0x1aca70(_0x406c73),_0x48dbe2=U(_0x19be46,_0x5e32df)['filter'](_0x229ced=>_0x229ced['commands']['length']);0x1===_0x48dbe2['length']?this['_getMenuBarGroupButtons']({'command':_0x47ae76,'commands':_0x48dbe2[0x0]['commands'],'parentMenuView':_0x5f4549,'onExecute':_0x1b7ef0})['forEach'](_0x1df06a=>_0x487da3['items']['add'](_0x1df06a)):_0x48dbe2['forEach'](({groupId:_0x3a8c68,groupLabel:_0x26210c,commands:_0x31f3c1})=>{const _0x50d2f5=new _0x275a7d(_0x406c73,_0x5f4549),_0x84132a=new _0x1c02be(_0x406c73),_0x537e2f=new _0x1aca70(_0x406c73),_0x42fd7a=this['_getMenuBarGroupButtons']({'command':_0x47ae76,'commands':_0x31f3c1,'parentMenuView':_0x84132a,'onExecute':_0x1b7ef0});_0x84132a['buttonView']['set']({'label':_0x26210c||_0x3a8c68}),_0x84132a['delegate']('execute')['to'](_0x5f4549),_0x537e2f['items']['addMany'](_0x42fd7a),_0x84132a['panelView']['children']['add'](_0x537e2f),_0x50d2f5['children']['add'](_0x84132a),_0x487da3['items']['add'](_0x50d2f5);}),_0x5f4549['panelView']['children']['add'](_0x487da3);}['_getMenuBarGroupButtons']({command:_0x4bb62a,commands:_0x56bff2,parentMenuView:_0x267dbd,onExecute:_0x503ae4}){const _0x586d8b=this['editor'],_0x44f74b=_0x586d8b['locale'];return U(_0x586d8b,_0x56bff2)['map'](_0x5a802b=>{const _0xd0cc81=new _0x275a7d(_0x44f74b,_0x267dbd),_0xfe6a55=new _0x2d66ee(_0x44f74b);return _0xfe6a55['set']({'label':_0x5a802b['label']}),_0xfe6a55['delegate']('execute')['to'](_0x267dbd),_0xfe6a55['on']('execute',()=>_0x503ae4(_0x5a802b['id'])),_0xfe6a55['bind']('isEnabled')['to'](_0x4bb62a,'enabledCommandsIds',_0x411351=>_0x411351['includes'](_0x5a802b['id'])),_0xd0cc81['children']['add'](_0xfe6a55),_0xd0cc81;});}}function B(_0x37df9d,_0x6a8f91){return void 0x0!==_0x37df9d['order']&&void 0x0===_0x6a8f91['order']?0x1:void 0x0===_0x37df9d['order']&&void 0x0!==_0x6a8f91['order']?-0x1:void 0x0!==_0x37df9d['order']&&void 0x0!==_0x6a8f91['order']?_0x37df9d['order']-_0x6a8f91['order']:0x0;}function U(_0x37ba4d,_0x415d69){_0x415d69['sort'](B);const _0x74e70b={},_0x5dfe2c=[];for(const _0x34bb80 of _0x415d69)if(void 0x0!==_0x34bb80['order']){if(_0x34bb80['order']in _0x74e70b)throw new _0x286c33('ai-commands-config-order-collision',_0x37ba4d,{'conflictingDefinitions':[_0x34bb80,_0x74e70b[_0x34bb80['order']]]});_0x74e70b[_0x34bb80['order']]=_0x34bb80,_0x5dfe2c['splice'](_0x34bb80['order'],0x0,_0x34bb80);}else _0x5dfe2c['push'](_0x34bb80);return _0x5dfe2c;}class r extends _0x2ff2b4{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x34d1b1){super(_0x34d1b1);const _0x3482d3=_0x34d1b1['config'],_0x5011cd=_0x34d1b1['locale'];_0x3482d3['define']('ai.aiAssistant.preserveComments',!0x0),_0x3482d3['define']('ai.aiAssistant.commands',function(_0x110010){return[{'groupId':'editOrReview','groupLabel':i(_0x110010,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x110010,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x110010,'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(_0x110010,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x110010,'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(_0x110010,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x110010,'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(_0x110010,'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(_0x110010,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x110010,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x110010,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x110010,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x110010,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x110010,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x110010,'Change\x20style'),'commands':[{'id':'business','label':i(_0x110010,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x110010,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x110010,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x110010,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x110010,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x110010,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x110010,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x110010,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x110010,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x110010,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x110010,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x110010,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x110010,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x5011cd)),_0x3482d3['define']('ai.aiAssistant.extraCommandGroups',[]),_0x3482d3['define']('ai.aiAssistant.removeCommands',[]);let _0x4e7084=o(_0x3482d3['get']('ai.aiAssistant.commands'),_0x5011cd);const _0x541abb=_0x3482d3['get']('ai.aiAssistant.extraCommandGroups'),_0x4b4dbc=_0x3482d3['get']('ai.aiAssistant.removeCommands');_0x541abb['forEach'](_0x573bf9=>{const _0x5b57f1=_0x4e7084['find'](_0x5b177c=>_0x5b177c['groupId']===_0x573bf9['groupId']);_0x5b57f1?_0x5b57f1['commands']=_0x5b57f1['commands']['concat'](_0x573bf9['commands']):_0x4e7084['push'](_0x573bf9);}),_0x4e7084=_0x4e7084['filter'](_0x43e8c3=>!_0x4b4dbc['includes'](_0x43e8c3['groupId'])),_0x4e7084['forEach'](_0x408878=>{_0x408878['commands']=_0x408878['commands']['filter'](_0x1db6b0=>!_0x4b4dbc['includes'](_0x1db6b0['id']));}),_0x3482d3['set']('ai.aiAssistant.commands',_0x4e7084);}}class P extends _0x2ff2b4{['abortController'];static get['requires'](){return[E];}constructor(_0x1ef8be){super(_0x1ef8be),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x2a0d27){return this['sendRequest'](_0x2a0d27)['catch'](_0x18ffca=>{if(_0x18ffca instanceof R)return Promise['reject'](_0x18ffca);if('AbortError'==_0x18ffca['name'])return Promise['resolve']();throw console['error'](_0x18ffca),new _0x286c33('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x5402b7,_0x1f3387){const _0x4d9994=this['editor']['locale'],_0x2a08ac={'Content-Type':'application/json'};if('object'==typeof _0x5402b7)Object['assign'](_0x2a08ac,_0x5402b7);else{if(_0x5402b7)try{const _0x54323a=await _0x5402b7(_0x1f3387);Object['assign'](_0x2a08ac,_0x54323a);}catch{return Promise['reject'](new R(i(_0x4d9994,'AI_ERROR_GET_HEADERS')));}}return _0x2a08ac;}async['_prepareRequestParameters'](_0x31b14b,_0x43805c){const _0x4c7821=this['editor']['locale'];if('object'==typeof _0x31b14b)return _0x31b14b;try{return await _0x31b14b(_0x43805c);}catch{return Promise['reject'](new R(i(_0x4c7821,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x2d0bb9){super(_0x2d0bb9),_0x2d0bb9['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x2d0bb9['config']['get']('ai.openAI.requestParameters')||_0x2d0bb9['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x2d0bb9['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x2d0bb9['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x2d0bb9['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x44a866,context:_0x2a1d8c,onData:_0x23b7de,actionId:_0x3e8613}){const _0x573cfc=this['editor']['locale'],_0x258895=await this['prepareMessages'](_0x44a866,_0x2a1d8c,_0x3e8613),_0x3b47a8=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3e8613),_0x56adf9=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3e8613),_0x1c34ea={'messages':_0x258895,..._0x56adf9},_0x1360da={'method':'POST','headers':_0x3b47a8,'body':JSON['stringify'](_0x1c34ea),'signal':this['abortController']['signal']},_0x232f53=await fetch(this['_apiUrl'],_0x1360da);if(_0x232f53['ok'])return _0x56adf9['stream']?await this['_readStreamableResponse'](_0x232f53,_0x23b7de):await this['_readStaticResponse'](_0x232f53,_0x23b7de),Promise['resolve']();{const _0xf6e796=await _0x232f53['text']();return _0xf6e796['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x573cfc,'AI_ERROR_CONTEXT_LENGTH'))):_0xf6e796['includes']('Moderation')?Promise['reject'](new R(i(_0x573cfc,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0xf6e796));}}async['prepareMessages'](_0x526a46,_0xd05fb8,_0x523e22){let _0x2afd74,_0x3db109;return _0xd05fb8?(_0x2afd74='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.',_0x3db109='Instruction:\x0a'+_0x526a46+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xd05fb8):(_0x2afd74='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.',_0x3db109=_0x526a46),[{'role':'system','content':_0x2afd74},{'role':'user','content':_0x3db109}];}async['_readStreamableResponse'](_0x1b09ac,_0x5c5117){const _0x5c08ce=_0x1b09ac['body']['getReader'](),_0x183817=new TextDecoder();let _0x5173fd='',_0x5ae102='',_0x3f1731='',_0x4a9e18=!0x1;for(;!_0x4a9e18;){const {done:_0x11baa5,value:_0x5dfc48}=await _0x5c08ce['read'](),_0x3f262e=_0x5173fd+_0x183817['decode'](_0x5dfc48);let _0x4f91ba='';_0x4a9e18=_0x11baa5;try{_0x4f91ba=this['_cleanUpData'](_0x3f262e),_0x5173fd='';}catch{_0x5173fd=_0x3f262e;continue;}_0x5ae102+=_0x4f91ba,!_0x4a9e18&&this['_isBufferIncomplete'](_0x5ae102)||_0x5ae102&&(_0x3f1731+=_0x5ae102,_0x5ae102='',_0x5c5117(_0x3f1731));}return Promise['resolve']();}async['_readStaticResponse'](_0x296e02,_0x1b9822){return _0x1b9822((await _0x296e02['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x3f55b4){const _0x2c82d4=_0x3f55b4['split']('<')['length']!==_0x3f55b4['split']('>')['length'],_0x1352f6=_0x3f55b4['length']<0x1e;return _0x2c82d4&&_0x1352f6;}['_cleanUpData'](_0x466ff1){return _0x466ff1['split'](/\n(?![^{]*\})/g)['map'](_0x57c8ff=>_0x57c8ff['replace']('data:\x20',''))['filter'](_0x3c12bb=>_0x3c12bb&&_0x3c12bb['length']>0x0&&'[DONE]'!==_0x3c12bb)['map'](_0x530018=>{const {choices:_0x78458f}=JSON['parse'](_0x530018);if(_0x78458f[0x0]?.['delta']?.['content'])return _0x78458f[0x0]['delta']['content'];})['filter'](_0x4faffb=>_0x4faffb)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x40bbed){super(_0x40bbed),_0x40bbed['config']['get']('ai.aws.requestParameters')||_0x40bbed['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']=_0x40bbed['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x40bbed['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x40bbed['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x40bbed['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x4490cd,context:_0x505529,onData:_0x3ed0db,actionId:_0x58bc8f}){const {model:_0x3e900b,stream:_0x5055fe,..._0x331e0b}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x58bc8f),_0x426f02={'prompt':await this['preparePrompt'](_0x4490cd,_0x505529,_0x3e900b,_0x58bc8f),..._0x331e0b};this['_apiUrl']?await this['_processProxyRequest'](_0x426f02,_0x3e900b,_0x5055fe,_0x3ed0db,_0x58bc8f):await this['_processAWSRequest'](_0x426f02,_0x3e900b,_0x5055fe,_0x3ed0db);}async['preparePrompt'](_0x588a14,_0x26aa49,_0x507183,_0x409269){let _0x453051,_0x588db8;return _0x26aa49?(_0x453051='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.',_0x588db8='Instruction:\x0a'+_0x588a14+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x26aa49):(_0x453051='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.',_0x588db8=_0x588a14),'meta.llama'==this['getModelFamily'](_0x507183)?'<<SYS>>\x0a'+_0x453051+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x588db8+'\x0a[/INST]':'Human:\x0a'+_0x453051+'\x0a'+_0x588db8+'\x0a\x0aAssistant:';}['getModelFamily'](_0x1ee57a){if(/^anthropic\.claude/['test'](_0x1ee57a))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x1ee57a))return'ai21.j2';if(/^cohere\.command/['test'](_0x1ee57a))return'cohere.command';if(/^meta\.llama/['test'](_0x1ee57a))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x1ee57a));}async['_processProxyRequest'](_0x26cf86,_0x24d355,_0xd9ef55,_0x49ff62,_0x2ecd74){const _0x8b9777={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2ecd74),'body':JSON['stringify']({..._0x26cf86,'model':_0x24d355,'stream':_0xd9ef55}),'signal':this['abortController']['signal']},_0x341608=await fetch(this['_apiUrl'],_0x8b9777);_0xd9ef55?await this['_readStreamableResponse'](_0x341608,_0x24d355,_0x49ff62):await this['_readStaticResponse'](_0x341608,_0x24d355,_0x49ff62);}async['_processAWSRequest'](_0x2d90f9,_0x198576,_0x43ff0e,_0x372aab){const _0x29baf4=new _0x814e00(this['_bedrockClientConfig']),_0x2c6b4e={'body':JSON['stringify'](_0x2d90f9),'contentType':'application/json','accept':'application/json','modelId':_0x198576};let _0xe62e9b;if(_0x43ff0e){const _0x1af5ea=new _0x266f1d(_0x2c6b4e);_0xe62e9b=await _0x29baf4['send'](_0x1af5ea,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0xe62e9b,_0x198576,_0x372aab);}else{const _0x5c4862=new _0x139fab(_0x2c6b4e);_0xe62e9b=await _0x29baf4['send'](_0x5c4862,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0xe62e9b,_0x198576,_0x372aab);}}async['_readAsyncIterableResponse'](_0x2a2e5f,_0x522caa,_0x2baa63){const _0x6a6890=_0x2a2e5f['body'],_0x109daa=new TextDecoder('utf-8');let _0x1dd71b='';for await(const _0x15e5fa of _0x6a6890)if(_0x15e5fa['chunk']){const _0xe0356c=_0x109daa['decode'](_0x15e5fa['chunk']['bytes']),_0x191eb4=JSON['parse'](_0xe0356c);_0x1dd71b+=this['_getGeneratedText'](_0x191eb4,_0x522caa),_0x2baa63(_0x1dd71b);}return Promise['resolve']();}async['_readStreamableResponse'](_0x428718,_0x10e656,_0x3dd814){const _0x4cbabf=_0x428718['body'],_0xc512a4=new TextDecoder('utf-8'),_0x197cf0=_0x4cbabf['getReader']();let _0x43ac03='',_0x4b4828='',_0x5ed196=!0x1;for(;!_0x5ed196;){const {done:_0x58cb3d,value:_0xe8cbd4}=await _0x197cf0['read']();if(_0x5ed196=_0x58cb3d,_0x5ed196)break;const _0x6dcd3c=(_0x43ac03+_0xc512a4['decode'](_0xe8cbd4))['split']('\x0a')['map'](_0x454a9d=>{try{return _0x43ac03='',JSON['parse'](_0x454a9d);}catch{return _0x43ac03=_0x454a9d,null;}})['filter'](_0x2c9c33=>null!==_0x2c9c33);_0x6dcd3c['length']&&(_0x4b4828+=_0x6dcd3c['map'](_0x2865f6=>this['_getGeneratedText'](_0x2865f6,_0x10e656))['join'](''),_0x3dd814(_0x4b4828));}return Promise['resolve']();}async['_readStaticResponse'](_0x49a328,_0x695371,_0x5144bd){let _0x57e412;return _0x57e412=_0x49a328 instanceof Response?await _0x49a328['json']():JSON['parse'](Buffer['from'](_0x49a328['body'])['toString']('utf8')),(_0x5144bd(this['_getGeneratedText'](_0x57e412,_0x695371)),Promise['resolve']());}['_getGeneratedText'](_0x4f2e6f,_0x3a91e8){switch(this['getModelFamily'](_0x3a91e8)){case'anthropic.claude':return _0x4f2e6f['completion'];case'ai21.j2':return _0x4f2e6f['completions'][0x0]['data']['text'];case'cohere.command':return _0x4f2e6f['generations'][0x0]['text'];case'meta.llama':return _0x4f2e6f['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O 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':_0x36ee48=>0x1!=_0x36ee48}};
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':_0x3bba63=>0x1!=_0x3bba63}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0xb048eb=>{const {af:{dictionary:_0x6d738f,getPluralForm:_0x1f5c09}}={'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':_0x38fb2b=>0x1!=_0x38fb2b}};_0xb048eb['af']||={'dictionary':{},'getPluralForm':null},_0xb048eb['af']['dictionary']=Object['assign'](_0xb048eb['af']['dictionary'],_0x6d738f),_0xb048eb['af']['getPluralForm']=_0x1f5c09;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x5cd9d3=>{const {af:{dictionary:_0x2b5c1d,getPluralForm:_0x4b66dc}}={'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':_0x369274=>0x1!=_0x369274}};_0x5cd9d3['af']||={'dictionary':{},'getPluralForm':null},_0x5cd9d3['af']['dictionary']=Object['assign'](_0x5cd9d3['af']['dictionary'],_0x2b5c1d),_0x5cd9d3['af']['getPluralForm']=_0x4b66dc;})(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':_0x21d8a5=>0x0==_0x21d8a5?0x0:0x1==_0x21d8a5?0x1:0x2==_0x21d8a5?0x2:_0x21d8a5%0x64>=0x3&&_0x21d8a5%0x64<=0xa?0x3:_0x21d8a5%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':_0x367b44=>0x0==_0x367b44?0x0:0x1==_0x367b44?0x1:0x2==_0x367b44?0x2:_0x367b44%0x64>=0x3&&_0x367b44%0x64<=0xa?0x3:_0x367b44%0x64>=0xb?0x4:0x5}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x267442=>{const {ar:{dictionary:_0x574688,getPluralForm:_0x55bb36}}={'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':_0x2a5e3b=>0x0==_0x2a5e3b?0x0:0x1==_0x2a5e3b?0x1:0x2==_0x2a5e3b?0x2:_0x2a5e3b%0x64>=0x3&&_0x2a5e3b%0x64<=0xa?0x3:_0x2a5e3b%0x64>=0xb?0x4:0x5}};_0x267442['ar']||={'dictionary':{},'getPluralForm':null},_0x267442['ar']['dictionary']=Object['assign'](_0x267442['ar']['dictionary'],_0x574688),_0x267442['ar']['getPluralForm']=_0x55bb36;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x3e9789=>{const {ar:{dictionary:_0x4690b6,getPluralForm:_0x163aa4}}={'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':_0x40227b=>0x0==_0x40227b?0x0:0x1==_0x40227b?0x1:0x2==_0x40227b?0x2:_0x40227b%0x64>=0x3&&_0x40227b%0x64<=0xa?0x3:_0x40227b%0x64>=0xb?0x4:0x5}};_0x3e9789['ar']||={'dictionary':{},'getPluralForm':null},_0x3e9789['ar']['dictionary']=Object['assign'](_0x3e9789['ar']['dictionary'],_0x4690b6),_0x3e9789['ar']['getPluralForm']=_0x163aa4;})(window['CKEDITOR_TRANSLATIONS']||={});