@ckeditor/ckeditor5-ai 45.2.1-alpha.3 → 45.2.1-alpha.5

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 _0x313720,Command as _0x254074}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x445dab,IconCheck as _0x442912,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x3fc08c,IconRobotPencil as _0x3df646}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x174b4b,CKEditorError as _0x38eda9,ObservableMixin as _0x43b835,global as _0x500632,isVisible as ot,Rect as it,Collection as _0x44ac22,FocusTracker as mt,KeystrokeHandler as ut,first as _0x41fdc6}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0xf91a83,View as _0x415ee7,SpinnerView as _0x1a4c1b,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0x4b1905,createDropdown as _0x279c1f,addMenuToDropdown as _0x1204ac,MenuBarMenuView as _0x5e937b,MenuBarMenuListItemButtonView as _0x4ad8a5,DialogViewPosition as _0x43c3ed,MenuBarMenuListView as _0x39ff67,MenuBarMenuListItemView as _0x6b4a24}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x3bb156,ClipboardMarkersUtils as _0x50eff8}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x25da54,DataTransfer as _0x1945a1,UpcastWriter as _0x410d76,Matcher as _0x460f38}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x2024e8,InvokeModelWithResponseStreamCommand as _0xc6a8de,InvokeModelCommand as _0x44dbd}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x1c17ab,_0x378378){const _0x3515c6=(0x0,_0x378378['t'])('Other');return _0x1c17ab['length']?'groupId'in _0x1c17ab[0x0]?_0x1c17ab:[{'groupId':x,'groupLabel':_0x3515c6,'order':0x1/0x0,'commands':_0x1c17ab}]:[{'groupId':x,'groupLabel':_0x3515c6,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x313720{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1aa172}=this,_0x5ddf95=['ck-fake-ai-selection'];_0x1aa172['config']['get']('ai.useTheme')&&_0x5ddf95['push']('ck-ai-assistant-ui_theme'),_0x1aa172['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x5ddf95,'priority':0xc}}),_0x1aa172['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x1420ef,{writer:_0x22f795})=>{if(!_0x1420ef['markerRange']['isCollapsed'])return null;const _0x4180e4=_0x22f795['createUIElement']('span');return _0x22f795['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4180e4),_0x4180e4;}});}['afterInit'](){!async function(_0x258d6c){const _0x236ffa=_0x4339fe([0x52,0x54,0x74,0x6f,0x55,0x53,0x34,0x70,0x30,0x31,0x35,0x68,0x77,0x48,0x71,0x49,0x46,0x41,0x6d,0x66,0x6a,0x4f,0x36,0x45,0x56,0x47,0x50,0x57,0x65,0x4e,0x6b,0x72,0x38,0x58,0x5a,0x79,0x63,0x7a,0x32,0x62,0x64,0x42,0x4d,0x43,0x44,0x61,0x75,0x4b,0x39,0x59,0x67,0x76,0x73,0x4a,0x69,0x37,0x6e,0x6c,0x78,0x51,0x33,0x4c]),_0x3cc067=0x6fd77b22,_0xb0bf98=0x6fd011ca^_0x3cc067,_0x5bc692=window[_0x4339fe([0x44,0x61,0x74,0x65])][_0x4339fe([0x6e,0x6f,0x77])](),_0x39d46b=_0x258d6c[_0x4339fe([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x552f8a=new window[(_0x4339fe([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3e74da=>{_0x39d46b[_0x4339fe([0x6f,0x6e,0x63,0x65])](_0x4339fe([0x72,0x65,0x61,0x64,0x79]),_0x3e74da);}),_0x5cd7a7={[_0x4339fe([0x6b,0x74,0x79])]:_0x4339fe([0x45,0x43]),[_0x4339fe([0x75,0x73,0x65])]:_0x4339fe([0x73,0x69,0x67]),[_0x4339fe([0x63,0x72,0x76])]:_0x4339fe([0x50,0x2d,0x32,0x35,0x36]),[_0x4339fe([0x78])]:_0x4339fe([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]),[_0x4339fe([0x79])]:_0x4339fe([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]),[_0x4339fe([0x61,0x6c,0x67])]:_0x4339fe([0x45,0x53,0x32,0x35,0x36])},_0x3c3b41=_0x39d46b[_0x4339fe([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4339fe([0x67,0x65,0x74])](_0x4339fe([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x3355db(){let _0x2d6fe8,_0x4d8764=null,_0x32a030=null;try{if(_0x3c3b41==_0x4339fe([0x47,0x50,0x4c]))return _0x4339fe([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x2d6fe8=_0x497135(),!_0x2d6fe8)return _0x4339fe([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x2d6fe8[_0x4339fe([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x32a030=_0x1141d0(_0x2d6fe8[_0x4339fe([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x2d6fe8[_0x4339fe([0x6a,0x74,0x69])])),await _0x11c7c0()?_0x240e0e()?_0xd2f27e()?_0x4339fe([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0xaf5c23()?(_0x2d6fe8[_0x4339fe([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4339fe([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4d8764=_0x8a0bd9(_0x4339fe([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x2d6fe8[_0x4339fe([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4339fe([0x74,0x72,0x69,0x61,0x6c])&&(_0x4d8764=_0x8a0bd9(_0x4339fe([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x3492c6()):_0x4339fe([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4339fe([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4339fe([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x4339fe([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0xd2f27e(){const _0x365893=[_0x4339fe([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4339fe([0x74,0x72,0x69,0x61,0x6c])][_0x4339fe([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2d6fe8[_0x4339fe([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5bc692/0x3e8:0xe10*_0xb0bf98;return _0x2d6fe8[_0x4339fe([0x65,0x78,0x70])]<_0x365893;}function _0x240e0e(){const _0x489566=_0x2d6fe8[_0x4339fe([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x489566&&(!!_0x489566[_0x4339fe([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4339fe([0x2a]))||!!_0x489566[_0x4339fe([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4339fe([0x41,0x49])));}function _0xaf5c23(){const _0x33f45b=_0x2d6fe8[_0x4339fe([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x33f45b||0x0==_0x33f45b[_0x4339fe([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0xc4a30}=new URL(window[_0x4339fe([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x33f45b[_0x4339fe([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xc4a30))return!0x0;const _0x365905=_0xc4a30[_0x4339fe([0x73,0x70,0x6c,0x69,0x74])](_0x4339fe([0x2e]));return _0x33f45b[_0x4339fe([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5df1e6=>_0x5df1e6[_0x4339fe([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4339fe([0x2a])))[_0x4339fe([0x6d,0x61,0x70])](_0x1cc2b0=>_0x1cc2b0[_0x4339fe([0x73,0x70,0x6c,0x69,0x74])](_0x4339fe([0x2e])))[_0x4339fe([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3cafb8=>_0x3cafb8[_0x4339fe([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x365905[_0x4339fe([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4339fe([0x6d,0x61,0x70])](_0x528bb5=>Array(_0x365905[_0x4339fe([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x528bb5[_0x4339fe([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4339fe([0x66,0x69,0x6c,0x6c])](_0x528bb5[0x0]===_0x4339fe([0x2a])?_0x4339fe([0x2a]):'')[_0x4339fe([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x528bb5))[_0x4339fe([0x73,0x6f,0x6d,0x65])](_0x271c62=>_0x365905[_0x4339fe([0x65,0x76,0x65,0x72,0x79])]((_0x27ccb2,_0x49175c)=>_0x271c62[_0x49175c]===_0x27ccb2||_0x271c62[_0x49175c]===_0x4339fe([0x2a])));}function _0x3492c6(){return _0x4d8764&&_0x32a030?new window[(_0x4339fe([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4701c6,_0x37727f)=>{_0x4d8764[_0x4339fe([0x74,0x68,0x65,0x6e])](_0x4701c6,_0x37727f),_0x32a030[_0x4339fe([0x74,0x68,0x65,0x6e])](_0x2488f8=>{_0x2488f8!=_0x4339fe([0x56,0x61,0x6c,0x69,0x64])&&_0x4701c6(_0x2488f8);},_0x37727f);}):_0x4d8764||_0x32a030||_0x4339fe([0x56,0x61,0x6c,0x69,0x64]);}}function _0x1141d0(_0x236d4f,_0xd012db){return new window[(_0x4339fe([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3027ff=>{if(_0x2d4ec2())return _0x3027ff(_0x4339fe([0x56,0x61,0x6c,0x69,0x64]));_0x176348(),_0x39d46b[_0x4339fe([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4339fe([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1c4e8f=!0x1;const _0x2f257b=_0x174b4b();function _0x3f95cf(_0x260822){return!!_0x260822&&(typeof _0x260822===_0x4339fe([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x260822===_0x4339fe([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x260822[_0x4339fe([0x74,0x68,0x65,0x6e])]===_0x4339fe([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x260822[_0x4339fe([0x63,0x61,0x74,0x63,0x68])]===_0x4339fe([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x522893(_0x1104fc){_0x1a361c(_0x1104fc)[_0x4339fe([0x74,0x68,0x65,0x6e])](_0x151bae=>{if(!_0x151bae||_0x151bae[_0x4339fe([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4339fe([0x6f,0x6b]))return _0x4339fe([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x7b5690(_0x10a146(_0x2f257b+_0xd012db))!=_0x151bae[_0x4339fe([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4339fe([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4339fe([0x56,0x61,0x6c,0x69,0x64]);})[_0x4339fe([0x74,0x68,0x65,0x6e])](_0x2940a6=>(_0xa6c196(),_0x2940a6),()=>{const _0x530e22=_0x213e21();return null==_0x530e22?(_0xa6c196(),_0x4339fe([0x56,0x61,0x6c,0x69,0x64])):_0x4339fe(_0x5bc692-_0x530e22>(0x4bdbff22^_0x3cc067)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4339fe([0x74,0x68,0x65,0x6e])](_0x3027ff)[_0x4339fe([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3027ff(_0x4339fe([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x41d2b7=0x6fe195a2^_0x3cc067;function _0xa6c196(){const _0xb6ca17=_0x4339fe([0x6c,0x6c,0x63,0x74,0x2d])+_0x7b5690(_0x10a146(_0x236d4f)),_0x4b115c=_0x573ba8(_0x7b5690(window[_0x4339fe([0x4d,0x61,0x74,0x68])][_0x4339fe([0x63,0x65,0x69,0x6c])](_0x5bc692/_0x41d2b7)));window[_0x4339fe([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4339fe([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xb6ca17,_0x4b115c);}function _0x213e21(){const _0x891af9=_0x4339fe([0x6c,0x6c,0x63,0x74,0x2d])+_0x7b5690(_0x10a146(_0x236d4f)),_0x5c5d2a=window[_0x4339fe([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4339fe([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x891af9);return _0x5c5d2a?window[_0x4339fe([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x573ba8(_0x5c5d2a),0x10)*_0x41d2b7:null;}function _0x1a361c(_0x3dbf3f){return new window[(_0x4339fe([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5a5bac,_0x270a12)=>{_0x3dbf3f[_0x4339fe([0x74,0x68,0x65,0x6e])](_0x5a5bac,_0x270a12),window[_0x4339fe([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x270a12,0x6fd6afe2^_0x3cc067);});}}_0x39d46b[_0x4339fe([0x6f,0x6e])](_0x4339fe([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5a55bf,_0x572ed6)=>{if(_0x572ed6[0x0]!=_0x236d4f)return _0x3027ff(_0x4339fe([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x572ed6[0x1]={..._0x572ed6[0x1],[_0x4339fe([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x2f257b};},{[_0x4339fe([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4339fe([0x68,0x69,0x67,0x68])}),_0x39d46b[_0x4339fe([0x6f,0x6e])](_0x4339fe([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2c02ee=>{_0x3f95cf(_0x2c02ee[_0x4339fe([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1c4e8f=!0x0,_0x522893(_0x2c02ee[_0x4339fe([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4339fe([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4339fe([0x6c,0x6f,0x77])}),_0x552f8a[_0x4339fe([0x74,0x68,0x65,0x6e])](()=>{_0x1c4e8f||_0x3027ff(_0x4339fe([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x2d4ec2(){return _0x39d46b[_0x4339fe([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4339fe([0x76,0x69,0x65,0x77])][_0x4339fe([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4339fe([0x61,0x75,0x74,0x6f]);}function _0x176348(){_0x39d46b[_0x4339fe([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4339fe([0x76,0x69,0x65,0x77])][_0x4339fe([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4339fe([0x61,0x75,0x74,0x6f]);}}function _0x8a0bd9(_0x2be112){const _0x9fd7f=[new window[(_0x4339fe([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2b738e=>setTimeout(_0x2b738e,0x6fde45ee^_0x3cc067)),_0x552f8a[_0x4339fe([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4339fe([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x26beec=>{let _0x37dbcc=0x0;_0x39d46b[_0x4339fe([0x6d,0x6f,0x64,0x65,0x6c])][_0x4339fe([0x6f,0x6e])](_0x4339fe([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x206c20,_0x6f410c)=>{_0x6f410c[0x0][_0x4339fe([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x37dbcc++,_0x37dbcc==(0x6fd77ada^_0x3cc067)&&(_0x26beec(),_0x206c20[_0x4339fe([0x6f,0x66,0x66])]());});}))];return window[_0x4339fe([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4339fe([0x72,0x61,0x63,0x65])](_0x9fd7f)[_0x4339fe([0x74,0x68,0x65,0x6e])](()=>_0x2be112);}async function _0x124e96(){await _0x552f8a,_0x39d46b[_0x4339fe([0x6d,0x6f,0x64,0x65,0x6c])][_0x4339fe([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x580a1a,_0x39d46b[_0x4339fe([0x6d,0x6f,0x64,0x65,0x6c])][_0x4339fe([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x580a1a,_0x39d46b[_0x4339fe([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4339fe([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x2f238a(_0x293979){const _0x429adc=_0x170013();_0x39d46b[_0x429adc]=_0x4339fe([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x293979,_0x293979!=_0x4339fe([0x56,0x61,0x6c,0x69,0x64])&&_0x124e96();}function _0x170013(){const _0x3610ad=window[_0x4339fe([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4339fe([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4339fe([0x6e,0x6f,0x77])]())[_0x4339fe([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4339fe([0x2e]),'');let _0x32e5ec=_0x4339fe([0x52]);for(let _0x485a22=0x0;_0x485a22<_0x3610ad[_0x4339fe([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x485a22+=0x2){let _0x2a76ca=window[_0x4339fe([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3610ad[_0x4339fe([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x485a22,_0x485a22+0x2));_0x2a76ca>=_0x236ffa[_0x4339fe([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x2a76ca-=_0x236ffa[_0x4339fe([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x32e5ec+=_0x236ffa[_0x2a76ca];}return _0x32e5ec;}function _0x497135(){const _0x459a45=_0x3c3b41[_0x4339fe([0x73,0x70,0x6c,0x69,0x74])](_0x4339fe([0x2e]));if(0x3!=_0x459a45[_0x4339fe([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x6af7cd(_0x459a45[0x1]);function _0x6af7cd(_0x3c0c5b){const _0x5a1815=_0x3e1842(_0x3c0c5b);return _0x5a1815&&_0x3cd425()?_0x5a1815:null;function _0x3cd425(){const _0x5600df=_0x5a1815[_0x4339fe([0x6a,0x74,0x69])],_0x1a6e44=window[_0x4339fe([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5600df[_0x4339fe([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5600df[_0x4339fe([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x5b1a22={..._0x5a1815,[_0x4339fe([0x6a,0x74,0x69])]:_0x5600df[_0x4339fe([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x5600df[_0x4339fe([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x5b1a22[_0x4339fe([0x76,0x63])],_0x10a146(_0x5b1a22)==_0x1a6e44;}}}async function _0x11c7c0(){let _0x1040bd=!0x0;try{const _0x398496=_0x3c3b41[_0x4339fe([0x73,0x70,0x6c,0x69,0x74])](_0x4339fe([0x2e])),[_0x5033e8,_0x122274,_0x26eff9]=_0x398496;return _0x5ca961(_0x5033e8),await _0x234908(_0x5033e8,_0x122274,_0x26eff9),_0x1040bd;}catch{return!0x1;}function _0x5ca961(_0x2dd705){const _0x15adaa=_0x3e1842(_0x2dd705);_0x15adaa&&_0x15adaa[_0x4339fe([0x61,0x6c,0x67])]==_0x4339fe([0x45,0x53,0x32,0x35,0x36])||(_0x1040bd=!0x1);}async function _0x234908(_0x3e06d3,_0x5339c3,_0x43ef59){const _0x249885=window[_0x4339fe([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4339fe([0x66,0x72,0x6f,0x6d])](_0x4af503(_0x43ef59),_0x2a2ce2=>_0x2a2ce2[_0x4339fe([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2f5246=new window[(_0x4339fe([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4339fe([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3e06d3+_0x4339fe([0x2e])+_0x5339c3),_0x16b8b9=window[_0x4339fe([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4339fe([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x16b8b9)return;const _0x282bab=await _0x16b8b9[_0x4339fe([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4339fe([0x6a,0x77,0x6b]),_0x5cd7a7,{[_0x4339fe([0x6e,0x61,0x6d,0x65])]:_0x4339fe([0x45,0x43,0x44,0x53,0x41]),[_0x4339fe([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4339fe([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4339fe([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x16b8b9[_0x4339fe([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4339fe([0x6e,0x61,0x6d,0x65])]:_0x4339fe([0x45,0x43,0x44,0x53,0x41]),[_0x4339fe([0x68,0x61,0x73,0x68])]:{[_0x4339fe([0x6e,0x61,0x6d,0x65])]:_0x4339fe([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x282bab,_0x249885,_0x2f5246)||(_0x1040bd=!0x1);}}function _0x3e1842(_0x3f2947){return _0x3f2947[_0x4339fe([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4339fe([0x65,0x79]))?JSON[_0x4339fe([0x70,0x61,0x72,0x73,0x65])](_0x4af503(_0x3f2947)):null;}function _0x4af503(_0x3adf4c){return window[_0x4339fe([0x61,0x74,0x6f,0x62])](_0x3adf4c[_0x4339fe([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4339fe([0x2b]))[_0x4339fe([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4339fe([0x2f])));}function _0x10a146(_0x355923){let _0x2550bb=0x1505;function _0x1b6cc4(_0x3c5328){for(let _0x4557df=0x0;_0x4557df<_0x3c5328[_0x4339fe([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4557df++){const _0x15a6c8=_0x3c5328[_0x4339fe([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x4557df);_0x2550bb=(_0x2550bb<<0x5)+_0x2550bb+_0x15a6c8,_0x2550bb&=_0x2550bb;}}function _0x3886dd(_0xe5fb8e){Array[_0x4339fe([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0xe5fb8e)?_0xe5fb8e[_0x4339fe([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x3886dd):_0xe5fb8e&&typeof _0xe5fb8e==_0x4339fe([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4339fe([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0xe5fb8e)[_0x4339fe([0x73,0x6f,0x72,0x74])]()[_0x4339fe([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3490e7,_0x42c9e9])=>{_0x1b6cc4(_0x3490e7),_0x3886dd(_0x42c9e9);}):_0x1b6cc4(window[_0x4339fe([0x53,0x74,0x72,0x69,0x6e,0x67])](_0xe5fb8e));}return _0x3886dd(_0x355923),_0x2550bb>>>0x0;}function _0x7b5690(_0x4d1998){return _0x4d1998[_0x4339fe([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4339fe([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4339fe([0x30]));}function _0x573ba8(_0x14d894){return _0x14d894[_0x4339fe([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4339fe([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4339fe([0x6a,0x6f,0x69,0x6e])]('');}function _0x580a1a(){}function _0x4339fe(_0x290e8b){return _0x290e8b['map'](_0x1f0cbc=>String['fromCharCode'](_0x1f0cbc))['join']('');}_0x2f238a(await _0x3355db());}(this);}['showFakeVisualSelection'](){const _0x118af0=this['editor']['model'];_0x118af0['change'](_0x2fd40e=>{const _0x29086d=_0x118af0['document']['selection']['getRanges']();let _0x3a20a6=0x0;for(const _0x217f28 of _0x29086d){const _0x157c33=f+':'+_0x3a20a6;if(_0x118af0['markers']['has'](_0x157c33))_0x2fd40e['updateMarker'](_0x157c33,{'range':_0x217f28});else{if(_0x217f28['start']['isAtEnd']){const _0x248e05=_0x217f28['start']['getLastMatchingPosition'](({item:_0x4d5d25})=>!_0x118af0['schema']['isContent'](_0x4d5d25),{'boundaries':_0x217f28});_0x2fd40e['addMarker'](_0x157c33,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2fd40e['createRange'](_0x248e05,_0x217f28['end'])});}else _0x2fd40e['addMarker'](_0x157c33,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x217f28});}_0x3a20a6++;}});}['hideFakeVisualSelection'](){const _0x3a3755=this['editor']['model'],_0x4874b1=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x4874b1['length']&&_0x3a3755['change'](_0x570335=>{_0x4874b1['forEach'](_0x38bde6=>{_0x570335['removeMarker'](_0x38bde6);});});}['insertContent'](_0x4eb720,_0x1a5b9d){const _0x460aa3=this['_getAISelection'](),_0x4ecf88=_0x1a5b9d||_0x460aa3['getFirstRange']();this['editor']['model']['canEditAt'](_0x4ecf88)&&this['editor']['model']['change'](_0x807130=>{this['hideFakeVisualSelection'](),_0x1a5b9d||this['_resetContentOfSelectedTableCells'](_0x807130,_0x460aa3),this['_pasteHTMLUsingClipboard']({'insertAt':_0x4ecf88,'writer':_0x807130,'html':_0x4eb720});});}['insertContentBelow'](_0x4a42fc){const {model:_0x49c256}=this['editor'],_0x1b4859=this['_getAISelection']();_0x49c256['change'](()=>{const _0x232b0a=this['_prepareTableInsertBelowPosition'](_0x4a42fc,_0x1b4859)||this['_getDefaultInsertBelowPosition'](_0x1b4859);this['insertContent'](_0x4a42fc,_0x232b0a);});}['_getAISelection'](){const _0x2dab8c=this['editor']['model'],_0x4ecfaf=Array['from'](_0x2dab8c['markers']['getMarkersGroup'](f))['map'](_0x544ce5=>_0x544ce5['getRange']());return _0x2dab8c['createSelection'](_0x4ecfaf);}['_pasteHTMLUsingClipboard']({writer:_0x10ae2e,html:_0x6f49a,insertAt:_0x42988a}){const {view:_0x156308}=this['editor']['editing'],_0x5871c8=this['editor']['plugins']['get'](_0x3bb156),_0x255063=new gt();_0x255063['setData']('text/html',_0x6f49a);const _0x55f003=new ClipboardEvent('paste',{'clipboardData':_0x255063}),_0x40865c=new _0x25da54(_0x156308,_0x55f003,{'dataTransfer':new _0x1945a1(_0x255063)});_0x10ae2e['setSelection'](_0x42988a);const _0x4cbfa2=(_0xa7403d,_0x13f10e)=>{_0x13f10e['resultRange']&&_0x10ae2e['setSelection'](_0x13f10e['resultRange']);};_0x5871c8['once']('contentInsertion',_0x4cbfa2,{'priority':'lowest'}),_0x156308['document']['fire']('paste',_0x40865c),_0x5871c8['off']('contentInsertion',_0x4cbfa2);}['_getDefaultInsertBelowPosition'](_0x22815e){const {model:_0x95ba34}=this['editor'],_0x273093=Array['from'](_0x22815e['getSelectedBlocks']());return _0x273093['length']?_0x95ba34['createPositionAfter'](_0x273093['pop']()):_0x22815e['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x4c8b0a,_0x3d829a){const {model:_0x3d6aa5,plugins:_0xfc149}=this['editor'];if(_0xfc149['has']('TableUtils')){const _0x40f09d=_0xfc149['get']('TableUtils')['getSelectedTableCells'](_0x3d829a);if(_0x40f09d['length']){const _0x33a76f=this['_getTableRowCountFromContent'](_0x4c8b0a),_0x158f89=this['_createEmptyTableRows'](_0x40f09d,_0x33a76f);return _0x3d6aa5['createPositionAt'](_0x158f89,0x0);}}return null;}['_getTableRowCountFromContent'](_0xc49d21){const _0x5bb536=this['editor']['plugins']['get']('TableUtils'),_0x484ea9=this['editor']['data']['parse'](_0xc49d21),_0x3d6685=Array['from'](_0x484ea9['getChildren']())['filter'](_0xab1c17=>_0xab1c17['is']('element','table'));let _0xa4df40=0x0;return _0x3d6685['forEach'](_0x1a46ce=>{_0xa4df40+=_0x5bb536['getRows'](_0x1a46ce);}),_0xa4df40;}['_createEmptyTableRows'](_0x5750cc,_0x56e320){const _0x3570e0=this['editor']['plugins']['get']('TableUtils'),_0x56e1e2=_0x3570e0['getRowIndexes'](_0x5750cc),_0x1b3afa=_0x3570e0['getColumnIndexes'](_0x5750cc),_0x583473=_0x56e1e2['last']+0x1,_0x52be8d=_0x1b3afa['first'],_0x350998=_0x5750cc[0x0]['findAncestor']('table');for(let _0x400b9d=0x0;_0x400b9d<_0x56e320;_0x400b9d++)_0x3570e0['insertRows'](_0x350998,{'at':_0x583473});return _0x350998['getChild'](_0x583473)['getChild'](_0x52be8d);}['_resetContentOfSelectedTableCells'](_0x95e8ee,_0x4352a8){const {plugins:_0x24ae09}=this['editor'],{model:_0x68f5ad}=_0x95e8ee;if(!_0x24ae09['has']('TableUtils'))return;_0x24ae09['get']('TableUtils')['getSelectedTableCells'](_0x4352a8)['length']&&_0x68f5ad['deleteContent'](_0x4352a8);}}class E extends _0x313720{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x38eda9('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x1c0989){super(_0x1c0989),this['name']='AIRequestError';}}function i(_0x2a8ef7,_0x44a82d,_0x3f15ef){const t=_0x2a8ef7['t'];switch(_0x44a82d){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',_0x3f15ef);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3f15ef);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'},_0x3f15ef);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 _0x44a82d;}}class j extends _0x254074{['_commandDefinitions'];constructor(_0x2e7032,_0x4495d0){super(_0x2e7032),this['_commandDefinitions']=_0x4495d0,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x43e6d2,_0x4d5bb5,_0x2e6d92)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x2e6d92));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x474551,_0x7a5fed,_0x440e51)=>{this['enabledCommandsIds']=_0x440e51?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x50bd98=this['editor']['model'];this['_hasContext']=function(_0x35ac52){const _0x365bbd=_0x35ac52['document']['selection'];return _0x365bbd['isCollapsed']?0x0!==[..._0x365bbd['getSelectedBlocks']()]['length']&&![..._0x365bbd['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x35ac52['hasContent'](_0x365bbd['getFirstRange']());}(_0x50bd98);const _0x215b32=_0x50bd98['document']['selection'],_0x4ede3c=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x5b3cf3 of _0x215b32['getRanges']())for(const _0x1d7cda of _0x5b3cf3['getItems']())if(_0x1d7cda['is']('element')&&_0x4ede3c['includes'](_0x1d7cda['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0xac05ff='',_0x551edc='',_0x510f04='custom'){this['editor']['plugins']['get'](n)['showUI'](_0xac05ff,_0x551edc,_0x510f04);}}function G(_0xd57c78,_0x56203a){const _0xa4433a=new Set();for(const _0xaff6c9 of _0xd57c78['values']())(_0x56203a||!0x1===_0xaff6c9['requiresContent'])&&_0xa4433a['add'](_0xaff6c9['id']);return Array['from'](_0xa4433a);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
24
- _0x43b835(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x46e818,_0x50128d,_0x44b6d3){super(),this['editor']=_0x46e818,this['textAdapter']=_0x50128d,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x44b6d3,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x504de4,_0x181268,_0x5395b7)=>{this['view']['value']=this['_sanitizeHTML'](_0x5395b7);}),this['listenTo'](this['view'],'submitPrompt',(_0x2c3525,_0x573b04)=>{const _0x5e582f=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x573b04,_0x5e582f,'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:_0x3df5b5,query:_0xd8704b,htmlContent:_0x524496,label:_0x4bd836,mainActionLabel:_0x5bc8ee}){this['view']['prompt']=_0x4bd836,this['view']['mainAction']=_0x5bc8ee,this['initialContext']=_0x524496,_0xd8704b&&(this['view']['isRendered']?this['_handleQuery'](_0xd8704b,_0x524496,_0x3df5b5,_0x4bd836):this['view']['once']('render',()=>{this['_handleQuery'](_0xd8704b,_0x524496,_0x3df5b5,_0x4bd836);}));}['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'](_0x134cad,_0x2fcb46,_0xa48c83,_0x239d08){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2fcb46,this['previousQuery']=_0x134cad,this['previousLabel']=_0x239d08||_0x134cad,this['previousActionId']=_0xa48c83,new Promise(_0x3e1357=>{this['textAdapter']['makeRequest']({'query':_0x134cad,'context':_0x2fcb46,'onData':_0x25b115=>{this['currentResponse']=_0x25b115,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0xa48c83})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x2d6a02=>{_0x2d6a02 instanceof R?this['view']['handleError'](_0x2d6a02['message']):this['view']['handleError'](),_0x3e1357();})['finally'](()=>{this['stopProcessing'](),_0x3e1357();});});}['_parseAndNormalizeContent'](_0x5d9a16,_0x5ba084=!0x1){const _0x133d51=Z['exec'](_0x5d9a16);_0x5d9a16=_0x133d51?_0x5d9a16['substring'](_0x133d51[0x1]['length']):_0x5d9a16['length']<0x64&&!_0x5ba084?'':this['_stripMarkdownSyntax'](_0x5d9a16);const _0x397946=this['_domParser']['parseFromString'](_0x5d9a16,'text/html');if(_0x133d51){const _0x4567b0=Array['from'](_0x397946['body']['childNodes']);_0x4567b0['reverse']();for(const _0x29bd31 of _0x4567b0){if(_0x29bd31['nodeType']==Node['ELEMENT_NODE'])break;_0x29bd31['remove']();}}const _0x3d321e=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x397946['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x3d321e);const _0x500479=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x27c030=this['editor']['data']['toModel'](_0x3d321e);return _0x500479||_0x27c030['markers']['clear'](),this['editor']['data']['stringify'](_0x27c030);}['_normalizeResponseHeadings'](_0x412214){const _0x78c74c=new _0x410d76(this['editor']['editing']['view']['document']),_0x341a6a=new _0x460f38({'name':/^h[1-5]$/}),_0x4c537c=[];let _0x18477f=!0x1;for(const _0x413e71 of _0x412214)_0x413e71['is']('element')&&_0x341a6a['match'](_0x413e71)&&(_0x4c537c['push'](_0x413e71),'h1'==_0x413e71['name']&&(_0x18477f=!0x0));if(_0x18477f){for(const _0x3326d5 of _0x4c537c)_0x78c74c['rename']('h'+(parseInt(_0x3326d5['name'][0x1])+0x1),_0x3326d5);}}['_isH1TagSupportEnabled'](){const {data:_0x569599,editing:_0x3951e8}=this['editor'],_0x54730f=_0x569599['htmlProcessor']['toView']('<h1></h1>'),_0x37c107=_0x569599['toView'](_0x569599['toModel'](_0x54730f));return!!_0x3951e8['view']['domConverter']['viewToDom'](_0x37c107)['querySelector']('h1');}['_sanitizeHTML'](_0x2ca532){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x2ca532),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5e75a5){const _0x400658=_0x5e75a5['trim']();return _0x400658['startsWith']('```html')?_0x400658['endsWith']('```')?_0x400658['substring'](0x7,_0x400658['length']-0x3):_0x400658['substring'](0x7):_0x5e75a5;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x14a353){super(_0x14a353),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xa17703=>i(_0x14a353,'AI_'+_0xa17703['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x14a353,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x14a353,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x14a353,'Stop'));const _0x3913d3=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3913d3['if']('isVisible','ck-hidden',_0x1c6681=>!_0x1c6681)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x85200b,_0x41063a){const _0x2aa359=new _0xf91a83(this['locale']);return _0x2aa359['set']({'label':_0x85200b,'class':_0x41063a||'','isVisible':!0x0,'withText':!0x0}),_0x2aa359;}}class Y extends _0x415ee7{['contentFieldView'];['copyButtonView'];constructor(_0x2224a2,_0x5d8cce=''){super(_0x2224a2),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x29ec73=this['bindTemplate'];this['contentFieldView']=new At(_0x2224a2,_0x5d8cce),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x29ec73['if']('isVisible','ck-hidden',_0x6719b3=>!_0x6719b3)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x29ec73['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 _0x1c925e=!0x1;this['on']('change:value',(_0xc4a46a,_0x423c42,_0x2f4995)=>{const _0xb15b5a=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2f4995),this['isProcessing']&&_0xb15b5a&&!_0x1c925e&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x564b5a,_0x3aad30,_0x4a10d2)=>{_0x1c925e=!0x1,_0x4a10d2?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1c925e=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1c925e=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x53669b=this['locale'],_0x337bc0=new _0xf91a83(this['locale']),_0x1acb81='ck-ai-form__copy-button';return _0x337bc0['set']({'label':i(_0x53669b,'Copy'),'icon':_0x445dab,'class':_0x1acb81,'tooltip':!0x0}),_0x337bc0['bind']('isVisible')['to'](this,'value',_0x53cbc1=>!!_0x53cbc1),_0x337bc0['bind']('isEnabled')['to'](this,'isProcessing',_0x477771=>!_0x477771),_0x337bc0['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x337bc0['icon']=_0x442912,_0x337bc0['class']=_0x1acb81+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x337bc0['icon']=_0x445dab,_0x337bc0['class']=_0x1acb81;},0x3e8);}),_0x337bc0;}['_copyHTMLToClipboard'](_0x30ca6d){const {window:_0x58334a,document:_0x4ab0fd}=_0x500632;if(_0x58334a['ClipboardItem']){const {Blob:_0x4ba2f2,ClipboardItem:_0x5a930f}=_0x58334a,_0x58f72e=[new _0x5a930f({'text/html':new _0x4ba2f2([_0x30ca6d['innerHTML']],{'type':'text/html'}),'text/plain':new _0x4ba2f2([_0x30ca6d['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x58f72e);}else{const _0x59d406=_0x4ab0fd['createElement']('div');_0x59d406['style']['position']='absolute',_0x59d406['style']['left']='-9999px',_0x59d406['innerHTML']='<span>[</span>'+_0x30ca6d['innerHTML']+'<span>]</span>',_0x4ab0fd['body']['appendChild'](_0x59d406);const _0x532303=_0x4ab0fd['createRange']();_0x532303['setStartAfter'](_0x59d406['firstElementChild']),_0x532303['setEndBefore'](_0x59d406['lastElementChild']);const _0x2989d1=_0x58334a['getSelection']();_0x2989d1['removeAllRanges'](),_0x2989d1['addRange'](_0x532303),_0x4ab0fd['execCommand']('copy'),_0x59d406['remove']();}}}class At extends _0x415ee7{constructor(_0x4a9a1f,_0x182e99=''){super(_0x4a9a1f),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x182e99,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2b9cd0){this['element']['innerHTML']=_0x2b9cd0;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x2edccd=new _0x415ee7(),_0x260de2=this['locale'],_0x30026b=new _0x1a4c1b();return _0x30026b['isVisible']=!0x0,_0x2edccd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x30026b,{'text':i(_0x260de2,'AI\x20is\x20writing...')}]}),_0x2edccd['render'](),_0x2edccd;}}class st extends _0x415ee7{constructor(_0xc8612a,_0x4beb4c=''){super(_0xc8612a);const _0xdd41ef=new rt(),_0x273323=this['bindTemplate'];this['set']('text',_0x4beb4c),_0xdd41ef['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0xdd41ef,{'text':_0x273323['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0xf9745c,_0x55295d){super(_0xf9745c,_0x55295d),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',(_0x66d539,_0x2ebaa9)=>{_0x66d539['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2ebaa9());});}['_createSubmitButton'](){const _0x114f3e=new _0xf91a83(this['locale']),_0x1deae7=this['locale'];return _0x114f3e['set']({'icon':ht,'label':i(_0x1deae7,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x114f3e['on']('execute',()=>{this['submit']();}),_0x114f3e['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x33fb0a,_0x49d59f)=>!_0x33fb0a&&_0x49d59f),_0x114f3e;}['_createShowHistoryButton'](){const _0x2cb458=new _0xf91a83(this['locale']),_0x1ee9ce=this['resultsView'],_0x19c9f0=this['locale'];_0x2cb458['set']({'label':i(_0x19c9f0,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x2cb458['bind']('isOn')['to'](_0x1ee9ce,'isVisible'),_0x2cb458['bind']('isEnabled')['to'](this,'isEnabled'),_0x2cb458['on']('execute',()=>{_0x1ee9ce['isVisible']=!_0x1ee9ce['isVisible'],_0x1ee9ce['isVisible']?this['filteredView']['focus']():this['focus']();});const _0xdd8837=()=>{_0x500632['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x179a9e=new it(this['queryView']['fieldView']['element']),_0x30bf0c=_0x179a9e['width'],_0x2227e4='rtl'===_0x19c9f0['uiLanguageDirection']?'left':'right';_0x179a9e['excludeScrollbarsAndBorders'](),_0x2cb458['element']['style'][_0x2227e4]=_0x30bf0c-_0x179a9e['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0xdd8837),this['on']('render',_0xdd8837),_0x2cb458;}['submit'](){const _0x5d05dd=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x5d05dd);}['focus'](_0x16f185){-0x1===_0x16f185?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0xb4e47e){super(_0xb4e47e),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0xb4e47e,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x9ef93d=0x0;for(const _0x330889 of this['items'])_0x9ef93d+=_0x330889['items']['length'];return{'resultsCount':_0x9ef93d,'totalItemsCount':_0x9ef93d};}['_createClearHistoryButton'](){const _0x121a40=this['locale'],_0x461cf3=new _0xf91a83(this['locale']);return _0x461cf3['set']({'label':'('+i(_0x121a40,'Clear')+')','withText':!0x0}),_0x461cf3['on']('execute',()=>this['fire']('clearHistory')),_0x461cf3;}}class bt extends xt{constructor(_0x3b0e00){super();const _0x3d4cb9=new kt(),_0x343b93=new _0xf91a83(this['locale'],_0x3d4cb9);this['children']['add'](_0x343b93),_0x343b93['set']({'label':_0x3b0e00['prompt'],'withText':!0x0}),_0x343b93['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x3b0e00['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x44ac22{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x568165,_0x3bec56)=>{const _0x108254=os(_0x3bec56['prompt']);for(const _0x120cbe of this)if(_0x120cbe!=_0x3bec56&&os(_0x120cbe['prompt'])===_0x108254){this['remove'](_0x120cbe);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x17c9c6=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x17c9c6));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x179cde=>_0x179cde)));}}function os(_0x3610ff){return _0x3610ff['toLowerCase']()['trim']();}class _ extends _0x415ee7{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x3d276c,_0x111ea0,_0x187dd3=''){super(_0x3d276c),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new wt(),this['errorView']=new st(_0x3d276c),this['contentArea']=new Y(_0x3d276c,_0x187dd3),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x50906c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x111ea0],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x50906c['if']('isError','ck-hidden',_0x3845d9=>!_0x3845d9)]},'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'](_0x4ccb12=0x1){-0x1===_0x4ccb12?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 _0x481378=this['locale'],_0x11577e=new ct(_0x481378,{'queryView':{'label':i(_0x481378,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x481378,'Empty\x20history'),'secondary':i(_0x481378,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x11577e['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4bb1fb,_0x182c2a)=>_0x4bb1fb&&!_0x182c2a),this['listenTo'](_0x11577e,'submit',(_0x1c6c19,_0x43dddf)=>{this['prompt']=_0x43dddf;const _0x5ae34f=yt(_0x43dddf);this['fire']('submitPrompt',_0x5ae34f),_0x43dddf['trim']()&&this['_promptHistory']['add']({'prompt':_0x5ae34f},0x0);},{'priority':'high'}),_0x11577e;}['_createHistoryView'](){const _0x50ac8b=new ft(this['locale']);return _0x50ac8b['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x50ac8b['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x50ac8b;}['_createToolbar'](){const _0x11a95b=new lt(this['locale']);return _0x11a95b['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xe66c52,_0x11d59a,_0x1fc7b9)=>_0xe66c52&&!_0x11d59a&&!!_0x1fc7b9),_0x11a95b['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x11a95b['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5ab5f4,_0x418a3b,_0x5821ae)=>_0x5ab5f4&&!_0x418a3b&&!!_0x5821ae),_0x11a95b['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x11a95b['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x34db8c,_0x4be080)=>_0x34db8c&&!_0x4be080),_0x11a95b['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x11a95b['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x11a95b['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x11a95b;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x145572=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x145572,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2568b8){const _0x4eac1a=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2568b8||i(_0x4eac1a,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x313720{['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[_0x50eff8,a,E,_0x4b1905];}constructor(_0xd48a00){super(_0xd48a00),_0xd48a00['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0xd48a00['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0xd48a00['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0xd48a00['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x1f6539}=this;this['_aiAdapter']=_0x1f6539['plugins']['get'](E),this['_dialog']=_0x1f6539['plugins']['get'](_0x4b1905),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x426788=new j(_0x1f6539,Array['from'](this['_commandDefinitions']['values']()));_0x1f6539['commands']['add']('showAIAssistant',_0x426788),_0x1f6539['ui']['componentFactory']['add']('aiCommands',_0x1161c3=>{const _0x57ebe6=_0x279c1f(_0x1161c3);return _0x57ebe6['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x57ebe6['buttonView']['set']({'label':i(_0x1161c3,'AI\x20Commands'),'icon':_0x3fc08c,'tooltip':!0x0}),_0x57ebe6['on']('execute',_0x5c9810=>this['_onExecute'](_0x5c9810['source']['id'])),_0x1204ac(_0x57ebe6,_0x1f6539['ui']['view']['body'],function(_0x208b83){const _0x19114e=o(_0x208b83['config']['get']('ai.aiAssistant.commands'),_0x208b83['locale']),_0x49f582=U(_0x208b83,_0x19114e)['filter'](_0x1e23b1=>_0x1e23b1['commands']['length']);if(0x1===_0x49f582['length'])return U(_0x208b83,_0x49f582[0x0]['commands'])['map'](_0xbc64c2=>({'id':_0xbc64c2['id'],'label':_0xbc64c2['label']}));return _0x49f582['map'](_0xa8983f=>{const {groupId:_0x3f1eca,groupLabel:_0x97b40e,commands:_0x581e6c}=_0xa8983f,_0x5e2dcb=U(_0x208b83,_0x581e6c)['map'](_0x30d9f0=>({'id':_0x30d9f0['id'],'label':_0x30d9f0['label']}));return{'id':_0x3f1eca,'menu':_0x97b40e||_0x3f1eca,'children':_0x5e2dcb};});}(_0x1f6539),{'ariaLabel':i(_0x1161c3,'AI\x20Commands')}),_0x57ebe6['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x426788['on']('change:enabledCommandsIds',_0x463ec9),_0x57ebe6['menuView']['once']('render',_0x463ec9),_0x57ebe6;function _0x463ec9(){_0x57ebe6['isEnabled']=_0x426788['enabledCommandsIds']['length']>0x0;for(const _0x174e8b of _0x57ebe6['menuView']['buttons'])_0x174e8b['isEnabled']=_0x426788['enabledCommandsIds']['includes'](_0x174e8b['id']);}}),_0x1f6539['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4f1bc4=>{const _0x4ef21b=new _0x5e937b(_0x4f1bc4);_0x4ef21b['buttonView']['set']({'label':i(_0x4f1bc4,'AI\x20Commands'),'icon':_0x3fc08c}),_0x4ef21b['bind']('isEnabled')['to'](_0x426788,'enabledCommandsIds',_0x2496b0=>_0x2496b0['length']>0x0);const _0x48feb7=o(_0x1f6539['config']['get']('ai.aiAssistant.commands'),_0x4f1bc4);return this['_populateMenuBarMenu'](_0x426788,_0x4ef21b,_0x48feb7,_0x4a8648=>this['_onExecute'](_0x4a8648)),_0x4ef21b;}),_0x1f6539['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x3b4eca=this['_createAIAssistantUIButton'](_0xf91a83);return _0x3b4eca['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x3b4eca;}),_0x1f6539['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4d469f=this['_createAIAssistantUIButton'](_0x4ad8a5);return _0x4d469f['set']({'role':'menuitemcheckbox'}),_0x4d469f;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3a32d8=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1475b5;for(const _0x7c10d7 in _0x3a32d8){const _0xc046d7=_0x7c10d7,_0x326086=_0x3a32d8[_0xc046d7];if('aiLicenseKeyValid'==_0x326086||'aiLicenseKeyInvalid'==_0x326086||'aiLicenseKeyExpired'==_0x326086||'aiLicenseKeyDomainLimit'==_0x326086||'aiLicenseKeyNotAllowed'==_0x326086||'aiLicenseKeyEvaluationLimit'==_0x326086||'aiLicenseKeyTrialLimit'==_0x326086||'aiLicenseKeyUsageLimit'==_0x326086){delete _0x3a32d8[_0xc046d7],_0x1475b5=_0x326086,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x1475b5&&_0x3a32d8['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x1475b5&&_0x3a32d8['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x1475b5&&_0x3a32d8['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x1475b5&&_0x3a32d8['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x1475b5&&_0x3a32d8['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x1475b5&&_0x3a32d8['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x1475b5&&_0x3a32d8['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x984d2a='',_0x24cb30='',_0x1cb7ee='custom'){const _0x51998f=this['editor'],_0x2b61dc=_0x51998f['editing']['view'],_0xa8ea3=_0x51998f['plugins']['get'](a),_0x231a41=_0x51998f['plugins']['get'](_0x50eff8);_0xa8ea3['showFakeVisualSelection']();const _0x2e30ec=new w(),_0x320f04=new ClipboardEvent('copy',{'clipboardData':_0x2e30ec}),_0x3e4675=new _0x1945a1(_0x2e30ec),_0x5cb72c=new _0x25da54(_0x2b61dc,_0x320f04,{'dataTransfer':_0x3e4675});_0x231a41['_forceMarkersCopy']('comment',()=>{_0x2b61dc['document']['fire']('copy',_0x5cb72c);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x51998f,this['_aiAdapter']['textAdapter'],this['_formView']));let _0xdef292=_0x3e4675['getData']('text/html');const _0xaa336a=_0x51998f['model']['document']['selection'],_0xf9acda=Array['from'](_0xaa336a['getRanges']());0x1===_0xf9acda['length']&&_0xf9acda[0x0]['isFlat']&&!_0xaa336a['getSelectedElement']()&&''!==_0xdef292['replace'](/&nbsp;/g,'')['trim']()&&(_0xdef292='<p>'+_0xdef292+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x1cb7ee,'query':_0x984d2a,'htmlContent':_0xdef292,'label':_0x24cb30,'mainActionLabel':M[_0x51998f['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x3df646,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x43c3ed['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0xa8ea3['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x8bfc5f=new Map(),_0x415ae7=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0xc3a10c of _0x415ae7)for(const _0x700832 of _0xc3a10c['commands'])_0x8bfc5f['set'](_0x700832['id'],{..._0x700832,'groupId':_0xc3a10c['groupId'],'groupLabel':_0xc3a10c['groupLabel']||_0xc3a10c['groupId']});return _0x8bfc5f;}['_createAIAssistantUIButton'](_0x8d5aca){const _0x507e9f=this['editor'],_0x16d211=_0x507e9f['commands']['get']('showAIAssistant'),_0x229a02=new _0x8d5aca(_0x507e9f['locale']);return _0x229a02['set']({'label':i(_0x507e9f['locale'],'AI\x20Assistant'),'icon':_0x3df646,'isToggleable':!0x0}),_0x229a02['bind']('isEnabled')['to'](_0x16d211),_0x229a02['bind']('isOn')['to'](this['_dialog'],'id',_0xb50471=>'aiAssistant'===_0xb50471),this['listenTo'](_0x229a02,'execute',()=>{_0x229a02['isOn']?this['hideUI']():_0x16d211['execute']();}),_0x229a02;}['_initView'](){const _0x44bee4=this['editor']['plugins']['get'](a);this['_formView']=new _(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x44bee4['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x44bee4['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x27b7b8,ui:{ariaLiveAnnouncer:_0x5027dd}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x2f6692,_0x126f8e,_0x4f31f4)=>{const _0x60f740=this['_aiAssistantController']['currentContext'];_0x4f31f4?_0x5027dd['announce'](i(_0x27b7b8,'AI\x20is\x20writing')):_0x60f740&&_0x5027dd['announce'](i(_0x27b7b8,'Generated\x20content:\x20%0',_0x60f740),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3e757e,_0x825c01,_0x3a3457)=>{if(_0x3a3457){const _0x18d82f=this['_formView']['errorView']['text'];_0x5027dd['announce'](i(_0x27b7b8,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x18d82f));}});}['_onExecute'](_0xae45a1){const _0x2be292=this['_commandDefinitions']['get'](_0xae45a1),_0x4ea41f=this['editor'],_0x28d515=_0x4ea41f['model']['document']['selection'],_0x5e2873=_0x4ea41f['commands']['get']('showAIAssistant'),_0x49d4d1=_0x4ea41f['plugins']['get'](a),_0x1a2af6=''+(_0x2be292['groupId']!==x?_0x2be292['groupLabel']+':\x20':'')+_0x2be292['label'];if(!0x1!==_0x2be292['requiresContent']&&_0x28d515['isCollapsed']){const _0x4bce07=_0x41fdc6(_0x28d515['getSelectedBlocks']())||_0x4ea41f['model']['schema']['getLimitElement'](_0x28d515);_0x4ea41f['model']['change'](_0x68704e=>{_0x68704e['setSelection'](_0x4bce07,'in');});}_0x49d4d1['showFakeVisualSelection'](),_0x5e2873['execute'](_0x2be292['prompt'],_0x1a2af6,'command:'+_0xae45a1);}['_populateMenuBarMenu'](_0x3f7948,_0x5b223e,_0x55e54a,_0x432d03){const _0x2d7f8e=this['editor'],_0x4d1e06=_0x2d7f8e['locale'],_0xd15fd5=new _0x39ff67(_0x4d1e06),_0xe6ea3b=U(_0x2d7f8e,_0x55e54a)['filter'](_0x1eabe0=>_0x1eabe0['commands']['length']);0x1===_0xe6ea3b['length']?this['_getMenuBarGroupButtons']({'command':_0x3f7948,'commands':_0xe6ea3b[0x0]['commands'],'parentMenuView':_0x5b223e,'onExecute':_0x432d03})['forEach'](_0xbf4945=>_0xd15fd5['items']['add'](_0xbf4945)):_0xe6ea3b['forEach'](({groupId:_0x509894,groupLabel:_0x296d30,commands:_0x30d026})=>{const _0x1899d4=new _0x6b4a24(_0x4d1e06,_0x5b223e),_0x7f5df4=new _0x5e937b(_0x4d1e06),_0x28d8df=new _0x39ff67(_0x4d1e06),_0x5dab2d=this['_getMenuBarGroupButtons']({'command':_0x3f7948,'commands':_0x30d026,'parentMenuView':_0x7f5df4,'onExecute':_0x432d03});_0x7f5df4['buttonView']['set']({'label':_0x296d30||_0x509894}),_0x7f5df4['delegate']('execute')['to'](_0x5b223e),_0x28d8df['items']['addMany'](_0x5dab2d),_0x7f5df4['panelView']['children']['add'](_0x28d8df),_0x1899d4['children']['add'](_0x7f5df4),_0xd15fd5['items']['add'](_0x1899d4);}),_0x5b223e['panelView']['children']['add'](_0xd15fd5);}['_getMenuBarGroupButtons']({command:_0x12fbc7,commands:_0x1c23b0,parentMenuView:_0x515fec,onExecute:_0x210a42}){const _0x235753=this['editor'],_0x18ad88=_0x235753['locale'];return U(_0x235753,_0x1c23b0)['map'](_0xf5a6a5=>{const _0x5aa6f0=new _0x6b4a24(_0x18ad88,_0x515fec),_0x4a9a4a=new _0x4ad8a5(_0x18ad88);return _0x4a9a4a['set']({'label':_0xf5a6a5['label']}),_0x4a9a4a['delegate']('execute')['to'](_0x515fec),_0x4a9a4a['on']('execute',()=>_0x210a42(_0xf5a6a5['id'])),_0x4a9a4a['bind']('isEnabled')['to'](_0x12fbc7,'enabledCommandsIds',_0x29db2c=>_0x29db2c['includes'](_0xf5a6a5['id'])),_0x5aa6f0['children']['add'](_0x4a9a4a),_0x5aa6f0;});}}function B(_0x546783,_0x576508){return void 0x0!==_0x546783['order']&&void 0x0===_0x576508['order']?0x1:void 0x0===_0x546783['order']&&void 0x0!==_0x576508['order']?-0x1:void 0x0!==_0x546783['order']&&void 0x0!==_0x576508['order']?_0x546783['order']-_0x576508['order']:0x0;}function U(_0xc3545b,_0x103c11){_0x103c11['sort'](B);const _0x3c9c13={},_0x12f115=[];for(const _0x4f5ace of _0x103c11)if(void 0x0!==_0x4f5ace['order']){if(_0x4f5ace['order']in _0x3c9c13)throw new _0x38eda9('ai-commands-config-order-collision',_0xc3545b,{'conflictingDefinitions':[_0x4f5ace,_0x3c9c13[_0x4f5ace['order']]]});_0x3c9c13[_0x4f5ace['order']]=_0x4f5ace,_0x12f115['splice'](_0x4f5ace['order'],0x0,_0x4f5ace);}else _0x12f115['push'](_0x4f5ace);return _0x12f115;}class r extends _0x313720{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x52d32a){super(_0x52d32a);const _0x3c9ae6=_0x52d32a['config'],_0x3ce0be=_0x52d32a['locale'];_0x3c9ae6['define']('ai.aiAssistant.preserveComments',!0x0),_0x3c9ae6['define']('ai.aiAssistant.commands',function(_0x1c9136){return[{'groupId':'editOrReview','groupLabel':i(_0x1c9136,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x1c9136,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x1c9136,'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(_0x1c9136,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x1c9136,'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(_0x1c9136,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x1c9136,'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(_0x1c9136,'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(_0x1c9136,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x1c9136,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x1c9136,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x1c9136,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x1c9136,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x1c9136,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x1c9136,'Change\x20style'),'commands':[{'id':'business','label':i(_0x1c9136,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x1c9136,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x1c9136,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x1c9136,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x1c9136,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x1c9136,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x1c9136,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x1c9136,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x1c9136,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x1c9136,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x1c9136,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x1c9136,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x1c9136,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x3ce0be)),_0x3c9ae6['define']('ai.aiAssistant.extraCommandGroups',[]),_0x3c9ae6['define']('ai.aiAssistant.removeCommands',[]);let _0xc0369a=o(_0x3c9ae6['get']('ai.aiAssistant.commands'),_0x3ce0be);const _0x42cfde=_0x3c9ae6['get']('ai.aiAssistant.extraCommandGroups'),_0x2ddeb7=_0x3c9ae6['get']('ai.aiAssistant.removeCommands');_0x42cfde['forEach'](_0x5764ae=>{const _0x2ef105=_0xc0369a['find'](_0x1a3a52=>_0x1a3a52['groupId']===_0x5764ae['groupId']);_0x2ef105?_0x2ef105['commands']=_0x2ef105['commands']['concat'](_0x5764ae['commands']):_0xc0369a['push'](_0x5764ae);}),_0xc0369a=_0xc0369a['filter'](_0x3361e1=>!_0x2ddeb7['includes'](_0x3361e1['groupId'])),_0xc0369a['forEach'](_0x81ae47=>{_0x81ae47['commands']=_0x81ae47['commands']['filter'](_0x2ea234=>!_0x2ddeb7['includes'](_0x2ea234['id']));}),_0x3c9ae6['set']('ai.aiAssistant.commands',_0xc0369a);}}class P extends _0x313720{['abortController'];static get['requires'](){return[E];}constructor(_0x568e43){super(_0x568e43),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x1a07f8){return this['sendRequest'](_0x1a07f8)['catch'](_0x52181b=>{if(_0x52181b instanceof R)return Promise['reject'](_0x52181b);if('AbortError'==_0x52181b['name'])return Promise['resolve']();throw console['error'](_0x52181b),new _0x38eda9('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x50df6c,_0x2731b8){const _0x278fdd=this['editor']['locale'],_0x288519={'Content-Type':'application/json'};if('object'==typeof _0x50df6c)Object['assign'](_0x288519,_0x50df6c);else{if(_0x50df6c)try{const _0x53a6ff=await _0x50df6c(_0x2731b8);Object['assign'](_0x288519,_0x53a6ff);}catch{return Promise['reject'](new R(i(_0x278fdd,'AI_ERROR_GET_HEADERS')));}}return _0x288519;}async['_prepareRequestParameters'](_0x5a290f,_0x45dbff){const _0x5c62fd=this['editor']['locale'];if('object'==typeof _0x5a290f)return _0x5a290f;try{return await _0x5a290f(_0x45dbff);}catch{return Promise['reject'](new R(i(_0x5c62fd,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x288ca4){super(_0x288ca4),_0x288ca4['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x288ca4['config']['get']('ai.openAI.requestParameters')||_0x288ca4['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x288ca4['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x288ca4['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x288ca4['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x456d7d,context:_0x15ec26,onData:_0x1d00ab,actionId:_0xb64031}){const _0x377316=this['editor']['locale'],_0x4310e8=await this['prepareMessages'](_0x456d7d,_0x15ec26,_0xb64031),_0x379991=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xb64031),_0x34b559=await this['_prepareRequestParameters'](this['_requestParameters'],_0xb64031),_0x49eb97={'messages':_0x4310e8,..._0x34b559},_0x260b66={'method':'POST','headers':_0x379991,'body':JSON['stringify'](_0x49eb97),'signal':this['abortController']['signal']},_0x4681b0=await fetch(this['_apiUrl'],_0x260b66);if(_0x4681b0['ok'])return _0x34b559['stream']?await this['_readStreamableResponse'](_0x4681b0,_0x1d00ab):await this['_readStaticResponse'](_0x4681b0,_0x1d00ab),Promise['resolve']();{const _0x5cca14=await _0x4681b0['text']();return _0x5cca14['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x377316,'AI_ERROR_CONTEXT_LENGTH'))):_0x5cca14['includes']('Moderation')?Promise['reject'](new R(i(_0x377316,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x5cca14));}}async['prepareMessages'](_0x4e74dd,_0x3aa713,_0x13e2a1){let _0x48da21,_0x3ea201;return _0x3aa713?(_0x48da21='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.',_0x3ea201='Instruction:\x0a'+_0x4e74dd+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3aa713):(_0x48da21='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.',_0x3ea201=_0x4e74dd),[{'role':'system','content':_0x48da21},{'role':'user','content':_0x3ea201}];}async['_readStreamableResponse'](_0x6dddb0,_0x321424){const _0x5a6105=_0x6dddb0['body']['getReader'](),_0x1c92f5=new TextDecoder();let _0x32b464='',_0x24dda6='',_0x45de7a='',_0x54ab49=!0x1;for(;!_0x54ab49;){const {done:_0xb2f727,value:_0x39365d}=await _0x5a6105['read'](),_0x1766d2=_0x32b464+_0x1c92f5['decode'](_0x39365d);let _0x414eb4='';_0x54ab49=_0xb2f727;try{_0x414eb4=this['_cleanUpData'](_0x1766d2),_0x32b464='';}catch{_0x32b464=_0x1766d2;continue;}_0x24dda6+=_0x414eb4,!_0x54ab49&&this['_isBufferIncomplete'](_0x24dda6)||_0x24dda6&&(_0x45de7a+=_0x24dda6,_0x24dda6='',_0x321424(_0x45de7a));}return Promise['resolve']();}async['_readStaticResponse'](_0x110e95,_0x5c2b57){return _0x5c2b57((await _0x110e95['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x1267cf){const _0x5812f2=_0x1267cf['split']('<')['length']!==_0x1267cf['split']('>')['length'],_0x12267b=_0x1267cf['length']<0x1e;return _0x5812f2&&_0x12267b;}['_cleanUpData'](_0x214ae7){return _0x214ae7['split'](/\n(?![^{]*\})/g)['map'](_0x1900f1=>_0x1900f1['replace']('data:\x20',''))['filter'](_0x1f66d6=>_0x1f66d6&&_0x1f66d6['length']>0x0&&'[DONE]'!==_0x1f66d6)['map'](_0x158d89=>{const {choices:_0x3dd8b7}=JSON['parse'](_0x158d89);if(_0x3dd8b7[0x0]?.['delta']?.['content'])return _0x3dd8b7[0x0]['delta']['content'];})['filter'](_0x300be0=>_0x300be0)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x35f3e1){super(_0x35f3e1),_0x35f3e1['config']['get']('ai.aws.requestParameters')||_0x35f3e1['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']=_0x35f3e1['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x35f3e1['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x35f3e1['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x35f3e1['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x5dc9ad,context:_0x11a073,onData:_0x322d4e,actionId:_0x75fb43}){const {model:_0x2eb5b1,stream:_0x29534f,..._0x3ad3c5}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x75fb43),_0x438db5={'prompt':await this['preparePrompt'](_0x5dc9ad,_0x11a073,_0x2eb5b1,_0x75fb43),..._0x3ad3c5};this['_apiUrl']?await this['_processProxyRequest'](_0x438db5,_0x2eb5b1,_0x29534f,_0x322d4e,_0x75fb43):await this['_processAWSRequest'](_0x438db5,_0x2eb5b1,_0x29534f,_0x322d4e);}async['preparePrompt'](_0x2c750b,_0x1f0443,_0x26dde4,_0x376a54){let _0x4e0e97,_0x3b2192;return _0x1f0443?(_0x4e0e97='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.',_0x3b2192='Instruction:\x0a'+_0x2c750b+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1f0443):(_0x4e0e97='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.',_0x3b2192=_0x2c750b),'meta.llama'==this['getModelFamily'](_0x26dde4)?'<<SYS>>\x0a'+_0x4e0e97+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x3b2192+'\x0a[/INST]':'Human:\x0a'+_0x4e0e97+'\x0a'+_0x3b2192+'\x0a\x0aAssistant:';}['getModelFamily'](_0x5d828d){if(/^anthropic\.claude/['test'](_0x5d828d))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x5d828d))return'ai21.j2';if(/^cohere\.command/['test'](_0x5d828d))return'cohere.command';if(/^meta\.llama/['test'](_0x5d828d))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x5d828d));}async['_processProxyRequest'](_0x1c679b,_0x3331c4,_0x5d182c,_0x39bfef,_0x1b3d0d){const _0x3aa339={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1b3d0d),'body':JSON['stringify']({..._0x1c679b,'model':_0x3331c4,'stream':_0x5d182c}),'signal':this['abortController']['signal']},_0x378abe=await fetch(this['_apiUrl'],_0x3aa339);_0x5d182c?await this['_readStreamableResponse'](_0x378abe,_0x3331c4,_0x39bfef):await this['_readStaticResponse'](_0x378abe,_0x3331c4,_0x39bfef);}async['_processAWSRequest'](_0x17b81f,_0x1a9925,_0x5b5878,_0x1fac02){const _0x4b0eae=new _0x2024e8(this['_bedrockClientConfig']),_0x31e072={'body':JSON['stringify'](_0x17b81f),'contentType':'application/json','accept':'application/json','modelId':_0x1a9925};let _0x580678;if(_0x5b5878){const _0x27851c=new _0xc6a8de(_0x31e072);_0x580678=await _0x4b0eae['send'](_0x27851c,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x580678,_0x1a9925,_0x1fac02);}else{const _0x30c9a2=new _0x44dbd(_0x31e072);_0x580678=await _0x4b0eae['send'](_0x30c9a2,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x580678,_0x1a9925,_0x1fac02);}}async['_readAsyncIterableResponse'](_0x558026,_0x3a5254,_0x333ab2){const _0x50e4bb=_0x558026['body'],_0x15f33d=new TextDecoder('utf-8');let _0x2a06fc='';for await(const _0x2324a1 of _0x50e4bb)if(_0x2324a1['chunk']){const _0x45ba04=_0x15f33d['decode'](_0x2324a1['chunk']['bytes']),_0x4cee82=JSON['parse'](_0x45ba04);_0x2a06fc+=this['_getGeneratedText'](_0x4cee82,_0x3a5254),_0x333ab2(_0x2a06fc);}return Promise['resolve']();}async['_readStreamableResponse'](_0x53ed86,_0x2c5880,_0x1c5517){const _0x478b3c=_0x53ed86['body'],_0x34a1c4=new TextDecoder('utf-8'),_0x40d92d=_0x478b3c['getReader']();let _0x5b9a09='',_0x4431f1='',_0x47f4ff=!0x1;for(;!_0x47f4ff;){const {done:_0x526a60,value:_0x1d1eef}=await _0x40d92d['read']();if(_0x47f4ff=_0x526a60,_0x47f4ff)break;const _0x2a4aca=(_0x5b9a09+_0x34a1c4['decode'](_0x1d1eef))['split']('\x0a')['map'](_0x27a728=>{try{return _0x5b9a09='',JSON['parse'](_0x27a728);}catch{return _0x5b9a09=_0x27a728,null;}})['filter'](_0x1439d9=>null!==_0x1439d9);_0x2a4aca['length']&&(_0x4431f1+=_0x2a4aca['map'](_0x14bd68=>this['_getGeneratedText'](_0x14bd68,_0x2c5880))['join'](''),_0x1c5517(_0x4431f1));}return Promise['resolve']();}async['_readStaticResponse'](_0x179a99,_0x211089,_0x1a4c7c){let _0x5b7d8c;return _0x5b7d8c=_0x179a99 instanceof Response?await _0x179a99['json']():JSON['parse'](Buffer['from'](_0x179a99['body'])['toString']('utf8')),(_0x1a4c7c(this['_getGeneratedText'](_0x5b7d8c,_0x211089)),Promise['resolve']());}['_getGeneratedText'](_0x2b8b0b,_0x4bb0d1){switch(this['getModelFamily'](_0x4bb0d1)){case'anthropic.claude':return _0x2b8b0b['completion'];case'ai21.j2':return _0x2b8b0b['completions'][0x0]['data']['text'];case'cohere.command':return _0x2b8b0b['generations'][0x0]['text'];case'meta.llama':return _0x2b8b0b['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O as OpenAITextAdapter};
23
+ import{Plugin as _0x1e8a11,Command as _0x320064}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x3736ca,IconCheck as _0x361fde,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x3e651d,IconRobotPencil as _0x1fd953}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x496c79,CKEditorError as _0x149dfa,ObservableMixin as _0x447e28,global as _0x301865,isVisible as ot,Rect as it,Collection as _0x2aeb58,FocusTracker as mt,KeystrokeHandler as ut,first as _0x4c7b68}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x490fba,View as _0x2981c6,SpinnerView as _0x1dd543,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0x20dd0b,createDropdown as _0x56cff,addMenuToDropdown as _0x2b8a0b,MenuBarMenuView as _0x26dcd7,MenuBarMenuListItemButtonView as _0x841fe8,DialogViewPosition as _0x64ed72,MenuBarMenuListView as _0x27cfab,MenuBarMenuListItemView as _0x202b41}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x4ec368,ClipboardMarkersUtils as _0x14dfda}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x460c8f,DataTransfer as _0x361b43,UpcastWriter as _0x251c1b,Matcher as _0xce2739}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x57a40a,InvokeModelWithResponseStreamCommand as _0x14d061,InvokeModelCommand as _0x2824dd}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x430601,_0x1d56ec){const _0x2236dd=(0x0,_0x1d56ec['t'])('Other');return _0x430601['length']?'groupId'in _0x430601[0x0]?_0x430601:[{'groupId':x,'groupLabel':_0x2236dd,'order':0x1/0x0,'commands':_0x430601}]:[{'groupId':x,'groupLabel':_0x2236dd,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x1e8a11{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x64f139}=this,_0x56b382=['ck-fake-ai-selection'];_0x64f139['config']['get']('ai.useTheme')&&_0x56b382['push']('ck-ai-assistant-ui_theme'),_0x64f139['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x56b382,'priority':0xc}}),_0x64f139['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x2132cc,{writer:_0x1ada19})=>{if(!_0x2132cc['markerRange']['isCollapsed'])return null;const _0x137635=_0x1ada19['createUIElement']('span');return _0x1ada19['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x137635),_0x137635;}});}['afterInit'](){!async function(_0x9a0331){const _0x5e06bc=_0x2bc310([0x4a,0x56,0x62,0x68,0x78,0x51,0x42,0x6c,0x70,0x38,0x6b,0x30,0x48,0x49,0x7a,0x59,0x36,0x34,0x55,0x63,0x6a,0x77,0x35,0x64,0x32,0x71,0x37,0x4f,0x52,0x41,0x46,0x67,0x6f,0x69,0x75,0x74,0x72,0x73,0x4c,0x76,0x6e,0x4d,0x44,0x4b,0x6d,0x45,0x79,0x47,0x54,0x33,0x65,0x50,0x43,0x53,0x31,0x57,0x5a,0x4e,0x39,0x58,0x66,0x61]),_0x251e36=0x3a03af5,_0x3483e7=0x3a751c5^_0x251e36,_0x84fc43=window[_0x2bc310([0x44,0x61,0x74,0x65])][_0x2bc310([0x6e,0x6f,0x77])](),_0x3e21e8=_0x9a0331[_0x2bc310([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x318edf=new window[(_0x2bc310([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3bea1e=>{_0x3e21e8[_0x2bc310([0x6f,0x6e,0x63,0x65])](_0x2bc310([0x72,0x65,0x61,0x64,0x79]),_0x3bea1e);}),_0x11f998={[_0x2bc310([0x6b,0x74,0x79])]:_0x2bc310([0x45,0x43]),[_0x2bc310([0x75,0x73,0x65])]:_0x2bc310([0x73,0x69,0x67]),[_0x2bc310([0x63,0x72,0x76])]:_0x2bc310([0x50,0x2d,0x32,0x35,0x36]),[_0x2bc310([0x78])]:_0x2bc310([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]),[_0x2bc310([0x79])]:_0x2bc310([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]),[_0x2bc310([0x61,0x6c,0x67])]:_0x2bc310([0x45,0x53,0x32,0x35,0x36])},_0x49ed8f=_0x3e21e8[_0x2bc310([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2bc310([0x67,0x65,0x74])](_0x2bc310([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x2e3531(){let _0x4cb3e5,_0x4a6e23=null,_0x24a068=null;try{if(_0x49ed8f==_0x2bc310([0x47,0x50,0x4c]))return _0x2bc310([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x4cb3e5=_0x589aed(),!_0x4cb3e5)return _0x2bc310([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x4cb3e5[_0x2bc310([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x24a068=_0x2246b6(_0x4cb3e5[_0x2bc310([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x4cb3e5[_0x2bc310([0x6a,0x74,0x69])])),await _0x54c386()?_0x4e1429()?_0x4f10df()?_0x2bc310([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x12df89()?(_0x4cb3e5[_0x2bc310([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2bc310([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4a6e23=_0x98b2d0(_0x2bc310([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x4cb3e5[_0x2bc310([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2bc310([0x74,0x72,0x69,0x61,0x6c])&&(_0x4a6e23=_0x98b2d0(_0x2bc310([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x380f96()):_0x2bc310([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2bc310([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2bc310([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x2bc310([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x4f10df(){const _0x57aec8=[_0x2bc310([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2bc310([0x74,0x72,0x69,0x61,0x6c])][_0x2bc310([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4cb3e5[_0x2bc310([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x84fc43/0x3e8:0xe10*_0x3483e7;return _0x4cb3e5[_0x2bc310([0x65,0x78,0x70])]<_0x57aec8;}function _0x4e1429(){const _0x1d8184=_0x4cb3e5[_0x2bc310([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x1d8184&&(!!_0x1d8184[_0x2bc310([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2bc310([0x2a]))||!!_0x1d8184[_0x2bc310([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2bc310([0x41,0x49])));}function _0x12df89(){const _0x325dc7=_0x4cb3e5[_0x2bc310([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x325dc7||0x0==_0x325dc7[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x4f68a5}=new URL(window[_0x2bc310([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x325dc7[_0x2bc310([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4f68a5))return!0x0;const _0x483217=_0x4f68a5[_0x2bc310([0x73,0x70,0x6c,0x69,0x74])](_0x2bc310([0x2e]));return _0x325dc7[_0x2bc310([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xafdb15=>_0xafdb15[_0x2bc310([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2bc310([0x2a])))[_0x2bc310([0x6d,0x61,0x70])](_0x47321b=>_0x47321b[_0x2bc310([0x73,0x70,0x6c,0x69,0x74])](_0x2bc310([0x2e])))[_0x2bc310([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x423b08=>_0x423b08[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x483217[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2bc310([0x6d,0x61,0x70])](_0x5c5f46=>Array(_0x483217[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x5c5f46[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2bc310([0x66,0x69,0x6c,0x6c])](_0x5c5f46[0x0]===_0x2bc310([0x2a])?_0x2bc310([0x2a]):'')[_0x2bc310([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x5c5f46))[_0x2bc310([0x73,0x6f,0x6d,0x65])](_0x4661e7=>_0x483217[_0x2bc310([0x65,0x76,0x65,0x72,0x79])]((_0x3d7973,_0x47e149)=>_0x4661e7[_0x47e149]===_0x3d7973||_0x4661e7[_0x47e149]===_0x2bc310([0x2a])));}function _0x380f96(){return _0x4a6e23&&_0x24a068?new window[(_0x2bc310([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x58aaea,_0xb48176)=>{_0x4a6e23[_0x2bc310([0x74,0x68,0x65,0x6e])](_0x58aaea,_0xb48176),_0x24a068[_0x2bc310([0x74,0x68,0x65,0x6e])](_0x1bb23f=>{_0x1bb23f!=_0x2bc310([0x56,0x61,0x6c,0x69,0x64])&&_0x58aaea(_0x1bb23f);},_0xb48176);}):_0x4a6e23||_0x24a068||_0x2bc310([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2246b6(_0x3faf8d,_0x8acc59){return new window[(_0x2bc310([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3c51df=>{if(_0x23be64())return _0x3c51df(_0x2bc310([0x56,0x61,0x6c,0x69,0x64]));_0x21b488(),_0x3e21e8[_0x2bc310([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2bc310([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x129ed=!0x1;const _0x54a988=_0x496c79();function _0x26695a(_0x59f3fb){return!!_0x59f3fb&&(typeof _0x59f3fb===_0x2bc310([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x59f3fb===_0x2bc310([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x59f3fb[_0x2bc310([0x74,0x68,0x65,0x6e])]===_0x2bc310([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x59f3fb[_0x2bc310([0x63,0x61,0x74,0x63,0x68])]===_0x2bc310([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0xb70089(_0x10f32d){_0x2535e7(_0x10f32d)[_0x2bc310([0x74,0x68,0x65,0x6e])](_0xfc8b8e=>{if(!_0xfc8b8e||_0xfc8b8e[_0x2bc310([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2bc310([0x6f,0x6b]))return _0x2bc310([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x3d65db(_0xc29279(_0x54a988+_0x8acc59))!=_0xfc8b8e[_0x2bc310([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2bc310([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2bc310([0x56,0x61,0x6c,0x69,0x64]);})[_0x2bc310([0x74,0x68,0x65,0x6e])](_0xa846e=>(_0x41f73c(),_0xa846e),()=>{const _0x25c92b=_0x5b5930();return null==_0x25c92b?(_0x41f73c(),_0x2bc310([0x56,0x61,0x6c,0x69,0x64])):_0x2bc310(_0x84fc43-_0x25c92b>(0x27acbef5^_0x251e36)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2bc310([0x74,0x68,0x65,0x6e])](_0x3c51df)[_0x2bc310([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3c51df(_0x2bc310([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x597206=0x396d475^_0x251e36;function _0x41f73c(){const _0x4225ae=_0x2bc310([0x6c,0x6c,0x63,0x74,0x2d])+_0x3d65db(_0xc29279(_0x3faf8d)),_0x28cd13=_0x9749da(_0x3d65db(window[_0x2bc310([0x4d,0x61,0x74,0x68])][_0x2bc310([0x63,0x65,0x69,0x6c])](_0x84fc43/_0x597206)));window[_0x2bc310([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2bc310([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4225ae,_0x28cd13);}function _0x5b5930(){const _0x206bb8=_0x2bc310([0x6c,0x6c,0x63,0x74,0x2d])+_0x3d65db(_0xc29279(_0x3faf8d)),_0x41b067=window[_0x2bc310([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2bc310([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x206bb8);return _0x41b067?window[_0x2bc310([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x9749da(_0x41b067),0x10)*_0x597206:null;}function _0x2535e7(_0x4b746a){return new window[(_0x2bc310([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x22357b,_0x4af012)=>{_0x4b746a[_0x2bc310([0x74,0x68,0x65,0x6e])](_0x22357b,_0x4af012),window[_0x2bc310([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4af012,0x3a1ee35^_0x251e36);});}}_0x3e21e8[_0x2bc310([0x6f,0x6e])](_0x2bc310([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x4c99ad,_0x250af3)=>{if(_0x250af3[0x0]!=_0x3faf8d)return _0x3c51df(_0x2bc310([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x250af3[0x1]={..._0x250af3[0x1],[_0x2bc310([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x54a988};},{[_0x2bc310([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2bc310([0x68,0x69,0x67,0x68])}),_0x3e21e8[_0x2bc310([0x6f,0x6e])](_0x2bc310([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x1a82c8=>{_0x26695a(_0x1a82c8[_0x2bc310([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x129ed=!0x0,_0xb70089(_0x1a82c8[_0x2bc310([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2bc310([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2bc310([0x6c,0x6f,0x77])}),_0x318edf[_0x2bc310([0x74,0x68,0x65,0x6e])](()=>{_0x129ed||_0x3c51df(_0x2bc310([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x23be64(){return _0x3e21e8[_0x2bc310([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2bc310([0x76,0x69,0x65,0x77])][_0x2bc310([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2bc310([0x61,0x75,0x74,0x6f]);}function _0x21b488(){_0x3e21e8[_0x2bc310([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2bc310([0x76,0x69,0x65,0x77])][_0x2bc310([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2bc310([0x61,0x75,0x74,0x6f]);}}function _0x98b2d0(_0x191848){const _0x25ec08=[new window[(_0x2bc310([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x295154=>setTimeout(_0x295154,0x3a90439^_0x251e36)),_0x318edf[_0x2bc310([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2bc310([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x266a78=>{let _0x26022e=0x0;_0x3e21e8[_0x2bc310([0x6d,0x6f,0x64,0x65,0x6c])][_0x2bc310([0x6f,0x6e])](_0x2bc310([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x17a396,_0x122ea8)=>{_0x122ea8[0x0][_0x2bc310([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x26022e++,_0x26022e==(0x3a03b0d^_0x251e36)&&(_0x266a78(),_0x17a396[_0x2bc310([0x6f,0x66,0x66])]());});}))];return window[_0x2bc310([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2bc310([0x72,0x61,0x63,0x65])](_0x25ec08)[_0x2bc310([0x74,0x68,0x65,0x6e])](()=>_0x191848);}async function _0x2183d7(){await _0x318edf,_0x3e21e8[_0x2bc310([0x6d,0x6f,0x64,0x65,0x6c])][_0x2bc310([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x4ae912,_0x3e21e8[_0x2bc310([0x6d,0x6f,0x64,0x65,0x6c])][_0x2bc310([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x4ae912,_0x3e21e8[_0x2bc310([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2bc310([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xd5170d(_0x519512){const _0xb6081=_0xda139d();_0x3e21e8[_0xb6081]=_0x2bc310([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x519512,_0x519512!=_0x2bc310([0x56,0x61,0x6c,0x69,0x64])&&_0x2183d7();}function _0xda139d(){const _0x6ef2d5=window[_0x2bc310([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2bc310([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2bc310([0x6e,0x6f,0x77])]())[_0x2bc310([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2bc310([0x2e]),'');let _0x1973b7=_0x2bc310([0x4a]);for(let _0x1c5611=0x0;_0x1c5611<_0x6ef2d5[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1c5611+=0x2){let _0x272aaa=window[_0x2bc310([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x6ef2d5[_0x2bc310([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1c5611,_0x1c5611+0x2));_0x272aaa>=_0x5e06bc[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x272aaa-=_0x5e06bc[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1973b7+=_0x5e06bc[_0x272aaa];}return _0x1973b7;}function _0x589aed(){const _0x26460f=_0x49ed8f[_0x2bc310([0x73,0x70,0x6c,0x69,0x74])](_0x2bc310([0x2e]));if(0x3!=_0x26460f[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xfd3ee6(_0x26460f[0x1]);function _0xfd3ee6(_0x332149){const _0xe2bbc6=_0x30cac2(_0x332149);return _0xe2bbc6&&_0x23f684()?_0xe2bbc6:null;function _0x23f684(){const _0x10d583=_0xe2bbc6[_0x2bc310([0x6a,0x74,0x69])],_0x34ad01=window[_0x2bc310([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x10d583[_0x2bc310([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x10d583[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x594083={..._0xe2bbc6,[_0x2bc310([0x6a,0x74,0x69])]:_0x10d583[_0x2bc310([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x10d583[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x594083[_0x2bc310([0x76,0x63])],_0xc29279(_0x594083)==_0x34ad01;}}}async function _0x54c386(){let _0x4f95eb=!0x0;try{const _0x3e61e5=_0x49ed8f[_0x2bc310([0x73,0x70,0x6c,0x69,0x74])](_0x2bc310([0x2e])),[_0x57c6f8,_0xe39fb5,_0x1440d4]=_0x3e61e5;return _0x103098(_0x57c6f8),await _0x352327(_0x57c6f8,_0xe39fb5,_0x1440d4),_0x4f95eb;}catch{return!0x1;}function _0x103098(_0x41614d){const _0x513503=_0x30cac2(_0x41614d);_0x513503&&_0x513503[_0x2bc310([0x61,0x6c,0x67])]==_0x2bc310([0x45,0x53,0x32,0x35,0x36])||(_0x4f95eb=!0x1);}async function _0x352327(_0x3e81f5,_0x322100,_0x1089f2){const _0x4a0869=window[_0x2bc310([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2bc310([0x66,0x72,0x6f,0x6d])](_0x254db4(_0x1089f2),_0x1c1686=>_0x1c1686[_0x2bc310([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x5a9e3f=new window[(_0x2bc310([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2bc310([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3e81f5+_0x2bc310([0x2e])+_0x322100),_0x2f883d=window[_0x2bc310([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2bc310([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x2f883d)return;const _0x39c6f4=await _0x2f883d[_0x2bc310([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2bc310([0x6a,0x77,0x6b]),_0x11f998,{[_0x2bc310([0x6e,0x61,0x6d,0x65])]:_0x2bc310([0x45,0x43,0x44,0x53,0x41]),[_0x2bc310([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2bc310([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2bc310([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x2f883d[_0x2bc310([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2bc310([0x6e,0x61,0x6d,0x65])]:_0x2bc310([0x45,0x43,0x44,0x53,0x41]),[_0x2bc310([0x68,0x61,0x73,0x68])]:{[_0x2bc310([0x6e,0x61,0x6d,0x65])]:_0x2bc310([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x39c6f4,_0x4a0869,_0x5a9e3f)||(_0x4f95eb=!0x1);}}function _0x30cac2(_0x2951c7){return _0x2951c7[_0x2bc310([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2bc310([0x65,0x79]))?JSON[_0x2bc310([0x70,0x61,0x72,0x73,0x65])](_0x254db4(_0x2951c7)):null;}function _0x254db4(_0x21567c){return window[_0x2bc310([0x61,0x74,0x6f,0x62])](_0x21567c[_0x2bc310([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2bc310([0x2b]))[_0x2bc310([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2bc310([0x2f])));}function _0xc29279(_0x499726){let _0x5f41fc=0x1505;function _0x438b1e(_0x21d0f8){for(let _0x9c2139=0x0;_0x9c2139<_0x21d0f8[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x9c2139++){const _0x397046=_0x21d0f8[_0x2bc310([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x9c2139);_0x5f41fc=(_0x5f41fc<<0x5)+_0x5f41fc+_0x397046,_0x5f41fc&=_0x5f41fc;}}function _0x251298(_0x56492f){Array[_0x2bc310([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x56492f)?_0x56492f[_0x2bc310([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x251298):_0x56492f&&typeof _0x56492f==_0x2bc310([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2bc310([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x56492f)[_0x2bc310([0x73,0x6f,0x72,0x74])]()[_0x2bc310([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3433b4,_0x3f59e8])=>{_0x438b1e(_0x3433b4),_0x251298(_0x3f59e8);}):_0x438b1e(window[_0x2bc310([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x56492f));}return _0x251298(_0x499726),_0x5f41fc>>>0x0;}function _0x3d65db(_0x88ad9a){return _0x88ad9a[_0x2bc310([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2bc310([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2bc310([0x30]));}function _0x9749da(_0x58f5a1){return _0x58f5a1[_0x2bc310([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2bc310([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2bc310([0x6a,0x6f,0x69,0x6e])]('');}function _0x4ae912(){}function _0x2bc310(_0x1d5b69){return _0x1d5b69['map'](_0x90ce9f=>String['fromCharCode'](_0x90ce9f))['join']('');}_0xd5170d(await _0x2e3531());}(this);}['showFakeVisualSelection'](){const _0x49bfc5=this['editor']['model'];_0x49bfc5['change'](_0x1bf106=>{const _0x1317f4=_0x49bfc5['document']['selection']['getRanges']();let _0x2c14b8=0x0;for(const _0x1049e9 of _0x1317f4){const _0x443beb=f+':'+_0x2c14b8;if(_0x49bfc5['markers']['has'](_0x443beb))_0x1bf106['updateMarker'](_0x443beb,{'range':_0x1049e9});else{if(_0x1049e9['start']['isAtEnd']){const _0x5a0116=_0x1049e9['start']['getLastMatchingPosition'](({item:_0x1b102f})=>!_0x49bfc5['schema']['isContent'](_0x1b102f),{'boundaries':_0x1049e9});_0x1bf106['addMarker'](_0x443beb,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1bf106['createRange'](_0x5a0116,_0x1049e9['end'])});}else _0x1bf106['addMarker'](_0x443beb,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1049e9});}_0x2c14b8++;}});}['hideFakeVisualSelection'](){const _0x27effb=this['editor']['model'],_0xb9c348=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0xb9c348['length']&&_0x27effb['change'](_0x4421ff=>{_0xb9c348['forEach'](_0xc542c3=>{_0x4421ff['removeMarker'](_0xc542c3);});});}['insertContent'](_0x243941,_0x8b2ebb){const _0x37d286=this['_getAISelection'](),_0x339ee1=_0x8b2ebb||_0x37d286['getFirstRange']();this['editor']['model']['canEditAt'](_0x339ee1)&&this['editor']['model']['change'](_0x3a30af=>{this['hideFakeVisualSelection'](),_0x8b2ebb||this['_resetContentOfSelectedTableCells'](_0x3a30af,_0x37d286),this['_pasteHTMLUsingClipboard']({'insertAt':_0x339ee1,'writer':_0x3a30af,'html':_0x243941});});}['insertContentBelow'](_0xaa6269){const {model:_0x3f4507}=this['editor'],_0x4699b0=this['_getAISelection']();_0x3f4507['change'](()=>{const _0x242fcc=this['_prepareTableInsertBelowPosition'](_0xaa6269,_0x4699b0)||this['_getDefaultInsertBelowPosition'](_0x4699b0);this['insertContent'](_0xaa6269,_0x242fcc);});}['_getAISelection'](){const _0x822ecf=this['editor']['model'],_0x14fb5d=Array['from'](_0x822ecf['markers']['getMarkersGroup'](f))['map'](_0x3a5e56=>_0x3a5e56['getRange']());return _0x822ecf['createSelection'](_0x14fb5d);}['_pasteHTMLUsingClipboard']({writer:_0x324e8f,html:_0x47e449,insertAt:_0x35d2cd}){const {view:_0x2ae43b}=this['editor']['editing'],_0x341628=this['editor']['plugins']['get'](_0x4ec368),_0x4a600f=new gt();_0x4a600f['setData']('text/html',_0x47e449);const _0x472e59=new ClipboardEvent('paste',{'clipboardData':_0x4a600f}),_0x1924e2=new _0x460c8f(_0x2ae43b,_0x472e59,{'dataTransfer':new _0x361b43(_0x4a600f)});_0x324e8f['setSelection'](_0x35d2cd);const _0x172c16=(_0x1764a9,_0x2323f2)=>{_0x2323f2['resultRange']&&_0x324e8f['setSelection'](_0x2323f2['resultRange']);};_0x341628['once']('contentInsertion',_0x172c16,{'priority':'lowest'}),_0x2ae43b['document']['fire']('paste',_0x1924e2),_0x341628['off']('contentInsertion',_0x172c16);}['_getDefaultInsertBelowPosition'](_0x57769f){const {model:_0x5866e3}=this['editor'],_0x270b47=Array['from'](_0x57769f['getSelectedBlocks']());return _0x270b47['length']?_0x5866e3['createPositionAfter'](_0x270b47['pop']()):_0x57769f['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3c972a,_0x14d6fa){const {model:_0x468ee3,plugins:_0x5af526}=this['editor'];if(_0x5af526['has']('TableUtils')){const _0x2650e1=_0x5af526['get']('TableUtils')['getSelectedTableCells'](_0x14d6fa);if(_0x2650e1['length']){const _0x55e296=this['_getTableRowCountFromContent'](_0x3c972a),_0x486198=this['_createEmptyTableRows'](_0x2650e1,_0x55e296);return _0x468ee3['createPositionAt'](_0x486198,0x0);}}return null;}['_getTableRowCountFromContent'](_0x50ce17){const _0x21e0f4=this['editor']['plugins']['get']('TableUtils'),_0x52376a=this['editor']['data']['parse'](_0x50ce17),_0x49a146=Array['from'](_0x52376a['getChildren']())['filter'](_0x18cf96=>_0x18cf96['is']('element','table'));let _0x7d84bc=0x0;return _0x49a146['forEach'](_0x56bd65=>{_0x7d84bc+=_0x21e0f4['getRows'](_0x56bd65);}),_0x7d84bc;}['_createEmptyTableRows'](_0x3ebdf5,_0xe3a789){const _0x5b9ab8=this['editor']['plugins']['get']('TableUtils'),_0x91e191=_0x5b9ab8['getRowIndexes'](_0x3ebdf5),_0x21c8ab=_0x5b9ab8['getColumnIndexes'](_0x3ebdf5),_0x131919=_0x91e191['last']+0x1,_0x5d2953=_0x21c8ab['first'],_0x40b149=_0x3ebdf5[0x0]['findAncestor']('table');for(let _0x118a19=0x0;_0x118a19<_0xe3a789;_0x118a19++)_0x5b9ab8['insertRows'](_0x40b149,{'at':_0x131919});return _0x40b149['getChild'](_0x131919)['getChild'](_0x5d2953);}['_resetContentOfSelectedTableCells'](_0x6717ce,_0x2c9dff){const {plugins:_0x57c5bd}=this['editor'],{model:_0x4fa221}=_0x6717ce;if(!_0x57c5bd['has']('TableUtils'))return;_0x57c5bd['get']('TableUtils')['getSelectedTableCells'](_0x2c9dff)['length']&&_0x4fa221['deleteContent'](_0x2c9dff);}}class E extends _0x1e8a11{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x149dfa('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x1e4d73){super(_0x1e4d73),this['name']='AIRequestError';}}function i(_0xbcdcd1,_0xa484e,_0x2b626a){const t=_0xbcdcd1['t'];switch(_0xa484e){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',_0x2b626a);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2b626a);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'},_0x2b626a);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 _0xa484e;}}class j extends _0x320064{['_commandDefinitions'];constructor(_0x3dc0a1,_0x21edd1){super(_0x3dc0a1),this['_commandDefinitions']=_0x21edd1,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x564193,_0x18eb26,_0x4531b7)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x4531b7));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x1da78b,_0x114ca3,_0x26968e)=>{this['enabledCommandsIds']=_0x26968e?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3a4673=this['editor']['model'];this['_hasContext']=function(_0x696747){const _0x5374dc=_0x696747['document']['selection'];return _0x5374dc['isCollapsed']?0x0!==[..._0x5374dc['getSelectedBlocks']()]['length']&&![..._0x5374dc['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x696747['hasContent'](_0x5374dc['getFirstRange']());}(_0x3a4673);const _0x248cbe=_0x3a4673['document']['selection'],_0x27fc27=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x62b56 of _0x248cbe['getRanges']())for(const _0x52cc7b of _0x62b56['getItems']())if(_0x52cc7b['is']('element')&&_0x27fc27['includes'](_0x52cc7b['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x395d1c='',_0x2ab1ba='',_0x15bf60='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x395d1c,_0x2ab1ba,_0x15bf60);}}function G(_0x344462,_0x52914f){const _0x1d33cd=new Set();for(const _0xc44ea0 of _0x344462['values']())(_0x52914f||!0x1===_0xc44ea0['requiresContent'])&&_0x1d33cd['add'](_0xc44ea0['id']);return Array['from'](_0x1d33cd);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
24
+ _0x447e28(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x5abfcf,_0x21fa95,_0xa5f507){super(),this['editor']=_0x5abfcf,this['textAdapter']=_0x21fa95,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xa5f507,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1b8699,_0x34c9d1,_0x15fcd0)=>{this['view']['value']=this['_sanitizeHTML'](_0x15fcd0);}),this['listenTo'](this['view'],'submitPrompt',(_0xf322bb,_0x2670e9)=>{const _0x47895f=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x2670e9,_0x47895f,'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:_0x25df62,query:_0x253bcd,htmlContent:_0x269939,label:_0x26371a,mainActionLabel:_0x2ddcdc}){this['view']['prompt']=_0x26371a,this['view']['mainAction']=_0x2ddcdc,this['initialContext']=_0x269939,_0x253bcd&&(this['view']['isRendered']?this['_handleQuery'](_0x253bcd,_0x269939,_0x25df62,_0x26371a):this['view']['once']('render',()=>{this['_handleQuery'](_0x253bcd,_0x269939,_0x25df62,_0x26371a);}));}['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'](_0x42dc2b,_0x23d41d,_0x4ec141,_0x51aa92){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x23d41d,this['previousQuery']=_0x42dc2b,this['previousLabel']=_0x51aa92||_0x42dc2b,this['previousActionId']=_0x4ec141,new Promise(_0x39aec1=>{this['textAdapter']['makeRequest']({'query':_0x42dc2b,'context':_0x23d41d,'onData':_0x13bb59=>{this['currentResponse']=_0x13bb59,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x4ec141})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x430830=>{_0x430830 instanceof R?this['view']['handleError'](_0x430830['message']):this['view']['handleError'](),_0x39aec1();})['finally'](()=>{this['stopProcessing'](),_0x39aec1();});});}['_parseAndNormalizeContent'](_0x25842a,_0xa53cb7=!0x1){const _0x13515f=Z['exec'](_0x25842a);_0x25842a=_0x13515f?_0x25842a['substring'](_0x13515f[0x1]['length']):_0x25842a['length']<0x64&&!_0xa53cb7?'':this['_stripMarkdownSyntax'](_0x25842a);const _0x146558=this['_domParser']['parseFromString'](_0x25842a,'text/html');if(_0x13515f){const _0xfa1ca6=Array['from'](_0x146558['body']['childNodes']);_0xfa1ca6['reverse']();for(const _0x504591 of _0xfa1ca6){if(_0x504591['nodeType']==Node['ELEMENT_NODE'])break;_0x504591['remove']();}}const _0x29ac53=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x146558['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x29ac53);const _0x1c97dd=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x1a5e9d=this['editor']['data']['toModel'](_0x29ac53);return _0x1c97dd||_0x1a5e9d['markers']['clear'](),this['editor']['data']['stringify'](_0x1a5e9d);}['_normalizeResponseHeadings'](_0x4c7cb8){const _0x15f2e9=new _0x251c1b(this['editor']['editing']['view']['document']),_0x331a64=new _0xce2739({'name':/^h[1-5]$/}),_0x3c20b7=[];let _0x525432=!0x1;for(const _0x47daa0 of _0x4c7cb8)_0x47daa0['is']('element')&&_0x331a64['match'](_0x47daa0)&&(_0x3c20b7['push'](_0x47daa0),'h1'==_0x47daa0['name']&&(_0x525432=!0x0));if(_0x525432){for(const _0x1869f1 of _0x3c20b7)_0x15f2e9['rename']('h'+(parseInt(_0x1869f1['name'][0x1])+0x1),_0x1869f1);}}['_isH1TagSupportEnabled'](){const {data:_0x318ad4,editing:_0x258681}=this['editor'],_0xbea855=_0x318ad4['htmlProcessor']['toView']('<h1></h1>'),_0xc295d0=_0x318ad4['toView'](_0x318ad4['toModel'](_0xbea855));return!!_0x258681['view']['domConverter']['viewToDom'](_0xc295d0)['querySelector']('h1');}['_sanitizeHTML'](_0x3a189c){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3a189c),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x4718d7){const _0x5f3fe9=_0x4718d7['trim']();return _0x5f3fe9['startsWith']('```html')?_0x5f3fe9['endsWith']('```')?_0x5f3fe9['substring'](0x7,_0x5f3fe9['length']-0x3):_0x5f3fe9['substring'](0x7):_0x4718d7;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x236519){super(_0x236519),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x444114=>i(_0x236519,'AI_'+_0x444114['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x236519,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x236519,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x236519,'Stop'));const _0x820f52=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x820f52['if']('isVisible','ck-hidden',_0x2659f5=>!_0x2659f5)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x12dfc0,_0x3dc115){const _0x14f46e=new _0x490fba(this['locale']);return _0x14f46e['set']({'label':_0x12dfc0,'class':_0x3dc115||'','isVisible':!0x0,'withText':!0x0}),_0x14f46e;}}class Y extends _0x2981c6{['contentFieldView'];['copyButtonView'];constructor(_0x3152f1,_0x16f3da=''){super(_0x3152f1),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x10e168=this['bindTemplate'];this['contentFieldView']=new At(_0x3152f1,_0x16f3da),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x10e168['if']('isVisible','ck-hidden',_0x5b8dcc=>!_0x5b8dcc)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x10e168['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 _0x5dbcc7=!0x1;this['on']('change:value',(_0x45c8b6,_0x278140,_0x3f3e33)=>{const _0x5ad55c=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3f3e33),this['isProcessing']&&_0x5ad55c&&!_0x5dbcc7&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3dd7bd,_0x255287,_0x1bd93f)=>{_0x5dbcc7=!0x1,_0x1bd93f?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x5dbcc7=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x5dbcc7=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x6d7131=this['locale'],_0x4d4b22=new _0x490fba(this['locale']),_0xf6c75='ck-ai-form__copy-button';return _0x4d4b22['set']({'label':i(_0x6d7131,'Copy'),'icon':_0x3736ca,'class':_0xf6c75,'tooltip':!0x0}),_0x4d4b22['bind']('isVisible')['to'](this,'value',_0x2969b4=>!!_0x2969b4),_0x4d4b22['bind']('isEnabled')['to'](this,'isProcessing',_0x377b21=>!_0x377b21),_0x4d4b22['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4d4b22['icon']=_0x361fde,_0x4d4b22['class']=_0xf6c75+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4d4b22['icon']=_0x3736ca,_0x4d4b22['class']=_0xf6c75;},0x3e8);}),_0x4d4b22;}['_copyHTMLToClipboard'](_0x2d4fce){const {window:_0x5930bc,document:_0x566065}=_0x301865;if(_0x5930bc['ClipboardItem']){const {Blob:_0x53ab32,ClipboardItem:_0x3a992f}=_0x5930bc,_0x15fa47=[new _0x3a992f({'text/html':new _0x53ab32([_0x2d4fce['innerHTML']],{'type':'text/html'}),'text/plain':new _0x53ab32([_0x2d4fce['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x15fa47);}else{const _0x139e36=_0x566065['createElement']('div');_0x139e36['style']['position']='absolute',_0x139e36['style']['left']='-9999px',_0x139e36['innerHTML']='<span>[</span>'+_0x2d4fce['innerHTML']+'<span>]</span>',_0x566065['body']['appendChild'](_0x139e36);const _0x512f93=_0x566065['createRange']();_0x512f93['setStartAfter'](_0x139e36['firstElementChild']),_0x512f93['setEndBefore'](_0x139e36['lastElementChild']);const _0x4e1a5e=_0x5930bc['getSelection']();_0x4e1a5e['removeAllRanges'](),_0x4e1a5e['addRange'](_0x512f93),_0x566065['execCommand']('copy'),_0x139e36['remove']();}}}class At extends _0x2981c6{constructor(_0x17951c,_0x4df1db=''){super(_0x17951c),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x4df1db,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x571411){this['element']['innerHTML']=_0x571411;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4e650c=new _0x2981c6(),_0x4762e8=this['locale'],_0x599a6c=new _0x1dd543();return _0x599a6c['isVisible']=!0x0,_0x4e650c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x599a6c,{'text':i(_0x4762e8,'AI\x20is\x20writing...')}]}),_0x4e650c['render'](),_0x4e650c;}}class st extends _0x2981c6{constructor(_0x1b0f8a,_0x2560b6=''){super(_0x1b0f8a);const _0x2785a4=new rt(),_0x10ffb9=this['bindTemplate'];this['set']('text',_0x2560b6),_0x2785a4['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2785a4,{'text':_0x10ffb9['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x442458,_0x173c4f){super(_0x442458,_0x173c4f),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',(_0x5d3ae3,_0x4e395a)=>{_0x5d3ae3['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4e395a());});}['_createSubmitButton'](){const _0x4fa642=new _0x490fba(this['locale']),_0x22e15b=this['locale'];return _0x4fa642['set']({'icon':ht,'label':i(_0x22e15b,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x4fa642['on']('execute',()=>{this['submit']();}),_0x4fa642['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x1ec282,_0x4ae404)=>!_0x1ec282&&_0x4ae404),_0x4fa642;}['_createShowHistoryButton'](){const _0x582ddd=new _0x490fba(this['locale']),_0x4b24d6=this['resultsView'],_0x1352ad=this['locale'];_0x582ddd['set']({'label':i(_0x1352ad,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x582ddd['bind']('isOn')['to'](_0x4b24d6,'isVisible'),_0x582ddd['bind']('isEnabled')['to'](this,'isEnabled'),_0x582ddd['on']('execute',()=>{_0x4b24d6['isVisible']=!_0x4b24d6['isVisible'],_0x4b24d6['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x28965a=()=>{_0x301865['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x42457a=new it(this['queryView']['fieldView']['element']),_0x3c60ba=_0x42457a['width'],_0x27e3a9='rtl'===_0x1352ad['uiLanguageDirection']?'left':'right';_0x42457a['excludeScrollbarsAndBorders'](),_0x582ddd['element']['style'][_0x27e3a9]=_0x3c60ba-_0x42457a['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x28965a),this['on']('render',_0x28965a),_0x582ddd;}['submit'](){const _0x27959b=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x27959b);}['focus'](_0x594118){-0x1===_0x594118?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x35ac9c){super(_0x35ac9c),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x35ac9c,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x37b192=0x0;for(const _0x3aa7bd of this['items'])_0x37b192+=_0x3aa7bd['items']['length'];return{'resultsCount':_0x37b192,'totalItemsCount':_0x37b192};}['_createClearHistoryButton'](){const _0xe3d420=this['locale'],_0x1059e3=new _0x490fba(this['locale']);return _0x1059e3['set']({'label':'('+i(_0xe3d420,'Clear')+')','withText':!0x0}),_0x1059e3['on']('execute',()=>this['fire']('clearHistory')),_0x1059e3;}}class bt extends xt{constructor(_0x507db7){super();const _0x2c29c2=new kt(),_0x2231d1=new _0x490fba(this['locale'],_0x2c29c2);this['children']['add'](_0x2231d1),_0x2231d1['set']({'label':_0x507db7['prompt'],'withText':!0x0}),_0x2231d1['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x507db7['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x2aeb58{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x2a1429,_0x1bb753)=>{const _0x48b023=os(_0x1bb753['prompt']);for(const _0x118ea0 of this)if(_0x118ea0!=_0x1bb753&&os(_0x118ea0['prompt'])===_0x48b023){this['remove'](_0x118ea0);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x503f33=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x503f33));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x56c19f=>_0x56c19f)));}}function os(_0x11938a){return _0x11938a['toLowerCase']()['trim']();}class _ extends _0x2981c6{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0xe05db7,_0x3191de,_0x729375=''){super(_0xe05db7),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new wt(),this['errorView']=new st(_0xe05db7),this['contentArea']=new Y(_0xe05db7,_0x729375),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x402e61=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x3191de],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x402e61['if']('isError','ck-hidden',_0x3154f4=>!_0x3154f4)]},'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'](_0x5da540=0x1){-0x1===_0x5da540?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 _0xdd4140=this['locale'],_0x1bba46=new ct(_0xdd4140,{'queryView':{'label':i(_0xdd4140,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0xdd4140,'Empty\x20history'),'secondary':i(_0xdd4140,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x1bba46['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x141407,_0x2f8448)=>_0x141407&&!_0x2f8448),this['listenTo'](_0x1bba46,'submit',(_0x297dae,_0x110084)=>{this['prompt']=_0x110084;const _0x1fabf4=yt(_0x110084);this['fire']('submitPrompt',_0x1fabf4),_0x110084['trim']()&&this['_promptHistory']['add']({'prompt':_0x1fabf4},0x0);},{'priority':'high'}),_0x1bba46;}['_createHistoryView'](){const _0x31be30=new ft(this['locale']);return _0x31be30['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x31be30['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x31be30;}['_createToolbar'](){const _0x3ce865=new lt(this['locale']);return _0x3ce865['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x448d01,_0x247d00,_0x37140f)=>_0x448d01&&!_0x247d00&&!!_0x37140f),_0x3ce865['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x3ce865['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x286491,_0x1cc747,_0x3f3503)=>_0x286491&&!_0x1cc747&&!!_0x3f3503),_0x3ce865['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x3ce865['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3cffe3,_0x107234)=>_0x3cffe3&&!_0x107234),_0x3ce865['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x3ce865['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x3ce865['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x3ce865;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x4545e5=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x4545e5,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2213bb){const _0x525ce1=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2213bb||i(_0x525ce1,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x1e8a11{['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[_0x14dfda,a,E,_0x20dd0b];}constructor(_0x1a4df6){super(_0x1a4df6),_0x1a4df6['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1a4df6['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x1a4df6['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1a4df6['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x306389}=this;this['_aiAdapter']=_0x306389['plugins']['get'](E),this['_dialog']=_0x306389['plugins']['get'](_0x20dd0b),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x4c590c=new j(_0x306389,Array['from'](this['_commandDefinitions']['values']()));_0x306389['commands']['add']('showAIAssistant',_0x4c590c),_0x306389['ui']['componentFactory']['add']('aiCommands',_0x5b7b92=>{const _0x143b93=_0x56cff(_0x5b7b92);return _0x143b93['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x143b93['buttonView']['set']({'label':i(_0x5b7b92,'AI\x20Commands'),'icon':_0x3e651d,'tooltip':!0x0}),_0x143b93['on']('execute',_0x314d6c=>this['_onExecute'](_0x314d6c['source']['id'])),_0x2b8a0b(_0x143b93,_0x306389['ui']['view']['body'],function(_0x3cab71){const _0x7dbbf0=o(_0x3cab71['config']['get']('ai.aiAssistant.commands'),_0x3cab71['locale']),_0x3d33ed=U(_0x3cab71,_0x7dbbf0)['filter'](_0x4186ef=>_0x4186ef['commands']['length']);if(0x1===_0x3d33ed['length'])return U(_0x3cab71,_0x3d33ed[0x0]['commands'])['map'](_0x5c471c=>({'id':_0x5c471c['id'],'label':_0x5c471c['label']}));return _0x3d33ed['map'](_0x377ed5=>{const {groupId:_0x2fe1ee,groupLabel:_0x581bc1,commands:_0x11308b}=_0x377ed5,_0x8ac86e=U(_0x3cab71,_0x11308b)['map'](_0x29cdb4=>({'id':_0x29cdb4['id'],'label':_0x29cdb4['label']}));return{'id':_0x2fe1ee,'menu':_0x581bc1||_0x2fe1ee,'children':_0x8ac86e};});}(_0x306389),{'ariaLabel':i(_0x5b7b92,'AI\x20Commands')}),_0x143b93['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x4c590c['on']('change:enabledCommandsIds',_0xea9a69),_0x143b93['menuView']['once']('render',_0xea9a69),_0x143b93;function _0xea9a69(){_0x143b93['isEnabled']=_0x4c590c['enabledCommandsIds']['length']>0x0;for(const _0x1acfc0 of _0x143b93['menuView']['buttons'])_0x1acfc0['isEnabled']=_0x4c590c['enabledCommandsIds']['includes'](_0x1acfc0['id']);}}),_0x306389['ui']['componentFactory']['add']('menuBar:aiCommands',_0x1722da=>{const _0x1ba094=new _0x26dcd7(_0x1722da);_0x1ba094['buttonView']['set']({'label':i(_0x1722da,'AI\x20Commands'),'icon':_0x3e651d}),_0x1ba094['bind']('isEnabled')['to'](_0x4c590c,'enabledCommandsIds',_0x4865d1=>_0x4865d1['length']>0x0);const _0x30a177=o(_0x306389['config']['get']('ai.aiAssistant.commands'),_0x1722da);return this['_populateMenuBarMenu'](_0x4c590c,_0x1ba094,_0x30a177,_0x245a31=>this['_onExecute'](_0x245a31)),_0x1ba094;}),_0x306389['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1784d3=this['_createAIAssistantUIButton'](_0x490fba);return _0x1784d3['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1784d3;}),_0x306389['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0xb0f33=this['_createAIAssistantUIButton'](_0x841fe8);return _0xb0f33['set']({'role':'menuitemcheckbox'}),_0xb0f33;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x37bfe2=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x10e7f6;for(const _0x5e287a in _0x37bfe2){const _0x3e6538=_0x5e287a,_0x370356=_0x37bfe2[_0x3e6538];if('aiLicenseKeyValid'==_0x370356||'aiLicenseKeyInvalid'==_0x370356||'aiLicenseKeyExpired'==_0x370356||'aiLicenseKeyDomainLimit'==_0x370356||'aiLicenseKeyNotAllowed'==_0x370356||'aiLicenseKeyEvaluationLimit'==_0x370356||'aiLicenseKeyTrialLimit'==_0x370356||'aiLicenseKeyUsageLimit'==_0x370356){delete _0x37bfe2[_0x3e6538],_0x10e7f6=_0x370356,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x10e7f6&&_0x37bfe2['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x10e7f6&&_0x37bfe2['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x10e7f6&&_0x37bfe2['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x10e7f6&&_0x37bfe2['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x10e7f6&&_0x37bfe2['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x10e7f6&&_0x37bfe2['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x10e7f6&&_0x37bfe2['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3299d3='',_0x418520='',_0x360b1e='custom'){const _0x1a524a=this['editor'],_0x526e19=_0x1a524a['editing']['view'],_0x2e59b8=_0x1a524a['plugins']['get'](a),_0x2a514c=_0x1a524a['plugins']['get'](_0x14dfda);_0x2e59b8['showFakeVisualSelection']();const _0xd0bcc1=new w(),_0x3d2f28=new ClipboardEvent('copy',{'clipboardData':_0xd0bcc1}),_0x3a2ede=new _0x361b43(_0xd0bcc1),_0x33753a=new _0x460c8f(_0x526e19,_0x3d2f28,{'dataTransfer':_0x3a2ede});_0x2a514c['_forceMarkersCopy']('comment',()=>{_0x526e19['document']['fire']('copy',_0x33753a);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x1a524a,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x5d249b=_0x3a2ede['getData']('text/html');const _0x40776a=_0x1a524a['model']['document']['selection'],_0x5e513f=Array['from'](_0x40776a['getRanges']());0x1===_0x5e513f['length']&&_0x5e513f[0x0]['isFlat']&&!_0x40776a['getSelectedElement']()&&''!==_0x5d249b['replace'](/&nbsp;/g,'')['trim']()&&(_0x5d249b='<p>'+_0x5d249b+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x360b1e,'query':_0x3299d3,'htmlContent':_0x5d249b,'label':_0x418520,'mainActionLabel':M[_0x1a524a['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x1fd953,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x64ed72['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x2e59b8['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x3d4808=new Map(),_0x252737=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0xbb8056 of _0x252737)for(const _0x3d81cf of _0xbb8056['commands'])_0x3d4808['set'](_0x3d81cf['id'],{..._0x3d81cf,'groupId':_0xbb8056['groupId'],'groupLabel':_0xbb8056['groupLabel']||_0xbb8056['groupId']});return _0x3d4808;}['_createAIAssistantUIButton'](_0x492512){const _0x5b24bd=this['editor'],_0x5531e2=_0x5b24bd['commands']['get']('showAIAssistant'),_0x4dd537=new _0x492512(_0x5b24bd['locale']);return _0x4dd537['set']({'label':i(_0x5b24bd['locale'],'AI\x20Assistant'),'icon':_0x1fd953,'isToggleable':!0x0}),_0x4dd537['bind']('isEnabled')['to'](_0x5531e2),_0x4dd537['bind']('isOn')['to'](this['_dialog'],'id',_0x120694=>'aiAssistant'===_0x120694),this['listenTo'](_0x4dd537,'execute',()=>{_0x4dd537['isOn']?this['hideUI']():_0x5531e2['execute']();}),_0x4dd537;}['_initView'](){const _0x22fb74=this['editor']['plugins']['get'](a);this['_formView']=new _(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x22fb74['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x22fb74['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x3b205d,ui:{ariaLiveAnnouncer:_0x72dd28}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1a3def,_0x1a2cd8,_0x9ccab8)=>{const _0x81701b=this['_aiAssistantController']['currentContext'];_0x9ccab8?_0x72dd28['announce'](i(_0x3b205d,'AI\x20is\x20writing')):_0x81701b&&_0x72dd28['announce'](i(_0x3b205d,'Generated\x20content:\x20%0',_0x81701b),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x9400bd,_0x180f7a,_0x16d2f8)=>{if(_0x16d2f8){const _0x530300=this['_formView']['errorView']['text'];_0x72dd28['announce'](i(_0x3b205d,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x530300));}});}['_onExecute'](_0x2e55ac){const _0x1727c9=this['_commandDefinitions']['get'](_0x2e55ac),_0x2f49b2=this['editor'],_0x13f353=_0x2f49b2['model']['document']['selection'],_0x5baa88=_0x2f49b2['commands']['get']('showAIAssistant'),_0xb82712=_0x2f49b2['plugins']['get'](a),_0xc74944=''+(_0x1727c9['groupId']!==x?_0x1727c9['groupLabel']+':\x20':'')+_0x1727c9['label'];if(!0x1!==_0x1727c9['requiresContent']&&_0x13f353['isCollapsed']){const _0x4a3aaa=_0x4c7b68(_0x13f353['getSelectedBlocks']())||_0x2f49b2['model']['schema']['getLimitElement'](_0x13f353);_0x2f49b2['model']['change'](_0x57b9a6=>{_0x57b9a6['setSelection'](_0x4a3aaa,'in');});}_0xb82712['showFakeVisualSelection'](),_0x5baa88['execute'](_0x1727c9['prompt'],_0xc74944,'command:'+_0x2e55ac);}['_populateMenuBarMenu'](_0x53101f,_0x1d8275,_0x405f30,_0x2ea096){const _0x317409=this['editor'],_0x283323=_0x317409['locale'],_0x41c0e6=new _0x27cfab(_0x283323),_0x4beb01=U(_0x317409,_0x405f30)['filter'](_0x435709=>_0x435709['commands']['length']);0x1===_0x4beb01['length']?this['_getMenuBarGroupButtons']({'command':_0x53101f,'commands':_0x4beb01[0x0]['commands'],'parentMenuView':_0x1d8275,'onExecute':_0x2ea096})['forEach'](_0x3693bb=>_0x41c0e6['items']['add'](_0x3693bb)):_0x4beb01['forEach'](({groupId:_0x317777,groupLabel:_0x532111,commands:_0x4bdc84})=>{const _0x3d039a=new _0x202b41(_0x283323,_0x1d8275),_0x285497=new _0x26dcd7(_0x283323),_0x52db42=new _0x27cfab(_0x283323),_0x2bc92e=this['_getMenuBarGroupButtons']({'command':_0x53101f,'commands':_0x4bdc84,'parentMenuView':_0x285497,'onExecute':_0x2ea096});_0x285497['buttonView']['set']({'label':_0x532111||_0x317777}),_0x285497['delegate']('execute')['to'](_0x1d8275),_0x52db42['items']['addMany'](_0x2bc92e),_0x285497['panelView']['children']['add'](_0x52db42),_0x3d039a['children']['add'](_0x285497),_0x41c0e6['items']['add'](_0x3d039a);}),_0x1d8275['panelView']['children']['add'](_0x41c0e6);}['_getMenuBarGroupButtons']({command:_0x39a4a7,commands:_0x2562df,parentMenuView:_0x1a0969,onExecute:_0x27672f}){const _0x8714b4=this['editor'],_0x13ab5a=_0x8714b4['locale'];return U(_0x8714b4,_0x2562df)['map'](_0x2788ed=>{const _0x45db1d=new _0x202b41(_0x13ab5a,_0x1a0969),_0x4bd6f1=new _0x841fe8(_0x13ab5a);return _0x4bd6f1['set']({'label':_0x2788ed['label']}),_0x4bd6f1['delegate']('execute')['to'](_0x1a0969),_0x4bd6f1['on']('execute',()=>_0x27672f(_0x2788ed['id'])),_0x4bd6f1['bind']('isEnabled')['to'](_0x39a4a7,'enabledCommandsIds',_0x134050=>_0x134050['includes'](_0x2788ed['id'])),_0x45db1d['children']['add'](_0x4bd6f1),_0x45db1d;});}}function B(_0x5a29fa,_0x3d0a33){return void 0x0!==_0x5a29fa['order']&&void 0x0===_0x3d0a33['order']?0x1:void 0x0===_0x5a29fa['order']&&void 0x0!==_0x3d0a33['order']?-0x1:void 0x0!==_0x5a29fa['order']&&void 0x0!==_0x3d0a33['order']?_0x5a29fa['order']-_0x3d0a33['order']:0x0;}function U(_0x16c934,_0x506f79){_0x506f79['sort'](B);const _0x56aae4={},_0xd03570=[];for(const _0x5af433 of _0x506f79)if(void 0x0!==_0x5af433['order']){if(_0x5af433['order']in _0x56aae4)throw new _0x149dfa('ai-commands-config-order-collision',_0x16c934,{'conflictingDefinitions':[_0x5af433,_0x56aae4[_0x5af433['order']]]});_0x56aae4[_0x5af433['order']]=_0x5af433,_0xd03570['splice'](_0x5af433['order'],0x0,_0x5af433);}else _0xd03570['push'](_0x5af433);return _0xd03570;}class r extends _0x1e8a11{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xdbdb03){super(_0xdbdb03);const _0x18a097=_0xdbdb03['config'],_0x10f219=_0xdbdb03['locale'];_0x18a097['define']('ai.aiAssistant.preserveComments',!0x0),_0x18a097['define']('ai.aiAssistant.commands',function(_0x2ef590){return[{'groupId':'editOrReview','groupLabel':i(_0x2ef590,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x2ef590,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x2ef590,'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(_0x2ef590,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x2ef590,'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(_0x2ef590,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x2ef590,'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(_0x2ef590,'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(_0x2ef590,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x2ef590,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x2ef590,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x2ef590,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x2ef590,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x2ef590,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x2ef590,'Change\x20style'),'commands':[{'id':'business','label':i(_0x2ef590,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x2ef590,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x2ef590,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x2ef590,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x2ef590,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x2ef590,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x2ef590,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x2ef590,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x2ef590,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x2ef590,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x2ef590,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x2ef590,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x2ef590,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x10f219)),_0x18a097['define']('ai.aiAssistant.extraCommandGroups',[]),_0x18a097['define']('ai.aiAssistant.removeCommands',[]);let _0x3822ab=o(_0x18a097['get']('ai.aiAssistant.commands'),_0x10f219);const _0xa67db1=_0x18a097['get']('ai.aiAssistant.extraCommandGroups'),_0x691d71=_0x18a097['get']('ai.aiAssistant.removeCommands');_0xa67db1['forEach'](_0x4a9837=>{const _0x5b11c1=_0x3822ab['find'](_0x4b582c=>_0x4b582c['groupId']===_0x4a9837['groupId']);_0x5b11c1?_0x5b11c1['commands']=_0x5b11c1['commands']['concat'](_0x4a9837['commands']):_0x3822ab['push'](_0x4a9837);}),_0x3822ab=_0x3822ab['filter'](_0x319382=>!_0x691d71['includes'](_0x319382['groupId'])),_0x3822ab['forEach'](_0x3ce5e7=>{_0x3ce5e7['commands']=_0x3ce5e7['commands']['filter'](_0x3d2e69=>!_0x691d71['includes'](_0x3d2e69['id']));}),_0x18a097['set']('ai.aiAssistant.commands',_0x3822ab);}}class P extends _0x1e8a11{['abortController'];static get['requires'](){return[E];}constructor(_0x54d109){super(_0x54d109),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x17436c){return this['sendRequest'](_0x17436c)['catch'](_0x17564f=>{if(_0x17564f instanceof R)return Promise['reject'](_0x17564f);if('AbortError'==_0x17564f['name'])return Promise['resolve']();throw console['error'](_0x17564f),new _0x149dfa('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x4e015f,_0x1a9e59){const _0x14b60d=this['editor']['locale'],_0x2fcdd1={'Content-Type':'application/json'};if('object'==typeof _0x4e015f)Object['assign'](_0x2fcdd1,_0x4e015f);else{if(_0x4e015f)try{const _0x41002d=await _0x4e015f(_0x1a9e59);Object['assign'](_0x2fcdd1,_0x41002d);}catch{return Promise['reject'](new R(i(_0x14b60d,'AI_ERROR_GET_HEADERS')));}}return _0x2fcdd1;}async['_prepareRequestParameters'](_0x229d5a,_0x1d503b){const _0x533ab8=this['editor']['locale'];if('object'==typeof _0x229d5a)return _0x229d5a;try{return await _0x229d5a(_0x1d503b);}catch{return Promise['reject'](new R(i(_0x533ab8,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4b7f05){super(_0x4b7f05),_0x4b7f05['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4b7f05['config']['get']('ai.openAI.requestParameters')||_0x4b7f05['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4b7f05['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x4b7f05['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x4b7f05['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x5cbc81,context:_0x5ea50c,onData:_0x2680d7,actionId:_0x4097d2}){const _0x3febbf=this['editor']['locale'],_0x2adbd1=await this['prepareMessages'](_0x5cbc81,_0x5ea50c,_0x4097d2),_0xc1f6e3=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4097d2),_0x106f49=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4097d2),_0xf58571={'messages':_0x2adbd1,..._0x106f49},_0x186499={'method':'POST','headers':_0xc1f6e3,'body':JSON['stringify'](_0xf58571),'signal':this['abortController']['signal']},_0x43deb6=await fetch(this['_apiUrl'],_0x186499);if(_0x43deb6['ok'])return _0x106f49['stream']?await this['_readStreamableResponse'](_0x43deb6,_0x2680d7):await this['_readStaticResponse'](_0x43deb6,_0x2680d7),Promise['resolve']();{const _0x50753c=await _0x43deb6['text']();return _0x50753c['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x3febbf,'AI_ERROR_CONTEXT_LENGTH'))):_0x50753c['includes']('Moderation')?Promise['reject'](new R(i(_0x3febbf,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x50753c));}}async['prepareMessages'](_0x1ee360,_0x13c2b6,_0x305233){let _0x53d7dc,_0x256abd;return _0x13c2b6?(_0x53d7dc='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.',_0x256abd='Instruction:\x0a'+_0x1ee360+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x13c2b6):(_0x53d7dc='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.',_0x256abd=_0x1ee360),[{'role':'system','content':_0x53d7dc},{'role':'user','content':_0x256abd}];}async['_readStreamableResponse'](_0x196b02,_0xeb93c9){const _0x38b5a6=_0x196b02['body']['getReader'](),_0x666163=new TextDecoder();let _0x1b308c='',_0x372924='',_0x2f6d35='',_0x33e03b=!0x1;for(;!_0x33e03b;){const {done:_0x12aa04,value:_0x273e61}=await _0x38b5a6['read'](),_0x952365=_0x1b308c+_0x666163['decode'](_0x273e61);let _0x1d1a7f='';_0x33e03b=_0x12aa04;try{_0x1d1a7f=this['_cleanUpData'](_0x952365),_0x1b308c='';}catch{_0x1b308c=_0x952365;continue;}_0x372924+=_0x1d1a7f,!_0x33e03b&&this['_isBufferIncomplete'](_0x372924)||_0x372924&&(_0x2f6d35+=_0x372924,_0x372924='',_0xeb93c9(_0x2f6d35));}return Promise['resolve']();}async['_readStaticResponse'](_0x1f1dc1,_0x272372){return _0x272372((await _0x1f1dc1['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x232c44){const _0xbf82d2=_0x232c44['split']('<')['length']!==_0x232c44['split']('>')['length'],_0x54dbe8=_0x232c44['length']<0x1e;return _0xbf82d2&&_0x54dbe8;}['_cleanUpData'](_0x38f156){return _0x38f156['split'](/\n(?![^{]*\})/g)['map'](_0xda940f=>_0xda940f['replace']('data:\x20',''))['filter'](_0x1510f0=>_0x1510f0&&_0x1510f0['length']>0x0&&'[DONE]'!==_0x1510f0)['map'](_0x335721=>{const {choices:_0x44d9e0}=JSON['parse'](_0x335721);if(_0x44d9e0[0x0]?.['delta']?.['content'])return _0x44d9e0[0x0]['delta']['content'];})['filter'](_0x3813c0=>_0x3813c0)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x5d0bfb){super(_0x5d0bfb),_0x5d0bfb['config']['get']('ai.aws.requestParameters')||_0x5d0bfb['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']=_0x5d0bfb['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x5d0bfb['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x5d0bfb['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x5d0bfb['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x5cd96f,context:_0x250b8f,onData:_0x29e893,actionId:_0x58f04b}){const {model:_0x497660,stream:_0x455e0f,..._0x4fd187}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x58f04b),_0x32c4df={'prompt':await this['preparePrompt'](_0x5cd96f,_0x250b8f,_0x497660,_0x58f04b),..._0x4fd187};this['_apiUrl']?await this['_processProxyRequest'](_0x32c4df,_0x497660,_0x455e0f,_0x29e893,_0x58f04b):await this['_processAWSRequest'](_0x32c4df,_0x497660,_0x455e0f,_0x29e893);}async['preparePrompt'](_0x553760,_0x49cfce,_0x24fd47,_0xb71793){let _0x4d3db7,_0x26b0af;return _0x49cfce?(_0x4d3db7='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.',_0x26b0af='Instruction:\x0a'+_0x553760+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x49cfce):(_0x4d3db7='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.',_0x26b0af=_0x553760),'meta.llama'==this['getModelFamily'](_0x24fd47)?'<<SYS>>\x0a'+_0x4d3db7+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x26b0af+'\x0a[/INST]':'Human:\x0a'+_0x4d3db7+'\x0a'+_0x26b0af+'\x0a\x0aAssistant:';}['getModelFamily'](_0x100a41){if(/^anthropic\.claude/['test'](_0x100a41))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x100a41))return'ai21.j2';if(/^cohere\.command/['test'](_0x100a41))return'cohere.command';if(/^meta\.llama/['test'](_0x100a41))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x100a41));}async['_processProxyRequest'](_0x1c77c3,_0x3af2a4,_0x5c96cd,_0x39bb5c,_0x4101c5){const _0x1bae64={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4101c5),'body':JSON['stringify']({..._0x1c77c3,'model':_0x3af2a4,'stream':_0x5c96cd}),'signal':this['abortController']['signal']},_0x316c56=await fetch(this['_apiUrl'],_0x1bae64);_0x5c96cd?await this['_readStreamableResponse'](_0x316c56,_0x3af2a4,_0x39bb5c):await this['_readStaticResponse'](_0x316c56,_0x3af2a4,_0x39bb5c);}async['_processAWSRequest'](_0x8e9600,_0x18d071,_0x3b4f97,_0x38e06a){const _0x46e28d=new _0x57a40a(this['_bedrockClientConfig']),_0x49d478={'body':JSON['stringify'](_0x8e9600),'contentType':'application/json','accept':'application/json','modelId':_0x18d071};let _0x3cf8c9;if(_0x3b4f97){const _0x37fe56=new _0x14d061(_0x49d478);_0x3cf8c9=await _0x46e28d['send'](_0x37fe56,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x3cf8c9,_0x18d071,_0x38e06a);}else{const _0x433d0f=new _0x2824dd(_0x49d478);_0x3cf8c9=await _0x46e28d['send'](_0x433d0f,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x3cf8c9,_0x18d071,_0x38e06a);}}async['_readAsyncIterableResponse'](_0x48a324,_0xca4359,_0x138efa){const _0x2a0886=_0x48a324['body'],_0x411af5=new TextDecoder('utf-8');let _0x29afef='';for await(const _0x17d434 of _0x2a0886)if(_0x17d434['chunk']){const _0x5604b4=_0x411af5['decode'](_0x17d434['chunk']['bytes']),_0xbf0175=JSON['parse'](_0x5604b4);_0x29afef+=this['_getGeneratedText'](_0xbf0175,_0xca4359),_0x138efa(_0x29afef);}return Promise['resolve']();}async['_readStreamableResponse'](_0x506072,_0x4c0acf,_0x459984){const _0x280845=_0x506072['body'],_0x22de11=new TextDecoder('utf-8'),_0x60496d=_0x280845['getReader']();let _0x1a846b='',_0x5d6b3c='',_0x52603f=!0x1;for(;!_0x52603f;){const {done:_0x427219,value:_0x1341e4}=await _0x60496d['read']();if(_0x52603f=_0x427219,_0x52603f)break;const _0x5380ea=(_0x1a846b+_0x22de11['decode'](_0x1341e4))['split']('\x0a')['map'](_0x3613fe=>{try{return _0x1a846b='',JSON['parse'](_0x3613fe);}catch{return _0x1a846b=_0x3613fe,null;}})['filter'](_0x3ca423=>null!==_0x3ca423);_0x5380ea['length']&&(_0x5d6b3c+=_0x5380ea['map'](_0x3aaa94=>this['_getGeneratedText'](_0x3aaa94,_0x4c0acf))['join'](''),_0x459984(_0x5d6b3c));}return Promise['resolve']();}async['_readStaticResponse'](_0x30c70e,_0x3c8624,_0x36723c){let _0x3b66c6;return _0x3b66c6=_0x30c70e instanceof Response?await _0x30c70e['json']():JSON['parse'](Buffer['from'](_0x30c70e['body'])['toString']('utf8')),(_0x36723c(this['_getGeneratedText'](_0x3b66c6,_0x3c8624)),Promise['resolve']());}['_getGeneratedText'](_0x2658f9,_0x41df50){switch(this['getModelFamily'](_0x41df50)){case'anthropic.claude':return _0x2658f9['completion'];case'ai21.j2':return _0x2658f9['completions'][0x0]['data']['text'];case'cohere.command':return _0x2658f9['generations'][0x0]['text'];case'meta.llama':return _0x2658f9['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O as OpenAITextAdapter};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x478642=>0x1!=_0x478642}};
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':_0x278300=>0x1!=_0x278300}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x14bac1=>{const {af:{dictionary:_0x57c6d7,getPluralForm:_0x2f3260}}={'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':_0x3214df=>0x1!=_0x3214df}};_0x14bac1['af']||={'dictionary':{},'getPluralForm':null},_0x14bac1['af']['dictionary']=Object['assign'](_0x14bac1['af']['dictionary'],_0x57c6d7),_0x14bac1['af']['getPluralForm']=_0x2f3260;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x55e452=>{const {af:{dictionary:_0xf87a19,getPluralForm:_0x28766e}}={'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':_0x427e98=>0x1!=_0x427e98}};_0x55e452['af']||={'dictionary':{},'getPluralForm':null},_0x55e452['af']['dictionary']=Object['assign'](_0x55e452['af']['dictionary'],_0xf87a19),_0x55e452['af']['getPluralForm']=_0x28766e;})(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':_0x264f14=>0x0==_0x264f14?0x0:0x1==_0x264f14?0x1:0x2==_0x264f14?0x2:_0x264f14%0x64>=0x3&&_0x264f14%0x64<=0xa?0x3:_0x264f14%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':_0xd65f4a=>0x0==_0xd65f4a?0x0:0x1==_0xd65f4a?0x1:0x2==_0xd65f4a?0x2:_0xd65f4a%0x64>=0x3&&_0xd65f4a%0x64<=0xa?0x3:_0xd65f4a%0x64>=0xb?0x4:0x5}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x270381=>{const {ar:{dictionary:_0x22c84e,getPluralForm:_0x52521e}}={'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':_0x33f52f=>0x0==_0x33f52f?0x0:0x1==_0x33f52f?0x1:0x2==_0x33f52f?0x2:_0x33f52f%0x64>=0x3&&_0x33f52f%0x64<=0xa?0x3:_0x33f52f%0x64>=0xb?0x4:0x5}};_0x270381['ar']||={'dictionary':{},'getPluralForm':null},_0x270381['ar']['dictionary']=Object['assign'](_0x270381['ar']['dictionary'],_0x22c84e),_0x270381['ar']['getPluralForm']=_0x52521e;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x3055e7=>{const {ar:{dictionary:_0xfc022,getPluralForm:_0x21210a}}={'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':_0x3a9c6f=>0x0==_0x3a9c6f?0x0:0x1==_0x3a9c6f?0x1:0x2==_0x3a9c6f?0x2:_0x3a9c6f%0x64>=0x3&&_0x3a9c6f%0x64<=0xa?0x3:_0x3a9c6f%0x64>=0xb?0x4:0x5}};_0x3055e7['ar']||={'dictionary':{},'getPluralForm':null},_0x3055e7['ar']['dictionary']=Object['assign'](_0x3055e7['ar']['dictionary'],_0xfc022),_0x3055e7['ar']['getPluralForm']=_0x21210a;})(window['CKEDITOR_TRANSLATIONS']||={});