@ckeditor/ckeditor5-ai 46.0.1-alpha.7 → 46.0.1-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 _0x1617a6,Command as _0xe0e343}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x20ea68,IconCheck as _0x379a8f,IconError as _0x400fa8,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x210025,IconRobotPencil as _0x3299e0}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x112588,CKEditorError as _0x548dad,ObservableMixin as _0x311d6f,global as _0x35ebaa,isVisible as _0x5054eb,Rect as _0x3afaaf,Collection as _0x3b7b48,FocusTracker as et,KeystrokeHandler as rt,first as _0x2f0719}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x40fca2,View as _0x4872ad,SpinnerView as _0x10d9cc,IconView as _0x134634,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x10c096,createDropdown as _0x382851,addMenuToDropdown as _0x10f20f,MenuBarMenuView as _0x1b1be8,MenuBarMenuListItemButtonView as _0x566113,DialogViewPosition as _0x9fd004,MenuBarMenuListView as _0x1c0c57,MenuBarMenuListItemView as _0x1f5b3b}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x4f845f,ClipboardMarkersUtils as _0xc9fa17}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0xcb38d8,ViewDataTransfer as _0x455834,ViewUpcastWriter as _0x5f44b8,Matcher as _0x5d9045}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x560e78,InvokeModelWithResponseStreamCommand as _0x388d2e,InvokeModelCommand as _0x2943e2}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x834779,_0x1fa0df){const _0x52f1b6=(0x0,_0x1fa0df['t'])('Other');return _0x834779['length']?'groupId'in _0x834779[0x0]?_0x834779:[{'groupId':K,'groupLabel':_0x52f1b6,'order':0x1/0x0,'commands':_0x834779}]:[{'groupId':K,'groupLabel':_0x52f1b6,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x1617a6{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x29464b}=this,_0x3bed9f=['ck-fake-ai-selection'];_0x29464b['config']['get']('ai.useTheme')&&_0x3bed9f['push']('ck-ai-assistant-ui_theme'),_0x29464b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x3bed9f,'priority':0xc}}),_0x29464b['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x546443,{writer:_0x4d79f2})=>{if(!_0x546443['markerRange']['isCollapsed'])return null;const _0x1a6b15=_0x4d79f2['createUIElement']('span');return _0x4d79f2['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1a6b15),_0x1a6b15;}});}['afterInit'](){!async function(_0x250dff){const _0x428523=_0x25993f([0x30,0x56,0x6f,0x46,0x50,0x58,0x67,0x35,0x6c,0x57,0x76,0x52,0x34,0x79,0x37,0x62,0x42,0x32,0x73,0x4e,0x33,0x5a,0x77,0x64,0x36,0x4f,0x43,0x70,0x31,0x4a,0x71,0x7a,0x69,0x53,0x74,0x61,0x51,0x4b,0x44,0x59,0x47,0x4c,0x54,0x49,0x6a,0x38,0x78,0x63,0x72,0x68,0x41,0x65,0x48,0x66,0x75,0x6b,0x45,0x55,0x4d,0x6d,0x6e,0x39]),_0x16205b=0xdd99ff3,_0x18eb3b=0xddef06b^_0x16205b,_0x227b57=window[_0x25993f([0x44,0x61,0x74,0x65])][_0x25993f([0x6e,0x6f,0x77])](),_0x4ea4dc=_0x250dff[_0x25993f([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x260fea=new window[(_0x25993f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4d2bf8=>{_0x4ea4dc[_0x25993f([0x6f,0x6e,0x63,0x65])](_0x25993f([0x72,0x65,0x61,0x64,0x79]),_0x4d2bf8);}),_0x5796e3={[_0x25993f([0x6b,0x74,0x79])]:_0x25993f([0x45,0x43]),[_0x25993f([0x75,0x73,0x65])]:_0x25993f([0x73,0x69,0x67]),[_0x25993f([0x63,0x72,0x76])]:_0x25993f([0x50,0x2d,0x32,0x35,0x36]),[_0x25993f([0x78])]:_0x25993f([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]),[_0x25993f([0x79])]:_0x25993f([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]),[_0x25993f([0x61,0x6c,0x67])]:_0x25993f([0x45,0x53,0x32,0x35,0x36])},_0x1f68b5=_0x4ea4dc[_0x25993f([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x25993f([0x67,0x65,0x74])](_0x25993f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x540a90(){let _0x472959,_0x2bd627=null,_0x47621c=null;try{if(_0x1f68b5==_0x25993f([0x47,0x50,0x4c]))return _0x25993f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x472959=_0x3b2384(),!_0x472959)return _0x25993f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x472959[_0x25993f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x47621c=_0x1b2608(_0x472959[_0x25993f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x472959[_0x25993f([0x6a,0x74,0x69])])),await _0x24df74()?_0x379ec9()?_0x50dc7f()?_0x25993f([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x2ec636()?(_0x472959[_0x25993f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x25993f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x2bd627=_0x549177(_0x25993f([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x472959[_0x25993f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x25993f([0x74,0x72,0x69,0x61,0x6c])&&(_0x2bd627=_0x549177(_0x25993f([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x5f04de()):_0x25993f([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x25993f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x25993f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x25993f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x50dc7f(){const _0x3cfb0d=[_0x25993f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x25993f([0x74,0x72,0x69,0x61,0x6c])][_0x25993f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x472959[_0x25993f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x227b57/0x3e8:0xe10*_0x18eb3b;return _0x472959[_0x25993f([0x65,0x78,0x70])]<_0x3cfb0d;}function _0x379ec9(){const _0x3800d6=_0x472959[_0x25993f([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x3800d6&&(!!_0x3800d6[_0x25993f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x25993f([0x2a]))||!!_0x3800d6[_0x25993f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x25993f([0x41,0x49])));}function _0x2ec636(){const _0x15a70f=_0x472959[_0x25993f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x15a70f||0x0==_0x15a70f[_0x25993f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0xfd430b}=new URL(window[_0x25993f([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x15a70f[_0x25993f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xfd430b))return!0x0;const _0x4dec2b=_0xfd430b[_0x25993f([0x73,0x70,0x6c,0x69,0x74])](_0x25993f([0x2e]));return _0x15a70f[_0x25993f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xe0c675=>_0xe0c675[_0x25993f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x25993f([0x2a])))[_0x25993f([0x6d,0x61,0x70])](_0x390011=>_0x390011[_0x25993f([0x73,0x70,0x6c,0x69,0x74])](_0x25993f([0x2e])))[_0x25993f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xeb8120=>_0xeb8120[_0x25993f([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x4dec2b[_0x25993f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x25993f([0x6d,0x61,0x70])](_0x231661=>Array(_0x4dec2b[_0x25993f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x231661[_0x25993f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x25993f([0x66,0x69,0x6c,0x6c])](_0x231661[0x0]===_0x25993f([0x2a])?_0x25993f([0x2a]):'')[_0x25993f([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x231661))[_0x25993f([0x73,0x6f,0x6d,0x65])](_0x2cce6e=>_0x4dec2b[_0x25993f([0x65,0x76,0x65,0x72,0x79])]((_0x378b8e,_0x4ca555)=>_0x2cce6e[_0x4ca555]===_0x378b8e||_0x2cce6e[_0x4ca555]===_0x25993f([0x2a])));}function _0x5f04de(){return _0x2bd627&&_0x47621c?new window[(_0x25993f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x448597,_0x16e644)=>{_0x2bd627[_0x25993f([0x74,0x68,0x65,0x6e])](_0x448597,_0x16e644),_0x47621c[_0x25993f([0x74,0x68,0x65,0x6e])](_0x406581=>{_0x406581!=_0x25993f([0x56,0x61,0x6c,0x69,0x64])&&_0x448597(_0x406581);},_0x16e644);}):_0x2bd627||_0x47621c||_0x25993f([0x56,0x61,0x6c,0x69,0x64]);}}function _0x1b2608(_0xed05a,_0x16cf3a){return new window[(_0x25993f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x42a10d=>{if(_0x33e33a())return _0x42a10d(_0x25993f([0x56,0x61,0x6c,0x69,0x64]));_0x4babf2(),_0x4ea4dc[_0x25993f([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x25993f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x2dbfa9=!0x1;const _0x24fa10=_0x112588();function _0x1bd344(_0x488911){return!!_0x488911&&(typeof _0x488911===_0x25993f([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x488911===_0x25993f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x488911[_0x25993f([0x74,0x68,0x65,0x6e])]===_0x25993f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x488911[_0x25993f([0x63,0x61,0x74,0x63,0x68])]===_0x25993f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0xa037be(_0x2bca74){_0xd54bd2(_0x2bca74)[_0x25993f([0x74,0x68,0x65,0x6e])](_0x2fae73=>{if(!_0x2fae73||_0x2fae73[_0x25993f([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x25993f([0x6f,0x6b]))return _0x25993f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x540c8d(_0x4bf599(_0x24fa10+_0x16cf3a))!=_0x2fae73[_0x25993f([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x25993f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x25993f([0x56,0x61,0x6c,0x69,0x64]);})[_0x25993f([0x74,0x68,0x65,0x6e])](_0xecd08e=>(_0x24731b(),_0xecd08e),()=>{const _0x30be16=_0x37c385();return null==_0x30be16?(_0x24731b(),_0x25993f([0x56,0x61,0x6c,0x69,0x64])):_0x25993f(_0x227b57-_0x30be16>(0x29d51bf3^_0x16205b)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x25993f([0x74,0x68,0x65,0x6e])](_0x42a10d)[_0x25993f([0x63,0x61,0x74,0x63,0x68])](()=>{_0x42a10d(_0x25993f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xcbd03d=0xdef7173^_0x16205b;function _0x24731b(){const _0x4e4ba2=_0x25993f([0x6c,0x6c,0x63,0x74,0x2d])+_0x540c8d(_0x4bf599(_0xed05a)),_0x182630=_0x278c1d(_0x540c8d(window[_0x25993f([0x4d,0x61,0x74,0x68])][_0x25993f([0x63,0x65,0x69,0x6c])](_0x227b57/_0xcbd03d)));window[_0x25993f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x25993f([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4e4ba2,_0x182630);}function _0x37c385(){const _0x18abac=_0x25993f([0x6c,0x6c,0x63,0x74,0x2d])+_0x540c8d(_0x4bf599(_0xed05a)),_0x2cd60f=window[_0x25993f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x25993f([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x18abac);return _0x2cd60f?window[_0x25993f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x278c1d(_0x2cd60f),0x10)*_0xcbd03d:null;}function _0xd54bd2(_0x5676cf){return new window[(_0x25993f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x572e17,_0x4950a9)=>{_0x5676cf[_0x25993f([0x74,0x68,0x65,0x6e])](_0x572e17,_0x4950a9),window[_0x25993f([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4950a9,0xdd84b33^_0x16205b);});}}_0x4ea4dc[_0x25993f([0x6f,0x6e])](_0x25993f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x121702,_0x1f8d2c)=>{if(_0x1f8d2c[0x0]!=_0xed05a)return _0x42a10d(_0x25993f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x1f8d2c[0x1]={..._0x1f8d2c[0x1],[_0x25993f([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x24fa10};},{[_0x25993f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x25993f([0x68,0x69,0x67,0x68])}),_0x4ea4dc[_0x25993f([0x6f,0x6e])](_0x25993f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2a23b2=>{_0x1bd344(_0x2a23b2[_0x25993f([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x2dbfa9=!0x0,_0xa037be(_0x2a23b2[_0x25993f([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x25993f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x25993f([0x6c,0x6f,0x77])}),_0x260fea[_0x25993f([0x74,0x68,0x65,0x6e])](()=>{_0x2dbfa9||_0x42a10d(_0x25993f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x33e33a(){return _0x4ea4dc[_0x25993f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x25993f([0x76,0x69,0x65,0x77])][_0x25993f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x25993f([0x61,0x75,0x74,0x6f]);}function _0x4babf2(){_0x4ea4dc[_0x25993f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x25993f([0x76,0x69,0x65,0x77])][_0x25993f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x25993f([0x61,0x75,0x74,0x6f]);}}function _0x549177(_0x5f307c){const _0x140681=[new window[(_0x25993f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x51e93f=>setTimeout(_0x51e93f,0xdd0a13f^_0x16205b)),_0x260fea[_0x25993f([0x74,0x68,0x65,0x6e])](()=>new window[(_0x25993f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x435ead=>{let _0x4528cf=0x0;_0x4ea4dc[_0x25993f([0x6d,0x6f,0x64,0x65,0x6c])][_0x25993f([0x6f,0x6e])](_0x25993f([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x594445,_0xe753e1)=>{_0xe753e1[0x0][_0x25993f([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4528cf++,_0x4528cf==(0xdd99e0b^_0x16205b)&&(_0x435ead(),_0x594445[_0x25993f([0x6f,0x66,0x66])]());});}))];return window[_0x25993f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x25993f([0x72,0x61,0x63,0x65])](_0x140681)[_0x25993f([0x74,0x68,0x65,0x6e])](()=>_0x5f307c);}async function _0x1bf8c9(){await _0x260fea,_0x4ea4dc[_0x25993f([0x6d,0x6f,0x64,0x65,0x6c])][_0x25993f([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0xa83231,_0x4ea4dc[_0x25993f([0x6d,0x6f,0x64,0x65,0x6c])][_0x25993f([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0xa83231,_0x4ea4dc[_0x25993f([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x25993f([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x477e3e(_0x5eef08){const _0x56cd1a=_0xd9cd1b();_0x4ea4dc[_0x56cd1a]=_0x25993f([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x5eef08,_0x5eef08!=_0x25993f([0x56,0x61,0x6c,0x69,0x64])&&_0x1bf8c9();}function _0xd9cd1b(){const _0x1f6a01=window[_0x25993f([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x25993f([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x25993f([0x6e,0x6f,0x77])]())[_0x25993f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x25993f([0x2e]),'');let _0x5276ae=_0x25993f([0x56]);for(let _0x504a88=0x0;_0x504a88<_0x1f6a01[_0x25993f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x504a88+=0x2){let _0x1806a6=window[_0x25993f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1f6a01[_0x25993f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x504a88,_0x504a88+0x2));_0x1806a6>=_0x428523[_0x25993f([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1806a6-=_0x428523[_0x25993f([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x5276ae+=_0x428523[_0x1806a6];}return _0x5276ae;}function _0x3b2384(){const _0x1c3ea6=_0x1f68b5[_0x25993f([0x73,0x70,0x6c,0x69,0x74])](_0x25993f([0x2e]));if(0x3!=_0x1c3ea6[_0x25993f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x2d39e6(_0x1c3ea6[0x1]);function _0x2d39e6(_0x4f235c){const _0x225fee=_0x3ab407(_0x4f235c);return _0x225fee&&_0x1a1ba4()?_0x225fee:null;function _0x1a1ba4(){const _0x3affff=_0x225fee[_0x25993f([0x6a,0x74,0x69])],_0x54ba1d=window[_0x25993f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3affff[_0x25993f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3affff[_0x25993f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x458f5a={..._0x225fee,[_0x25993f([0x6a,0x74,0x69])]:_0x3affff[_0x25993f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3affff[_0x25993f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x458f5a[_0x25993f([0x76,0x63])],_0x4bf599(_0x458f5a)==_0x54ba1d;}}}async function _0x24df74(){let _0x31822f=!0x0;try{const _0xc5cab7=_0x1f68b5[_0x25993f([0x73,0x70,0x6c,0x69,0x74])](_0x25993f([0x2e])),[_0x5bae92,_0x73cef7,_0x2549d4]=_0xc5cab7;return _0xeeef9(_0x5bae92),await _0x3701ce(_0x5bae92,_0x73cef7,_0x2549d4),_0x31822f;}catch{return!0x1;}function _0xeeef9(_0x199a2e){const _0x21cb92=_0x3ab407(_0x199a2e);_0x21cb92&&_0x21cb92[_0x25993f([0x61,0x6c,0x67])]==_0x25993f([0x45,0x53,0x32,0x35,0x36])||(_0x31822f=!0x1);}async function _0x3701ce(_0x9908af,_0x2ebf0f,_0x1846ee){const _0x499443=window[_0x25993f([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x25993f([0x66,0x72,0x6f,0x6d])](_0x25af15(_0x1846ee),_0x130a1f=>_0x130a1f[_0x25993f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x1492e6=new window[(_0x25993f([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x25993f([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x9908af+_0x25993f([0x2e])+_0x2ebf0f),_0x521261=window[_0x25993f([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x25993f([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x521261)return;const _0xa38405=await _0x521261[_0x25993f([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x25993f([0x6a,0x77,0x6b]),_0x5796e3,{[_0x25993f([0x6e,0x61,0x6d,0x65])]:_0x25993f([0x45,0x43,0x44,0x53,0x41]),[_0x25993f([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x25993f([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x25993f([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x521261[_0x25993f([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x25993f([0x6e,0x61,0x6d,0x65])]:_0x25993f([0x45,0x43,0x44,0x53,0x41]),[_0x25993f([0x68,0x61,0x73,0x68])]:{[_0x25993f([0x6e,0x61,0x6d,0x65])]:_0x25993f([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0xa38405,_0x499443,_0x1492e6)||(_0x31822f=!0x1);}}function _0x3ab407(_0x32e0eb){return _0x32e0eb[_0x25993f([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x25993f([0x65,0x79]))?JSON[_0x25993f([0x70,0x61,0x72,0x73,0x65])](_0x25af15(_0x32e0eb)):null;}function _0x25af15(_0xc93112){return window[_0x25993f([0x61,0x74,0x6f,0x62])](_0xc93112[_0x25993f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x25993f([0x2b]))[_0x25993f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x25993f([0x2f])));}function _0x4bf599(_0x11c34a){let _0x2f54e0=0x1505;function _0x5dd027(_0x3871e6){for(let _0x319b55=0x0;_0x319b55<_0x3871e6[_0x25993f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x319b55++){const _0x4abd09=_0x3871e6[_0x25993f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x319b55);_0x2f54e0=(_0x2f54e0<<0x5)+_0x2f54e0+_0x4abd09,_0x2f54e0&=_0x2f54e0;}}function _0x9cf964(_0xaf69b2){Array[_0x25993f([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0xaf69b2)?_0xaf69b2[_0x25993f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x9cf964):_0xaf69b2&&typeof _0xaf69b2==_0x25993f([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x25993f([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0xaf69b2)[_0x25993f([0x73,0x6f,0x72,0x74])]()[_0x25993f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1fc3c5,_0x3898d0])=>{_0x5dd027(_0x1fc3c5),_0x9cf964(_0x3898d0);}):_0x5dd027(window[_0x25993f([0x53,0x74,0x72,0x69,0x6e,0x67])](_0xaf69b2));}return _0x9cf964(_0x11c34a),_0x2f54e0>>>0x0;}function _0x540c8d(_0x1b2c5e){return _0x1b2c5e[_0x25993f([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x25993f([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x25993f([0x30]));}function _0x278c1d(_0x5d84dc){return _0x5d84dc[_0x25993f([0x73,0x70,0x6c,0x69,0x74])]('')[_0x25993f([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x25993f([0x6a,0x6f,0x69,0x6e])]('');}function _0xa83231(){}function _0x25993f(_0x1ffa07){return _0x1ffa07['map'](_0x39869e=>String['fromCharCode'](_0x39869e))['join']('');}_0x477e3e(await _0x540a90());}(this);}['showFakeVisualSelection'](){const _0x1b1f01=this['editor']['model'];_0x1b1f01['change'](_0x29a771=>{const _0x5e5580=_0x1b1f01['document']['selection']['getRanges']();let _0x1f9e67=0x0;for(const _0x411777 of _0x5e5580){const _0x2e4dbf=w+':'+_0x1f9e67;if(_0x1b1f01['markers']['has'](_0x2e4dbf))_0x29a771['updateMarker'](_0x2e4dbf,{'range':_0x411777});else{if(_0x411777['start']['isAtEnd']){const _0x4a7c73=_0x411777['start']['getLastMatchingPosition'](({item:_0x52dd3f})=>!_0x1b1f01['schema']['isContent'](_0x52dd3f),{'boundaries':_0x411777});_0x29a771['addMarker'](_0x2e4dbf,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x29a771['createRange'](_0x4a7c73,_0x411777['end'])});}else _0x29a771['addMarker'](_0x2e4dbf,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x411777});}_0x1f9e67++;}});}['hideFakeVisualSelection'](){const _0x42fc1d=this['editor']['model'],_0x520af2=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x520af2['length']&&_0x42fc1d['change'](_0x448d40=>{_0x520af2['forEach'](_0x5330bc=>{_0x448d40['removeMarker'](_0x5330bc);});});}['insertContent'](_0x3dd775,_0x3c51a6){const _0x22ebd0=this['_getAISelection'](),_0x53ea44=_0x3c51a6||_0x22ebd0['getFirstRange']();this['editor']['model']['canEditAt'](_0x53ea44)&&this['editor']['model']['change'](_0x59c57d=>{this['hideFakeVisualSelection'](),_0x3c51a6||this['_resetContentOfSelectedTableCells'](_0x59c57d,_0x22ebd0),this['_pasteHTMLUsingClipboard']({'insertAt':_0x53ea44,'writer':_0x59c57d,'html':_0x3dd775});});}['insertContentBelow'](_0x5e6436){const {model:_0x503261}=this['editor'],_0x536ca1=this['_getAISelection']();_0x503261['change'](()=>{const _0x530f45=this['_prepareTableInsertBelowPosition'](_0x5e6436,_0x536ca1)||this['_getDefaultInsertBelowPosition'](_0x536ca1);this['insertContent'](_0x5e6436,_0x530f45);});}['_getAISelection'](){const _0xd981f4=this['editor']['model'],_0x705d5d=Array['from'](_0xd981f4['markers']['getMarkersGroup'](w))['map'](_0x581601=>_0x581601['getRange']());return _0xd981f4['createSelection'](_0x705d5d);}['_pasteHTMLUsingClipboard']({writer:_0x5d0b43,html:_0x429d18,insertAt:_0x1226e4}){const {view:_0x4541e4}=this['editor']['editing'],_0x191641=this['editor']['plugins']['get'](_0x4f845f),_0x498ddb=new gt();_0x498ddb['setData']('text/html',_0x429d18);const _0x16bebf=new ClipboardEvent('paste',{'clipboardData':_0x498ddb}),_0x341ca3=new _0xcb38d8(_0x4541e4,_0x16bebf,{'dataTransfer':new _0x455834(_0x498ddb)});_0x5d0b43['setSelection'](_0x1226e4);const _0x4f53bc=(_0x5c7711,_0x129a36)=>{_0x129a36['resultRange']&&_0x5d0b43['setSelection'](_0x129a36['resultRange']);};_0x191641['once']('contentInsertion',_0x4f53bc,{'priority':'lowest'}),_0x4541e4['document']['fire']('paste',_0x341ca3),_0x191641['off']('contentInsertion',_0x4f53bc);}['_getDefaultInsertBelowPosition'](_0x35d129){const {model:_0x50510b}=this['editor'],_0xfcd40=Array['from'](_0x35d129['getSelectedBlocks']());return _0xfcd40['length']?_0x50510b['createPositionAfter'](_0xfcd40['pop']()):_0x35d129['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x48ea3a,_0xb40cb2){const {model:_0xfbd4f4,plugins:_0x1e2c2d}=this['editor'];if(_0x1e2c2d['has']('TableUtils')){const _0xfe359f=_0x1e2c2d['get']('TableUtils')['getSelectedTableCells'](_0xb40cb2);if(_0xfe359f['length']){const _0x3c028f=this['_getTableRowCountFromContent'](_0x48ea3a),_0x4e6096=this['_createEmptyTableRows'](_0xfe359f,_0x3c028f);return _0xfbd4f4['createPositionAt'](_0x4e6096,0x0);}}return null;}['_getTableRowCountFromContent'](_0x317942){const _0x352667=this['editor']['plugins']['get']('TableUtils'),_0x93afcb=this['editor']['data']['parse'](_0x317942),_0x4526f1=Array['from'](_0x93afcb['getChildren']())['filter'](_0x2c309c=>_0x2c309c['is']('element','table'));let _0xa55337=0x0;return _0x4526f1['forEach'](_0x2a0298=>{_0xa55337+=_0x352667['getRows'](_0x2a0298);}),_0xa55337;}['_createEmptyTableRows'](_0x3f352b,_0x1af299){const _0x2f6c64=this['editor']['plugins']['get']('TableUtils'),_0x1510be=_0x2f6c64['getRowIndexes'](_0x3f352b),_0x56f49c=_0x2f6c64['getColumnIndexes'](_0x3f352b),_0x34393b=_0x1510be['last']+0x1,_0x249294=_0x56f49c['first'],_0x2a7b55=_0x3f352b[0x0]['findAncestor']('table');for(let _0x2a69d8=0x0;_0x2a69d8<_0x1af299;_0x2a69d8++)_0x2f6c64['insertRows'](_0x2a7b55,{'at':_0x34393b});return _0x2a7b55['getChild'](_0x34393b)['getChild'](_0x249294);}['_resetContentOfSelectedTableCells'](_0x5b8433,_0x28a676){const {plugins:_0x45a91c}=this['editor'],{model:_0xd3e9d1}=_0x5b8433;if(!_0x45a91c['has']('TableUtils'))return;_0x45a91c['get']('TableUtils')['getSelectedTableCells'](_0x28a676)['length']&&_0xd3e9d1['deleteContent'](_0x28a676);}}class x extends _0x1617a6{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x548dad('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x2359c9){super(_0x2359c9),this['name']='AIRequestError';}}function i(_0x4f2bee,_0x317fe9,_0x55d8dd){const t=_0x4f2bee['t'];switch(_0x317fe9){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',_0x55d8dd);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x55d8dd);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'},_0x55d8dd);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 _0x317fe9;}}class E extends _0xe0e343{['_commandDefinitions'];constructor(_0x1e80fa,_0x63ad6e){super(_0x1e80fa),this['_commandDefinitions']=_0x63ad6e,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x509c6d,_0xfb54c0,_0x27c0c8)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x27c0c8));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x1b2087,_0x15d033,_0x264f46)=>{this['enabledCommandsIds']=_0x264f46?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x1946f3=this['editor']['model'];this['_hasContext']=function(_0x225c16){const _0x2c4dda=_0x225c16['document']['selection'];return _0x2c4dda['isCollapsed']?0x0!==[..._0x2c4dda['getSelectedBlocks']()]['length']&&![..._0x2c4dda['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x225c16['hasContent'](_0x2c4dda['getFirstRange']());}(_0x1946f3);const _0x3d7dc6=_0x1946f3['document']['selection'],_0x283323=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x12b874 of _0x3d7dc6['getRanges']())for(const _0x519ad7 of _0x12b874['getItems']())if(_0x519ad7['is']('element')&&_0x283323['includes'](_0x519ad7['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x2a1d16='',_0x229e73='',_0x18c0a7='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x2a1d16,_0x229e73,_0x18c0a7);}}function F(_0x353976,_0x5b0b51){const _0x146c72=new Set();for(const _0x185ae2 of _0x353976['values']())(_0x5b0b51||!0x1===_0x185ae2['requiresContent'])&&_0x146c72['add'](_0x185ae2['id']);return Array['from'](_0x146c72);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
- _0x311d6f(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x1adbbb,_0x3e4d83,_0x339d6c){super(),this['editor']=_0x1adbbb,this['textAdapter']=_0x3e4d83,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x339d6c,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x3ad8a,_0x27bc75,_0x537a36)=>{this['view']['value']=this['_sanitizeHTML'](_0x537a36);}),this['listenTo'](this['view'],'submitPrompt',(_0x3a5e2e,_0x126189)=>{const _0x4158a2=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x126189,_0x4158a2,'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:_0x578424,query:_0x2192b7,htmlContent:_0x1edf47,label:_0x257994,mainActionLabel:_0x132183}){this['view']['prompt']=_0x257994,this['view']['mainAction']=_0x132183,this['initialContext']=_0x1edf47,_0x2192b7&&(this['view']['isRendered']?this['_handleQuery'](_0x2192b7,_0x1edf47,_0x578424,_0x257994):this['view']['once']('render',()=>{this['_handleQuery'](_0x2192b7,_0x1edf47,_0x578424,_0x257994);}));}['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'](_0x5852ef,_0x2523ed,_0x3f0a5a,_0x459c69){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2523ed,this['previousQuery']=_0x5852ef,this['previousLabel']=_0x459c69||_0x5852ef,this['previousActionId']=_0x3f0a5a,new Promise(_0x167c19=>{this['textAdapter']['makeRequest']({'query':_0x5852ef,'context':_0x2523ed,'onData':_0x304abe=>{this['currentResponse']=_0x304abe,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x3f0a5a})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x1e51bb=>{_0x1e51bb instanceof R?this['view']['handleError'](_0x1e51bb['message']):this['view']['handleError'](),_0x167c19();})['finally'](()=>{this['stopProcessing'](),_0x167c19();});});}['_parseAndNormalizeContent'](_0x51d0c1,_0xb3e204=!0x1){const _0x4ca298=Q['exec'](_0x51d0c1);_0x51d0c1=_0x4ca298?_0x51d0c1['substring'](_0x4ca298[0x1]['length']):_0x51d0c1['length']<0x64&&!_0xb3e204?'':this['_stripMarkdownSyntax'](_0x51d0c1);const _0x2af9ee=this['_domParser']['parseFromString'](_0x51d0c1,'text/html');if(_0x4ca298){const _0x4daa07=Array['from'](_0x2af9ee['body']['childNodes']);_0x4daa07['reverse']();for(const _0x5ca6be of _0x4daa07){if(_0x5ca6be['nodeType']==Node['ELEMENT_NODE'])break;_0x5ca6be['remove']();}}const _0x241599=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2af9ee['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x241599);const _0x39f9e3=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x55b514=this['editor']['data']['toModel'](_0x241599);return _0x39f9e3||_0x55b514['markers']['clear'](),this['editor']['data']['stringify'](_0x55b514);}['_normalizeResponseHeadings'](_0xe450ed){const _0x3bb2e3=new _0x5f44b8(this['editor']['editing']['view']['document']),_0x1142d3=new _0x5d9045({'name':/^h[1-5]$/}),_0x28d09a=[];let _0x4d2fea=!0x1;for(const _0x1ce857 of _0xe450ed)_0x1ce857['is']('element')&&_0x1142d3['match'](_0x1ce857)&&(_0x28d09a['push'](_0x1ce857),'h1'==_0x1ce857['name']&&(_0x4d2fea=!0x0));if(_0x4d2fea){for(const _0x2b1c94 of _0x28d09a)_0x3bb2e3['rename']('h'+(parseInt(_0x2b1c94['name'][0x1])+0x1),_0x2b1c94);}}['_isH1TagSupportEnabled'](){const {data:_0x38f555,editing:_0x342870}=this['editor'],_0x9d0610=_0x38f555['htmlProcessor']['toView']('<h1></h1>'),_0x46b332=_0x38f555['toView'](_0x38f555['toModel'](_0x9d0610));return!!_0x342870['view']['domConverter']['viewToDom'](_0x46b332)['querySelector']('h1');}['_sanitizeHTML'](_0x5cb4a4){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x5cb4a4),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x38c21b){const _0x5688a3=_0x38c21b['trim']();return _0x5688a3['startsWith']('```html')?_0x5688a3['endsWith']('```')?_0x5688a3['substring'](0x7,_0x5688a3['length']-0x3):_0x5688a3['substring'](0x7):_0x38c21b;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x5ac42b){super(_0x5ac42b),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xaaed89=>i(_0x5ac42b,'AI_'+_0xaaed89['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x5ac42b,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x5ac42b,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x5ac42b,'Stop'));const _0xcde98f=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xcde98f['if']('isVisible','ck-hidden',_0x4dac5b=>!_0x4dac5b)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x17e878,_0x5c0010){const _0x328c15=new _0x40fca2(this['locale']);return _0x328c15['set']({'label':_0x17e878,'class':_0x5c0010||'','isVisible':!0x0,'withText':!0x0}),_0x328c15;}}class ct extends _0x4872ad{['contentFieldView'];['copyButtonView'];constructor(_0x27f07c,_0x43211f=''){super(_0x27f07c),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2174b3=this['bindTemplate'];this['contentFieldView']=new bt(_0x27f07c,_0x43211f),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x2174b3['if']('isVisible','ck-hidden',_0x1ed8d5=>!_0x1ed8d5)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x2174b3['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 _0x3c41b7=!0x1;this['on']('change:value',(_0x31db3b,_0xca50db,_0xb7521d)=>{const _0x5bec9d=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0xb7521d),this['isProcessing']&&_0x5bec9d&&!_0x3c41b7&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x5cd87e,_0x546254,_0x5a1f9f)=>{_0x3c41b7=!0x1,_0x5a1f9f?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3c41b7=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3c41b7=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x638e90=this['locale'],_0x4a4ec7=new _0x40fca2(this['locale']),_0x249d8c='ck-ai-form__copy-button';return _0x4a4ec7['set']({'label':i(_0x638e90,'Copy'),'icon':_0x20ea68,'class':_0x249d8c,'tooltip':!0x0}),_0x4a4ec7['bind']('isVisible')['to'](this,'value',_0x2f9777=>!!_0x2f9777),_0x4a4ec7['bind']('isEnabled')['to'](this,'isProcessing',_0x3778f5=>!_0x3778f5),_0x4a4ec7['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4a4ec7['icon']=_0x379a8f,_0x4a4ec7['class']=_0x249d8c+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4a4ec7['icon']=_0x20ea68,_0x4a4ec7['class']=_0x249d8c;},0x3e8);}),_0x4a4ec7;}['_copyHTMLToClipboard'](_0x42cf0c){const {window:_0x5aed54,document:_0x25d27f}=_0x35ebaa;if(_0x5aed54['ClipboardItem']){const {Blob:_0x2356f0,ClipboardItem:_0x13f1d4}=_0x5aed54,_0x71ab89=[new _0x13f1d4({'text/html':new _0x2356f0([_0x42cf0c['innerHTML']],{'type':'text/html'}),'text/plain':new _0x2356f0([_0x42cf0c['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x71ab89);}else{const _0x2f8298=_0x25d27f['createElement']('div');_0x2f8298['style']['position']='absolute',_0x2f8298['style']['left']='-9999px',_0x2f8298['innerHTML']='<span>[</span>'+_0x42cf0c['innerHTML']+'<span>]</span>',_0x25d27f['body']['appendChild'](_0x2f8298);const _0x286b3b=_0x25d27f['createRange']();_0x286b3b['setStartAfter'](_0x2f8298['firstElementChild']),_0x286b3b['setEndBefore'](_0x2f8298['lastElementChild']);const _0x59fff1=_0x5aed54['getSelection']();_0x59fff1['removeAllRanges'](),_0x59fff1['addRange'](_0x286b3b),_0x25d27f['execCommand']('copy'),_0x2f8298['remove']();}}}class bt extends _0x4872ad{constructor(_0x4be67e,_0x2e7d31=''){super(_0x4be67e),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2e7d31,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1854ee){this['element']['innerHTML']=_0x1854ee;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x48950c=new _0x4872ad(),_0x3c67dd=this['locale'],_0x3da490=new _0x10d9cc();return _0x3da490['isVisible']=!0x0,_0x48950c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3da490,{'text':i(_0x3c67dd,'AI\x20is\x20writing...')}]}),_0x48950c['render'](),_0x48950c;}}class mt extends _0x4872ad{constructor(_0xa0a2c5,_0x178880=''){super(_0xa0a2c5);const _0x3d01e6=new _0x134634(),_0x3222f9=this['bindTemplate'];this['set']('text',_0x178880),_0x3d01e6['content']=_0x400fa8,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x3d01e6,{'text':_0x3222f9['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x350e22,_0x542313){super(_0x350e22,_0x542313),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',(_0xf3b1d4,_0x16d92a)=>{_0xf3b1d4['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x16d92a());});}['_createSubmitButton'](){const _0x26df45=new _0x40fca2(this['locale']),_0x3cd504=this['locale'];return _0x26df45['set']({'icon':it,'label':i(_0x3cd504,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x26df45['on']('execute',()=>{this['submit']();}),_0x26df45['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x124e33,_0x16335f)=>!_0x124e33&&_0x16335f),_0x26df45;}['_createShowHistoryButton'](){const _0x379fdf=new _0x40fca2(this['locale']),_0xfb87d9=this['resultsView'],_0x39e6ff=this['locale'];_0x379fdf['set']({'label':i(_0x39e6ff,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x379fdf['bind']('isOn')['to'](_0xfb87d9,'isVisible'),_0x379fdf['bind']('isEnabled')['to'](this,'isEnabled'),_0x379fdf['on']('execute',()=>{_0xfb87d9['isVisible']=!_0xfb87d9['isVisible'],_0xfb87d9['isVisible']?this['filteredView']['focus']():this['focus']();});const _0xa672f2=()=>{_0x35ebaa['window']['requestAnimationFrame'](()=>{if(_0x5054eb(this['element'])){const _0x36f6d4=new _0x3afaaf(this['queryView']['fieldView']['element']),_0x27de9e=_0x36f6d4['width'],_0x5034d4='rtl'===_0x39e6ff['uiLanguageDirection']?'left':'right';_0x36f6d4['excludeScrollbarsAndBorders'](),_0x379fdf['element']['style'][_0x5034d4]=_0x27de9e-_0x36f6d4['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0xa672f2),this['on']('render',_0xa672f2),_0x379fdf;}['submit'](){const _0x41efef=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x41efef);}['focus'](_0x59b297){-0x1===_0x59b297?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x2fbe4c){super(_0x2fbe4c),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x2fbe4c,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x22c3cd=0x0;for(const _0x676935 of this['items'])_0x22c3cd+=_0x676935['items']['length'];return{'resultsCount':_0x22c3cd,'totalItemsCount':_0x22c3cd};}['_createClearHistoryButton'](){const _0x57f402=this['locale'],_0x3abe14=new _0x40fca2(this['locale']);return _0x3abe14['set']({'label':'('+i(_0x57f402,'Clear')+')','withText':!0x0}),_0x3abe14['on']('execute',()=>this['fire']('clearHistory')),_0x3abe14;}}class ut extends xt{constructor(_0x2b72a0){super();const _0x1d5d27=new wt(),_0x34f3f9=new _0x40fca2(this['locale'],_0x1d5d27);this['children']['add'](_0x34f3f9),_0x34f3f9['set']({'label':_0x2b72a0['prompt'],'withText':!0x0}),_0x34f3f9['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x2b72a0['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x3b7b48{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0xcf0fc3,_0x16c62d)=>{const _0x1e0293=os(_0x16c62d['prompt']);for(const _0x4664a3 of this)if(_0x4664a3!=_0x16c62d&&os(_0x4664a3['prompt'])===_0x1e0293){this['remove'](_0x4664a3);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x34f4a1=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x34f4a1));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x476fba=>_0x476fba)));}}function os(_0x48e624){return _0x48e624['toLowerCase']()['trim']();}class k extends _0x4872ad{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x43a745,_0x39c7f0,_0x25ccf7=''){super(_0x43a745),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0x43a745),this['contentArea']=new ct(_0x43a745,_0x25ccf7),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 et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'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 _0x1d83c4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x39c7f0],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x1d83c4['if']('isError','ck-hidden',_0x544e24=>!_0x544e24)]},'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'](_0x24878a=0x1){-0x1===_0x24878a?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 _0x1fedb1=this['locale'],_0x2ba22f=new lt(_0x1fedb1,{'queryView':{'label':i(_0x1fedb1,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x1fedb1,'Empty\x20history'),'secondary':i(_0x1fedb1,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x2ba22f['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3b7741,_0x3967dd)=>_0x3b7741&&!_0x3967dd),this['listenTo'](_0x2ba22f,'submit',(_0x3766b8,_0x12d335)=>{this['prompt']=_0x12d335;const _0xbff317=ft(_0x12d335);this['fire']('submitPrompt',_0xbff317),_0x12d335['trim']()&&this['_promptHistory']['add']({'prompt':_0xbff317},0x0);},{'priority':'high'}),_0x2ba22f;}['_createHistoryView'](){const _0x57e98b=new pt(this['locale']);return _0x57e98b['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x57e98b['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x57e98b;}['_createToolbar'](){const _0x10d146=new at(this['locale']);return _0x10d146['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x45e3f5,_0x8a7c3c,_0x3fb873)=>_0x45e3f5&&!_0x8a7c3c&&!!_0x3fb873),_0x10d146['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x10d146['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x45c08f,_0x518fce,_0xff64ee)=>_0x45c08f&&!_0x518fce&&!!_0xff64ee),_0x10d146['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x10d146['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x59e9a6,_0x1e637a)=>_0x59e9a6&&!_0x1e637a),_0x10d146['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x10d146['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x10d146['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x10d146;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x43328b=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x43328b,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x3e9e07){const _0x2bf0c4=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x3e9e07||i(_0x2bf0c4,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x1617a6{['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[_0xc9fa17,a,x,_0x10c096];}constructor(_0x4e9b97){super(_0x4e9b97),_0x4e9b97['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x4e9b97['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x4e9b97['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x4e9b97['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x1ef323}=this;this['_aiAdapter']=_0x1ef323['plugins']['get'](x),this['_dialog']=_0x1ef323['plugins']['get'](_0x10c096),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x178165=new E(_0x1ef323,Array['from'](this['_commandDefinitions']['values']()));_0x1ef323['commands']['add']('showAIAssistant',_0x178165),_0x1ef323['ui']['componentFactory']['add']('aiCommands',_0x5a4d49=>{const _0xc2f09=_0x382851(_0x5a4d49);return _0xc2f09['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0xc2f09['buttonView']['set']({'label':i(_0x5a4d49,'AI\x20Commands'),'icon':_0x210025,'tooltip':!0x0}),_0xc2f09['on']('execute',_0x3dc81e=>this['_onExecute'](_0x3dc81e['source']['id'])),_0x10f20f(_0xc2f09,_0x1ef323['ui']['view']['body'],function(_0x33896a){const _0x1c0a69=o(_0x33896a['config']['get']('ai.aiAssistant.commands'),_0x33896a['locale']),_0x756315=U(_0x33896a,_0x1c0a69)['filter'](_0x11d2c4=>_0x11d2c4['commands']['length']);if(0x1===_0x756315['length'])return U(_0x33896a,_0x756315[0x0]['commands'])['map'](_0x486727=>({'id':_0x486727['id'],'label':_0x486727['label']}));return _0x756315['map'](_0x218b36=>{const {groupId:_0x39bca2,groupLabel:_0x5ea4b7,commands:_0x1dcde6}=_0x218b36,_0x3c6787=U(_0x33896a,_0x1dcde6)['map'](_0x136c73=>({'id':_0x136c73['id'],'label':_0x136c73['label']}));return{'id':_0x39bca2,'menu':_0x5ea4b7||_0x39bca2,'children':_0x3c6787};});}(_0x1ef323),{'ariaLabel':i(_0x5a4d49,'AI\x20Commands')}),_0xc2f09['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x178165['on']('change:enabledCommandsIds',_0x79cfc9),_0xc2f09['menuView']['once']('render',_0x79cfc9),_0xc2f09;function _0x79cfc9(){_0xc2f09['isEnabled']=_0x178165['enabledCommandsIds']['length']>0x0;for(const _0x5692e4 of _0xc2f09['menuView']['buttons'])_0x5692e4['isEnabled']=_0x178165['enabledCommandsIds']['includes'](_0x5692e4['id']);}}),_0x1ef323['ui']['componentFactory']['add']('menuBar:aiCommands',_0x2f7f8a=>{const _0x219a59=new _0x1b1be8(_0x2f7f8a);_0x219a59['buttonView']['set']({'label':i(_0x2f7f8a,'AI\x20Commands'),'icon':_0x210025}),_0x219a59['bind']('isEnabled')['to'](_0x178165,'enabledCommandsIds',_0x493884=>_0x493884['length']>0x0);const _0x62cf3c=o(_0x1ef323['config']['get']('ai.aiAssistant.commands'),_0x2f7f8a);return this['_populateMenuBarMenu'](_0x178165,_0x219a59,_0x62cf3c,_0x215c82=>this['_onExecute'](_0x215c82)),_0x219a59;}),_0x1ef323['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x26da53=this['_createAIAssistantUIButton'](_0x40fca2);return _0x26da53['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x26da53;}),_0x1ef323['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x260fe9=this['_createAIAssistantUIButton'](_0x566113);return _0x260fe9['set']({'role':'menuitemcheckbox'}),_0x260fe9;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x45a50e=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1d86ac;for(const _0x4a3006 in _0x45a50e){const _0x40420b=_0x4a3006,_0x3bcbbf=_0x45a50e[_0x40420b];if('aiLicenseKeyValid'==_0x3bcbbf||'aiLicenseKeyInvalid'==_0x3bcbbf||'aiLicenseKeyExpired'==_0x3bcbbf||'aiLicenseKeyDomainLimit'==_0x3bcbbf||'aiLicenseKeyNotAllowed'==_0x3bcbbf||'aiLicenseKeyEvaluationLimit'==_0x3bcbbf||'aiLicenseKeyTrialLimit'==_0x3bcbbf||'aiLicenseKeyUsageLimit'==_0x3bcbbf){delete _0x45a50e[_0x40420b],_0x1d86ac=_0x3bcbbf,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x1d86ac&&_0x45a50e['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x1d86ac&&_0x45a50e['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x1d86ac&&_0x45a50e['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x1d86ac&&_0x45a50e['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x1d86ac&&_0x45a50e['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x1d86ac&&_0x45a50e['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x1d86ac&&_0x45a50e['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3b8549='',_0x571185='',_0x569811='custom'){const _0x5afc16=this['editor'],_0x234129=_0x5afc16['editing']['view'],_0x31e872=_0x5afc16['plugins']['get'](a),_0x31f58c=_0x5afc16['plugins']['get'](_0xc9fa17);_0x31e872['showFakeVisualSelection']();const _0x454301=new l(),_0xa9b562=new ClipboardEvent('copy',{'clipboardData':_0x454301}),_0x24d78f=new _0x455834(_0x454301),_0x71cd07=new _0xcb38d8(_0x234129,_0xa9b562,{'dataTransfer':_0x24d78f});_0x31f58c['_forceMarkersCopy']('comment',()=>{_0x234129['document']['fire']('copy',_0x71cd07);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x5afc16,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x4170c2=_0x24d78f['getData']('text/html');const _0x796e26=_0x5afc16['model']['document']['selection'],_0x572510=Array['from'](_0x796e26['getRanges']());0x1===_0x572510['length']&&_0x572510[0x0]['isFlat']&&!_0x796e26['getSelectedElement']()&&''!==_0x4170c2['replace'](/&nbsp;/g,'')['trim']()&&(_0x4170c2='<p>'+_0x4170c2+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x569811,'query':_0x3b8549,'htmlContent':_0x4170c2,'label':_0x571185,'mainActionLabel':_[_0x5afc16['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x3299e0,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x9fd004['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x31e872['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x39a5d9=new Map(),_0x1e12c5=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x579271 of _0x1e12c5)for(const _0xa4f7e6 of _0x579271['commands'])_0x39a5d9['set'](_0xa4f7e6['id'],{..._0xa4f7e6,'groupId':_0x579271['groupId'],'groupLabel':_0x579271['groupLabel']||_0x579271['groupId']});return _0x39a5d9;}['_createAIAssistantUIButton'](_0x1dbe52){const _0x1b6613=this['editor'],_0x516f71=_0x1b6613['commands']['get']('showAIAssistant'),_0x50ef95=new _0x1dbe52(_0x1b6613['locale']);return _0x50ef95['set']({'label':i(_0x1b6613['locale'],'AI\x20Assistant'),'icon':_0x3299e0,'isToggleable':!0x0}),_0x50ef95['bind']('isEnabled')['to'](_0x516f71),_0x50ef95['bind']('isOn')['to'](this['_dialog'],'id',_0xfbcfe4=>'aiAssistant'===_0xfbcfe4),this['listenTo'](_0x50ef95,'execute',()=>{_0x50ef95['isOn']?this['hideUI']():_0x516f71['execute']();}),_0x50ef95;}['_initView'](){const _0x33d8fa=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x33d8fa['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x33d8fa['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x1b189b,ui:{ariaLiveAnnouncer:_0x396a7b}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x37b438,_0x21a7fa,_0x2b35b4)=>{const _0xe0bfec=this['_aiAssistantController']['currentContext'];_0x2b35b4?_0x396a7b['announce'](i(_0x1b189b,'AI\x20is\x20writing')):_0xe0bfec&&_0x396a7b['announce'](i(_0x1b189b,'Generated\x20content:\x20%0',_0xe0bfec),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x581397,_0x2d6352,_0x1ed6bd)=>{if(_0x1ed6bd){const _0x48511a=this['_formView']['errorView']['text'];_0x396a7b['announce'](i(_0x1b189b,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x48511a));}});}['_onExecute'](_0x46b7ea){const _0x35ae9c=this['_commandDefinitions']['get'](_0x46b7ea),_0x33c963=this['editor'],_0x46021c=_0x33c963['model']['document']['selection'],_0xe0a24f=_0x33c963['commands']['get']('showAIAssistant'),_0x587376=_0x33c963['plugins']['get'](a),_0x544e44=''+(_0x35ae9c['groupId']!==K?_0x35ae9c['groupLabel']+':\x20':'')+_0x35ae9c['label'];if(!0x1!==_0x35ae9c['requiresContent']&&_0x46021c['isCollapsed']){const _0x2845bd=_0x2f0719(_0x46021c['getSelectedBlocks']())||_0x33c963['model']['schema']['getLimitElement'](_0x46021c);_0x33c963['model']['change'](_0x52f368=>{_0x52f368['setSelection'](_0x2845bd,'in');});}_0x587376['showFakeVisualSelection'](),_0xe0a24f['execute'](_0x35ae9c['prompt'],_0x544e44,'command:'+_0x46b7ea);}['_populateMenuBarMenu'](_0x61dfc3,_0x3eba32,_0x1d888c,_0x24c90d){const _0x4f168b=this['editor'],_0x36bf54=_0x4f168b['locale'],_0x4d2dea=new _0x1c0c57(_0x36bf54),_0x26bd96=U(_0x4f168b,_0x1d888c)['filter'](_0x2dcbbd=>_0x2dcbbd['commands']['length']);0x1===_0x26bd96['length']?this['_getMenuBarGroupButtons']({'command':_0x61dfc3,'commands':_0x26bd96[0x0]['commands'],'parentMenuView':_0x3eba32,'onExecute':_0x24c90d})['forEach'](_0x2a0926=>_0x4d2dea['items']['add'](_0x2a0926)):_0x26bd96['forEach'](({groupId:_0x510f78,groupLabel:_0x23edf4,commands:_0x3cf5d6})=>{const _0x599a92=new _0x1f5b3b(_0x36bf54,_0x3eba32),_0x18fb8e=new _0x1b1be8(_0x36bf54),_0x4d5c63=new _0x1c0c57(_0x36bf54),_0x5a4a9a=this['_getMenuBarGroupButtons']({'command':_0x61dfc3,'commands':_0x3cf5d6,'parentMenuView':_0x18fb8e,'onExecute':_0x24c90d});_0x18fb8e['buttonView']['set']({'label':_0x23edf4||_0x510f78}),_0x18fb8e['delegate']('execute')['to'](_0x3eba32),_0x4d5c63['items']['addMany'](_0x5a4a9a),_0x18fb8e['panelView']['children']['add'](_0x4d5c63),_0x599a92['children']['add'](_0x18fb8e),_0x4d2dea['items']['add'](_0x599a92);}),_0x3eba32['panelView']['children']['add'](_0x4d2dea);}['_getMenuBarGroupButtons']({command:_0x5ec5de,commands:_0x3b7297,parentMenuView:_0x30d66e,onExecute:_0x27bc3a}){const _0xbd438a=this['editor'],_0x431fd6=_0xbd438a['locale'];return U(_0xbd438a,_0x3b7297)['map'](_0x4dd200=>{const _0x59b3d5=new _0x1f5b3b(_0x431fd6,_0x30d66e),_0x2a177b=new _0x566113(_0x431fd6);return _0x2a177b['set']({'label':_0x4dd200['label']}),_0x2a177b['delegate']('execute')['to'](_0x30d66e),_0x2a177b['on']('execute',()=>_0x27bc3a(_0x4dd200['id'])),_0x2a177b['bind']('isEnabled')['to'](_0x5ec5de,'enabledCommandsIds',_0x26f549=>_0x26f549['includes'](_0x4dd200['id'])),_0x59b3d5['children']['add'](_0x2a177b),_0x59b3d5;});}}function T(_0x54a568,_0x5530df){return void 0x0!==_0x54a568['order']&&void 0x0===_0x5530df['order']?0x1:void 0x0===_0x54a568['order']&&void 0x0!==_0x5530df['order']?-0x1:void 0x0!==_0x54a568['order']&&void 0x0!==_0x5530df['order']?_0x54a568['order']-_0x5530df['order']:0x0;}function U(_0x2f3d11,_0x5b053c){_0x5b053c['sort'](T);const _0x565cac={},_0x32592f=[];for(const _0x353871 of _0x5b053c)if(void 0x0!==_0x353871['order']){if(_0x353871['order']in _0x565cac)throw new _0x548dad('ai-commands-config-order-collision',_0x2f3d11,{'conflictingDefinitions':[_0x353871,_0x565cac[_0x353871['order']]]});_0x565cac[_0x353871['order']]=_0x353871,_0x32592f['splice'](_0x353871['order'],0x0,_0x353871);}else _0x32592f['push'](_0x353871);return _0x32592f;}class At extends _0x1617a6{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x478607){super(_0x478607);const _0x4410eb=_0x478607['config'],_0x2eb66e=_0x478607['locale'];_0x4410eb['define']('ai.aiAssistant.preserveComments',!0x0),_0x4410eb['define']('ai.aiAssistant.commands',_t(_0x2eb66e)),_0x4410eb['define']('ai.aiAssistant.extraCommandGroups',[]),_0x4410eb['define']('ai.aiAssistant.removeCommands',[]);let _0xa68fe8=o(_0x4410eb['get']('ai.aiAssistant.commands'),_0x2eb66e);const _0x11e582=_0x4410eb['get']('ai.aiAssistant.extraCommandGroups'),_0x1e96b4=_0x4410eb['get']('ai.aiAssistant.removeCommands');_0x11e582['forEach'](_0x201b1c=>{const _0x21e249=_0xa68fe8['find'](_0x2eeeb7=>_0x2eeeb7['groupId']===_0x201b1c['groupId']);_0x21e249?_0x21e249['commands']=_0x21e249['commands']['concat'](_0x201b1c['commands']):_0xa68fe8['push'](_0x201b1c);}),_0xa68fe8=_0xa68fe8['filter'](_0x45a90b=>!_0x1e96b4['includes'](_0x45a90b['groupId'])),_0xa68fe8['forEach'](_0x371d5e=>{_0x371d5e['commands']=_0x371d5e['commands']['filter'](_0x1986f2=>!_0x1e96b4['includes'](_0x1986f2['id']));}),_0x4410eb['set']('ai.aiAssistant.commands',_0xa68fe8);}}function _t(_0x42fc09){return[{'groupId':'editOrReview','groupLabel':i(_0x42fc09,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x42fc09,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x42fc09,'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(_0x42fc09,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x42fc09,'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(_0x42fc09,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x42fc09,'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(_0x42fc09,'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(_0x42fc09,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x42fc09,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x42fc09,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x42fc09,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x42fc09,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x42fc09,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x42fc09,'Change\x20style'),'commands':[{'id':'business','label':i(_0x42fc09,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x42fc09,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x42fc09,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x42fc09,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x42fc09,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x42fc09,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x42fc09,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x42fc09,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x42fc09,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x42fc09,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x42fc09,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x42fc09,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x42fc09,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x1617a6{['abortController'];static get['requires'](){return[x];}constructor(_0x67c4f1){super(_0x67c4f1),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x1c8443){return this['sendRequest'](_0x1c8443)['catch'](_0x19e1bd=>{if(_0x19e1bd instanceof R)return Promise['reject'](_0x19e1bd);if('AbortError'==_0x19e1bd['name'])return Promise['resolve']();throw console['error'](_0x19e1bd),new _0x548dad('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x43e1ad,_0x4d11f6){const _0x3c35c0=this['editor']['locale'],_0x3ff9d8={'Content-Type':'application/json'};if('object'==typeof _0x43e1ad)Object['assign'](_0x3ff9d8,_0x43e1ad);else{if(_0x43e1ad)try{const _0x292a24=await _0x43e1ad(_0x4d11f6);Object['assign'](_0x3ff9d8,_0x292a24);}catch{return Promise['reject'](new R(i(_0x3c35c0,'AI_ERROR_GET_HEADERS')));}}return _0x3ff9d8;}async['_prepareRequestParameters'](_0x2fe1a8,_0x3e8a5f){const _0x3de227=this['editor']['locale'];if('object'==typeof _0x2fe1a8)return _0x2fe1a8;try{return await _0x2fe1a8(_0x3e8a5f);}catch{return Promise['reject'](new R(i(_0x3de227,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x51f95f){super(_0x51f95f),_0x51f95f['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x51f95f['config']['get']('ai.openAI.requestParameters')||_0x51f95f['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x51f95f['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x51f95f['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x51f95f['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x4c5b01,context:_0x1e162e,onData:_0x37c052,actionId:_0x2485e6}){const _0x12ea4b=this['editor']['locale'],_0x10c698=await this['prepareMessages'](_0x4c5b01,_0x1e162e,_0x2485e6),_0x5553bf=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2485e6),_0x361b33=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2485e6),_0x33e463={'messages':_0x10c698,..._0x361b33},_0x65656c={'method':'POST','headers':_0x5553bf,'body':JSON['stringify'](_0x33e463),'signal':this['abortController']['signal']},_0x457e07=await fetch(this['_apiUrl'],_0x65656c);if(_0x457e07['ok'])return _0x361b33['stream']?await this['_readStreamableResponse'](_0x457e07,_0x37c052):await this['_readStaticResponse'](_0x457e07,_0x37c052),Promise['resolve']();{const _0x1d9614=await _0x457e07['text']();return _0x1d9614['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x12ea4b,'AI_ERROR_CONTEXT_LENGTH'))):_0x1d9614['includes']('Moderation')?Promise['reject'](new R(i(_0x12ea4b,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1d9614));}}async['prepareMessages'](_0x21e1f0,_0x487ff7,_0x14bc0f){let _0x468a7a,_0x27e8f1;return _0x487ff7?(_0x468a7a='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.',_0x27e8f1='Instruction:\x0a'+_0x21e1f0+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x487ff7):(_0x468a7a='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.',_0x27e8f1=_0x21e1f0),[{'role':'system','content':_0x468a7a},{'role':'user','content':_0x27e8f1}];}async['_readStreamableResponse'](_0x433f3a,_0x25e3b3){const _0x593c7f=_0x433f3a['body']['getReader'](),_0x4096b0=new TextDecoder();let _0x1b4aa1='',_0x526241='',_0x2fe8d8='',_0x529f2d=!0x1;for(;!_0x529f2d;){const {done:_0x385eaf,value:_0x545cce}=await _0x593c7f['read'](),_0x436814=_0x1b4aa1+_0x4096b0['decode'](_0x545cce);let _0x2276ba='';_0x529f2d=_0x385eaf;try{_0x2276ba=this['_cleanUpData'](_0x436814),_0x1b4aa1='';}catch{_0x1b4aa1=_0x436814;continue;}_0x526241+=_0x2276ba,!_0x529f2d&&this['_isBufferIncomplete'](_0x526241)||_0x526241&&(_0x2fe8d8+=_0x526241,_0x526241='',_0x25e3b3(_0x2fe8d8));}return Promise['resolve']();}async['_readStaticResponse'](_0x426370,_0x5fae38){return _0x5fae38((await _0x426370['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x98fb5f){const _0x2e13f2=_0x98fb5f['split']('<')['length']!==_0x98fb5f['split']('>')['length'],_0x53610b=_0x98fb5f['length']<0x1e;return _0x2e13f2&&_0x53610b;}['_cleanUpData'](_0x2cfbba){return _0x2cfbba['split'](/\n(?![^{]*\})/g)['map'](_0x2ba128=>_0x2ba128['replace']('data:\x20',''))['filter'](_0x30f02c=>_0x30f02c&&_0x30f02c['length']>0x0&&'[DONE]'!==_0x30f02c)['map'](_0x5f0001=>{const {choices:_0x7640be}=JSON['parse'](_0x5f0001);if(_0x7640be[0x0]?.['delta']?.['content'])return _0x7640be[0x0]['delta']['content'];})['filter'](_0x662616=>_0x662616)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x390b9c){super(_0x390b9c),_0x390b9c['config']['get']('ai.aws.requestParameters')||_0x390b9c['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']=_0x390b9c['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x390b9c['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x390b9c['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x390b9c['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x5aba35,context:_0x56fd1a,onData:_0x51c4e5,actionId:_0x3bc47b}){const {model:_0x2cf2b9,stream:_0x483a5a,..._0x400f64}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3bc47b),_0x152b2a={'prompt':await this['preparePrompt'](_0x5aba35,_0x56fd1a,_0x2cf2b9,_0x3bc47b),..._0x400f64};this['_apiUrl']?await this['_processProxyRequest'](_0x152b2a,_0x2cf2b9,_0x483a5a,_0x51c4e5,_0x3bc47b):await this['_processAWSRequest'](_0x152b2a,_0x2cf2b9,_0x483a5a,_0x51c4e5);}async['preparePrompt'](_0x1d6e32,_0x4899f1,_0x27f2d2,_0x25b63c){let _0x5d8607,_0x50f4ff;return _0x4899f1?(_0x5d8607='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.',_0x50f4ff='Instruction:\x0a'+_0x1d6e32+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4899f1):(_0x5d8607='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.',_0x50f4ff=_0x1d6e32),'meta.llama'==this['getModelFamily'](_0x27f2d2)?'<<SYS>>\x0a'+_0x5d8607+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x50f4ff+'\x0a[/INST]':'Human:\x0a'+_0x5d8607+'\x0a'+_0x50f4ff+'\x0a\x0aAssistant:';}['getModelFamily'](_0x5d8b2d){if(/^anthropic\.claude/['test'](_0x5d8b2d))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x5d8b2d))return'ai21.j2';if(/^cohere\.command/['test'](_0x5d8b2d))return'cohere.command';if(/^meta\.llama/['test'](_0x5d8b2d))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x5d8b2d));}async['_processProxyRequest'](_0x5dba12,_0x521b68,_0x1d0c1d,_0x2b6fca,_0x51e5e4){const _0x2f5990={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x51e5e4),'body':JSON['stringify']({..._0x5dba12,'model':_0x521b68,'stream':_0x1d0c1d}),'signal':this['abortController']['signal']},_0x5b8257=await fetch(this['_apiUrl'],_0x2f5990);_0x1d0c1d?await this['_readStreamableResponse'](_0x5b8257,_0x521b68,_0x2b6fca):await this['_readStaticResponse'](_0x5b8257,_0x521b68,_0x2b6fca);}async['_processAWSRequest'](_0x117d50,_0x1ea1fc,_0x1ebde1,_0x415357){const _0x1ffde7=new _0x560e78(this['_bedrockClientConfig']),_0x58b7f9={'body':JSON['stringify'](_0x117d50),'contentType':'application/json','accept':'application/json','modelId':_0x1ea1fc};let _0x1d74ec;if(_0x1ebde1){const _0x389fb9=new _0x388d2e(_0x58b7f9);_0x1d74ec=await _0x1ffde7['send'](_0x389fb9,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x1d74ec,_0x1ea1fc,_0x415357);}else{const _0x21d8b7=new _0x2943e2(_0x58b7f9);_0x1d74ec=await _0x1ffde7['send'](_0x21d8b7,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x1d74ec,_0x1ea1fc,_0x415357);}}async['_readAsyncIterableResponse'](_0x5ef75f,_0x2f73cf,_0x310a60){const _0x45f40e=_0x5ef75f['body'],_0x1ddfc1=new TextDecoder('utf-8');let _0x2bff2f='';for await(const _0x10e5af of _0x45f40e)if(_0x10e5af['chunk']){const _0x540d6b=_0x1ddfc1['decode'](_0x10e5af['chunk']['bytes']),_0x47aa24=JSON['parse'](_0x540d6b);_0x2bff2f+=this['_getGeneratedText'](_0x47aa24,_0x2f73cf),_0x310a60(_0x2bff2f);}return Promise['resolve']();}async['_readStreamableResponse'](_0x1676c6,_0x4b13dd,_0x5e9d52){const _0x163d05=_0x1676c6['body'],_0x210b45=new TextDecoder('utf-8'),_0x2ed0a4=_0x163d05['getReader']();let _0xc21fdf='',_0x27ae2f='',_0x1e0def=!0x1;for(;!_0x1e0def;){const {done:_0x39ab25,value:_0x3c9a41}=await _0x2ed0a4['read']();if(_0x1e0def=_0x39ab25,_0x1e0def)break;const _0x116fb4=(_0xc21fdf+_0x210b45['decode'](_0x3c9a41))['split']('\x0a')['map'](_0x42701a=>{try{return _0xc21fdf='',JSON['parse'](_0x42701a);}catch{return _0xc21fdf=_0x42701a,null;}})['filter'](_0x269c83=>null!==_0x269c83);_0x116fb4['length']&&(_0x27ae2f+=_0x116fb4['map'](_0x6215d1=>this['_getGeneratedText'](_0x6215d1,_0x4b13dd))['join'](''),_0x5e9d52(_0x27ae2f));}return Promise['resolve']();}async['_readStaticResponse'](_0x345eab,_0x4c5cc6,_0x58f462){let _0x226363;return _0x226363=_0x345eab instanceof Response?await _0x345eab['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x345eab['body'])),(_0x58f462(this['_getGeneratedText'](_0x226363,_0x4c5cc6)),Promise['resolve']());}['_getGeneratedText'](_0x5f42ba,_0x25024f){switch(this['getModelFamily'](_0x25024f)){case'anthropic.claude':return _0x5f42ba['completion'];case'ai21.j2':return _0x5f42ba['completions'][0x0]['data']['text'];case'cohere.command':return _0x5f42ba['generations'][0x0]['text'];case'meta.llama':return _0x5f42ba['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
23
+ import{Plugin as _0x79df7f,Command as _0x57e141}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x18e128,IconCheck as _0x1a8284,IconError as _0x5d6f38,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x1c8c09,IconRobotPencil as _0x4e7f8e}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x43c569,CKEditorError as _0x31f53a,ObservableMixin as _0x1a04e9,global as _0x38d498,isVisible as _0x2a8359,Rect as _0x8cd30b,Collection as _0x2197ad,FocusTracker as et,KeystrokeHandler as rt,first as _0x5d1380}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x243c46,View as _0x315dd6,SpinnerView as _0x57ab1b,IconView as _0x173f5c,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x14799d,createDropdown as _0x445275,addMenuToDropdown as _0x3532bf,MenuBarMenuView as _0x58da05,MenuBarMenuListItemButtonView as _0x1d8a4f,DialogViewPosition as _0x5e961b,MenuBarMenuListView as _0x56611d,MenuBarMenuListItemView as _0x35a1dc}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x278642,ClipboardMarkersUtils as _0x5f161a}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x56d237,ViewDataTransfer as _0x1e5433,ViewUpcastWriter as _0x146d0d,Matcher as _0x4873a8}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x2c193d,InvokeModelWithResponseStreamCommand as _0x47d31f,InvokeModelCommand as _0x2ac079}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x3c8318,_0x37fae0){const _0xe5738b=(0x0,_0x37fae0['t'])('Other');return _0x3c8318['length']?'groupId'in _0x3c8318[0x0]?_0x3c8318:[{'groupId':K,'groupLabel':_0xe5738b,'order':0x1/0x0,'commands':_0x3c8318}]:[{'groupId':K,'groupLabel':_0xe5738b,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x79df7f{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x3b8239}=this,_0x2e99ba=['ck-fake-ai-selection'];_0x3b8239['config']['get']('ai.useTheme')&&_0x2e99ba['push']('ck-ai-assistant-ui_theme'),_0x3b8239['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x2e99ba,'priority':0xc}}),_0x3b8239['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x386f3e,{writer:_0x3b47fd})=>{if(!_0x386f3e['markerRange']['isCollapsed'])return null;const _0xa518da=_0x3b47fd['createUIElement']('span');return _0x3b47fd['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0xa518da),_0xa518da;}});}['afterInit'](){!async function(_0x259002){const _0x4d0fc4=_0x5805e1([0x7a,0x62,0x36,0x31,0x46,0x4d,0x49,0x42,0x32,0x67,0x41,0x59,0x6c,0x39,0x37,0x51,0x72,0x35,0x44,0x70,0x6b,0x6a,0x56,0x4e,0x6d,0x6e,0x38,0x75,0x63,0x34,0x6f,0x77,0x64,0x68,0x45,0x58,0x73,0x33,0x78,0x54,0x30,0x53,0x4a,0x52,0x74,0x4b,0x71,0x50,0x65,0x79,0x5a,0x55,0x57,0x61,0x43,0x47,0x66,0x4f,0x76,0x48,0x4c,0x69]),_0x386fc9=0x155df333,_0x172081=0x155a9cfb^_0x386fc9,_0x50febe=window[_0x5805e1([0x44,0x61,0x74,0x65])][_0x5805e1([0x6e,0x6f,0x77])](),_0x697a88=_0x259002[_0x5805e1([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x58726a=new window[(_0x5805e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2c688a=>{_0x697a88[_0x5805e1([0x6f,0x6e,0x63,0x65])](_0x5805e1([0x72,0x65,0x61,0x64,0x79]),_0x2c688a);}),_0x499b95={[_0x5805e1([0x6b,0x74,0x79])]:_0x5805e1([0x45,0x43]),[_0x5805e1([0x75,0x73,0x65])]:_0x5805e1([0x73,0x69,0x67]),[_0x5805e1([0x63,0x72,0x76])]:_0x5805e1([0x50,0x2d,0x32,0x35,0x36]),[_0x5805e1([0x78])]:_0x5805e1([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]),[_0x5805e1([0x79])]:_0x5805e1([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]),[_0x5805e1([0x61,0x6c,0x67])]:_0x5805e1([0x45,0x53,0x32,0x35,0x36])},_0x5c15c7=_0x697a88[_0x5805e1([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x5805e1([0x67,0x65,0x74])](_0x5805e1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x3cc183(){let _0x157f07,_0x2e7447=null,_0x448ef9=null;try{if(_0x5c15c7==_0x5805e1([0x47,0x50,0x4c]))return _0x5805e1([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x157f07=_0x39f69a(),!_0x157f07)return _0x5805e1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x157f07[_0x5805e1([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x448ef9=_0xa15d(_0x157f07[_0x5805e1([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x157f07[_0x5805e1([0x6a,0x74,0x69])])),await _0x4bb1ac()?_0x333837()?_0x149622()?_0x5805e1([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1ffb27()?(_0x157f07[_0x5805e1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5805e1([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x2e7447=_0x5a43cc(_0x5805e1([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x157f07[_0x5805e1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5805e1([0x74,0x72,0x69,0x61,0x6c])&&(_0x2e7447=_0x5a43cc(_0x5805e1([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x54e5bd()):_0x5805e1([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x5805e1([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x5805e1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x5805e1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x149622(){const _0x2d9958=[_0x5805e1([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x5805e1([0x74,0x72,0x69,0x61,0x6c])][_0x5805e1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x157f07[_0x5805e1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x50febe/0x3e8:0xe10*_0x172081;return _0x157f07[_0x5805e1([0x65,0x78,0x70])]<_0x2d9958;}function _0x333837(){const _0x5b0d45=_0x157f07[_0x5805e1([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x5b0d45&&(!!_0x5b0d45[_0x5805e1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5805e1([0x2a]))||!!_0x5b0d45[_0x5805e1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5805e1([0x41,0x49])));}function _0x1ffb27(){const _0x15afe2=_0x157f07[_0x5805e1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x15afe2||0x0==_0x15afe2[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x5160fc}=new URL(window[_0x5805e1([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x15afe2[_0x5805e1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5160fc))return!0x0;const _0x5d6e11=_0x5160fc[_0x5805e1([0x73,0x70,0x6c,0x69,0x74])](_0x5805e1([0x2e]));return _0x15afe2[_0x5805e1([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5e6625=>_0x5e6625[_0x5805e1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5805e1([0x2a])))[_0x5805e1([0x6d,0x61,0x70])](_0x91d38e=>_0x91d38e[_0x5805e1([0x73,0x70,0x6c,0x69,0x74])](_0x5805e1([0x2e])))[_0x5805e1([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x246556=>_0x246556[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5d6e11[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x5805e1([0x6d,0x61,0x70])](_0x21f2a8=>Array(_0x5d6e11[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x21f2a8[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x5805e1([0x66,0x69,0x6c,0x6c])](_0x21f2a8[0x0]===_0x5805e1([0x2a])?_0x5805e1([0x2a]):'')[_0x5805e1([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x21f2a8))[_0x5805e1([0x73,0x6f,0x6d,0x65])](_0x48b430=>_0x5d6e11[_0x5805e1([0x65,0x76,0x65,0x72,0x79])]((_0x1389f8,_0x1904fe)=>_0x48b430[_0x1904fe]===_0x1389f8||_0x48b430[_0x1904fe]===_0x5805e1([0x2a])));}function _0x54e5bd(){return _0x2e7447&&_0x448ef9?new window[(_0x5805e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xc1af0d,_0x332da8)=>{_0x2e7447[_0x5805e1([0x74,0x68,0x65,0x6e])](_0xc1af0d,_0x332da8),_0x448ef9[_0x5805e1([0x74,0x68,0x65,0x6e])](_0xe42b78=>{_0xe42b78!=_0x5805e1([0x56,0x61,0x6c,0x69,0x64])&&_0xc1af0d(_0xe42b78);},_0x332da8);}):_0x2e7447||_0x448ef9||_0x5805e1([0x56,0x61,0x6c,0x69,0x64]);}}function _0xa15d(_0x12bf71,_0x349b86){return new window[(_0x5805e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x222e9e=>{if(_0x262a05())return _0x222e9e(_0x5805e1([0x56,0x61,0x6c,0x69,0x64]));_0x1bd7a2(),_0x697a88[_0x5805e1([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x5805e1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x262e4d=!0x1;const _0x32915d=_0x43c569();function _0x395329(_0x37c45a){return!!_0x37c45a&&(typeof _0x37c45a===_0x5805e1([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x37c45a===_0x5805e1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x37c45a[_0x5805e1([0x74,0x68,0x65,0x6e])]===_0x5805e1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x37c45a[_0x5805e1([0x63,0x61,0x74,0x63,0x68])]===_0x5805e1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x3184bd(_0x1e74ec){_0x1bf211(_0x1e74ec)[_0x5805e1([0x74,0x68,0x65,0x6e])](_0x3c9157=>{if(!_0x3c9157||_0x3c9157[_0x5805e1([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x5805e1([0x6f,0x6b]))return _0x5805e1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x41850f(_0x516eaa(_0x32915d+_0x349b86))!=_0x3c9157[_0x5805e1([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x5805e1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x5805e1([0x56,0x61,0x6c,0x69,0x64]);})[_0x5805e1([0x74,0x68,0x65,0x6e])](_0x125865=>(_0x381090(),_0x125865),()=>{const _0x4b4076=_0x34075f();return null==_0x4b4076?(_0x381090(),_0x5805e1([0x56,0x61,0x6c,0x69,0x64])):_0x5805e1(_0x50febe-_0x4b4076>(0x31517733^_0x386fc9)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x5805e1([0x74,0x68,0x65,0x6e])](_0x222e9e)[_0x5805e1([0x63,0x61,0x74,0x63,0x68])](()=>{_0x222e9e(_0x5805e1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x17b05f=0x156b1db3^_0x386fc9;function _0x381090(){const _0x5bb3ef=_0x5805e1([0x6c,0x6c,0x63,0x74,0x2d])+_0x41850f(_0x516eaa(_0x12bf71)),_0x804906=_0x1ec095(_0x41850f(window[_0x5805e1([0x4d,0x61,0x74,0x68])][_0x5805e1([0x63,0x65,0x69,0x6c])](_0x50febe/_0x17b05f)));window[_0x5805e1([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5805e1([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5bb3ef,_0x804906);}function _0x34075f(){const _0xb0d064=_0x5805e1([0x6c,0x6c,0x63,0x74,0x2d])+_0x41850f(_0x516eaa(_0x12bf71)),_0x2670ad=window[_0x5805e1([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5805e1([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xb0d064);return _0x2670ad?window[_0x5805e1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1ec095(_0x2670ad),0x10)*_0x17b05f:null;}function _0x1bf211(_0x224f50){return new window[(_0x5805e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x15b57d,_0x3dadae)=>{_0x224f50[_0x5805e1([0x74,0x68,0x65,0x6e])](_0x15b57d,_0x3dadae),window[_0x5805e1([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3dadae,0x155c27f3^_0x386fc9);});}}_0x697a88[_0x5805e1([0x6f,0x6e])](_0x5805e1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1a34e1,_0x420393)=>{if(_0x420393[0x0]!=_0x12bf71)return _0x222e9e(_0x5805e1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x420393[0x1]={..._0x420393[0x1],[_0x5805e1([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x32915d};},{[_0x5805e1([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5805e1([0x68,0x69,0x67,0x68])}),_0x697a88[_0x5805e1([0x6f,0x6e])](_0x5805e1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x5f2a92=>{_0x395329(_0x5f2a92[_0x5805e1([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x262e4d=!0x0,_0x3184bd(_0x5f2a92[_0x5805e1([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x5805e1([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5805e1([0x6c,0x6f,0x77])}),_0x58726a[_0x5805e1([0x74,0x68,0x65,0x6e])](()=>{_0x262e4d||_0x222e9e(_0x5805e1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x262a05(){return _0x697a88[_0x5805e1([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5805e1([0x76,0x69,0x65,0x77])][_0x5805e1([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x5805e1([0x61,0x75,0x74,0x6f]);}function _0x1bd7a2(){_0x697a88[_0x5805e1([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5805e1([0x76,0x69,0x65,0x77])][_0x5805e1([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x5805e1([0x61,0x75,0x74,0x6f]);}}function _0x5a43cc(_0x277cdb){const _0x3d31a9=[new window[(_0x5805e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1fd4d7=>setTimeout(_0x1fd4d7,0x1554cdff^_0x386fc9)),_0x58726a[_0x5805e1([0x74,0x68,0x65,0x6e])](()=>new window[(_0x5805e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2ac1d1=>{let _0x42a02d=0x0;_0x697a88[_0x5805e1([0x6d,0x6f,0x64,0x65,0x6c])][_0x5805e1([0x6f,0x6e])](_0x5805e1([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xc3b445,_0x1510af)=>{_0x1510af[0x0][_0x5805e1([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x42a02d++,_0x42a02d==(0x155df2cb^_0x386fc9)&&(_0x2ac1d1(),_0xc3b445[_0x5805e1([0x6f,0x66,0x66])]());});}))];return window[_0x5805e1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x5805e1([0x72,0x61,0x63,0x65])](_0x3d31a9)[_0x5805e1([0x74,0x68,0x65,0x6e])](()=>_0x277cdb);}async function _0x297db7(){await _0x58726a,_0x697a88[_0x5805e1([0x6d,0x6f,0x64,0x65,0x6c])][_0x5805e1([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x4fa75a,_0x697a88[_0x5805e1([0x6d,0x6f,0x64,0x65,0x6c])][_0x5805e1([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x4fa75a,_0x697a88[_0x5805e1([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x5805e1([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x1822f0(_0x4c32fd){const _0x7f071=_0x5dd34a();_0x697a88[_0x7f071]=_0x5805e1([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x4c32fd,_0x4c32fd!=_0x5805e1([0x56,0x61,0x6c,0x69,0x64])&&_0x297db7();}function _0x5dd34a(){const _0x5ee210=window[_0x5805e1([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x5805e1([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x5805e1([0x6e,0x6f,0x77])]())[_0x5805e1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x5805e1([0x2e]),'');let _0x1e86cb=_0x5805e1([0x7a]);for(let _0x559053=0x0;_0x559053<_0x5ee210[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x559053+=0x2){let _0x3cc373=window[_0x5805e1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5ee210[_0x5805e1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x559053,_0x559053+0x2));_0x3cc373>=_0x4d0fc4[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x3cc373-=_0x4d0fc4[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1e86cb+=_0x4d0fc4[_0x3cc373];}return _0x1e86cb;}function _0x39f69a(){const _0x15a7a1=_0x5c15c7[_0x5805e1([0x73,0x70,0x6c,0x69,0x74])](_0x5805e1([0x2e]));if(0x3!=_0x15a7a1[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xefbe57(_0x15a7a1[0x1]);function _0xefbe57(_0x237e55){const _0x45cf6c=_0x13e640(_0x237e55);return _0x45cf6c&&_0x27362c()?_0x45cf6c:null;function _0x27362c(){const _0x2c7299=_0x45cf6c[_0x5805e1([0x6a,0x74,0x69])],_0x40f8a0=window[_0x5805e1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2c7299[_0x5805e1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2c7299[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0xcc3f11={..._0x45cf6c,[_0x5805e1([0x6a,0x74,0x69])]:_0x2c7299[_0x5805e1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2c7299[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0xcc3f11[_0x5805e1([0x76,0x63])],_0x516eaa(_0xcc3f11)==_0x40f8a0;}}}async function _0x4bb1ac(){let _0x56376c=!0x0;try{const _0x1b9ec5=_0x5c15c7[_0x5805e1([0x73,0x70,0x6c,0x69,0x74])](_0x5805e1([0x2e])),[_0xd6f7cf,_0x32aff4,_0x330084]=_0x1b9ec5;return _0x7c99d5(_0xd6f7cf),await _0x271c2b(_0xd6f7cf,_0x32aff4,_0x330084),_0x56376c;}catch{return!0x1;}function _0x7c99d5(_0x1bee29){const _0x233367=_0x13e640(_0x1bee29);_0x233367&&_0x233367[_0x5805e1([0x61,0x6c,0x67])]==_0x5805e1([0x45,0x53,0x32,0x35,0x36])||(_0x56376c=!0x1);}async function _0x271c2b(_0x3e045b,_0x251a68,_0x1d6226){const _0x14cf1f=window[_0x5805e1([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x5805e1([0x66,0x72,0x6f,0x6d])](_0x32fef6(_0x1d6226),_0x4721d1=>_0x4721d1[_0x5805e1([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x18d68f=new window[(_0x5805e1([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x5805e1([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3e045b+_0x5805e1([0x2e])+_0x251a68),_0x2856ee=window[_0x5805e1([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x5805e1([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x2856ee)return;const _0x2d215e=await _0x2856ee[_0x5805e1([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x5805e1([0x6a,0x77,0x6b]),_0x499b95,{[_0x5805e1([0x6e,0x61,0x6d,0x65])]:_0x5805e1([0x45,0x43,0x44,0x53,0x41]),[_0x5805e1([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x5805e1([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x5805e1([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x2856ee[_0x5805e1([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x5805e1([0x6e,0x61,0x6d,0x65])]:_0x5805e1([0x45,0x43,0x44,0x53,0x41]),[_0x5805e1([0x68,0x61,0x73,0x68])]:{[_0x5805e1([0x6e,0x61,0x6d,0x65])]:_0x5805e1([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2d215e,_0x14cf1f,_0x18d68f)||(_0x56376c=!0x1);}}function _0x13e640(_0xbab1d9){return _0xbab1d9[_0x5805e1([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x5805e1([0x65,0x79]))?JSON[_0x5805e1([0x70,0x61,0x72,0x73,0x65])](_0x32fef6(_0xbab1d9)):null;}function _0x32fef6(_0x895ac){return window[_0x5805e1([0x61,0x74,0x6f,0x62])](_0x895ac[_0x5805e1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x5805e1([0x2b]))[_0x5805e1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x5805e1([0x2f])));}function _0x516eaa(_0xc5983a){let _0x39107f=0x1505;function _0x284714(_0x823ce0){for(let _0x4f57e6=0x0;_0x4f57e6<_0x823ce0[_0x5805e1([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4f57e6++){const _0x39a1a9=_0x823ce0[_0x5805e1([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x4f57e6);_0x39107f=(_0x39107f<<0x5)+_0x39107f+_0x39a1a9,_0x39107f&=_0x39107f;}}function _0x66623a(_0x592022){Array[_0x5805e1([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x592022)?_0x592022[_0x5805e1([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x66623a):_0x592022&&typeof _0x592022==_0x5805e1([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x5805e1([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x592022)[_0x5805e1([0x73,0x6f,0x72,0x74])]()[_0x5805e1([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x4f60c0,_0x17b69e])=>{_0x284714(_0x4f60c0),_0x66623a(_0x17b69e);}):_0x284714(window[_0x5805e1([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x592022));}return _0x66623a(_0xc5983a),_0x39107f>>>0x0;}function _0x41850f(_0xb20e91){return _0xb20e91[_0x5805e1([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x5805e1([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x5805e1([0x30]));}function _0x1ec095(_0x422fa6){return _0x422fa6[_0x5805e1([0x73,0x70,0x6c,0x69,0x74])]('')[_0x5805e1([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x5805e1([0x6a,0x6f,0x69,0x6e])]('');}function _0x4fa75a(){}function _0x5805e1(_0x37793e){return _0x37793e['map'](_0x430fe0=>String['fromCharCode'](_0x430fe0))['join']('');}_0x1822f0(await _0x3cc183());}(this);}['showFakeVisualSelection'](){const _0x91367c=this['editor']['model'];_0x91367c['change'](_0x125a80=>{const _0x16dc54=_0x91367c['document']['selection']['getRanges']();let _0xd294f=0x0;for(const _0x25ab79 of _0x16dc54){const _0x5c07d5=w+':'+_0xd294f;if(_0x91367c['markers']['has'](_0x5c07d5))_0x125a80['updateMarker'](_0x5c07d5,{'range':_0x25ab79});else{if(_0x25ab79['start']['isAtEnd']){const _0x1857d1=_0x25ab79['start']['getLastMatchingPosition'](({item:_0x242ec4})=>!_0x91367c['schema']['isContent'](_0x242ec4),{'boundaries':_0x25ab79});_0x125a80['addMarker'](_0x5c07d5,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x125a80['createRange'](_0x1857d1,_0x25ab79['end'])});}else _0x125a80['addMarker'](_0x5c07d5,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x25ab79});}_0xd294f++;}});}['hideFakeVisualSelection'](){const _0x34eb9c=this['editor']['model'],_0x338210=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x338210['length']&&_0x34eb9c['change'](_0x229cde=>{_0x338210['forEach'](_0x4517dd=>{_0x229cde['removeMarker'](_0x4517dd);});});}['insertContent'](_0x709be1,_0x2845a7){const _0x39a85d=this['_getAISelection'](),_0x10bbbf=_0x2845a7||_0x39a85d['getFirstRange']();this['editor']['model']['canEditAt'](_0x10bbbf)&&this['editor']['model']['change'](_0x2a6599=>{this['hideFakeVisualSelection'](),_0x2845a7||this['_resetContentOfSelectedTableCells'](_0x2a6599,_0x39a85d),this['_pasteHTMLUsingClipboard']({'insertAt':_0x10bbbf,'writer':_0x2a6599,'html':_0x709be1});});}['insertContentBelow'](_0x19b3d9){const {model:_0x54f8a0}=this['editor'],_0x49f3df=this['_getAISelection']();_0x54f8a0['change'](()=>{const _0x106dc2=this['_prepareTableInsertBelowPosition'](_0x19b3d9,_0x49f3df)||this['_getDefaultInsertBelowPosition'](_0x49f3df);this['insertContent'](_0x19b3d9,_0x106dc2);});}['_getAISelection'](){const _0x1c23ee=this['editor']['model'],_0x4f0b15=Array['from'](_0x1c23ee['markers']['getMarkersGroup'](w))['map'](_0x22c882=>_0x22c882['getRange']());return _0x1c23ee['createSelection'](_0x4f0b15);}['_pasteHTMLUsingClipboard']({writer:_0x40778a,html:_0x49340e,insertAt:_0x46f8bd}){const {view:_0x2337ef}=this['editor']['editing'],_0x6ffef6=this['editor']['plugins']['get'](_0x278642),_0x3739f5=new gt();_0x3739f5['setData']('text/html',_0x49340e);const _0xfddf7e=new ClipboardEvent('paste',{'clipboardData':_0x3739f5}),_0xb4c310=new _0x56d237(_0x2337ef,_0xfddf7e,{'dataTransfer':new _0x1e5433(_0x3739f5)});_0x40778a['setSelection'](_0x46f8bd);const _0x439300=(_0x4d343f,_0x18712c)=>{_0x18712c['resultRange']&&_0x40778a['setSelection'](_0x18712c['resultRange']);};_0x6ffef6['once']('contentInsertion',_0x439300,{'priority':'lowest'}),_0x2337ef['document']['fire']('paste',_0xb4c310),_0x6ffef6['off']('contentInsertion',_0x439300);}['_getDefaultInsertBelowPosition'](_0x5e6897){const {model:_0x229eec}=this['editor'],_0x4b375c=Array['from'](_0x5e6897['getSelectedBlocks']());return _0x4b375c['length']?_0x229eec['createPositionAfter'](_0x4b375c['pop']()):_0x5e6897['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3b8909,_0x2c34bf){const {model:_0x483491,plugins:_0x1b76cc}=this['editor'];if(_0x1b76cc['has']('TableUtils')){const _0x33934f=_0x1b76cc['get']('TableUtils')['getSelectedTableCells'](_0x2c34bf);if(_0x33934f['length']){const _0x5828a1=this['_getTableRowCountFromContent'](_0x3b8909),_0x21f890=this['_createEmptyTableRows'](_0x33934f,_0x5828a1);return _0x483491['createPositionAt'](_0x21f890,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1a5a09){const _0x51f573=this['editor']['plugins']['get']('TableUtils'),_0xf8f87=this['editor']['data']['parse'](_0x1a5a09),_0x3772c9=Array['from'](_0xf8f87['getChildren']())['filter'](_0x3d7ae4=>_0x3d7ae4['is']('element','table'));let _0x56a65e=0x0;return _0x3772c9['forEach'](_0x596f7b=>{_0x56a65e+=_0x51f573['getRows'](_0x596f7b);}),_0x56a65e;}['_createEmptyTableRows'](_0x2f45ec,_0x26a03b){const _0x4dd2be=this['editor']['plugins']['get']('TableUtils'),_0x6e4914=_0x4dd2be['getRowIndexes'](_0x2f45ec),_0x51b50c=_0x4dd2be['getColumnIndexes'](_0x2f45ec),_0x2ee861=_0x6e4914['last']+0x1,_0x9dcecd=_0x51b50c['first'],_0x4047d2=_0x2f45ec[0x0]['findAncestor']('table');for(let _0x196ec5=0x0;_0x196ec5<_0x26a03b;_0x196ec5++)_0x4dd2be['insertRows'](_0x4047d2,{'at':_0x2ee861});return _0x4047d2['getChild'](_0x2ee861)['getChild'](_0x9dcecd);}['_resetContentOfSelectedTableCells'](_0x1a31f5,_0xb75946){const {plugins:_0x1dfbcd}=this['editor'],{model:_0x4ce610}=_0x1a31f5;if(!_0x1dfbcd['has']('TableUtils'))return;_0x1dfbcd['get']('TableUtils')['getSelectedTableCells'](_0xb75946)['length']&&_0x4ce610['deleteContent'](_0xb75946);}}class x extends _0x79df7f{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x31f53a('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x3fda56){super(_0x3fda56),this['name']='AIRequestError';}}function i(_0x4e45f4,_0xb43446,_0x160771){const t=_0x4e45f4['t'];switch(_0xb43446){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',_0x160771);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x160771);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'},_0x160771);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 _0xb43446;}}class E extends _0x57e141{['_commandDefinitions'];constructor(_0x53b595,_0xd521a6){super(_0x53b595),this['_commandDefinitions']=_0xd521a6,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0xb280f3,_0xf1b8d0,_0x4e2af7)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x4e2af7));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x423840,_0x3afc7f,_0x44962e)=>{this['enabledCommandsIds']=_0x44962e?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3fd3ce=this['editor']['model'];this['_hasContext']=function(_0x56d8e1){const _0x1f215b=_0x56d8e1['document']['selection'];return _0x1f215b['isCollapsed']?0x0!==[..._0x1f215b['getSelectedBlocks']()]['length']&&![..._0x1f215b['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x56d8e1['hasContent'](_0x1f215b['getFirstRange']());}(_0x3fd3ce);const _0x196fab=_0x3fd3ce['document']['selection'],_0x5021d9=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x240547 of _0x196fab['getRanges']())for(const _0x19aba5 of _0x240547['getItems']())if(_0x19aba5['is']('element')&&_0x5021d9['includes'](_0x19aba5['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x473047='',_0x119c4a='',_0x3a2645='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x473047,_0x119c4a,_0x3a2645);}}function F(_0x14af6c,_0x83b9d7){const _0x36af52=new Set();for(const _0x2ffedd of _0x14af6c['values']())(_0x83b9d7||!0x1===_0x2ffedd['requiresContent'])&&_0x36af52['add'](_0x2ffedd['id']);return Array['from'](_0x36af52);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
+ _0x1a04e9(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x175084,_0x260b28,_0x74840c){super(),this['editor']=_0x175084,this['textAdapter']=_0x260b28,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x74840c,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x312763,_0x22baf3,_0x541141)=>{this['view']['value']=this['_sanitizeHTML'](_0x541141);}),this['listenTo'](this['view'],'submitPrompt',(_0x504c1a,_0x1240af)=>{const _0x3fded9=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x1240af,_0x3fded9,'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:_0x18804a,query:_0x19d168,htmlContent:_0x279bd9,label:_0xd97c9c,mainActionLabel:_0x4acc5d}){this['view']['prompt']=_0xd97c9c,this['view']['mainAction']=_0x4acc5d,this['initialContext']=_0x279bd9,_0x19d168&&(this['view']['isRendered']?this['_handleQuery'](_0x19d168,_0x279bd9,_0x18804a,_0xd97c9c):this['view']['once']('render',()=>{this['_handleQuery'](_0x19d168,_0x279bd9,_0x18804a,_0xd97c9c);}));}['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'](_0x4b8cc9,_0x363b04,_0x891021,_0x45ec89){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x363b04,this['previousQuery']=_0x4b8cc9,this['previousLabel']=_0x45ec89||_0x4b8cc9,this['previousActionId']=_0x891021,new Promise(_0x23f3b6=>{this['textAdapter']['makeRequest']({'query':_0x4b8cc9,'context':_0x363b04,'onData':_0x41846c=>{this['currentResponse']=_0x41846c,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x891021})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x423b5e=>{_0x423b5e instanceof R?this['view']['handleError'](_0x423b5e['message']):this['view']['handleError'](),_0x23f3b6();})['finally'](()=>{this['stopProcessing'](),_0x23f3b6();});});}['_parseAndNormalizeContent'](_0x132888,_0x5f18e0=!0x1){const _0xcfefdb=Q['exec'](_0x132888);_0x132888=_0xcfefdb?_0x132888['substring'](_0xcfefdb[0x1]['length']):_0x132888['length']<0x64&&!_0x5f18e0?'':this['_stripMarkdownSyntax'](_0x132888);const _0x51478d=this['_domParser']['parseFromString'](_0x132888,'text/html');if(_0xcfefdb){const _0x209236=Array['from'](_0x51478d['body']['childNodes']);_0x209236['reverse']();for(const _0x58ae1b of _0x209236){if(_0x58ae1b['nodeType']==Node['ELEMENT_NODE'])break;_0x58ae1b['remove']();}}const _0x12eece=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x51478d['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x12eece);const _0x32d2a7=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x527353=this['editor']['data']['toModel'](_0x12eece);return _0x32d2a7||_0x527353['markers']['clear'](),this['editor']['data']['stringify'](_0x527353);}['_normalizeResponseHeadings'](_0x2633a3){const _0x9efd43=new _0x146d0d(this['editor']['editing']['view']['document']),_0x450513=new _0x4873a8({'name':/^h[1-5]$/}),_0x20e443=[];let _0x29606a=!0x1;for(const _0x34ce2d of _0x2633a3)_0x34ce2d['is']('element')&&_0x450513['match'](_0x34ce2d)&&(_0x20e443['push'](_0x34ce2d),'h1'==_0x34ce2d['name']&&(_0x29606a=!0x0));if(_0x29606a){for(const _0x3e0814 of _0x20e443)_0x9efd43['rename']('h'+(parseInt(_0x3e0814['name'][0x1])+0x1),_0x3e0814);}}['_isH1TagSupportEnabled'](){const {data:_0x5c8efa,editing:_0x975ab7}=this['editor'],_0x5a0c72=_0x5c8efa['htmlProcessor']['toView']('<h1></h1>'),_0xad71b2=_0x5c8efa['toView'](_0x5c8efa['toModel'](_0x5a0c72));return!!_0x975ab7['view']['domConverter']['viewToDom'](_0xad71b2)['querySelector']('h1');}['_sanitizeHTML'](_0x743606){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x743606),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x59d8ed){const _0x976bba=_0x59d8ed['trim']();return _0x976bba['startsWith']('```html')?_0x976bba['endsWith']('```')?_0x976bba['substring'](0x7,_0x976bba['length']-0x3):_0x976bba['substring'](0x7):_0x59d8ed;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x103b44){super(_0x103b44),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x505fdb=>i(_0x103b44,'AI_'+_0x505fdb['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x103b44,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x103b44,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x103b44,'Stop'));const _0x2fa3da=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x2fa3da['if']('isVisible','ck-hidden',_0x33fb8c=>!_0x33fb8c)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x4a45aa,_0x304f81){const _0x4502cd=new _0x243c46(this['locale']);return _0x4502cd['set']({'label':_0x4a45aa,'class':_0x304f81||'','isVisible':!0x0,'withText':!0x0}),_0x4502cd;}}class ct extends _0x315dd6{['contentFieldView'];['copyButtonView'];constructor(_0x11d8e8,_0x3075b5=''){super(_0x11d8e8),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x13c909=this['bindTemplate'];this['contentFieldView']=new bt(_0x11d8e8,_0x3075b5),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x13c909['if']('isVisible','ck-hidden',_0x3d778c=>!_0x3d778c)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x13c909['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 _0x2adb92=!0x1;this['on']('change:value',(_0x534973,_0x12fd5b,_0x2c8be9)=>{const _0xa84f47=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2c8be9),this['isProcessing']&&_0xa84f47&&!_0x2adb92&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1a03d1,_0x4b8843,_0x2a9d96)=>{_0x2adb92=!0x1,_0x2a9d96?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x2adb92=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x2adb92=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x114bf5=this['locale'],_0x21946d=new _0x243c46(this['locale']),_0x25a868='ck-ai-form__copy-button';return _0x21946d['set']({'label':i(_0x114bf5,'Copy'),'icon':_0x18e128,'class':_0x25a868,'tooltip':!0x0}),_0x21946d['bind']('isVisible')['to'](this,'value',_0x72a3c9=>!!_0x72a3c9),_0x21946d['bind']('isEnabled')['to'](this,'isProcessing',_0x29b653=>!_0x29b653),_0x21946d['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x21946d['icon']=_0x1a8284,_0x21946d['class']=_0x25a868+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x21946d['icon']=_0x18e128,_0x21946d['class']=_0x25a868;},0x3e8);}),_0x21946d;}['_copyHTMLToClipboard'](_0x20a1c7){const {window:_0x52f40b,document:_0x2f2c8b}=_0x38d498;if(_0x52f40b['ClipboardItem']){const {Blob:_0x304ce1,ClipboardItem:_0x23fb00}=_0x52f40b,_0x2cde29=[new _0x23fb00({'text/html':new _0x304ce1([_0x20a1c7['innerHTML']],{'type':'text/html'}),'text/plain':new _0x304ce1([_0x20a1c7['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2cde29);}else{const _0x32f8b3=_0x2f2c8b['createElement']('div');_0x32f8b3['style']['position']='absolute',_0x32f8b3['style']['left']='-9999px',_0x32f8b3['innerHTML']='<span>[</span>'+_0x20a1c7['innerHTML']+'<span>]</span>',_0x2f2c8b['body']['appendChild'](_0x32f8b3);const _0x1036a9=_0x2f2c8b['createRange']();_0x1036a9['setStartAfter'](_0x32f8b3['firstElementChild']),_0x1036a9['setEndBefore'](_0x32f8b3['lastElementChild']);const _0x2036ff=_0x52f40b['getSelection']();_0x2036ff['removeAllRanges'](),_0x2036ff['addRange'](_0x1036a9),_0x2f2c8b['execCommand']('copy'),_0x32f8b3['remove']();}}}class bt extends _0x315dd6{constructor(_0x62bc22,_0x33c240=''){super(_0x62bc22),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x33c240,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x179c2b){this['element']['innerHTML']=_0x179c2b;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4c96cd=new _0x315dd6(),_0x57b805=this['locale'],_0x427a3e=new _0x57ab1b();return _0x427a3e['isVisible']=!0x0,_0x4c96cd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x427a3e,{'text':i(_0x57b805,'AI\x20is\x20writing...')}]}),_0x4c96cd['render'](),_0x4c96cd;}}class mt extends _0x315dd6{constructor(_0x4692bc,_0x2bdd7e=''){super(_0x4692bc);const _0xadbea7=new _0x173f5c(),_0x1c5619=this['bindTemplate'];this['set']('text',_0x2bdd7e),_0xadbea7['content']=_0x5d6f38,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0xadbea7,{'text':_0x1c5619['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x10a2b1,_0x496fbc){super(_0x10a2b1,_0x496fbc),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',(_0x43b4b0,_0xce49d0)=>{_0x43b4b0['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xce49d0());});}['_createSubmitButton'](){const _0x52077c=new _0x243c46(this['locale']),_0x342e46=this['locale'];return _0x52077c['set']({'icon':it,'label':i(_0x342e46,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x52077c['on']('execute',()=>{this['submit']();}),_0x52077c['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x59763b,_0x2e5f0a)=>!_0x59763b&&_0x2e5f0a),_0x52077c;}['_createShowHistoryButton'](){const _0x355ab4=new _0x243c46(this['locale']),_0x48356c=this['resultsView'],_0x86856=this['locale'];_0x355ab4['set']({'label':i(_0x86856,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x355ab4['bind']('isOn')['to'](_0x48356c,'isVisible'),_0x355ab4['bind']('isEnabled')['to'](this,'isEnabled'),_0x355ab4['on']('execute',()=>{_0x48356c['isVisible']=!_0x48356c['isVisible'],_0x48356c['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2ffc47=()=>{_0x38d498['window']['requestAnimationFrame'](()=>{if(_0x2a8359(this['element'])){const _0x53c29e=new _0x8cd30b(this['queryView']['fieldView']['element']),_0x1d7e14=_0x53c29e['width'],_0x5ed01d='rtl'===_0x86856['uiLanguageDirection']?'left':'right';_0x53c29e['excludeScrollbarsAndBorders'](),_0x355ab4['element']['style'][_0x5ed01d]=_0x1d7e14-_0x53c29e['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2ffc47),this['on']('render',_0x2ffc47),_0x355ab4;}['submit'](){const _0x3870b3=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x3870b3);}['focus'](_0x12e077){-0x1===_0x12e077?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x5b8ca4){super(_0x5b8ca4),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x5b8ca4,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x55e82b=0x0;for(const _0x34891e of this['items'])_0x55e82b+=_0x34891e['items']['length'];return{'resultsCount':_0x55e82b,'totalItemsCount':_0x55e82b};}['_createClearHistoryButton'](){const _0x3d3af5=this['locale'],_0x1ec567=new _0x243c46(this['locale']);return _0x1ec567['set']({'label':'('+i(_0x3d3af5,'Clear')+')','withText':!0x0}),_0x1ec567['on']('execute',()=>this['fire']('clearHistory')),_0x1ec567;}}class ut extends xt{constructor(_0xb8a8b5){super();const _0x59b26f=new wt(),_0x5a4bee=new _0x243c46(this['locale'],_0x59b26f);this['children']['add'](_0x5a4bee),_0x5a4bee['set']({'label':_0xb8a8b5['prompt'],'withText':!0x0}),_0x5a4bee['on']('execute',()=>{this['fire']('execute',{'value':kt(_0xb8a8b5['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x2197ad{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x18be4f,_0x58027c)=>{const _0x1baba6=os(_0x58027c['prompt']);for(const _0x116bc0 of this)if(_0x116bc0!=_0x58027c&&os(_0x116bc0['prompt'])===_0x1baba6){this['remove'](_0x116bc0);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2c7bd8=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x2c7bd8));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x5ab588=>_0x5ab588)));}}function os(_0x29d5d7){return _0x29d5d7['toLowerCase']()['trim']();}class k extends _0x315dd6{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2d94ab,_0x36efd6,_0x3669d7=''){super(_0x2d94ab),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0x2d94ab),this['contentArea']=new ct(_0x2d94ab,_0x3669d7),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 et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'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 _0x51ed9d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x36efd6],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x51ed9d['if']('isError','ck-hidden',_0xb00ba9=>!_0xb00ba9)]},'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'](_0x3f7fdf=0x1){-0x1===_0x3f7fdf?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 _0x572e49=this['locale'],_0x5ce0e4=new lt(_0x572e49,{'queryView':{'label':i(_0x572e49,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x572e49,'Empty\x20history'),'secondary':i(_0x572e49,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5ce0e4['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x431ca5,_0x5cd404)=>_0x431ca5&&!_0x5cd404),this['listenTo'](_0x5ce0e4,'submit',(_0x11cd86,_0x3658b3)=>{this['prompt']=_0x3658b3;const _0x437205=ft(_0x3658b3);this['fire']('submitPrompt',_0x437205),_0x3658b3['trim']()&&this['_promptHistory']['add']({'prompt':_0x437205},0x0);},{'priority':'high'}),_0x5ce0e4;}['_createHistoryView'](){const _0x43b76f=new pt(this['locale']);return _0x43b76f['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x43b76f['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x43b76f;}['_createToolbar'](){const _0x2dade4=new at(this['locale']);return _0x2dade4['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1b8402,_0x40b5e8,_0x1ac2c3)=>_0x1b8402&&!_0x40b5e8&&!!_0x1ac2c3),_0x2dade4['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x2dade4['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1793bd,_0x253560,_0x3a225d)=>_0x1793bd&&!_0x253560&&!!_0x3a225d),_0x2dade4['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x2dade4['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x246080,_0x4743ca)=>_0x246080&&!_0x4743ca),_0x2dade4['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x2dade4['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x2dade4['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x2dade4;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x4b9786=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x4b9786,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x436623){const _0xf27ea5=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x436623||i(_0xf27ea5,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x79df7f{['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[_0x5f161a,a,x,_0x14799d];}constructor(_0x158e44){super(_0x158e44),_0x158e44['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x158e44['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x158e44['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x158e44['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0xc899e9}=this;this['_aiAdapter']=_0xc899e9['plugins']['get'](x),this['_dialog']=_0xc899e9['plugins']['get'](_0x14799d),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x343fb6=new E(_0xc899e9,Array['from'](this['_commandDefinitions']['values']()));_0xc899e9['commands']['add']('showAIAssistant',_0x343fb6),_0xc899e9['ui']['componentFactory']['add']('aiCommands',_0x22c543=>{const _0x28893a=_0x445275(_0x22c543);return _0x28893a['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x28893a['buttonView']['set']({'label':i(_0x22c543,'AI\x20Commands'),'icon':_0x1c8c09,'tooltip':!0x0}),_0x28893a['on']('execute',_0x1a5b69=>this['_onExecute'](_0x1a5b69['source']['id'])),_0x3532bf(_0x28893a,_0xc899e9['ui']['view']['body'],function(_0x2143a3){const _0x446eff=o(_0x2143a3['config']['get']('ai.aiAssistant.commands'),_0x2143a3['locale']),_0x28ad25=U(_0x2143a3,_0x446eff)['filter'](_0x384262=>_0x384262['commands']['length']);if(0x1===_0x28ad25['length'])return U(_0x2143a3,_0x28ad25[0x0]['commands'])['map'](_0x5d5281=>({'id':_0x5d5281['id'],'label':_0x5d5281['label']}));return _0x28ad25['map'](_0x4d1ddb=>{const {groupId:_0xf01714,groupLabel:_0x297b22,commands:_0x3523e2}=_0x4d1ddb,_0x474014=U(_0x2143a3,_0x3523e2)['map'](_0x37b0af=>({'id':_0x37b0af['id'],'label':_0x37b0af['label']}));return{'id':_0xf01714,'menu':_0x297b22||_0xf01714,'children':_0x474014};});}(_0xc899e9),{'ariaLabel':i(_0x22c543,'AI\x20Commands')}),_0x28893a['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x343fb6['on']('change:enabledCommandsIds',_0x1eefdf),_0x28893a['menuView']['once']('render',_0x1eefdf),_0x28893a;function _0x1eefdf(){_0x28893a['isEnabled']=_0x343fb6['enabledCommandsIds']['length']>0x0;for(const _0x2bd7a5 of _0x28893a['menuView']['buttons'])_0x2bd7a5['isEnabled']=_0x343fb6['enabledCommandsIds']['includes'](_0x2bd7a5['id']);}}),_0xc899e9['ui']['componentFactory']['add']('menuBar:aiCommands',_0x250a8a=>{const _0x3db10a=new _0x58da05(_0x250a8a);_0x3db10a['buttonView']['set']({'label':i(_0x250a8a,'AI\x20Commands'),'icon':_0x1c8c09}),_0x3db10a['bind']('isEnabled')['to'](_0x343fb6,'enabledCommandsIds',_0x2dd499=>_0x2dd499['length']>0x0);const _0xd73dfb=o(_0xc899e9['config']['get']('ai.aiAssistant.commands'),_0x250a8a);return this['_populateMenuBarMenu'](_0x343fb6,_0x3db10a,_0xd73dfb,_0x39abca=>this['_onExecute'](_0x39abca)),_0x3db10a;}),_0xc899e9['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x5a3d53=this['_createAIAssistantUIButton'](_0x243c46);return _0x5a3d53['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x5a3d53;}),_0xc899e9['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x264730=this['_createAIAssistantUIButton'](_0x1d8a4f);return _0x264730['set']({'role':'menuitemcheckbox'}),_0x264730;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x5406c7=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1321d7;for(const _0x15ecb2 in _0x5406c7){const _0x158278=_0x15ecb2,_0x3469e0=_0x5406c7[_0x158278];if('aiLicenseKeyValid'==_0x3469e0||'aiLicenseKeyInvalid'==_0x3469e0||'aiLicenseKeyExpired'==_0x3469e0||'aiLicenseKeyDomainLimit'==_0x3469e0||'aiLicenseKeyNotAllowed'==_0x3469e0||'aiLicenseKeyEvaluationLimit'==_0x3469e0||'aiLicenseKeyTrialLimit'==_0x3469e0||'aiLicenseKeyUsageLimit'==_0x3469e0){delete _0x5406c7[_0x158278],_0x1321d7=_0x3469e0,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x1321d7&&_0x5406c7['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x1321d7&&_0x5406c7['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x1321d7&&_0x5406c7['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x1321d7&&_0x5406c7['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x1321d7&&_0x5406c7['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x1321d7&&_0x5406c7['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x1321d7&&_0x5406c7['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x25600f='',_0x2aaf00='',_0x5eeea3='custom'){const _0x13800e=this['editor'],_0x5aa55a=_0x13800e['editing']['view'],_0x99c4da=_0x13800e['plugins']['get'](a),_0x5a06b1=_0x13800e['plugins']['get'](_0x5f161a);_0x99c4da['showFakeVisualSelection']();const _0x577672=new l(),_0x37bec3=new ClipboardEvent('copy',{'clipboardData':_0x577672}),_0xd29b6d=new _0x1e5433(_0x577672),_0x3f3479=new _0x56d237(_0x5aa55a,_0x37bec3,{'dataTransfer':_0xd29b6d});_0x5a06b1['_forceMarkersCopy']('comment',()=>{_0x5aa55a['document']['fire']('copy',_0x3f3479);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x13800e,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x323722=_0xd29b6d['getData']('text/html');const _0x530522=_0x13800e['model']['document']['selection'],_0x402c3a=Array['from'](_0x530522['getRanges']());0x1===_0x402c3a['length']&&_0x402c3a[0x0]['isFlat']&&!_0x530522['getSelectedElement']()&&''!==_0x323722['replace'](/&nbsp;/g,'')['trim']()&&(_0x323722='<p>'+_0x323722+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x5eeea3,'query':_0x25600f,'htmlContent':_0x323722,'label':_0x2aaf00,'mainActionLabel':_[_0x13800e['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x4e7f8e,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x5e961b['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x99c4da['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x59093f=new Map(),_0x4c0454=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x30b488 of _0x4c0454)for(const _0x3600f9 of _0x30b488['commands'])_0x59093f['set'](_0x3600f9['id'],{..._0x3600f9,'groupId':_0x30b488['groupId'],'groupLabel':_0x30b488['groupLabel']||_0x30b488['groupId']});return _0x59093f;}['_createAIAssistantUIButton'](_0x3c2154){const _0xf6ff02=this['editor'],_0x1b4346=_0xf6ff02['commands']['get']('showAIAssistant'),_0x3eea2f=new _0x3c2154(_0xf6ff02['locale']);return _0x3eea2f['set']({'label':i(_0xf6ff02['locale'],'AI\x20Assistant'),'icon':_0x4e7f8e,'isToggleable':!0x0}),_0x3eea2f['bind']('isEnabled')['to'](_0x1b4346),_0x3eea2f['bind']('isOn')['to'](this['_dialog'],'id',_0x914db1=>'aiAssistant'===_0x914db1),this['listenTo'](_0x3eea2f,'execute',()=>{_0x3eea2f['isOn']?this['hideUI']():_0x1b4346['execute']();}),_0x3eea2f;}['_initView'](){const _0x14b3df=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x14b3df['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x14b3df['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2465d3,ui:{ariaLiveAnnouncer:_0x544d78}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x122f4b,_0x290abd,_0x324043)=>{const _0x368889=this['_aiAssistantController']['currentContext'];_0x324043?_0x544d78['announce'](i(_0x2465d3,'AI\x20is\x20writing')):_0x368889&&_0x544d78['announce'](i(_0x2465d3,'Generated\x20content:\x20%0',_0x368889),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x58916c,_0x1f6e47,_0xc5a0d4)=>{if(_0xc5a0d4){const _0x28b98f=this['_formView']['errorView']['text'];_0x544d78['announce'](i(_0x2465d3,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x28b98f));}});}['_onExecute'](_0x49b813){const _0x5d80ea=this['_commandDefinitions']['get'](_0x49b813),_0xa94a39=this['editor'],_0x2052a7=_0xa94a39['model']['document']['selection'],_0x52e846=_0xa94a39['commands']['get']('showAIAssistant'),_0x1b05de=_0xa94a39['plugins']['get'](a),_0x27eefa=''+(_0x5d80ea['groupId']!==K?_0x5d80ea['groupLabel']+':\x20':'')+_0x5d80ea['label'];if(!0x1!==_0x5d80ea['requiresContent']&&_0x2052a7['isCollapsed']){const _0x2fb4ce=_0x5d1380(_0x2052a7['getSelectedBlocks']())||_0xa94a39['model']['schema']['getLimitElement'](_0x2052a7);_0xa94a39['model']['change'](_0xd947c9=>{_0xd947c9['setSelection'](_0x2fb4ce,'in');});}_0x1b05de['showFakeVisualSelection'](),_0x52e846['execute'](_0x5d80ea['prompt'],_0x27eefa,'command:'+_0x49b813);}['_populateMenuBarMenu'](_0x1af07b,_0x501a06,_0x92445c,_0x256569){const _0x4fb1de=this['editor'],_0x95d4ec=_0x4fb1de['locale'],_0x40f803=new _0x56611d(_0x95d4ec),_0x228d30=U(_0x4fb1de,_0x92445c)['filter'](_0x6b1093=>_0x6b1093['commands']['length']);0x1===_0x228d30['length']?this['_getMenuBarGroupButtons']({'command':_0x1af07b,'commands':_0x228d30[0x0]['commands'],'parentMenuView':_0x501a06,'onExecute':_0x256569})['forEach'](_0x29dbc2=>_0x40f803['items']['add'](_0x29dbc2)):_0x228d30['forEach'](({groupId:_0x58167c,groupLabel:_0x1d8235,commands:_0x4c748c})=>{const _0x154aec=new _0x35a1dc(_0x95d4ec,_0x501a06),_0x265690=new _0x58da05(_0x95d4ec),_0x46251d=new _0x56611d(_0x95d4ec),_0x161dce=this['_getMenuBarGroupButtons']({'command':_0x1af07b,'commands':_0x4c748c,'parentMenuView':_0x265690,'onExecute':_0x256569});_0x265690['buttonView']['set']({'label':_0x1d8235||_0x58167c}),_0x265690['delegate']('execute')['to'](_0x501a06),_0x46251d['items']['addMany'](_0x161dce),_0x265690['panelView']['children']['add'](_0x46251d),_0x154aec['children']['add'](_0x265690),_0x40f803['items']['add'](_0x154aec);}),_0x501a06['panelView']['children']['add'](_0x40f803);}['_getMenuBarGroupButtons']({command:_0x51a71d,commands:_0x678a65,parentMenuView:_0x16a98b,onExecute:_0x55d674}){const _0x177f83=this['editor'],_0x53231b=_0x177f83['locale'];return U(_0x177f83,_0x678a65)['map'](_0x3067d9=>{const _0x55a57a=new _0x35a1dc(_0x53231b,_0x16a98b),_0x54aebe=new _0x1d8a4f(_0x53231b);return _0x54aebe['set']({'label':_0x3067d9['label']}),_0x54aebe['delegate']('execute')['to'](_0x16a98b),_0x54aebe['on']('execute',()=>_0x55d674(_0x3067d9['id'])),_0x54aebe['bind']('isEnabled')['to'](_0x51a71d,'enabledCommandsIds',_0x48bdff=>_0x48bdff['includes'](_0x3067d9['id'])),_0x55a57a['children']['add'](_0x54aebe),_0x55a57a;});}}function T(_0x238eb0,_0x6f84f){return void 0x0!==_0x238eb0['order']&&void 0x0===_0x6f84f['order']?0x1:void 0x0===_0x238eb0['order']&&void 0x0!==_0x6f84f['order']?-0x1:void 0x0!==_0x238eb0['order']&&void 0x0!==_0x6f84f['order']?_0x238eb0['order']-_0x6f84f['order']:0x0;}function U(_0x9000d5,_0x864ce4){_0x864ce4['sort'](T);const _0x5b8bf3={},_0x1b98d8=[];for(const _0x181ab9 of _0x864ce4)if(void 0x0!==_0x181ab9['order']){if(_0x181ab9['order']in _0x5b8bf3)throw new _0x31f53a('ai-commands-config-order-collision',_0x9000d5,{'conflictingDefinitions':[_0x181ab9,_0x5b8bf3[_0x181ab9['order']]]});_0x5b8bf3[_0x181ab9['order']]=_0x181ab9,_0x1b98d8['splice'](_0x181ab9['order'],0x0,_0x181ab9);}else _0x1b98d8['push'](_0x181ab9);return _0x1b98d8;}class At extends _0x79df7f{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4ea030){super(_0x4ea030);const _0x4626fd=_0x4ea030['config'],_0x1ca602=_0x4ea030['locale'];_0x4626fd['define']('ai.aiAssistant.preserveComments',!0x0),_0x4626fd['define']('ai.aiAssistant.commands',_t(_0x1ca602)),_0x4626fd['define']('ai.aiAssistant.extraCommandGroups',[]),_0x4626fd['define']('ai.aiAssistant.removeCommands',[]);let _0x54adf3=o(_0x4626fd['get']('ai.aiAssistant.commands'),_0x1ca602);const _0x2e26d0=_0x4626fd['get']('ai.aiAssistant.extraCommandGroups'),_0x52b77d=_0x4626fd['get']('ai.aiAssistant.removeCommands');_0x2e26d0['forEach'](_0x5e3bbe=>{const _0x13563a=_0x54adf3['find'](_0x28f67b=>_0x28f67b['groupId']===_0x5e3bbe['groupId']);_0x13563a?_0x13563a['commands']=_0x13563a['commands']['concat'](_0x5e3bbe['commands']):_0x54adf3['push'](_0x5e3bbe);}),_0x54adf3=_0x54adf3['filter'](_0x57a617=>!_0x52b77d['includes'](_0x57a617['groupId'])),_0x54adf3['forEach'](_0x1b0090=>{_0x1b0090['commands']=_0x1b0090['commands']['filter'](_0x51a802=>!_0x52b77d['includes'](_0x51a802['id']));}),_0x4626fd['set']('ai.aiAssistant.commands',_0x54adf3);}}function _t(_0x306e1a){return[{'groupId':'editOrReview','groupLabel':i(_0x306e1a,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x306e1a,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x306e1a,'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(_0x306e1a,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x306e1a,'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(_0x306e1a,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x306e1a,'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(_0x306e1a,'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(_0x306e1a,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x306e1a,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x306e1a,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x306e1a,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x306e1a,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x306e1a,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x306e1a,'Change\x20style'),'commands':[{'id':'business','label':i(_0x306e1a,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x306e1a,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x306e1a,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x306e1a,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x306e1a,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x306e1a,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x306e1a,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x306e1a,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x306e1a,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x306e1a,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x306e1a,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x306e1a,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x306e1a,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x79df7f{['abortController'];static get['requires'](){return[x];}constructor(_0xcd289a){super(_0xcd289a),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x3678c1){return this['sendRequest'](_0x3678c1)['catch'](_0x4f635a=>{if(_0x4f635a instanceof R)return Promise['reject'](_0x4f635a);if('AbortError'==_0x4f635a['name'])return Promise['resolve']();throw console['error'](_0x4f635a),new _0x31f53a('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x43e333,_0x4e10f6){const _0x2d172c=this['editor']['locale'],_0x41395c={'Content-Type':'application/json'};if('object'==typeof _0x43e333)Object['assign'](_0x41395c,_0x43e333);else{if(_0x43e333)try{const _0x582100=await _0x43e333(_0x4e10f6);Object['assign'](_0x41395c,_0x582100);}catch{return Promise['reject'](new R(i(_0x2d172c,'AI_ERROR_GET_HEADERS')));}}return _0x41395c;}async['_prepareRequestParameters'](_0xe985bf,_0x133cdc){const _0x48fcad=this['editor']['locale'];if('object'==typeof _0xe985bf)return _0xe985bf;try{return await _0xe985bf(_0x133cdc);}catch{return Promise['reject'](new R(i(_0x48fcad,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x281f0e){super(_0x281f0e),_0x281f0e['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x281f0e['config']['get']('ai.openAI.requestParameters')||_0x281f0e['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x281f0e['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x281f0e['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x281f0e['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x49092a,context:_0x18a241,onData:_0x590a77,actionId:_0x56e192}){const _0x847872=this['editor']['locale'],_0x554b3b=await this['prepareMessages'](_0x49092a,_0x18a241,_0x56e192),_0x522575=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x56e192),_0xb7df81=await this['_prepareRequestParameters'](this['_requestParameters'],_0x56e192),_0x4a868d={'messages':_0x554b3b,..._0xb7df81},_0x5bf4dc={'method':'POST','headers':_0x522575,'body':JSON['stringify'](_0x4a868d),'signal':this['abortController']['signal']},_0x123ee5=await fetch(this['_apiUrl'],_0x5bf4dc);if(_0x123ee5['ok'])return _0xb7df81['stream']?await this['_readStreamableResponse'](_0x123ee5,_0x590a77):await this['_readStaticResponse'](_0x123ee5,_0x590a77),Promise['resolve']();{const _0x518aeb=await _0x123ee5['text']();return _0x518aeb['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x847872,'AI_ERROR_CONTEXT_LENGTH'))):_0x518aeb['includes']('Moderation')?Promise['reject'](new R(i(_0x847872,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x518aeb));}}async['prepareMessages'](_0x5dedeb,_0x58cfa7,_0x5b7a43){let _0x288045,_0x3e6a8b;return _0x58cfa7?(_0x288045='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.',_0x3e6a8b='Instruction:\x0a'+_0x5dedeb+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x58cfa7):(_0x288045='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.',_0x3e6a8b=_0x5dedeb),[{'role':'system','content':_0x288045},{'role':'user','content':_0x3e6a8b}];}async['_readStreamableResponse'](_0x123938,_0x8b37){const _0x29e148=_0x123938['body']['getReader'](),_0x91dc=new TextDecoder();let _0x199175='',_0x2ab31e='',_0x3b28f7='',_0x50717f=!0x1;for(;!_0x50717f;){const {done:_0xf8af2d,value:_0x479c10}=await _0x29e148['read'](),_0x50ea48=_0x199175+_0x91dc['decode'](_0x479c10);let _0x445f8a='';_0x50717f=_0xf8af2d;try{_0x445f8a=this['_cleanUpData'](_0x50ea48),_0x199175='';}catch{_0x199175=_0x50ea48;continue;}_0x2ab31e+=_0x445f8a,!_0x50717f&&this['_isBufferIncomplete'](_0x2ab31e)||_0x2ab31e&&(_0x3b28f7+=_0x2ab31e,_0x2ab31e='',_0x8b37(_0x3b28f7));}return Promise['resolve']();}async['_readStaticResponse'](_0x59687e,_0x155f34){return _0x155f34((await _0x59687e['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x558b56){const _0x27622d=_0x558b56['split']('<')['length']!==_0x558b56['split']('>')['length'],_0x5a5851=_0x558b56['length']<0x1e;return _0x27622d&&_0x5a5851;}['_cleanUpData'](_0x189180){return _0x189180['split'](/\n(?![^{]*\})/g)['map'](_0x3e62ad=>_0x3e62ad['replace']('data:\x20',''))['filter'](_0x1450bb=>_0x1450bb&&_0x1450bb['length']>0x0&&'[DONE]'!==_0x1450bb)['map'](_0x3995e0=>{const {choices:_0x475991}=JSON['parse'](_0x3995e0);if(_0x475991[0x0]?.['delta']?.['content'])return _0x475991[0x0]['delta']['content'];})['filter'](_0x21f8bd=>_0x21f8bd)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x1829a0){super(_0x1829a0),_0x1829a0['config']['get']('ai.aws.requestParameters')||_0x1829a0['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']=_0x1829a0['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x1829a0['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x1829a0['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x1829a0['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x3d347e,context:_0x4c0b77,onData:_0x2671ce,actionId:_0x5ba840}){const {model:_0x3484ac,stream:_0x367ad8,..._0x2d6ccb}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5ba840),_0x19e419={'prompt':await this['preparePrompt'](_0x3d347e,_0x4c0b77,_0x3484ac,_0x5ba840),..._0x2d6ccb};this['_apiUrl']?await this['_processProxyRequest'](_0x19e419,_0x3484ac,_0x367ad8,_0x2671ce,_0x5ba840):await this['_processAWSRequest'](_0x19e419,_0x3484ac,_0x367ad8,_0x2671ce);}async['preparePrompt'](_0x32a0c8,_0x44c116,_0x3b3a51,_0xfcdc53){let _0xbbdb61,_0x3a02c7;return _0x44c116?(_0xbbdb61='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.',_0x3a02c7='Instruction:\x0a'+_0x32a0c8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x44c116):(_0xbbdb61='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.',_0x3a02c7=_0x32a0c8),'meta.llama'==this['getModelFamily'](_0x3b3a51)?'<<SYS>>\x0a'+_0xbbdb61+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x3a02c7+'\x0a[/INST]':'Human:\x0a'+_0xbbdb61+'\x0a'+_0x3a02c7+'\x0a\x0aAssistant:';}['getModelFamily'](_0x2a8d8f){if(/^anthropic\.claude/['test'](_0x2a8d8f))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x2a8d8f))return'ai21.j2';if(/^cohere\.command/['test'](_0x2a8d8f))return'cohere.command';if(/^meta\.llama/['test'](_0x2a8d8f))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x2a8d8f));}async['_processProxyRequest'](_0x50bc30,_0x355b5f,_0x469cd0,_0x43ea5b,_0x5b2cd3){const _0x1e3ca6={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5b2cd3),'body':JSON['stringify']({..._0x50bc30,'model':_0x355b5f,'stream':_0x469cd0}),'signal':this['abortController']['signal']},_0x206681=await fetch(this['_apiUrl'],_0x1e3ca6);_0x469cd0?await this['_readStreamableResponse'](_0x206681,_0x355b5f,_0x43ea5b):await this['_readStaticResponse'](_0x206681,_0x355b5f,_0x43ea5b);}async['_processAWSRequest'](_0x526a5e,_0x305f0a,_0x449ae3,_0x42675f){const _0x2be2d2=new _0x2c193d(this['_bedrockClientConfig']),_0x169652={'body':JSON['stringify'](_0x526a5e),'contentType':'application/json','accept':'application/json','modelId':_0x305f0a};let _0x4d68d9;if(_0x449ae3){const _0x24b096=new _0x47d31f(_0x169652);_0x4d68d9=await _0x2be2d2['send'](_0x24b096,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x4d68d9,_0x305f0a,_0x42675f);}else{const _0x48a762=new _0x2ac079(_0x169652);_0x4d68d9=await _0x2be2d2['send'](_0x48a762,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x4d68d9,_0x305f0a,_0x42675f);}}async['_readAsyncIterableResponse'](_0x5d0aff,_0x635638,_0xb743db){const _0x44c773=_0x5d0aff['body'],_0x18e59c=new TextDecoder('utf-8');let _0x1a49eb='';for await(const _0x1bd2a5 of _0x44c773)if(_0x1bd2a5['chunk']){const _0xd0d3b=_0x18e59c['decode'](_0x1bd2a5['chunk']['bytes']),_0x406bb3=JSON['parse'](_0xd0d3b);_0x1a49eb+=this['_getGeneratedText'](_0x406bb3,_0x635638),_0xb743db(_0x1a49eb);}return Promise['resolve']();}async['_readStreamableResponse'](_0x2302b8,_0x10cfdd,_0x5e3cf4){const _0x3da8da=_0x2302b8['body'],_0x4ad577=new TextDecoder('utf-8'),_0x7d254f=_0x3da8da['getReader']();let _0x2b3716='',_0x2100dc='',_0xfc474f=!0x1;for(;!_0xfc474f;){const {done:_0x5673be,value:_0x3adc75}=await _0x7d254f['read']();if(_0xfc474f=_0x5673be,_0xfc474f)break;const _0x517a60=(_0x2b3716+_0x4ad577['decode'](_0x3adc75))['split']('\x0a')['map'](_0x1fb0e0=>{try{return _0x2b3716='',JSON['parse'](_0x1fb0e0);}catch{return _0x2b3716=_0x1fb0e0,null;}})['filter'](_0x5217eb=>null!==_0x5217eb);_0x517a60['length']&&(_0x2100dc+=_0x517a60['map'](_0x19ea5b=>this['_getGeneratedText'](_0x19ea5b,_0x10cfdd))['join'](''),_0x5e3cf4(_0x2100dc));}return Promise['resolve']();}async['_readStaticResponse'](_0x295e73,_0x12d1fe,_0x535dbd){let _0x2fccbb;return _0x2fccbb=_0x295e73 instanceof Response?await _0x295e73['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x295e73['body'])),(_0x535dbd(this['_getGeneratedText'](_0x2fccbb,_0x12d1fe)),Promise['resolve']());}['_getGeneratedText'](_0x3fb3e6,_0x165a1c){switch(this['getModelFamily'](_0x165a1c)){case'anthropic.claude':return _0x3fb3e6['completion'];case'ai21.j2':return _0x3fb3e6['completions'][0x0]['data']['text'];case'cohere.command':return _0x3fb3e6['generations'][0x0]['text'];case'meta.llama':return _0x3fb3e6['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
@@ -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':_0x116696=>0x1!=_0x116696}};
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':_0x243e40=>0x1!=_0x243e40}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x3d7240=>{const {af:{dictionary:_0x351c26,getPluralForm:_0x335870}}={'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':_0x15c688=>0x1!=_0x15c688}};_0x3d7240['af']||={'dictionary':{},'getPluralForm':null},_0x3d7240['af']['dictionary']=Object['assign'](_0x3d7240['af']['dictionary'],_0x351c26),_0x3d7240['af']['getPluralForm']=_0x335870;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x56d95e=>{const {af:{dictionary:_0x3a245b,getPluralForm:_0x40dd1d}}={'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':_0x448bfa=>0x1!=_0x448bfa}};_0x56d95e['af']||={'dictionary':{},'getPluralForm':null},_0x56d95e['af']['dictionary']=Object['assign'](_0x56d95e['af']['dictionary'],_0x3a245b),_0x56d95e['af']['getPluralForm']=_0x40dd1d;})(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':_0xdbe042=>0x0==_0xdbe042?0x0:0x1==_0xdbe042?0x1:0x2==_0xdbe042?0x2:_0xdbe042%0x64>=0x3&&_0xdbe042%0x64<=0xa?0x3:_0xdbe042%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':_0x16b236=>0x0==_0x16b236?0x0:0x1==_0x16b236?0x1:0x2==_0x16b236?0x2:_0x16b236%0x64>=0x3&&_0x16b236%0x64<=0xa?0x3:_0x16b236%0x64>=0xb?0x4:0x5}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x46c8ec=>{const {ar:{dictionary:_0x42583a,getPluralForm:_0x45c2eb}}={'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':_0x8663d1=>0x0==_0x8663d1?0x0:0x1==_0x8663d1?0x1:0x2==_0x8663d1?0x2:_0x8663d1%0x64>=0x3&&_0x8663d1%0x64<=0xa?0x3:_0x8663d1%0x64>=0xb?0x4:0x5}};_0x46c8ec['ar']||={'dictionary':{},'getPluralForm':null},_0x46c8ec['ar']['dictionary']=Object['assign'](_0x46c8ec['ar']['dictionary'],_0x42583a),_0x46c8ec['ar']['getPluralForm']=_0x45c2eb;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x19157f=>{const {ar:{dictionary:_0x3f591a,getPluralForm:_0xb72b4a}}={'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':_0x4308a7=>0x0==_0x4308a7?0x0:0x1==_0x4308a7?0x1:0x2==_0x4308a7?0x2:_0x4308a7%0x64>=0x3&&_0x4308a7%0x64<=0xa?0x3:_0x4308a7%0x64>=0xb?0x4:0x5}};_0x19157f['ar']||={'dictionary':{},'getPluralForm':null},_0x19157f['ar']['dictionary']=Object['assign'](_0x19157f['ar']['dictionary'],_0x3f591a),_0x19157f['ar']['getPluralForm']=_0xb72b4a;})(window['CKEDITOR_TRANSLATIONS']||={});