@ckeditor/ckeditor5-ai 47.2.0-alpha.0 → 47.2.0-alpha.1

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 (289) hide show
  1. package/build/ai.js +1 -1
  2. package/dist/index.js +5 -5
  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 +15 -15
  150. package/src/aiactions/aiactions.js +1 -1
  151. package/src/aiactions/model/aiactionsinteraction.js +1 -1
  152. package/src/aiactions/model/aiactionsreply.js +1 -1
  153. package/src/aiassistant/adapters/aiadapter.js +1 -1
  154. package/src/aiassistant/adapters/aitextadapter.js +1 -1
  155. package/src/aiassistant/adapters/awstextadapter.js +1 -1
  156. package/src/aiassistant/adapters/openaitextadapter.js +1 -1
  157. package/src/aiassistant/aiassistant.js +1 -1
  158. package/src/aiassistant/aiassistantediting.js +1 -1
  159. package/src/aiassistant/aiassistantui.js +1 -1
  160. package/src/aiassistant/legacyerrors.js +1 -1
  161. package/src/aiassistant/ui/aiassistantcontroller.js +2 -2
  162. package/src/aiassistant/ui/form/aiformcontentarea.js +1 -1
  163. package/src/aiassistant/ui/form/aiformerrorview.js +1 -1
  164. package/src/aiassistant/ui/form/aiformpromptview.js +1 -1
  165. package/src/aiassistant/ui/form/aiformtoolbarview.js +1 -1
  166. package/src/aiassistant/ui/form/aiformview.js +1 -1
  167. package/src/aiassistant/ui/form/aihistorylistitemview.js +1 -1
  168. package/src/aiassistant/ui/form/aihistorylistview.js +1 -1
  169. package/src/aiassistant/ui/form/prompthistory.js +1 -1
  170. package/src/aiassistant/ui/showaiassistantcommand.js +1 -1
  171. package/src/aiassistant/utils/common-translations.js +1 -1
  172. package/src/aiassistant/utils/normalizecommandsconfig.js +1 -1
  173. package/src/aiballoon/aiballoon.js +1 -1
  174. package/src/aiballoon/ui/aiballoondisclaimerview.js +1 -1
  175. package/src/aiballoon/ui/aiballoontoolbarview.js +1 -1
  176. package/src/aiballoon/ui/aiballoonview.js +1 -1
  177. package/src/aichat/aichat.js +1 -1
  178. package/src/aichat/aichatcontroller.js +1 -1
  179. package/src/aichat/aichatui.js +1 -1
  180. package/src/aichat/model/aichatcontext.js +1 -1
  181. package/src/aichat/model/aichatconversation.js +1 -1
  182. package/src/aichat/model/aichatinteraction.js +1 -1
  183. package/src/aichat/model/aichatmodels.js +1 -1
  184. package/src/aichat/ui/aichatcontrolsview.js +1 -1
  185. package/src/aichat/ui/aichatfeedview.js +1 -1
  186. package/src/aichat/ui/aichatheaderview.js +1 -1
  187. package/src/aichat/ui/aichatview.js +1 -1
  188. package/src/aichat/ui/controls/aichatchipsoverflowmanager.js +1 -1
  189. package/src/aichat/ui/controls/aichatcontextitembuttonview.js +1 -1
  190. package/src/aichat/ui/controls/aichatcontextpanelurlinputview.js +1 -1
  191. package/src/aichat/ui/controls/aichatcontextpanelview.js +1 -1
  192. package/src/aichat/ui/controls/aichatcontrolsloaderview.js +1 -1
  193. package/src/aichat/ui/controls/aichatpromptcapabilitiesview.js +1 -1
  194. package/src/aichat/ui/controls/aichatpromptinputview.js +1 -1
  195. package/src/aichat/ui/controls/aichatpromptsuggestionslistview.js +1 -1
  196. package/src/aichat/ui/controls/resources/aichatcontextresourceslistview.js +1 -1
  197. package/src/aichat/ui/controls/resources/aichatcontextresourcesview.js +1 -1
  198. package/src/aichat/ui/controls/resources/aichatresourcelistitemview.js +1 -1
  199. package/src/aichat/ui/controls/resources/aichatresourcesballoonview.js +1 -1
  200. package/src/aichat/ui/controls/resources/aichatresourcessearchinputview.js +1 -1
  201. package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
  202. package/src/aichat/ui/feed/aichatfeederroritemview.js +1 -1
  203. package/src/aichat/ui/feed/aichatfeedinteractionheaderview.js +1 -1
  204. package/src/aichat/ui/feed/aichatfeeditemview.js +1 -1
  205. package/src/aichat/ui/feed/aichatfeedreplyitemview.js +1 -1
  206. package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.js +1 -1
  207. package/src/aichat/ui/feed/aichatfeedsuggestionitemview.js +1 -1
  208. package/src/aichat/ui/feed/aichatfeedusermessageitem.js +1 -1
  209. package/src/aichat/utils/eventnames.js +1 -1
  210. package/src/aichat/utils/promisequeue.js +1 -1
  211. package/src/aichat/utils/scrollmanager.js +1 -1
  212. package/src/aichathistory/aichathistory.js +1 -1
  213. package/src/aichathistory/aichathistorycontroller.js +1 -1
  214. package/src/aichathistory/aichathistoryui.js +1 -1
  215. package/src/aichathistory/model/aichathistoryconversations.js +1 -1
  216. package/src/aichathistory/model/aichathistoryitem.js +1 -1
  217. package/src/aichathistory/ui/aichathistorylistitemview.js +2 -2
  218. package/src/aichathistory/ui/aichathistorylistview.js +1 -1
  219. package/src/aichathistory/ui/aichathistorysectionlistview.js +1 -1
  220. package/src/aichathistory/ui/aichathistoryview.js +1 -1
  221. package/src/aicore/aiconnector.js +1 -1
  222. package/src/aicore/aiediting.js +1 -1
  223. package/src/aicore/model/aicapabilities.js +1 -1
  224. package/src/aicore/model/aicontext.js +1 -1
  225. package/src/aicore/model/aiinteraction.js +1 -1
  226. package/src/aicore/model/aimodels.js +1 -1
  227. package/src/aicore/model/aireply.js +1 -1
  228. package/src/aicore/pipeline/airesponseapplier.js +2 -2
  229. package/src/aicore/pipeline/airesponseparser.js +2 -2
  230. package/src/aicore/ui/aidisclaimerview.js +1 -1
  231. package/src/aicore/ui/aiskeleton.js +1 -1
  232. package/src/aicore/ui/aispinner.js +1 -1
  233. package/src/aicore/ui/suggestioncontainer/aiminitoolbarview.js +1 -1
  234. package/src/aicore/ui/suggestioncontainer/aisuggestionbodyview.js +1 -1
  235. package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.js +1 -1
  236. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.js +1 -1
  237. package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
  238. package/src/aicore/utils/common-translations.js +1 -1
  239. package/src/aicore/utils/createresizebutton.js +1 -1
  240. package/src/aicore/utils/documentposition.js +1 -1
  241. package/src/aicore/utils/documentrange.js +1 -1
  242. package/src/aicore/utils/eventnames.js +1 -1
  243. package/src/aicore/utils/geteditorfromcontext.js +1 -1
  244. package/src/aicore/utils/getoperationsfromreply.js +1 -1
  245. package/src/aicore/utils/getsuggestionpartsfromreply.js +1 -1
  246. package/src/aicore/utils/htmlparser.js +1 -1
  247. package/src/aicore/utils/htmlstreamer.js +1 -1
  248. package/src/aieditorintegration/aieditorintegration.js +1 -1
  249. package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.js +1 -1
  250. package/src/aieditorintegration/aitogglebutton/toggleaicommand.js +1 -1
  251. package/src/aiquickactions/aiquickactions.js +1 -1
  252. package/src/aiquickactions/aiquickactionscommand.js +1 -1
  253. package/src/aiquickactions/aiquickactionsediting.js +1 -1
  254. package/src/aiquickactions/aiquickactionsui.js +1 -1
  255. package/src/aiquickactions/ui/aiquickactionsbuttoncreator.js +1 -1
  256. package/src/aiquickactions/ui/aiquickactionsdropdowncontentview.js +1 -1
  257. package/src/aiquickactions/ui/aiquickactionsdropdowncreator.js +1 -1
  258. package/src/aireviewmode/aireviewcheckdefinitions.js +1 -1
  259. package/src/aireviewmode/aireviewmode.js +1 -1
  260. package/src/aireviewmode/aireviewmodecontroller.js +1 -1
  261. package/src/aireviewmode/aireviewmodeediting.js +1 -1
  262. package/src/aireviewmode/aireviewmodeui.js +1 -1
  263. package/src/aireviewmode/model/aireviewcheck.js +1 -1
  264. package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
  265. package/src/aireviewmode/model/aireviewchecklist.js +1 -1
  266. package/src/aireviewmode/model/aireviewcheckresult.js +1 -1
  267. package/src/aireviewmode/model/aireviewcheckresultchange.js +1 -1
  268. package/src/aireviewmode/model/aireviewcheckrun.js +1 -1
  269. package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
  270. package/src/aireviewmode/model/aireviewsystemcheckrun.js +1 -1
  271. package/src/aireviewmode/ui/aireviemodepromptinputview.js +1 -1
  272. package/src/aireviewmode/ui/aireviewmodeballoonsuggestionview.js +1 -1
  273. package/src/aireviewmode/ui/aireviewmodechecklistitemresultview.js +1 -1
  274. package/src/aireviewmode/ui/aireviewmodecustomcheckview.js +1 -1
  275. package/src/aireviewmode/ui/aireviewmodefinishreviewbuttonview.js +1 -1
  276. package/src/aireviewmode/ui/aireviewmodereviewchecklistview.js +1 -1
  277. package/src/aireviewmode/ui/aireviewmodereviewcheckresultsview.js +1 -1
  278. package/src/aireviewmode/ui/aireviewmodereviewcommandlistitemview.js +1 -1
  279. package/src/aireviewmode/ui/aireviewmodereviewcompletedview.js +1 -1
  280. package/src/aireviewmode/ui/aireviewmodeview.js +1 -1
  281. package/src/aireviewmode/ui/form/aireviewmodeformdropdown.js +1 -1
  282. package/src/aireviewmode/ui/form/aireviewmodeformmanager.js +1 -1
  283. package/src/aitabs/aitabs.js +1 -1
  284. package/src/aitabs/aitabsmainview.js +1 -1
  285. package/src/aitabs/tabs/aitabsview.js +1 -1
  286. package/src/aitabs/tabs/tabbuttonview.js +1 -1
  287. package/src/aitabs/tabs/tabpanelview.js +1 -1
  288. package/src/errors.js +1 -1
  289. package/src/index.js +1 -1
package/dist/index.js CHANGED
@@ -20,8 +20,8 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x473589,Command as Qt,ContextPlugin as ot,Editor as pt}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0xbe74c0,IconCheck as _0xde42e2,IconError as _0x5ab23d,IconSubmit as _0x50c2db,IconAIHistory as Nt,IconMagicWand as _0x38df54,IconRobotPencil as _0x477b29,IconMaximize as _0x546b68,IconMinimize as to,IconDocumentWithLoupe as _0x44f5fb,IconAddComment as _0x59808a,IconShowChangesOn as _0x38adf9,IconShowChangesOff as _0x7debf1,IconDocument as _0x559ebe,IconThreeStars as _0x5200bc,IconRemove as _0x2d117b,IconDocumentWithCheckmark as _0x1ae4a5,IconDocumentWithCross as _0x47ae46,IconLoupe as _0xb4883c,IconCancel as _0x5e4164,IconStop as _0x5591c2,IconAIChat as Ht,IconPlus as _0x1b9cf9,IconPin as _0x382323,IconThreeHorizontalDots as _0x157c65,IconChevronRight as _0x3865d7,IconInfo as _0x5092b4,IconOutdated as _0x426255,IconEye as _0x51a136,IconEyeCrossedOut as _0x5df65b,IconAIReview as _0x2a7e08}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x4237d5,CKEditorError as _0x2520c7,ObservableMixin as ts,global as rt,isVisible as _0x3c2798,Rect as lt,Collection as _0x3a64b1,FocusTracker as _0x57a285,KeystrokeHandler as _0xa0e91d,first as _0x8b356e,toArray as _0x14a540,EmitterMixin as _0x42ebaf,logWarning as _0x2db034,scrollViewportToShowTarget as ct,logError as ft,ResizeObserver as _0x124fc4,_isMotionReduced as Pt,scrollAncestorsToShowTarget as _0x1205da,DomEmitterMixin as _0x230d1d}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x231138,ButtonView as _0x32eaf5,View as _0xe56eb6,SpinnerView as _0xad8088,IconView as _0x2c655b,AutocompleteView as _0x36a3f6,ListView as _0x3cd02e,ListItemGroupView as _0x42607b,ListItemView as _0x256274,ButtonLabelView as _0x102c6c,FocusCycler as _0x90a56c,createLabeledTextarea as _0x2972cd,Dialog as _0x452334,createDropdown as _0x4f8f4d,addMenuToDropdown as _0x2b750d,MenuBarMenuView as _0x2ef427,MenuBarMenuListItemButtonView as _0x267e6c,DialogViewPosition as _0xb64c2b,MenuBarMenuListView as _0x19edac,MenuBarMenuListItemView as _0x3471e3,UIModel as _0xa62dc5,SplitButtonView as _0x323de6,BalloonPanelView as _0xbb1014,BodyCollection as _0x1c0188,clickOutsideHandler as _0x3cc083,ListItemButtonView as _0x1afbe6,ViewCollection as _0x2a5a90,addListToDropdown as _0x5be927,submitHandler as _0xde76b,LabeledFieldView as _0x555191,createLabeledInputText as th,FormHeaderView as _0x565fd0,HighlightedTextView as _0x5a4cd5,FileDialogButtonView as _0x3e98e0,InputTextView as _0x1fd503,SearchTextView as _0x8f42ae,DropdownMenuButtonView as _0x39b6e6,DropdownMenuPanelPositioningFunctions as _0x1c984b,BalloonToolbar as _0x58cc86,FormRowView as _0x3da535,TextareaView as _0x238eb9}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0xfe5f12,ClipboardMarkersUtils as _0x284b61}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x10ba9f,ViewDataTransfer as _0x31e84d,ViewUpcastWriter as _0x30b3f5,Matcher as _0x30e66d,_DetachOperation as tt,_insertIntoModelNodeList as _0x5f381e,_removeFromModelNodeList as _0x555785,ModelRange as _0x10f501,ViewDowncastWriter as kt,transformOperationSets as it,ModelDocumentFragment as _0x403049,ModelPosition as _0x399771,ModelTreeWalker as _0x44401a,InsertOperation as _0x37b91e,MarkerOperation as _0x4bf0e3}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x21b930,escape as _0x2b58c0,escapeRegExp as _0x224fd3}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x2f2883,InvokeModelWithResponseStreamCommand as _0x33163f,InvokeModelCommand as _0x5e9ef4}from'@aws-sdk/client-bedrock-runtime';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x133e39}from'htmlparser2';import{isTag as _0xf0837b,findOne as wt,getParent as _0x1116a3,findAll as _0x2c33af,removeElement as _0x40dbe2,replaceElement as _0x53ed79,prepend as _0x20a345,prependChild as _0x2c1cf5,appendChild as _0xec0d69,append as _0x5c93f3,find as _0x24523c,isComment as _0x44d98b,getChildren as _0x244914,textContent as _0x4a27c9}from'domutils';import _0x2e70cb from'dom-serializer';import{Document as Rt,Element as _0x245d41,Text as _0x106f4b,cloneNode as _0x134b10,isDocument as _0x48e3f7,isText as _0x25daad,NodeWithChildren as _0x5d77f3}from'domhandler';import{MarkdownGfmMdToHtml as _0x3fb7e0}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x34d451,getAllMarkersDomElementsSorted as at,DocumentCompare as _0x568068,DATA_ID_MODEL_ATTRIBUTE as Tt,ConfirmMixin as _0x4308cc,LateFocusDropdownButtonView as _0x50daf7,DATA_ID_VIEW_ATTRIBUTE as _0x22c998}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x38ac24}from'es-toolkit';import{IconThumbUp as _0x153791,IconThumbDown as _0x19395a,IconCopy as _0x5375d8,IconCheck as _0x5d441a,IconShowChangesOff as _0x2677d0,IconShowChangesOn as _0x35a902,IconWeb as _0x1de698,IconNextArrow as _0x33f48f,IconPreviousArrow as _0x1a5b12,IconAI as Ot,IconClose as _0x3bb86e,IconSelection as _0x3fc565,IconFileUpload as _0x1b7f7f,IconLink as _0xf06db1,IconDocument as _0x32a474,IconBulb as _0x41561c,IconDocumentOutline as _0x5d99e2,IconPaperClip as _0x5d25cb,IconBrowseFiles as _0x491498,IconDropdownArrow as _0x3f1131,IconAIAskAI as _0x1479aa,IconAIQuickActions as _0x58ae49,IconAIChatCommands as Wt,IconAIImproveWriting as Vt,IconAIContinueWriting as Bt,IconAIGrammarCheck as Jt,IconAIAdjustLength as Kt,IconAIChangeTone as Gt,IconAITranslate as Zt,IconAIOther as Xt,IconRefresh as _0x3e5f8e}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x4392b3 from'morphdom';import{SuggestionsConversion as zt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0x34d077}from'diff';const K='_ungrouppedCommands';function o(_0x13994f,_0x5f559a){const _0x4e30c3=(0x0,_0x5f559a['t'])('Other');return _0x13994f['length']?'groupId'in _0x13994f[0x0]?_0x13994f:[{'groupId':K,'groupLabel':_0x4e30c3,'order':0x1/0x0,'commands':_0x13994f}]:[{'groupId':K,'groupLabel':_0x4e30c3,'order':0x1/0x0,'commands':[]}];}const Fn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x473589{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x3eda19}=this,_0x69c623=['ck-fake-ai-selection'];_0x3eda19['config']['get']('ai.assistant.useTheme')&&_0x69c623['push']('ck-ai-assistant-ui_theme'),_0x3eda19['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x69c623,'priority':0xc}}),_0x3eda19['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x50c053,{writer:_0x30cc52})=>{if(!_0x50c053['markerRange']['isCollapsed'])return null;const _0x511e12=_0x30cc52['createUIElement']('span');return _0x30cc52['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x511e12),_0x511e12;}});}['afterInit'](){!async function(_0x4e7687){const _0x569bc5=_0x562a70([0x6e,0x41,0x37,0x79,0x75,0x72,0x67,0x4f,0x48,0x62,0x5a,0x76,0x44,0x70,0x6c,0x52,0x6b,0x4a,0x73,0x63,0x64,0x49,0x43,0x6d,0x38,0x36,0x6f,0x50,0x57,0x78,0x39,0x32,0x66,0x31,0x71,0x46,0x30,0x4c,0x61,0x53,0x58,0x33,0x4e,0x47,0x77,0x54,0x4d,0x4b,0x34,0x6a,0x56,0x74,0x59,0x55,0x42,0x51,0x69,0x35,0x7a,0x68,0x65,0x45]),_0x17cba7=0x3dffc4e1,_0x137363=0x3df8b371^_0x17cba7,_0x272bbb=window[_0x562a70([0x44,0x61,0x74,0x65])][_0x562a70([0x6e,0x6f,0x77])](),_0x244989=_0x4e7687[_0x562a70([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x514016=new window[(_0x562a70([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3f9942=>{_0x244989[_0x562a70([0x6f,0x6e,0x63,0x65])](_0x562a70([0x72,0x65,0x61,0x64,0x79]),_0x3f9942);}),_0x591618={[_0x562a70([0x6b,0x74,0x79])]:_0x562a70([0x45,0x43]),[_0x562a70([0x75,0x73,0x65])]:_0x562a70([0x73,0x69,0x67]),[_0x562a70([0x63,0x72,0x76])]:_0x562a70([0x50,0x2d,0x32,0x35,0x36]),[_0x562a70([0x78])]:_0x562a70([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]),[_0x562a70([0x79])]:_0x562a70([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]),[_0x562a70([0x61,0x6c,0x67])]:_0x562a70([0x45,0x53,0x32,0x35,0x36])},_0x3ac370=_0x244989[_0x562a70([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x562a70([0x67,0x65,0x74])](_0x562a70([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x46cb16(){let _0x54c826,_0x24977a=null,_0x49e5bf=null;try{if(_0x3ac370==_0x562a70([0x47,0x50,0x4c]))return _0x562a70([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x54c826=_0x3ce971(),!_0x54c826)return _0x562a70([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x54c826[_0x562a70([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x49e5bf=_0x25d8d5(_0x54c826[_0x562a70([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x54c826[_0x562a70([0x6a,0x74,0x69])])),await _0x5b477c()?_0x2982d0()?_0x2ae035()?_0x562a70([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x33fdd2()?(_0x54c826[_0x562a70([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x562a70([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x24977a=_0x3922cc(_0x562a70([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x54c826[_0x562a70([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x562a70([0x74,0x72,0x69,0x61,0x6c])&&(_0x24977a=_0x3922cc(_0x562a70([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x473a3c()):_0x562a70([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x562a70([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x562a70([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x562a70([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2ae035(){const _0xe2bf0d=[_0x562a70([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x562a70([0x74,0x72,0x69,0x61,0x6c])][_0x562a70([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x54c826[_0x562a70([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x272bbb/0x3e8:0xe10*_0x137363;return _0x54c826[_0x562a70([0x65,0x78,0x70])]<_0xe2bf0d;}function _0x2982d0(){const _0x564ff4=_0x54c826[_0x562a70([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x564ff4&&(!!_0x564ff4[_0x562a70([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x562a70([0x2a]))||!!_0x564ff4[_0x562a70([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x562a70([0x41,0x49])));}function _0x33fdd2(){const _0x4106f2=_0x54c826[_0x562a70([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x4106f2||0x0==_0x4106f2[_0x562a70([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x52d302}=new URL(window[_0x562a70([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x4106f2[_0x562a70([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x52d302))return!0x0;const _0x417ec2=_0x52d302[_0x562a70([0x73,0x70,0x6c,0x69,0x74])](_0x562a70([0x2e]));return _0x4106f2[_0x562a70([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2f8508=>_0x2f8508[_0x562a70([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x562a70([0x2a])))[_0x562a70([0x6d,0x61,0x70])](_0x1e24f7=>_0x1e24f7[_0x562a70([0x73,0x70,0x6c,0x69,0x74])](_0x562a70([0x2e])))[_0x562a70([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x294927=>_0x294927[_0x562a70([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x417ec2[_0x562a70([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x562a70([0x6d,0x61,0x70])](_0x299fe8=>Array(_0x417ec2[_0x562a70([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x299fe8[_0x562a70([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x562a70([0x66,0x69,0x6c,0x6c])](_0x299fe8[0x0]===_0x562a70([0x2a])?_0x562a70([0x2a]):'')[_0x562a70([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x299fe8))[_0x562a70([0x73,0x6f,0x6d,0x65])](_0x522415=>_0x417ec2[_0x562a70([0x65,0x76,0x65,0x72,0x79])]((_0x115bcd,_0x82f18b)=>_0x522415[_0x82f18b]===_0x115bcd||_0x522415[_0x82f18b]===_0x562a70([0x2a])));}function _0x473a3c(){return _0x24977a&&_0x49e5bf?new window[(_0x562a70([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xf3fd52,_0x312f20)=>{_0x24977a[_0x562a70([0x74,0x68,0x65,0x6e])](_0xf3fd52,_0x312f20),_0x49e5bf[_0x562a70([0x74,0x68,0x65,0x6e])](_0x57afd1=>{_0x57afd1!=_0x562a70([0x56,0x61,0x6c,0x69,0x64])&&_0xf3fd52(_0x57afd1);},_0x312f20);}):_0x24977a||_0x49e5bf||_0x562a70([0x56,0x61,0x6c,0x69,0x64]);}}function _0x25d8d5(_0x4d388f,_0x2c8b22){return new window[(_0x562a70([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x445a76=>{if(_0x172460())return _0x445a76(_0x562a70([0x56,0x61,0x6c,0x69,0x64]));_0x34abb7(),_0x244989[_0x562a70([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x562a70([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x48de5f=!0x1;const _0x461555=_0x4237d5();function _0x1c8ddb(_0xf90000){return!!_0xf90000&&(typeof _0xf90000===_0x562a70([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0xf90000===_0x562a70([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0xf90000[_0x562a70([0x74,0x68,0x65,0x6e])]===_0x562a70([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0xf90000[_0x562a70([0x63,0x61,0x74,0x63,0x68])]===_0x562a70([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x4903a8(_0x15588f){_0x558380(_0x15588f)[_0x562a70([0x74,0x68,0x65,0x6e])](_0xcbf807=>{if(!_0xcbf807||_0xcbf807[_0x562a70([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x562a70([0x6f,0x6b]))return _0x562a70([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x4f87c7(_0x43ea76(_0x461555+_0x2c8b22))!=_0xcbf807[_0x562a70([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x562a70([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x562a70([0x56,0x61,0x6c,0x69,0x64]);})[_0x562a70([0x74,0x68,0x65,0x6e])](_0x532629=>(_0x4bc923(),_0x532629),()=>{const _0x5d3ddd=_0x5452b6();return null==_0x5d3ddd?(_0x4bc923(),_0x562a70([0x56,0x61,0x6c,0x69,0x64])):_0x562a70(_0x272bbb-_0x5d3ddd>(0x19f340e1^_0x17cba7)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x562a70([0x74,0x68,0x65,0x6e])](_0x445a76)[_0x562a70([0x63,0x61,0x74,0x63,0x68])](()=>{_0x445a76(_0x562a70([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x43f3f6=0x3dc92a61^_0x17cba7;function _0x4bc923(){const _0x5e9d86=_0x562a70([0x6c,0x6c,0x63,0x74,0x2d])+_0x4f87c7(_0x43ea76(_0x4d388f)),_0x143b34=_0x1662ad(_0x4f87c7(window[_0x562a70([0x4d,0x61,0x74,0x68])][_0x562a70([0x63,0x65,0x69,0x6c])](_0x272bbb/_0x43f3f6)));window[_0x562a70([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x562a70([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5e9d86,_0x143b34);}function _0x5452b6(){const _0x2431f7=_0x562a70([0x6c,0x6c,0x63,0x74,0x2d])+_0x4f87c7(_0x43ea76(_0x4d388f)),_0x2ddb19=window[_0x562a70([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x562a70([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2431f7);return _0x2ddb19?window[_0x562a70([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1662ad(_0x2ddb19),0x10)*_0x43f3f6:null;}function _0x558380(_0x968a0c){return new window[(_0x562a70([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5b295c,_0x41b0ea)=>{_0x968a0c[_0x562a70([0x74,0x68,0x65,0x6e])](_0x5b295c,_0x41b0ea),window[_0x562a70([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x41b0ea,0x3dfe1021^_0x17cba7);});}}_0x244989[_0x562a70([0x6f,0x6e])](_0x562a70([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x26934d,_0x40d1e2)=>{if(_0x40d1e2[0x0]!=_0x4d388f)return _0x445a76(_0x562a70([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x40d1e2[0x1]={..._0x40d1e2[0x1],[_0x562a70([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x461555};},{[_0x562a70([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x562a70([0x68,0x69,0x67,0x68])}),_0x244989[_0x562a70([0x6f,0x6e])](_0x562a70([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x337595=>{_0x1c8ddb(_0x337595[_0x562a70([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x48de5f=!0x0,_0x4903a8(_0x337595[_0x562a70([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x562a70([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x562a70([0x6c,0x6f,0x77])}),_0x514016[_0x562a70([0x74,0x68,0x65,0x6e])](()=>{_0x48de5f||_0x445a76(_0x562a70([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x172460(){return _0x244989[_0x562a70([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x562a70([0x76,0x69,0x65,0x77])][_0x562a70([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x562a70([0x61,0x75,0x74,0x6f]);}function _0x34abb7(){_0x244989[_0x562a70([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x562a70([0x76,0x69,0x65,0x77])][_0x562a70([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x562a70([0x61,0x75,0x74,0x6f]);}}function _0x3922cc(_0xc45c4){const _0x2cf956=[new window[(_0x562a70([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x583645=>setTimeout(_0x583645,0x3df6fa2d^_0x17cba7)),_0x514016[_0x562a70([0x74,0x68,0x65,0x6e])](()=>new window[(_0x562a70([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1d800d=>{let _0xe55775=0x0;_0x244989[_0x562a70([0x6d,0x6f,0x64,0x65,0x6c])][_0x562a70([0x6f,0x6e])](_0x562a70([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x449e2a,_0x2bc0df)=>{_0x2bc0df[0x0][_0x562a70([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0xe55775++,_0xe55775==(0x3dffc519^_0x17cba7)&&(_0x1d800d(),_0x449e2a[_0x562a70([0x6f,0x66,0x66])]());});}))];return window[_0x562a70([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x562a70([0x72,0x61,0x63,0x65])](_0x2cf956)[_0x562a70([0x74,0x68,0x65,0x6e])](()=>_0xc45c4);}async function _0x2886c7(){await _0x514016,_0x244989[_0x562a70([0x6d,0x6f,0x64,0x65,0x6c])][_0x562a70([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x5be70f,_0x244989[_0x562a70([0x6d,0x6f,0x64,0x65,0x6c])][_0x562a70([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x5be70f,_0x244989[_0x562a70([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x562a70([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3e2ed1(_0x270804){const _0x851254=_0x23ac97();_0x244989[_0x851254]=_0x562a70([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x270804,_0x270804!=_0x562a70([0x56,0x61,0x6c,0x69,0x64])&&_0x2886c7();}function _0x23ac97(){const _0x49f898=window[_0x562a70([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x562a70([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x562a70([0x6e,0x6f,0x77])]())[_0x562a70([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x562a70([0x2e]),'');let _0xfc4c15=_0x562a70([0x6e]);for(let _0x209269=0x0;_0x209269<_0x49f898[_0x562a70([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x209269+=0x2){let _0x4725f1=window[_0x562a70([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x49f898[_0x562a70([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x209269,_0x209269+0x2));_0x4725f1>=_0x569bc5[_0x562a70([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x4725f1-=_0x569bc5[_0x562a70([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0xfc4c15+=_0x569bc5[_0x4725f1];}return _0xfc4c15;}function _0x3ce971(){const _0x4f02c4=_0x3ac370[_0x562a70([0x73,0x70,0x6c,0x69,0x74])](_0x562a70([0x2e]));if(0x3!=_0x4f02c4[_0x562a70([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4f40a6(_0x4f02c4[0x1]);function _0x4f40a6(_0x144df1){const _0x46753e=_0x893be4(_0x144df1);return _0x46753e&&_0x38a993()?_0x46753e:null;function _0x38a993(){const _0x4fe4fa=_0x46753e[_0x562a70([0x6a,0x74,0x69])],_0x4c0e60=window[_0x562a70([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4fe4fa[_0x562a70([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4fe4fa[_0x562a70([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x49cc33={..._0x46753e,[_0x562a70([0x6a,0x74,0x69])]:_0x4fe4fa[_0x562a70([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4fe4fa[_0x562a70([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x49cc33[_0x562a70([0x76,0x63])],_0x43ea76(_0x49cc33)==_0x4c0e60;}}}async function _0x5b477c(){let _0x53777c=!0x0;try{const _0x5b8e49=_0x3ac370[_0x562a70([0x73,0x70,0x6c,0x69,0x74])](_0x562a70([0x2e])),[_0x2a828d,_0x48c123,_0x80aad9]=_0x5b8e49;return _0x4ac729(_0x2a828d),await _0x54dc6f(_0x2a828d,_0x48c123,_0x80aad9),_0x53777c;}catch{return!0x1;}function _0x4ac729(_0x57c34a){const _0x20c3a2=_0x893be4(_0x57c34a);_0x20c3a2&&_0x20c3a2[_0x562a70([0x61,0x6c,0x67])]==_0x562a70([0x45,0x53,0x32,0x35,0x36])||(_0x53777c=!0x1);}async function _0x54dc6f(_0x5d22d2,_0x5e3879,_0x8d5638){const _0x564071=window[_0x562a70([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x562a70([0x66,0x72,0x6f,0x6d])](_0x14765c(_0x8d5638),_0x3a7667=>_0x3a7667[_0x562a70([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x548285=new window[(_0x562a70([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x562a70([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5d22d2+_0x562a70([0x2e])+_0x5e3879),_0x46e950=window[_0x562a70([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x562a70([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x46e950)return;const _0xc4d93c=await _0x46e950[_0x562a70([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x562a70([0x6a,0x77,0x6b]),_0x591618,{[_0x562a70([0x6e,0x61,0x6d,0x65])]:_0x562a70([0x45,0x43,0x44,0x53,0x41]),[_0x562a70([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x562a70([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x562a70([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x46e950[_0x562a70([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x562a70([0x6e,0x61,0x6d,0x65])]:_0x562a70([0x45,0x43,0x44,0x53,0x41]),[_0x562a70([0x68,0x61,0x73,0x68])]:{[_0x562a70([0x6e,0x61,0x6d,0x65])]:_0x562a70([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0xc4d93c,_0x564071,_0x548285)||(_0x53777c=!0x1);}}function _0x893be4(_0x5c8ede){return _0x5c8ede[_0x562a70([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x562a70([0x65,0x79]))?JSON[_0x562a70([0x70,0x61,0x72,0x73,0x65])](_0x14765c(_0x5c8ede)):null;}function _0x14765c(_0x182749){return window[_0x562a70([0x61,0x74,0x6f,0x62])](_0x182749[_0x562a70([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x562a70([0x2b]))[_0x562a70([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x562a70([0x2f])));}function _0x43ea76(_0x595c9b){let _0x3ac767=0x1505;function _0x4e093b(_0x412532){for(let _0x5d2608=0x0;_0x5d2608<_0x412532[_0x562a70([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5d2608++){const _0x386611=_0x412532[_0x562a70([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x5d2608);_0x3ac767=(_0x3ac767<<0x5)+_0x3ac767+_0x386611,_0x3ac767&=_0x3ac767;}}function _0x48f1eb(_0x34bd94){Array[_0x562a70([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x34bd94)?_0x34bd94[_0x562a70([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x48f1eb):_0x34bd94&&typeof _0x34bd94==_0x562a70([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x562a70([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x34bd94)[_0x562a70([0x73,0x6f,0x72,0x74])]()[_0x562a70([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x23aef6,_0x9668d8])=>{_0x4e093b(_0x23aef6),_0x48f1eb(_0x9668d8);}):_0x4e093b(window[_0x562a70([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x34bd94));}return _0x48f1eb(_0x595c9b),_0x3ac767>>>0x0;}function _0x4f87c7(_0x4efba9){return _0x4efba9[_0x562a70([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x562a70([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x562a70([0x30]));}function _0x1662ad(_0x392514){return _0x392514[_0x562a70([0x73,0x70,0x6c,0x69,0x74])]('')[_0x562a70([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x562a70([0x6a,0x6f,0x69,0x6e])]('');}function _0x5be70f(){}function _0x562a70(_0x44e0c2){return _0x44e0c2['map'](_0x54a2ce=>String['fromCharCode'](_0x54a2ce))['join']('');}_0x3e2ed1(await _0x46cb16());}(this);}['showFakeVisualSelection'](){const _0xaa8349=this['editor']['model'];_0xaa8349['change'](_0x39fbf8=>{const _0x25255d=_0xaa8349['document']['selection']['getRanges']();let _0x5dfea6=0x0;for(const _0xa623e8 of _0x25255d){const _0x44ff0b=f+':'+_0x5dfea6;if(_0xaa8349['markers']['has'](_0x44ff0b))_0x39fbf8['updateMarker'](_0x44ff0b,{'range':_0xa623e8});else{if(_0xa623e8['start']['isAtEnd']){const _0x47117c=_0xa623e8['start']['getLastMatchingPosition'](({item:_0x4f429f})=>!_0xaa8349['schema']['isContent'](_0x4f429f),{'boundaries':_0xa623e8});_0x39fbf8['addMarker'](_0x44ff0b,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x39fbf8['createRange'](_0x47117c,_0xa623e8['end'])});}else _0x39fbf8['addMarker'](_0x44ff0b,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xa623e8});}_0x5dfea6++;}});}['hideFakeVisualSelection'](){const _0x342284=this['editor']['model'],_0x4ac96a=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x4ac96a['length']&&_0x342284['change'](_0x3e5ca0=>{_0x4ac96a['forEach'](_0x1f3f85=>{_0x3e5ca0['removeMarker'](_0x1f3f85);});});}['insertContent'](_0xdcbc99,_0x39d466){const _0xd10ed3=this['_getAISelection'](),_0x2f429a=_0x39d466||_0xd10ed3['getFirstRange']();this['editor']['model']['canEditAt'](_0x2f429a)&&this['editor']['model']['change'](_0x273b9e=>{this['hideFakeVisualSelection'](),_0x39d466||this['_resetContentOfSelectedTableCells'](_0x273b9e,_0xd10ed3),this['_pasteHTMLUsingClipboard']({'insertAt':_0x2f429a,'writer':_0x273b9e,'html':_0xdcbc99});});}['insertContentBelow'](_0x11cf68){const {model:_0x1dc1ed}=this['editor'],_0x498d09=this['_getAISelection']();_0x1dc1ed['change'](()=>{const _0x6a06f2=this['_prepareTableInsertBelowPosition'](_0x11cf68,_0x498d09)||this['_getDefaultInsertBelowPosition'](_0x498d09);this['insertContent'](_0x11cf68,_0x6a06f2);});}['_getAISelection'](){const _0x38cdf7=this['editor']['model'],_0x301706=Array['from'](_0x38cdf7['markers']['getMarkersGroup'](f))['map'](_0x1c6d10=>_0x1c6d10['getRange']());return _0x38cdf7['createSelection'](_0x301706);}['_pasteHTMLUsingClipboard']({writer:_0x1b5852,html:_0x31b06c,insertAt:_0xf9569d}){const {view:_0x21308f}=this['editor']['editing'],_0x372f55=this['editor']['plugins']['get'](_0xfe5f12),_0x507e2c=new Fn();_0x507e2c['setData']('text/html',_0x31b06c);const _0x4b3c67=new ClipboardEvent('paste',{'clipboardData':_0x507e2c}),_0x2114d5=new _0x10ba9f(_0x21308f,_0x4b3c67,{'dataTransfer':new _0x31e84d(_0x507e2c)});_0x1b5852['setSelection'](_0xf9569d);const _0x5672df=(_0xc055b8,_0x189e93)=>{_0x189e93['resultRange']&&_0x1b5852['setSelection'](_0x189e93['resultRange']);};_0x372f55['once']('contentInsertion',_0x5672df,{'priority':'lowest'}),_0x21308f['document']['fire']('paste',_0x2114d5),_0x372f55['off']('contentInsertion',_0x5672df);}['_getDefaultInsertBelowPosition'](_0x5ea41f){const {model:_0x4a1515}=this['editor'],_0x19d31a=Array['from'](_0x5ea41f['getSelectedBlocks']());return _0x19d31a['length']?_0x4a1515['createPositionAfter'](_0x19d31a['pop']()):_0x5ea41f['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x14e796,_0x49bcbd){const {model:_0x244000,plugins:_0x17a052}=this['editor'];if(_0x17a052['has']('TableUtils')){const _0x1a045d=_0x17a052['get']('TableUtils')['getSelectedTableCells'](_0x49bcbd);if(_0x1a045d['length']){const _0x4fdc3f=this['_getTableRowCountFromContent'](_0x14e796),_0x853dd6=this['_createEmptyTableRows'](_0x1a045d,_0x4fdc3f);return _0x244000['createPositionAt'](_0x853dd6,0x0);}}return null;}['_getTableRowCountFromContent'](_0x391e0e){const _0xb95c0f=this['editor']['plugins']['get']('TableUtils'),_0x59815e=this['editor']['data']['parse'](_0x391e0e),_0x442db7=Array['from'](_0x59815e['getChildren']())['filter'](_0x16ada3=>_0x16ada3['is']('element','table'));let _0x1ca37d=0x0;return _0x442db7['forEach'](_0x462869=>{_0x1ca37d+=_0xb95c0f['getRows'](_0x462869);}),_0x1ca37d;}['_createEmptyTableRows'](_0x4a8c38,_0x460c77){const _0x21bfc6=this['editor']['plugins']['get']('TableUtils'),_0x38aba1=_0x21bfc6['getRowIndexes'](_0x4a8c38),_0x523706=_0x21bfc6['getColumnIndexes'](_0x4a8c38),_0x151f3d=_0x38aba1['last']+0x1,_0x20cd37=_0x523706['first'],_0x592bbf=_0x4a8c38[0x0]['findAncestor']('table');for(let _0x4504c8=0x0;_0x4504c8<_0x460c77;_0x4504c8++)_0x21bfc6['insertRows'](_0x592bbf,{'at':_0x151f3d});return _0x592bbf['getChild'](_0x151f3d)['getChild'](_0x20cd37);}['_resetContentOfSelectedTableCells'](_0x41b4f1,_0x4a6754){const {plugins:_0x232acd}=this['editor'],{model:_0x12025f}=_0x41b4f1;if(!_0x232acd['has']('TableUtils'))return;_0x232acd['get']('TableUtils')['getSelectedTableCells'](_0x4a6754)['length']&&_0x12025f['deleteContent'](_0x4a6754);}}class x extends _0x473589{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x2520c7('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x38b5e1){super(_0x38b5e1),this['name']='AIRequestError';}}function Yn(_0xd2d39b,_0xed3d0b,_0x289b5b){const t=_0xd2d39b['t'];switch(_0xed3d0b){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',_0x289b5b);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x289b5b);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'},_0x289b5b);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 _0xed3d0b;}}class E extends Qt{['_commandDefinitions'];constructor(_0x24b058,_0x569492){super(_0x24b058),this['_commandDefinitions']=_0x569492,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x39003f,_0x304a2a,_0x28780d)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x28780d));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xc415c5,_0xd0cd93,_0x2a00bf)=>{this['enabledCommandsIds']=_0x2a00bf?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x4a8eaf=this['editor']['model'];this['_hasContext']=function(_0x5ed71e){const _0x6fe6de=_0x5ed71e['document']['selection'];return _0x6fe6de['isCollapsed']?0x0!==[..._0x6fe6de['getSelectedBlocks']()]['length']&&![..._0x6fe6de['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x5ed71e['hasContent'](_0x6fe6de['getFirstRange']());}(_0x4a8eaf);const _0x5119ee=_0x4a8eaf['document']['selection'],_0xebfb63=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x554621 of _0x5119ee['getRanges']())for(const _0x422f7c of _0x554621['getItems']())if(_0x422f7c['is']('element')&&_0xebfb63['includes'](_0x422f7c['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x21261e='',_0x44ff95='',_0x17a2ed='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x21261e,_0x44ff95,_0x17a2ed);}}function ns(_0xb9c4f5,_0x2bddcb){const _0x45e751=new Set();for(const _0x59a959 of _0xb9c4f5['values']())(_0x2bddcb||!0x1===_0x59a959['requiresContent'])&&_0x45e751['add'](_0x59a959['id']);return Array['from'](_0x45e751);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
- ts(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x4cfadc,_0x1ecde0,_0x55f62f){super(),this['editor']=_0x4cfadc,this['textAdapter']=_0x1ecde0,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x55f62f,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1cbac3,_0x55ab77,_0xd68e67)=>{this['view']['value']=this['_sanitizeHTML'](_0xd68e67);}),this['listenTo'](this['view'],'submitPrompt',(_0x55b22a,_0x40926a)=>{const _0x46660f=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x40926a,_0x46660f,'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:_0xae5fb6,query:_0x16c0e6,htmlContent:_0x5deb7f,label:_0x594051,mainActionLabel:_0x34f885}){this['view']['prompt']=_0x594051,this['view']['mainAction']=_0x34f885,this['initialContext']=_0x5deb7f,_0x16c0e6&&(this['view']['isRendered']?this['_handleQuery'](_0x16c0e6,_0x5deb7f,_0xae5fb6,_0x594051):this['view']['once']('render',()=>{this['_handleQuery'](_0x16c0e6,_0x5deb7f,_0xae5fb6,_0x594051);}));}['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'](_0x530c75,_0x530057,_0x55f563,_0x1a5c1d){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x530057,this['previousQuery']=_0x530c75,this['previousLabel']=_0x1a5c1d||_0x530c75,this['previousActionId']=_0x55f563,new Promise(_0x5ae158=>{this['textAdapter']['makeRequest']({'query':_0x530c75,'context':_0x530057,'onData':_0x18ee6d=>{this['currentResponse']=_0x18ee6d,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x55f563})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0xe85fd9=>{_0xe85fd9 instanceof tr?this['view']['handleError'](_0xe85fd9['message']):this['view']['handleError'](),_0x5ae158();})['finally'](()=>{this['stopProcessing'](),_0x5ae158();});});}['_parseAndNormalizeContent'](_0x7d813c,_0x22f67d=!0x1){const _0x4ef80e=hs['exec'](_0x7d813c);_0x7d813c=_0x4ef80e?_0x7d813c['substring'](_0x4ef80e[0x1]['length']):_0x7d813c['length']<0x64&&!_0x22f67d?'':this['_stripMarkdownSyntax'](_0x7d813c);const _0x4802f8=this['_domParser']['parseFromString'](_0x7d813c,'text/html');if(_0x4ef80e){const _0x39bac8=Array['from'](_0x4802f8['body']['childNodes']);_0x39bac8['reverse']();for(const _0x2eb1a2 of _0x39bac8){if(_0x2eb1a2['nodeType']==Node['ELEMENT_NODE'])break;_0x2eb1a2['remove']();}}const _0x3891d5=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x4802f8['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x3891d5);const _0x12df13=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x53ebcc=this['editor']['data']['toModel'](_0x3891d5);return _0x12df13||_0x53ebcc['markers']['clear'](),this['editor']['data']['stringify'](_0x53ebcc);}['_normalizeResponseHeadings'](_0x20aa86){const _0x2baf64=new _0x30b3f5(this['editor']['editing']['view']['document']),_0x292024=new _0x30e66d({'name':/^h[1-5]$/}),_0x5d83b3=[];let _0x471cec=!0x1;for(const _0x4c6b9d of _0x20aa86)_0x4c6b9d['is']('element')&&_0x292024['match'](_0x4c6b9d)&&(_0x5d83b3['push'](_0x4c6b9d),'h1'==_0x4c6b9d['name']&&(_0x471cec=!0x0));if(_0x471cec){for(const _0x3f9d1f of _0x5d83b3)_0x2baf64['rename']('h'+(parseInt(_0x3f9d1f['name'][0x1])+0x1),_0x3f9d1f);}}['_isH1TagSupportEnabled'](){const {data:_0x11f199,editing:_0x4d7678}=this['editor'],_0x2533dc=_0x11f199['htmlProcessor']['toView']('<h1></h1>'),_0x310225=_0x11f199['toView'](_0x11f199['toModel'](_0x2533dc));return!!_0x4d7678['view']['domConverter']['viewToDom'](_0x310225)['querySelector']('h1');}['_sanitizeHTML'](_0x4f453e){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4f453e),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x2f7c25){const _0x354b64=_0x2f7c25['trim']();return _0x354b64['startsWith']('```html')?_0x354b64['endsWith']('```')?_0x354b64['substring'](0x7,_0x354b64['length']-0x3):_0x354b64['substring'](0x7):_0x2f7c25;}}const _={'REPLACE':'replace','INSERT':'insert'};class wr extends _0x231138{constructor(_0x2cc0c3){super(_0x2cc0c3),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xc1cbce=>Yn(_0x2cc0c3,'AI_'+_0xc1cbce['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Yn(_0x2cc0c3,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Yn(_0x2cc0c3,'Try\x20again')),this['stopButton']=this['_createButton'](Yn(_0x2cc0c3,'Stop'));const _0x303db5=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x303db5['if']('isVisible','ck-hidden',_0x4303b7=>!_0x4303b7)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x424f30,_0x17449d){const _0xc0b8be=new _0x32eaf5(this['locale']);return _0xc0b8be['set']({'label':_0x424f30,'class':_0x17449d||'','isVisible':!0x0,'withText':!0x0}),_0xc0b8be;}}class yr extends _0xe56eb6{['contentFieldView'];['copyButtonView'];constructor(_0x3212e0,_0xa141ba=''){super(_0x3212e0),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x10843f=this['bindTemplate'];this['contentFieldView']=new $n(_0x3212e0,_0xa141ba),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x10843f['if']('isVisible','ck-hidden',_0x58e87b=>!_0x58e87b)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x10843f['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 _0x2fd43c=!0x1;this['on']('change:value',(_0x6551f9,_0x3c4a99,_0x50b7b7)=>{const _0x248f22=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x50b7b7),this['isProcessing']&&_0x248f22&&!_0x2fd43c&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1a954f,_0x344870,_0x2d37c4)=>{_0x2fd43c=!0x1,_0x2d37c4?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x2fd43c=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x2fd43c=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x68f3bd=this['locale'],_0x3ef548=new _0x32eaf5(this['locale']),_0x3032f5='ck-ai-form__copy-button';return _0x3ef548['set']({'label':Yn(_0x68f3bd,'Copy'),'icon':_0xbe74c0,'class':_0x3032f5,'tooltip':!0x0}),_0x3ef548['bind']('isVisible')['to'](this,'value',_0x5d167c=>!!_0x5d167c),_0x3ef548['bind']('isEnabled')['to'](this,'isProcessing',_0x3b8473=>!_0x3b8473),_0x3ef548['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x3ef548['icon']=_0xde42e2,_0x3ef548['class']=_0x3032f5+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x3ef548['icon']=_0xbe74c0,_0x3ef548['class']=_0x3032f5;},0x3e8);}),_0x3ef548;}['_copyHTMLToClipboard'](_0x541306){const {window:_0x3d5c98,document:_0x460aef}=rt;if(_0x3d5c98['ClipboardItem']){const {Blob:_0x6f28f8,ClipboardItem:_0x5db56f}=_0x3d5c98,_0x4e28f3=[new _0x5db56f({'text/html':new _0x6f28f8([_0x541306['innerHTML']],{'type':'text/html'}),'text/plain':new _0x6f28f8([_0x541306['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x4e28f3);}else{const _0x496c21=_0x460aef['createElement']('div');_0x496c21['style']['position']='absolute',_0x496c21['style']['left']='-9999px',_0x496c21['innerHTML']='<span>[</span>'+_0x541306['innerHTML']+'<span>]</span>',_0x460aef['body']['appendChild'](_0x496c21);const _0x10fa5c=_0x460aef['createRange']();_0x10fa5c['setStartAfter'](_0x496c21['firstElementChild']),_0x10fa5c['setEndBefore'](_0x496c21['lastElementChild']);const _0x47c676=_0x3d5c98['getSelection']();_0x47c676['removeAllRanges'](),_0x47c676['addRange'](_0x10fa5c),_0x460aef['execCommand']('copy'),_0x496c21['remove']();}}}class $n extends _0xe56eb6{constructor(_0x1c575d,_0x4adada=''){super(_0x1c575d),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x4adada,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x53f81d){this['element']['innerHTML']=_0x53f81d;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x237f00=new _0xe56eb6(),_0x4f5a30=this['locale'],_0x2c6a14=new _0xad8088();return _0x2c6a14['isVisible']=!0x0,_0x237f00['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x2c6a14,{'text':Yn(_0x4f5a30,'AI\x20is\x20writing...')}]}),_0x237f00['render'](),_0x237f00;}}class gr extends _0xe56eb6{constructor(_0x5446d7,_0xf19e45=''){super(_0x5446d7);const _0x569508=new _0x2c655b(),_0x39306e=this['bindTemplate'];this['set']('text',_0xf19e45),_0x569508['content']=_0x5ab23d,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x569508,{'text':_0x39306e['to']('text')}]});}}class Er extends _0x36a3f6{['submitButtonView'];['showHistoryButtonView'];constructor(_0x13f4e8,_0x158897){super(_0x13f4e8,_0x158897),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',(_0x5a3815,_0x2f1016)=>{_0x5a3815['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2f1016());});}['_createSubmitButton'](){const _0x3b0b1e=new _0x32eaf5(this['locale']),_0x2d6fef=this['locale'];return _0x3b0b1e['set']({'icon':_0x50c2db,'label':Yn(_0x2d6fef,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3b0b1e['on']('execute',()=>{this['submit']();}),_0x3b0b1e['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x227397,_0x35fad3)=>!_0x227397&&_0x35fad3),_0x3b0b1e;}['_createShowHistoryButton'](){const _0x1268a3=new _0x32eaf5(this['locale']),_0x4092d9=this['resultsView'],_0x281e36=this['locale'];_0x1268a3['set']({'label':Yn(_0x281e36,'History'),'withText':!0x1,'icon':Nt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x1268a3['bind']('isOn')['to'](_0x4092d9,'isVisible'),_0x1268a3['bind']('isEnabled')['to'](this,'isEnabled'),_0x1268a3['on']('execute',()=>{_0x4092d9['isVisible']=!_0x4092d9['isVisible'],_0x4092d9['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x23872f=()=>{rt['window']['requestAnimationFrame'](()=>{if(_0x3c2798(this['element'])){const _0x2672ac=new lt(this['queryView']['fieldView']['element']),_0x1553a0=_0x2672ac['width'],_0x451977='rtl'===_0x281e36['uiLanguageDirection']?'left':'right';_0x2672ac['excludeScrollbarsAndBorders'](),_0x1268a3['element']['style'][_0x451977]=_0x1553a0-_0x2672ac['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x23872f),this['on']('render',_0x23872f),_0x1268a3;}['submit'](){const _0x58ea33=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x58ea33);}['focus'](_0x527821){-0x1===_0x527821?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class vr extends _0x3cd02e{['historyGroupView'];['clearHistoryButton'];constructor(_0x17c3f){super(_0x17c3f),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x42607b(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Yn(_0x17c3f,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x375915=0x0;for(const _0x11d7f5 of this['items'])_0x375915+=_0x11d7f5['items']['length'];return{'resultsCount':_0x375915,'totalItemsCount':_0x375915};}['_createClearHistoryButton'](){const _0x4974b2=this['locale'],_0x51f74f=new _0x32eaf5(this['locale']);return _0x51f74f['set']({'label':'('+Yn(_0x4974b2,'Clear')+')','withText':!0x0}),_0x51f74f['on']('execute',()=>this['fire']('clearHistory')),_0x51f74f;}}class Ar extends _0x256274{constructor(_0x1d89eb){super();const _0x603454=new _0x102c6c(),_0x532a9b=new _0x32eaf5(this['locale'],_0x603454);this['children']['add'](_0x532a9b),_0x532a9b['set']({'label':_0x1d89eb['prompt'],'withText':!0x0}),_0x532a9b['on']('execute',()=>{this['fire']('execute',{'value':_0x21b930(_0x1d89eb['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Pr extends _0x3a64b1{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x483066,_0x471216)=>{const _0x249f02=fo(_0x471216['prompt']);for(const _0x4f86d7 of this)if(_0x4f86d7!=_0x471216&&fo(_0x4f86d7['prompt'])===_0x249f02){this['remove'](_0x4f86d7);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x5a0489=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x5a0489));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x212857=>_0x212857)));}}function fo(_0x5ebeea){return _0x5ebeea['toLowerCase']()['trim']();}class k extends _0xe56eb6{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1f7ab5,_0x2a9998,_0xc3cb1e=''){super(_0x1f7ab5),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new Pr(),this['errorView']=new gr(_0x1f7ab5),this['contentArea']=new yr(_0x1f7ab5,_0xc3cb1e),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 _0x57a285(),this['keystrokes']=new _0xa0e91d(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x90a56c({'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 _0x1b8a86=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x2a9998],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x1b8a86['if']('isError','ck-hidden',_0x2ede2b=>!_0x2ede2b)]},'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'](_0xfb1551=0x1){-0x1===_0xfb1551?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 _0x4f619e=this['locale'],_0x37510d=new Er(_0x4f619e,{'queryView':{'label':Yn(_0x4f619e,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x2972cd,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Yn(_0x4f619e,'Empty\x20history'),'secondary':Yn(_0x4f619e,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x37510d['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x30d2c1,_0x20a77a)=>_0x30d2c1&&!_0x20a77a),this['listenTo'](_0x37510d,'submit',(_0x5b82cc,_0xe9ec41)=>{this['prompt']=_0xe9ec41;const _0x5824e8=_0x2b58c0(_0xe9ec41);this['fire']('submitPrompt',_0x5824e8),_0xe9ec41['trim']()&&this['_promptHistory']['add']({'prompt':_0x5824e8},0x0);},{'priority':'high'}),_0x37510d;}['_createHistoryView'](){const _0x49ba38=new vr(this['locale']);return _0x49ba38['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ar),_0x49ba38['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x49ba38;}['_createToolbar'](){const _0x1f294f=new wr(this['locale']);return _0x1f294f['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x22878a,_0x35f421,_0x3ebb31)=>_0x22878a&&!_0x35f421&&!!_0x3ebb31),_0x1f294f['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1f294f['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x16cb59,_0xccff56,_0x3afbd6)=>_0x16cb59&&!_0xccff56&&!!_0x3afbd6),_0x1f294f['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1f294f['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x47cd48,_0x1b7887)=>_0x47cd48&&!_0x1b7887),_0x1f294f['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1f294f['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1f294f['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1f294f;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x534c12=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Yn(_0x534c12,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x1da535){const _0x5b539d=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x1da535||Yn(_0x5b539d,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x473589{['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[_0x284b61,a,x,_0x452334];}constructor(_0x3f22b8){super(_0x3f22b8),_0x3f22b8['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x3f22b8['config']['define']('ai.assistant.contentAreaCssClass',''),_0x3f22b8['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x3f22b8['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x30f2ea}=this;this['_aiAdapter']=_0x30f2ea['plugins']['get'](x),this['_dialog']=_0x30f2ea['plugins']['get'](_0x452334),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x281a3a=new E(_0x30f2ea,Array['from'](this['_commandDefinitions']['values']()));_0x30f2ea['commands']['add']('showAIAssistant',_0x281a3a),_0x30f2ea['ui']['componentFactory']['add']('aiCommands',_0xfb8c75=>{const _0x2166ec=_0x4f8f4d(_0xfb8c75);return _0x2166ec['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x2166ec['buttonView']['set']({'label':Yn(_0xfb8c75,'AI\x20Commands'),'icon':_0x38df54,'tooltip':!0x0}),_0x2166ec['on']('execute',_0x5a0512=>this['_onExecute'](_0x5a0512['source']['id'])),_0x2b750d(_0x2166ec,_0x30f2ea['ui']['view']['body'],function(_0x3415d4){const _0x1d1cf9=o(_0x3415d4['config']['get']('ai.assistant.commands'),_0x3415d4['locale']),_0x551678=U(_0x3415d4,_0x1d1cf9)['filter'](_0x535e91=>_0x535e91['commands']['length']);if(0x1===_0x551678['length'])return U(_0x3415d4,_0x551678[0x0]['commands'])['map'](_0x1ed349=>({'id':_0x1ed349['id'],'label':_0x1ed349['label']}));return _0x551678['map'](_0x334b5a=>{const {groupId:_0x3b07ab,groupLabel:_0x414e87,commands:_0x1ec549}=_0x334b5a,_0x311adf=U(_0x3415d4,_0x1ec549)['map'](_0xdaea46=>({'id':_0xdaea46['id'],'label':_0xdaea46['label']}));return{'id':_0x3b07ab,'menu':_0x414e87||_0x3b07ab,'children':_0x311adf};});}(_0x30f2ea),{'ariaLabel':Yn(_0xfb8c75,'AI\x20Commands')}),_0x2166ec['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x281a3a['on']('change:enabledCommandsIds',_0x5132f4),_0x2166ec['menuView']['once']('render',_0x5132f4),_0x2166ec;function _0x5132f4(){_0x2166ec['isEnabled']=_0x281a3a['enabledCommandsIds']['length']>0x0;for(const _0x43d3ac of _0x2166ec['menuView']['buttons'])_0x43d3ac['isEnabled']=_0x281a3a['enabledCommandsIds']['includes'](_0x43d3ac['id']);}}),_0x30f2ea['ui']['componentFactory']['add']('menuBar:aiCommands',_0x9a9104=>{const _0x25da6c=new _0x2ef427(_0x9a9104);_0x25da6c['buttonView']['set']({'label':Yn(_0x9a9104,'AI\x20Commands'),'icon':_0x38df54}),_0x25da6c['bind']('isEnabled')['to'](_0x281a3a,'enabledCommandsIds',_0x4e3095=>_0x4e3095['length']>0x0);const _0x44049e=o(_0x30f2ea['config']['get']('ai.assistant.commands'),_0x9a9104);return this['_populateMenuBarMenu'](_0x281a3a,_0x25da6c,_0x44049e,_0x5978df=>this['_onExecute'](_0x5978df)),_0x25da6c;}),_0x30f2ea['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1483a5=this['_createAIAssistantUIButton'](_0x32eaf5);return _0x1483a5['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1483a5;}),_0x30f2ea['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x34e6dc=this['_createAIAssistantUIButton'](_0x267e6c);return _0x34e6dc['set']({'role':'menuitemcheckbox'}),_0x34e6dc;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4b4a4b=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x34c0f2;for(const _0x4e846e in _0x4b4a4b){const _0x3c2aad=_0x4e846e,_0x3bed65=_0x4b4a4b[_0x3c2aad];if('aiLicenseKeyValid'==_0x3bed65||'aiLicenseKeyInvalid'==_0x3bed65||'aiLicenseKeyExpired'==_0x3bed65||'aiLicenseKeyDomainLimit'==_0x3bed65||'aiLicenseKeyNotAllowed'==_0x3bed65||'aiLicenseKeyEvaluationLimit'==_0x3bed65||'aiLicenseKeyTrialLimit'==_0x3bed65||'aiLicenseKeyUsageLimit'==_0x3bed65){delete _0x4b4a4b[_0x3c2aad],_0x34c0f2=_0x3bed65,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x34c0f2&&_0x4b4a4b['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x34c0f2&&_0x4b4a4b['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x34c0f2&&_0x4b4a4b['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x34c0f2&&_0x4b4a4b['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x34c0f2&&_0x4b4a4b['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x34c0f2&&_0x4b4a4b['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x34c0f2&&_0x4b4a4b['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x11aed3='',_0x1b0c98='',_0x2d08c7='custom'){const _0x32f565=this['editor'],_0x11028f=_0x32f565['editing']['view'],_0x44309a=_0x32f565['plugins']['get'](a),_0x301b6e=_0x32f565['plugins']['get'](_0x284b61);_0x44309a['showFakeVisualSelection']();const _0x238434=new w(),_0x148c09=new ClipboardEvent('copy',{'clipboardData':_0x238434}),_0x43a479=new _0x31e84d(_0x238434),_0x12ae96=new _0x10ba9f(_0x11028f,_0x148c09,{'dataTransfer':_0x43a479});_0x301b6e['_forceMarkersCopy']('comment',()=>{_0x11028f['document']['fire']('copy',_0x12ae96);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x32f565,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x35f0a7=_0x43a479['getData']('text/html');const _0x637c8c=_0x32f565['model']['document']['selection'],_0x340fbc=Array['from'](_0x637c8c['getRanges']());0x1===_0x340fbc['length']&&_0x340fbc[0x0]['isFlat']&&!_0x637c8c['getSelectedElement']()&&''!==_0x35f0a7['replace'](/&nbsp;/g,'')['trim']()&&(_0x35f0a7='<p>'+_0x35f0a7+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2d08c7,'query':_0x11aed3,'htmlContent':_0x35f0a7,'label':_0x1b0c98,'mainActionLabel':_[_0x32f565['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x477b29,'title':Yn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0xb64c2b['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x44309a['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2de46e=new Map(),_0x344fb0=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x5acd59 of _0x344fb0)for(const _0x5ee389 of _0x5acd59['commands'])_0x2de46e['set'](_0x5ee389['id'],{..._0x5ee389,'groupId':_0x5acd59['groupId'],'groupLabel':_0x5acd59['groupLabel']||_0x5acd59['groupId']});return _0x2de46e;}['_createAIAssistantUIButton'](_0x24b7fe){const _0x2dda8c=this['editor'],_0x49263c=_0x2dda8c['commands']['get']('showAIAssistant'),_0x1c80ae=new _0x24b7fe(_0x2dda8c['locale']);return _0x1c80ae['set']({'label':Yn(_0x2dda8c['locale'],'AI\x20Assistant'),'icon':_0x477b29,'isToggleable':!0x0}),_0x1c80ae['bind']('isEnabled')['to'](_0x49263c),_0x1c80ae['bind']('isOn')['to'](this['_dialog'],'id',_0x2afe63=>'aiAssistant'===_0x2afe63),this['listenTo'](_0x1c80ae,'execute',()=>{_0x1c80ae['isOn']?this['hideUI']():_0x49263c['execute']();}),_0x1c80ae;}['_initView'](){const _0x328a2e=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.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',()=>{_0x328a2e['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x328a2e['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x1c8dbf,ui:{ariaLiveAnnouncer:_0x325f6f}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x9956b4,_0x3a057d,_0x2c8c8a)=>{const _0x32e834=this['_aiAssistantController']['currentContext'];_0x2c8c8a?_0x325f6f['announce'](Yn(_0x1c8dbf,'AI\x20is\x20writing')):_0x32e834&&_0x325f6f['announce'](Yn(_0x1c8dbf,'Generated\x20content:\x20%0',_0x32e834),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x11ec62,_0x2aba84,_0x19007d)=>{if(_0x19007d){const _0x2a5ac9=this['_formView']['errorView']['text'];_0x325f6f['announce'](Yn(_0x1c8dbf,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2a5ac9));}});}['_onExecute'](_0x4c37e4){const _0x38d96a=this['_commandDefinitions']['get'](_0x4c37e4),_0x2c4e0e=this['editor'],_0x115f9c=_0x2c4e0e['model']['document']['selection'],_0x3f236e=_0x2c4e0e['commands']['get']('showAIAssistant'),_0x1fefe8=_0x2c4e0e['plugins']['get'](a),_0x31a72c=''+(_0x38d96a['groupId']!==K?_0x38d96a['groupLabel']+':\x20':'')+_0x38d96a['label'];if(!0x1!==_0x38d96a['requiresContent']&&_0x115f9c['isCollapsed']){const _0x20da5b=_0x8b356e(_0x115f9c['getSelectedBlocks']())||_0x2c4e0e['model']['schema']['getLimitElement'](_0x115f9c);_0x2c4e0e['model']['change'](_0x3860d6=>{_0x3860d6['setSelection'](_0x20da5b,'in');});}_0x1fefe8['showFakeVisualSelection'](),_0x3f236e['execute'](_0x38d96a['prompt'],_0x31a72c,'command:'+_0x4c37e4);}['_populateMenuBarMenu'](_0x184518,_0x399a87,_0x3a0e8a,_0x1c18f0){const _0x207cce=this['editor'],_0x8dbf68=_0x207cce['locale'],_0x2fa214=new _0x19edac(_0x8dbf68),_0x460aa1=U(_0x207cce,_0x3a0e8a)['filter'](_0x45b91f=>_0x45b91f['commands']['length']);0x1===_0x460aa1['length']?this['_getMenuBarGroupButtons']({'command':_0x184518,'commands':_0x460aa1[0x0]['commands'],'parentMenuView':_0x399a87,'onExecute':_0x1c18f0})['forEach'](_0x1308a8=>_0x2fa214['items']['add'](_0x1308a8)):_0x460aa1['forEach'](({groupId:_0x51ae8e,groupLabel:_0x2c23ff,commands:_0x1d9c02})=>{const _0x2df0ea=new _0x3471e3(_0x8dbf68,_0x399a87),_0x27fbe0=new _0x2ef427(_0x8dbf68),_0x9f55f6=new _0x19edac(_0x8dbf68),_0xc582ef=this['_getMenuBarGroupButtons']({'command':_0x184518,'commands':_0x1d9c02,'parentMenuView':_0x27fbe0,'onExecute':_0x1c18f0});_0x27fbe0['buttonView']['set']({'label':_0x2c23ff||_0x51ae8e}),_0x27fbe0['delegate']('execute')['to'](_0x399a87),_0x9f55f6['items']['addMany'](_0xc582ef),_0x27fbe0['panelView']['children']['add'](_0x9f55f6),_0x2df0ea['children']['add'](_0x27fbe0),_0x2fa214['items']['add'](_0x2df0ea);}),_0x399a87['panelView']['children']['add'](_0x2fa214);}['_getMenuBarGroupButtons']({command:_0x265b52,commands:_0x4c17b5,parentMenuView:_0x481e76,onExecute:_0x3a3e88}){const _0x3590fd=this['editor'],_0x10325e=_0x3590fd['locale'];return U(_0x3590fd,_0x4c17b5)['map'](_0x29a750=>{const _0x5b5d97=new _0x3471e3(_0x10325e,_0x481e76),_0x5e3a66=new _0x267e6c(_0x10325e);return _0x5e3a66['set']({'label':_0x29a750['label']}),_0x5e3a66['delegate']('execute')['to'](_0x481e76),_0x5e3a66['on']('execute',()=>_0x3a3e88(_0x29a750['id'])),_0x5e3a66['bind']('isEnabled')['to'](_0x265b52,'enabledCommandsIds',_0x133379=>_0x133379['includes'](_0x29a750['id'])),_0x5b5d97['children']['add'](_0x5e3a66),_0x5b5d97;});}}function T(_0x264c7c,_0x204fe2){return void 0x0!==_0x264c7c['order']&&void 0x0===_0x204fe2['order']?0x1:void 0x0===_0x264c7c['order']&&void 0x0!==_0x204fe2['order']?-0x1:void 0x0!==_0x264c7c['order']&&void 0x0!==_0x204fe2['order']?_0x264c7c['order']-_0x204fe2['order']:0x0;}function U(_0x5448d6,_0x273cda){_0x273cda['sort'](T);const _0x306dd2={},_0x56ae1d=[];for(const _0x55d311 of _0x273cda)if(void 0x0!==_0x55d311['order']){if(_0x55d311['order']in _0x306dd2)throw new _0x2520c7('ai-commands-config-order-collision',_0x5448d6,{'conflictingDefinitions':[_0x55d311,_0x306dd2[_0x55d311['order']]]});_0x306dd2[_0x55d311['order']]=_0x55d311,_0x56ae1d['splice'](_0x55d311['order'],0x0,_0x55d311);}else _0x56ae1d['push'](_0x55d311);return _0x56ae1d;}class qn extends _0x473589{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x16c12b){super(_0x16c12b);const _0x1d9c34=_0x16c12b['config'],_0x2d42a1=_0x16c12b['locale'];_0x1d9c34['define']('ai.assistant.preserveComments',!0x0),_0x1d9c34['define']('ai.assistant.commands',Qn(_0x2d42a1)),_0x1d9c34['define']('ai.assistant.extraCommandGroups',[]),_0x1d9c34['define']('ai.assistant.removeCommands',[]);let _0x3d4aef=o(_0x1d9c34['get']('ai.assistant.commands'),_0x2d42a1);const _0x1a4781=_0x1d9c34['get']('ai.assistant.extraCommandGroups'),_0x5d7e4b=_0x1d9c34['get']('ai.assistant.removeCommands');_0x1a4781['forEach'](_0x5605be=>{const _0x2483d4=_0x3d4aef['find'](_0x376d9b=>_0x376d9b['groupId']===_0x5605be['groupId']);_0x2483d4?_0x2483d4['commands']=_0x2483d4['commands']['concat'](_0x5605be['commands']):_0x3d4aef['push'](_0x5605be);}),_0x3d4aef=_0x3d4aef['filter'](_0x19c41c=>!_0x5d7e4b['includes'](_0x19c41c['groupId'])),_0x3d4aef['forEach'](_0x1f7d69=>{_0x1f7d69['commands']=_0x1f7d69['commands']['filter'](_0x2b077c=>!_0x5d7e4b['includes'](_0x2b077c['id']));}),_0x1d9c34['set']('ai.assistant.commands',_0x3d4aef);}}function Qn(_0x4794fe){return[{'groupId':'editOrReview','groupLabel':Yn(_0x4794fe,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Yn(_0x4794fe,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Yn(_0x4794fe,'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':Yn(_0x4794fe,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Yn(_0x4794fe,'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':Yn(_0x4794fe,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Yn(_0x4794fe,'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':Yn(_0x4794fe,'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':Yn(_0x4794fe,'Change\x20tone'),'commands':[{'id':'professional','label':Yn(_0x4794fe,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Yn(_0x4794fe,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Yn(_0x4794fe,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Yn(_0x4794fe,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Yn(_0x4794fe,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Yn(_0x4794fe,'Change\x20style'),'commands':[{'id':'business','label':Yn(_0x4794fe,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Yn(_0x4794fe,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Yn(_0x4794fe,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Yn(_0x4794fe,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Yn(_0x4794fe,'Translate'),'commands':[{'id':'translateEnglish','label':Yn(_0x4794fe,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Yn(_0x4794fe,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Yn(_0x4794fe,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Yn(_0x4794fe,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Yn(_0x4794fe,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Yn(_0x4794fe,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Yn(_0x4794fe,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Yn(_0x4794fe,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class pe extends _0x473589{['abortController'];static get['requires'](){return[x];}constructor(_0xbb2f9b){super(_0xbb2f9b),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x97bf58){return this['sendRequest'](_0x97bf58)['catch'](_0x39c7a8=>{if(_0x39c7a8 instanceof tr)return Promise['reject'](_0x39c7a8);if('AbortError'==_0x39c7a8['name'])return Promise['resolve']();throw console['error'](_0x39c7a8),new _0x2520c7('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x501abd,_0x4d7a54){const _0x43399b=this['editor']['locale'],_0x136bf2={'Content-Type':'application/json'};if('object'==typeof _0x501abd)Object['assign'](_0x136bf2,_0x501abd);else{if(_0x501abd)try{const _0x5740ea=await _0x501abd(_0x4d7a54);Object['assign'](_0x136bf2,_0x5740ea);}catch{return Promise['reject'](new tr(Yn(_0x43399b,'AI_ERROR_GET_HEADERS')));}}return _0x136bf2;}async['_prepareRequestParameters'](_0x12eb40,_0x58ba7f){const _0x477c6c=this['editor']['locale'];if('object'==typeof _0x12eb40)return _0x12eb40;try{return await _0x12eb40(_0x58ba7f);}catch{return Promise['reject'](new tr(Yn(_0x477c6c,'AI_ERROR_GET_PARAMETERS')));}}}class Xn extends pe{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x37f9fa){super(_0x37f9fa),_0x37f9fa['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x37f9fa['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x37f9fa['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x37f9fa['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x37f9fa['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x37f9fa['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x5120be,context:_0x372ef0,onData:_0x578224,actionId:_0x5d5943}){const _0x530318=this['editor']['locale'],_0x56f2ce=await this['prepareMessages'](_0x5120be,_0x372ef0,_0x5d5943),_0x1c7ed1=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5d5943),_0x273173=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5d5943),_0x4c1b2e={'messages':_0x56f2ce,..._0x273173},_0x13900d={'method':'POST','headers':_0x1c7ed1,'body':JSON['stringify'](_0x4c1b2e),'signal':this['abortController']['signal']},_0x10c955=await fetch(this['_apiUrl'],_0x13900d);if(_0x10c955['ok'])return _0x273173['stream']?await this['_readStreamableResponse'](_0x10c955,_0x578224):await this['_readStaticResponse'](_0x10c955,_0x578224),Promise['resolve']();{const _0x4a39bb=await _0x10c955['text']();return _0x4a39bb['includes']('context_length_exceeded')?Promise['reject'](new tr(Yn(_0x530318,'AI_ERROR_CONTEXT_LENGTH'))):_0x4a39bb['includes']('Moderation')?Promise['reject'](new tr(Yn(_0x530318,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x4a39bb));}}async['prepareMessages'](_0x11d794,_0x2d7fd3,_0x5d4afb){let _0x408a7e,_0x9ea8ad;return _0x2d7fd3?(_0x408a7e='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.',_0x9ea8ad='Instruction:\x0a'+_0x11d794+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2d7fd3):(_0x408a7e='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.',_0x9ea8ad=_0x11d794),[{'role':'system','content':_0x408a7e},{'role':'user','content':_0x9ea8ad}];}async['_readStreamableResponse'](_0x4e8e49,_0x40b999){const _0x29aed7=_0x4e8e49['body']['getReader'](),_0x33ffb5=new TextDecoder();let _0x11dd82='',_0x3bd143='',_0x4cf2b5='',_0x124787=!0x1;for(;!_0x124787;){const {done:_0x4e821a,value:_0x2ad4a5}=await _0x29aed7['read'](),_0x5cf286=_0x11dd82+_0x33ffb5['decode'](_0x2ad4a5);let _0x185adb='';_0x124787=_0x4e821a;try{_0x185adb=this['_cleanUpData'](_0x5cf286),_0x11dd82='';}catch{_0x11dd82=_0x5cf286;continue;}_0x3bd143+=_0x185adb,!_0x124787&&this['_isBufferIncomplete'](_0x3bd143)||_0x3bd143&&(_0x4cf2b5+=_0x3bd143,_0x3bd143='',_0x40b999(_0x4cf2b5));}return Promise['resolve']();}async['_readStaticResponse'](_0x905e83,_0x5b9287){return _0x5b9287((await _0x905e83['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x50fa60){const _0x1d8361=_0x50fa60['split']('<')['length']!==_0x50fa60['split']('>')['length'],_0x14173e=_0x50fa60['length']<0x1e;return _0x1d8361&&_0x14173e;}['_cleanUpData'](_0x499930){return _0x499930['split'](/\n(?![^{]*\})/g)['map'](_0x205b32=>_0x205b32['replace']('data:\x20',''))['filter'](_0x55ac8f=>_0x55ac8f&&_0x55ac8f['length']>0x0&&'[DONE]'!==_0x55ac8f)['map'](_0x102532=>{const {choices:_0x3d41b0}=JSON['parse'](_0x102532);if(_0x3d41b0[0x0]?.['delta']?.['content'])return _0x3d41b0[0x0]['delta']['content'];})['filter'](_0x3b2827=>_0x3b2827)['join']('');}}class zn extends pe{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x114859){super(_0x114859),_0x114859['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x114859['config']['define']('ai.assistant.adapter.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']=_0x114859['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x114859['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x114859['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x114859['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0xe34633,context:_0x5e8fb1,onData:_0x2982d7,actionId:_0x2b2837}){const {model:_0x56902c,stream:_0x5b5dce,..._0x412d0b}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2b2837),_0x3be0a7={'prompt':await this['preparePrompt'](_0xe34633,_0x5e8fb1,_0x56902c,_0x2b2837),..._0x412d0b};this['_apiUrl']?await this['_processProxyRequest'](_0x3be0a7,_0x56902c,_0x5b5dce,_0x2982d7,_0x2b2837):await this['_processAWSRequest'](_0x3be0a7,_0x56902c,_0x5b5dce,_0x2982d7);}async['preparePrompt'](_0x21da49,_0x27b45b,_0x56816b,_0x114e99){let _0x11ffed,_0x31ec59;return _0x27b45b?(_0x11ffed='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.',_0x31ec59='Instruction:\x0a'+_0x21da49+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x27b45b):(_0x11ffed='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.',_0x31ec59=_0x21da49),'meta.llama'==this['getModelFamily'](_0x56816b)?'<<SYS>>\x0a'+_0x11ffed+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x31ec59+'\x0a[/INST]':'Human:\x0a'+_0x11ffed+'\x0a'+_0x31ec59+'\x0a\x0aAssistant:';}['getModelFamily'](_0x3ed1cc){if(/^anthropic\.claude/['test'](_0x3ed1cc))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x3ed1cc))return'ai21.j2';if(/^cohere\.command/['test'](_0x3ed1cc))return'cohere.command';if(/^meta\.llama/['test'](_0x3ed1cc))return'meta.llama';throw new tr(Yn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x3ed1cc));}async['_processProxyRequest'](_0x5eb059,_0x1c6a33,_0x21144f,_0x341983,_0x46e49b){const _0x3659e2={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x46e49b),'body':JSON['stringify']({..._0x5eb059,'model':_0x1c6a33,'stream':_0x21144f}),'signal':this['abortController']['signal']},_0x3f8b28=await fetch(this['_apiUrl'],_0x3659e2);_0x21144f?await this['_readStreamableResponse'](_0x3f8b28,_0x1c6a33,_0x341983):await this['_readStaticResponse'](_0x3f8b28,_0x1c6a33,_0x341983);}async['_processAWSRequest'](_0x13bb68,_0x48749d,_0x545adc,_0x2cadf2){const _0x3529b2=new _0x2f2883(this['_bedrockClientConfig']),_0x55ba1a={'body':JSON['stringify'](_0x13bb68),'contentType':'application/json','accept':'application/json','modelId':_0x48749d};let _0x4d85cd;if(_0x545adc){const _0x1a8976=new _0x33163f(_0x55ba1a);_0x4d85cd=await _0x3529b2['send'](_0x1a8976,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x4d85cd,_0x48749d,_0x2cadf2);}else{const _0xa12aec=new _0x5e9ef4(_0x55ba1a);_0x4d85cd=await _0x3529b2['send'](_0xa12aec,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x4d85cd,_0x48749d,_0x2cadf2);}}async['_readAsyncIterableResponse'](_0x3834c3,_0x42e648,_0x5a8430){const _0x5d6ae3=_0x3834c3['body'],_0x4e768a=new TextDecoder('utf-8');let _0x4da28a='';for await(const _0x4ed3e1 of _0x5d6ae3)if(_0x4ed3e1['chunk']){const _0x3e2d38=_0x4e768a['decode'](_0x4ed3e1['chunk']['bytes']),_0x3cd459=JSON['parse'](_0x3e2d38);_0x4da28a+=this['_getGeneratedText'](_0x3cd459,_0x42e648),_0x5a8430(_0x4da28a);}return Promise['resolve']();}async['_readStreamableResponse'](_0x31f20c,_0x1fefc7,_0x34c8d1){const _0x1a06ce=_0x31f20c['body'],_0x3ae3ee=new TextDecoder('utf-8'),_0x1d7eda=_0x1a06ce['getReader']();let _0x2825ba='',_0x384739='',_0x463a14=!0x1;for(;!_0x463a14;){const {done:_0x13c01c,value:_0x5b93ad}=await _0x1d7eda['read']();if(_0x463a14=_0x13c01c,_0x463a14)break;const _0x404a8d=(_0x2825ba+_0x3ae3ee['decode'](_0x5b93ad))['split']('\x0a')['map'](_0x151455=>{try{return _0x2825ba='',JSON['parse'](_0x151455);}catch{return _0x2825ba=_0x151455,null;}})['filter'](_0x54f2b6=>null!==_0x54f2b6);_0x404a8d['length']&&(_0x384739+=_0x404a8d['map'](_0x5814c1=>this['_getGeneratedText'](_0x5814c1,_0x1fefc7))['join'](''),_0x34c8d1(_0x384739));}return Promise['resolve']();}async['_readStaticResponse'](_0x30d3c0,_0x21c0d2,_0x28ae23){let _0x3ef1a2;return _0x3ef1a2=_0x30d3c0 instanceof Response?await _0x30d3c0['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x30d3c0['body'])),(_0x28ae23(this['_getGeneratedText'](_0x3ef1a2,_0x21c0d2)),Promise['resolve']());}['_getGeneratedText'](_0x55881d,_0x413973){switch(this['getModelFamily'](_0x413973)){case'anthropic.claude':return _0x55881d['completion'];case'ai21.j2':return _0x55881d['completions'][0x0]['data']['text'];case'cohere.command':return _0x55881d['generations'][0x0]['text'];case'meta.llama':return _0x55881d['generation'];}}}class ia extends _0x32eaf5{constructor(_0x155058,_0x42b473={}){super(_0x155058),this['isToggleable']=!0x0,this['set']('side',_0x42b473['side']||'top');const _0x28074b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x14a540(_0x42b473['class']||[]),_0x28074b['to']('side',_0x2cf4bc=>'ck-tab-button_'+_0x2cf4bc),_0x28074b['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0xe56eb6{['children'];constructor(_0x5c08d1,_0x2a5a87={}){super(_0x5c08d1);const _0x355d44=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x14a540(_0x2a5a87['class']||[]),_0x355d44['to']('class'),_0x355d44['if']('isVisible','ck-hidden',_0x4d31fb=>!_0x4d31fb)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0xe56eb6{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x125d4a,_0x3da1ef={}){super(_0x125d4a),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x3da1ef['side']||'top'),this['set']('isMaximized',!0x1);const _0x2f1bde=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x14a540(_0x3da1ef['class']||[]),_0x2f1bde['to']('side',_0xc75fb3=>'ck-tabs_'+_0xc75fb3),_0x2f1bde['to']('class'),_0x2f1bde['to']('isMaximized',_0x168354=>_0x168354?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x2f1bde['to']('side',_0x2f5285=>'ck-tabs__buttons-container_'+_0x2f5285)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x2f1bde['to']('side',_0x5c745a=>'ck-tabs__panels-container_'+_0x5c745a)]},'children':this['panelViews']},..._0x14a540(_0x3da1ef['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x372d60){const _0xe78188=this['_tabs']['get'](_0x372d60);return _0xe78188||null;}['addTab'](_0x35a9e0){const _0x3b50cc=this['_setupButton']({'id':_0x35a9e0['id'],'label':_0x35a9e0['buttonLabel'],'icon':_0x35a9e0['buttonIcon'],'order':_0x35a9e0['order']}),_0x35d8ed=new ea(this['locale']);return _0x35d8ed['render'](),_0x35a9e0['content']&&_0x35d8ed['children']['add'](_0x35a9e0['content']),this['panelViews']['add'](_0x35d8ed),this['_tabs']['set'](_0x35a9e0['id'],{'button':_0x3b50cc,'panel':_0x35d8ed,'order':void 0x0!==_0x35a9e0['order']?_0x35a9e0['order']:null}),this['fire']('addTab:'+_0x35a9e0['id'],{'id':_0x35a9e0['id'],'button':_0x3b50cc,'panel':_0x35d8ed}),null===this['activeTab']?this['activateTab'](_0x35a9e0['id']):this['_hidePanel'](_0x35a9e0['id']),{'button':_0x3b50cc,'panel':_0x35d8ed};}['activateTab'](_0x46ae7c){if(null!==_0x46ae7c&&!this['getTab'](_0x46ae7c))throw new _0x2520c7('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x46ae7c});this['activeTab']!==_0x46ae7c&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x46ae7c,_0x46ae7c&&this['_showPanel'](_0x46ae7c),this['fire']('activateTab:'+_0x46ae7c,_0x46ae7c));}['showTab'](_0x116c49){if(!this['getTab'](_0x116c49))throw new _0x2520c7('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x116c49});this['_showPanel'](_0x116c49),this['_showButton'](_0x116c49),this['fire']('show:'+_0x116c49,_0x116c49);}['hideTab'](_0x5eea53){if(!this['getTab'](_0x5eea53))throw new _0x2520c7('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x5eea53});const _0x5e32a0=this['activeTab'];this['_hidePanel'](_0x5eea53),this['_hideButton'](_0x5eea53);const _0x1d4c87=this['getTabIds']();_0x5e32a0===_0x5eea53&&_0x1d4c87['length']>0x1&&this['activateTab'](_0x1d4c87['find'](_0x3d408f=>_0x3d408f!==_0x5eea53)),this['fire']('hide:'+_0x5eea53,_0x5eea53);}['_getPanel'](_0x4e5094){const _0x57b49b=this['_tabs']['get'](_0x4e5094);return _0x57b49b?_0x57b49b['panel']:null;}['_showPanel'](_0x285de9){null!==this['activeTab']&&this['activeTab']!==_0x285de9||this['_getPanel'](_0x285de9)['show']();}['_hidePanel'](_0x4ebf7f){const _0x51522e=this['_getPanel'](_0x4ebf7f);_0x51522e['isVisible']&&(this['activeTab']===_0x4ebf7f&&(this['activeTab']=null),_0x51522e['hide']());}['_getButton'](_0x1b043d){const _0x4daada=this['_tabs']['get'](_0x1b043d);return _0x4daada?_0x4daada['button']:null;}['_showButton'](_0xc9683f){this['_getButton'](_0xc9683f)['show']();}['_hideButton'](_0x2309d1){this['_getButton'](_0x2309d1)['hide']();}['_setupButton'](_0x563e){const _0x416f67=new ia(this['locale'],{'side':this['side']}),_0x564ff7=this['buttonViews'];if(_0x416f67['set']({'label':_0x563e['label'],'icon':_0x563e['icon'],'tooltip':!0x0,'withText':!0x0}),_0x416f67['bind']('isOn')['to'](this,'activeTab',_0x29e2f9=>_0x29e2f9===_0x563e['id']),_0x416f67['bind']('side')['to'](this,'side'),_0x563e['order']){const _0x1288ab=[...this['_tabs']]['reduce']((_0x40044c,_0x434e59)=>{const _0x2bbded=_0x434e59[0x0],{order:_0x11499c}=_0x434e59[0x1];return!_0x11499c||_0x11499c>_0x563e['order']?_0x40044c:_0x11499c>=_0x40044c['order']?{'id':_0x2bbded,'order':_0x11499c}:_0x40044c;},{'id':'','order':0x0}),_0x145718=_0x564ff7['getIndex'](this['_getButton'](_0x1288ab['id']));_0x564ff7['add'](_0x416f67,_0x145718+0x1);}else _0x564ff7['add'](_0x416f67);return _0x416f67['on']('execute',()=>{this['activateTab'](_0x563e['id']);}),_0x416f67;}}const pi=['overlay','sidebar','custom'],di=['left','right'];class ui extends ss{constructor(_0x3f8e5e,_0x4d3bae={}){super(_0x3f8e5e,_0x4d3bae),this['set']('type',_0x4d3bae['type']||'sidebar'),this['set']('side',_0x4d3bae['side']||'right'),this['set']('isVisible',_0x4d3bae['visibleByDefault']??!0x0);const _0x1b453e=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x1b453e['if']('type','ck-ai-tabs__overlay',_0xf34347=>'overlay'===_0xf34347),_0x1b453e['if']('type','ck-ai-tabs__sidebar',_0x24b7be=>'sidebar'===_0x24b7be),_0x1b453e['if']('isVisible','ck-hidden',_0x452412=>!_0x452412)]}}),this['buttonViews']['on']('add',(_0x53165e,_0x57d384)=>{_0x57d384['set']('withText',!0x1);});}}class Ct extends ot{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x7f4f6b){super(_0x7f4f6b);const _0x4f6a4c=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x4f6a4c)throw new _0x2520c7('ai-tabs-configuration-not-found');if(void 0x0!==_0x4f6a4c['showResizeButton']&&(this['showResizeButton']=_0x4f6a4c['showResizeButton']),'sidebar'!==_0x4f6a4c['type']&&'overlay'!==_0x4f6a4c['type']||_0x4f6a4c['side']&&(this['side']=_0x4f6a4c['side']),'sidebar'===_0x4f6a4c['type']){if(this['container']=_0x4f6a4c['element'],this['set']('type','sidebar'),!this['container'])throw new _0x2520c7('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x4f6a4c['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ui(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x4f6a4c['visibleByDefault']||_0x4f6a4c['visibleByDefault']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['container']&&this['container']['appendChild'](this['view']['element']),this['context']instanceof pt&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x13009f){if(_0x13009f&&this['type']!==_0x13009f){if(!pi['includes'](_0x13009f))throw new _0x2520c7('ai-tabs-unsupported-ui-type');this['type']=_0x13009f;}}['switchSide'](_0x33f486){if(_0x33f486&&this['side']!==_0x33f486){if(!di['includes'](_0x33f486))throw new _0x2520c7('ai-tabs-unsupported-ui-side');this['side']=_0x33f486;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class S extends ot{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2704eb){super(_0x2704eb),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl'),this['_token']=null,this['_decoder']=new TextDecoder();}['init'](){const _0x112a94=this['context']['plugins']['get']('CloudServices');if(!_0x112a94['token'])throw new _0x2520c7('ai-missing-token',this);this['_token']=_0x112a94['token'];}['startConversation'](_0x1b6e40,_0x173fb6){const _0x3e26d7=this['_sendApiRequest']('/conversations','POST',{'id':_0x1b6e40,'group':_0x173fb6});return{'getConversation':async()=>(await _0x3e26d7['request'])['json'](),'abortController':_0x3e26d7['abortController']};}['queryAssistant']({message:_0x3d13eb,conversationId:_0x3d0b80,parts:_0x199327,capabilities:_0x2b70ec,model:_0x5343df,quickActionData:_0x1d9d97}){const _0x34fb64={..._0x1d9d97&&{'quickActionData':_0x1d9d97}},_0x32aa6d={'prompt':_0x3d13eb,'content':_0x199327,'model':_0x5343df,..._0x2b70ec&&{'capabilities':_0x2b70ec},...Object['keys'](_0x34fb64)['length']>0x0&&{'attributes':_0x34fb64}},_0x402e79=this['_sendApiRequest']('/conversations/'+_0x3d0b80+'/messages','POST',_0x32aa6d);return{'getStream':async()=>{const _0x301a8b=(await _0x402e79['request'])['body'];return this['_getStreamReader'](_0x301a8b);},'abortController':_0x402e79['abortController']};}['executeCustomAction']({content:_0x3a7401,message:_0x5e7503,model:_0x372958,outputFormat:_0xa1be11}){const _0x2dc93f={'content':[{'type':'text','content':_0x3a7401}],'prompt':_0x5e7503,'model':_0x372958,'outputFormat':_0xa1be11},_0x24c2b9=this['_sendApiRequest']('/actions/custom/calls','POST',_0x2dc93f);return{'getStream':async()=>{const _0x44d267=(await _0x24c2b9['request'])['body'];return this['_getStreamReader'](_0x44d267);},'abortController':_0x24c2b9['abortController']};}['executeAction']({actionName:_0x57386c,content:_0x2b007a,args:_0x5e9e31}){const _0x2d81eb={'content':[{'type':'text','content':_0x2b007a}],'args':_0x5e9e31},_0x37c03c=this['_sendApiRequest']('/actions/system/'+_0x57386c+'/calls','POST',_0x2d81eb);return{'getStream':async()=>{const _0xf5da3d=(await _0x37c03c['request'])['body'];return this['_getStreamReader'](_0xf5da3d);},'abortController':_0x37c03c['abortController']};}['uploadFile'](_0x2aec69,_0x20072c,_0x568079){const _0x24c672=new FormData();_0x24c672['append']('file',_0x20072c,_0x20072c['name']),_0x568079&&_0x24c672['append']('attributes',JSON['stringify'](_0x568079));const _0x31b803=this['_sendApiRequest']('/conversations/'+_0x2aec69+'/files','POST',_0x24c672);return{'getId':async()=>(await _0x31b803['request'])['json'](),'abortController':_0x31b803['abortController']};}['fetchDocument'](_0x4b70ca,_0x258389){const _0x1461e1=this['_sendApiRequest']('/conversations/'+_0x4b70ca+'/documents/'+_0x258389,'GET');return{'getDocument':async()=>(await _0x1461e1['request'])['json'](),'abortController':_0x1461e1['abortController']};}['uploadDocument'](_0x51dd1c,_0x216dde,_0x3b3fa1){const _0x22f7d0={'content':_0x216dde};_0x3b3fa1&&(_0x22f7d0['attributes']=_0x3b3fa1);const _0x32ec34=this['_sendApiRequest']('/conversations/'+_0x51dd1c+'/documents','POST',_0x22f7d0);return{'getId':async()=>(await _0x32ec34['request'])['json'](),'abortController':_0x32ec34['abortController']};}['fetchConversations'](_0x4c9572,_0x30e33f){const _0x480897=new URLSearchParams();_0x480897['append']('excludeEmpty','true'),_0x480897['append']('limit','100'),_0x480897['append']('group',_0x4c9572),_0x30e33f&&_0x480897['append']('search',_0x30e33f);const _0x2084a0=this['_sendApiRequest']('/conversations?'+_0x480897['toString'](),'GET');return{'getConversations':async()=>{const _0x32705b=await _0x2084a0['request'];return(await _0x32705b['json']())['items'];},'abortController':_0x2084a0['abortController']};}['deleteConversation'](_0x1e2fa1){const _0x2e9890=this['_sendApiRequest']('/conversations/'+_0x1e2fa1,'DELETE');return{'execute':async()=>{await _0x2e9890['request'];},'abortController':_0x2e9890['abortController']};}['updateConversation'](_0x4b5013,_0x3f1e6e){const _0x520eca=this['_sendApiRequest']('/conversations/'+_0x4b5013,'PATCH',_0x3f1e6e);return{'getResult':async()=>(await _0x520eca['request'],_0x3f1e6e),'abortController':_0x520eca['abortController']};}['fetchConversation'](_0x410cb4){const _0x170296=this['_sendApiRequest']('/conversations/'+_0x410cb4,'GET');return{'getConversation':async()=>(await _0x170296['request'])['json'](),'abortController':_0x170296['abortController']};}['fetchConversationMessages'](_0x13ea55){const _0x1e6693=this['_sendApiRequest']('/conversations/'+_0x13ea55+'/messages','GET');return{'getMessages':async()=>{const _0x5753c5=await _0x1e6693['request'];return(await _0x5753c5['json']())['items'];},'abortController':_0x1e6693['abortController']};}['uploadUrl'](_0x52c1f1,_0x58359e,_0x480b2b){const _0x2f2d97=this['_sendApiRequest']('/conversations/'+_0x52c1f1+'/web-resources','POST',{'url':_0x58359e,'attributes':_0x480b2b});return{'getId':async()=>(await _0x2f2d97['request'])['json'](),'abortController':_0x2f2d97['abortController']};}['getModels'](){const _0x273ad4=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>await(await _0x273ad4['request'])['json'](),'abortController':_0x273ad4['abortController']};}['deleteFile'](_0x1ee2bf,_0x566a86){const _0x3e3d97=this['_sendApiRequest']('/conversations/'+_0x1ee2bf+'/files/'+_0x566a86,'DELETE');return{'execute':async()=>{await _0x3e3d97['request'];},'abortController':_0x3e3d97['abortController']};}['deleteDocument'](_0x51be54,_0x44c500){const _0x2ab190=this['_sendApiRequest']('/conversations/'+_0x51be54+'/documents/'+_0x44c500,'DELETE');return{'execute':async()=>{await _0x2ab190['request'];},'abortController':_0x2ab190['abortController']};}['deleteWebResource'](_0x1180fd,_0x182bb4){const _0x16e414=this['_sendApiRequest']('/conversations/'+_0x1180fd+'/web-resources/'+_0x182bb4,'DELETE');return{'execute':async()=>{await _0x16e414['request'];},'abortController':_0x16e414['abortController']};}['callSystemReview']({reviewName:_0x5eda31,content:_0x3ee24f,args:_0x2ce006}){const _0x49f9f2=this['_sendApiRequest']('/reviews/system/'+_0x5eda31+'/calls','POST',{'content':[{'type':'text','content':_0x3ee24f}],'args':_0x2ce006});return{'getStream':async()=>{const _0x1a7077=(await _0x49f9f2['request'])['body'];return this['_getStreamReader'](_0x1a7077);},'abortController':_0x49f9f2['abortController']};}['callCustomReview']({content:_0x4a7d3e,prompt:_0x5b9816,model:_0x1b2d3d}){const _0x17ec6e=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x4a7d3e}],'prompt':_0x5b9816,'model':_0x1b2d3d});return{'getStream':async()=>{const _0x4e4fb9=(await _0x17ec6e['request'])['body'];return this['_getStreamReader'](_0x4e4fb9);},'abortController':_0x17ec6e['abortController']};}['upsertAIChatRating'](_0x2391a8,_0x42fbfe,_0x3cae37){const _0x170bbe=this['_sendApiRequest']('/conversations/'+_0x2391a8+'/messages/'+_0x42fbfe+'/ratings','PUT',{'positiveCount':_0x3cae37['positiveCount'],'totalCount':_0x3cae37['totalCount'],'modificationId':_0x3cae37['modificationId']});return{'execute':async()=>{await _0x170bbe['request'];},'abortController':_0x170bbe['abortController']};}['upsertAIActionRating'](_0x23d98d,_0x9e7f99,_0xc6fb11){const _0x39e384=this['_sendApiRequest']('/actions/system/'+_0x23d98d+'/calls/'+_0x9e7f99+'/ratings','PUT',{'positiveCount':_0xc6fb11['positiveCount'],'totalCount':_0xc6fb11['totalCount']});return{'execute':async()=>{await _0x39e384['request'];},'abortController':_0x39e384['abortController']};}['upsertCustomAIActionRating'](_0xa1f048,_0x502460){const _0x1df278=this['_sendApiRequest']('/actions/custom/calls/'+_0xa1f048+'/ratings','PUT',{'positiveCount':_0x502460['positiveCount'],'totalCount':_0x502460['totalCount']});return{'execute':async()=>{await _0x1df278['request'];},'abortController':_0x1df278['abortController']};}['upsertAIReviewRating'](_0x5884dd,_0x511686,_0x377e7f,_0x1c5335){const _0x536792=this['_sendApiRequest']('/reviews/system/'+_0x5884dd+'/calls/'+_0x511686+'/ratings','PUT',{'positiveCount':_0x377e7f['positiveCount'],'totalCount':_0x377e7f['totalCount'],'dataId':_0x1c5335});return{'execute':async()=>{await _0x536792['request'];},'abortController':_0x536792['abortController']};}['upsertCustomAIReviewRating'](_0x4699c6,_0x40351c,_0x1e615a){const _0x5c7a20=this['_sendApiRequest']('/reviews/custom/calls/'+_0x4699c6+'/ratings','PUT',{'positiveCount':_0x40351c['positiveCount'],'totalCount':_0x40351c['totalCount'],'dataId':_0x1e615a});return{'execute':async()=>{await _0x5c7a20['request'];},'abortController':_0x5c7a20['abortController']};}['_sendApiRequest'](_0x383d54,_0x16d237,_0x9fd6f2){const _0x20b71b=new AbortController(),_0x21558a=_0x9fd6f2 instanceof FormData,_0x1b6c8c={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x9fd6f2&&!_0x21558a&&(_0x1b6c8c['Content-Type']='application/json');const _0x5846f8={'method':_0x16d237,'headers':_0x1b6c8c,'signal':_0x20b71b['signal']};return _0x9fd6f2&&(_0x5846f8['body']=_0x21558a?_0x9fd6f2:JSON['stringify'](_0x9fd6f2)),{'request':fetch(''+this['_apiUrl']+_0x383d54,_0x5846f8)['catch'](_0x84e0db=>{this['_handleError'](_0x84e0db);})['then'](_0x50a595=>{if(!_0x50a595['ok'])throw new _0x2520c7('ai-request-failed',this,{'url':this['_apiUrl'],'path':_0x383d54,'method':_0x16d237,'body':_0x9fd6f2,'status':(_0x50a595||{})['status'],'statusText':(_0x50a595||{})['statusText']});return _0x50a595;}),'abortController':_0x20b71b};}async*['_getStreamReader'](_0x5e85cb){const _0x4e068d=[],_0x11968a=_0x5e85cb['getReader'](),_0x2cd1ce=$t({'onError':_0x15fb15=>{this['_handleError'](_0x15fb15);},'onEvent':_0x2878f8=>{_0x2878f8['data']=JSON['parse'](_0x2878f8['data']),_0x4e068d['push'](_0x2878f8);}});try{let _0x3da3ac=!0x1;for(;!_0x3da3ac;){const {done:_0x43451e,value:_0x35b25e}=await _0x11968a['read']();_0x43451e&&(_0x3da3ac=!0x0),_0x2cd1ce['feed'](this['_decoder']['decode'](_0x35b25e,{'stream':!0x0})),yield*_0x4e068d,_0x4e068d['length']=0x0;}}catch(_0x5153da){this['_handleError'](_0x5153da);}finally{_0x11968a['releaseLock'](),_0x2cd1ce['reset']();}}['_handleError'](_0x2cc726){if(_0x2cc726 instanceof _0x2520c7)throw _0x2cc726;if(_0x2cc726 instanceof Error&&'AbortError'===_0x2cc726['name'])throw new _0x2520c7('ai-request-aborted',this,{'originalError':_0x2cc726});throw new _0x2520c7('ai-request-failed',this,{'originalError':_0x2cc726});}}function i(_0x3d8bbe,_0x3a5f8b,_0x1b846f){const t=_0x3d8bbe['t'];switch(_0x3a5f8b){case'AI_SUGGESTION_HEADER_TITLE':return t({'id':'AI_SUGGESTION_HEADER_TITLE','string':'Proposed\x20changes'});case'AI_SUGGESTION_BUTTON_SHOW_CHANGES':return t({'id':'AI_SUGGESTION_BUTTON_SHOW_CHANGES','string':'Show\x20details'});case'AI_MINI_TOOLBAR_LIKE':return t({'id':'AI_MINI_TOOLBAR_LIKE','string':'I\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_DISLIKE':return t({'id':'AI_MINI_TOOLBAR_DISLIKE','string':'I\x20don\x27t\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_COPY':return t({'id':'AI_MINI_TOOLBAR_COPY','string':'Copy\x20to\x20clipboard'});case'AI_SUGGESTION_CONTENT_PART_TITLE':return t({'id':'AI_SUGGESTION_CONTENT_PART_TITLE','string':'Change\x20%0'},_0x1b846f);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x1b846f);case'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES','string':'Unable\x20to\x20load\x20resources\x20from\x20%0.\x20Please\x20try\x20again.'},_0x1b846f);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x1b846f);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0x1b846f);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0x1b846f);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x1b846f);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0x1b846f);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x1b846f);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0x1b846f);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x1b846f);case'AI_CHAT_MODEL_SELECTOR_GROUP':return t({'id':'AI_CHAT_MODEL_SELECTOR_GROUP','string':'Models'});case'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP','string':'Select\x20a\x20model'});case'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP','string':'Start\x20a\x20new\x20conversation\x20to\x20change\x20the\x20model'});case'AI_CHAT_CAPABILITIES_YES':return t({'id':'AI_CHAT_CAPABILITIES_YES','string':'Yes'});case'AI_CHAT_CAPABILITIES_NO':return t({'id':'AI_CHAT_CAPABILITIES_NO','string':'No'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT','string':'The\x20selected\x20model\x20is\x20no\x20longer\x20available,\x20so\x20you\x20cannot\x20continue\x20this\x20conversation.\x20Please\x20'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON','string':'start\x20a\x20new\x20one.'});case'AI_CHAT_CONTEXT_SOURCES_LABEL':return t({'id':'AI_CHAT_CONTEXT_SOURCES_LABEL','string':'Sources'});case'AI_CHAT_HISTORY_HEADING':return t({'id':'AI_CHAT_HISTORY_HEADING','string':'Chat\x20History'});case'AI_CHAT_HISTORY_SEARCH_LABEL':return t({'id':'AI_CHAT_HISTORY_SEARCH_LABEL','string':'Search\x20history'});case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY','string':'No\x20chats\x20were\x20found\x20matching\x20\x22%0\x22.'},_0x1b846f);case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY','string':'Please\x20try\x20a\x20different\x20phrase\x20or\x20check\x20the\x20spelling.'});case'AI_CHAT_HISTORY_EMPTY_MESSAGE':return t({'id':'AI_CHAT_HISTORY_EMPTY_MESSAGE','string':'Your\x20chat\x20history\x20for\x20current\x20document\x20will\x20appear\x20here.'});case'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON':return t({'id':'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON','string':'Go\x20to\x20chat'});case'AI_CHAT_HISTORY_PIN_BUTTON':return t({'id':'AI_CHAT_HISTORY_PIN_BUTTON','string':'Pin'});case'AI_CHAT_HISTORY_SHOW_MORE_ITEMS':return t({'id':'AI_CHAT_HISTORY_SHOW_MORE_ITEMS','string':'Show\x20more\x20items'});case'AI_CHAT_HISTORY_EDIT_NAME':return t({'id':'AI_CHAT_HISTORY_EDIT_NAME','string':'Edit\x20name'});case'AI_CHAT_HISTORY_REMOVE':return t({'id':'AI_CHAT_HISTORY_REMOVE','string':'Remove'});case'AI_CHAT_HISTORY_REMOVE_CONFIRM':return t({'id':'AI_CHAT_HISTORY_REMOVE_CONFIRM','string':'Do\x20you\x20want\x20to\x20remove\x20this\x20chat?'});case'AI_CHAT_HISTORY_ACCEPT':return t({'id':'AI_CHAT_HISTORY_ACCEPT','string':'Accept'});case'AI_CHAT_HISTORY_CANCEL':return t({'id':'AI_CHAT_HISTORY_CANCEL','string':'Cancel'});case'AI_CHAT_HISTORY_LOADING_REMOVING':return t({'id':'AI_CHAT_HISTORY_LOADING_REMOVING','string':'Removing\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_RENAMING':return t({'id':'AI_CHAT_HISTORY_LOADING_RENAMING','string':'Renaming\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_PINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_PINNING','string':'Pinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_UNPINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_UNPINNING','string':'Unpinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_CATEGORY_PINNED':return t({'id':'AI_CHAT_HISTORY_CATEGORY_PINNED','string':'Pinned'});case'AI_CHAT_HISTORY_CATEGORY_TODAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_TODAY','string':'Today'});case'AI_CHAT_HISTORY_CATEGORY_YESTERDAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_YESTERDAY','string':'Yesterday'});case'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS','string':'Last\x2014\x20days'});case'AI_CHAT_HISTORY_CATEGORY_LATER':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LATER','string':'Later'});case'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE','string':'Failed\x20to\x20change\x20the\x20\x22%0\x22\x20chat\x20name.\x20Please\x20try\x20again\x20later.'},_0x1b846f);case'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED','string':'Failed\x20to\x20%0\x20the\x20\x22%1\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x1b846f);case'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM':return t({'id':'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM','string':'Failed\x20to\x20delete\x20the\x20\x22%0\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x1b846f);case'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS':return t({'id':'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS','string':'Failed\x20to\x20load\x20the\x20chat\x20history.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_ERROR_GENERIC':return t({'id':'AI_CHAT_HISTORY_ERROR_GENERIC','string':'Something\x20went\x20wrong.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_PIN_ACTION':return t({'id':'AI_CHAT_HISTORY_PIN_ACTION','string':'pin'});case'AI_CHAT_HISTORY_UNPIN_ACTION':return t({'id':'AI_CHAT_HISTORY_UNPIN_ACTION','string':'unpin'});case'AI_BALLOON_HEADER_TITLE':return t({'id':'AI_BALLOON_HEADER_TITLE','string':'Change\x20%0'},_0x1b846f);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_MODEL_DESCRIPTION_AUTO':return t({'id':'AI_MODEL_DESCRIPTION_AUTO','string':'Automatically\x20selects\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost.'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20-\x20faster,\x20more\x20cost-efficient'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU','string':'Cost-efficient\x20model\x20for\x20quick\x20interactions\x20with\x20improved\x20reasoning'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET','string':'Advanced\x20model\x20with\x20strong\x20reasoning\x20and\x20reliability\x20for\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET','string':'Advanced\x20model\x20with\x20improved\x20creativity,\x20reliability,\x20and\x20reasoning'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO','string':'Google\x27s\x20advanced\x20model\x20for\x20versatile\x20problem-solving\x20and\x20research'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH','string':'Lightweight\x20Gemini\x20model\x20for\x20fast,\x20cost-efficient\x20interactions'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x1b846f);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_ACTIONS_SELECTION_REMOVED_ERROR':return t({'id':'AI_ACTIONS_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});default:return _0x3a5f8b;}}function ks(_0x38a42e,_0x44705b){const _0x26d9e5=new _0x32eaf5(_0x38a42e),_0x497c1e=i(_0x38a42e,'AI_TABS_LABEL_MINIMIZE'),_0x50fe26=i(_0x38a42e,'AI_TABS_LABEL_MAXIMIZE');return _0x26d9e5['set']({'withText':!0x1,'icon':_0x546b68,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x26d9e5['bind']('label')['to'](_0x44705b,'isMaximized',_0x2e936f=>_0x2e936f?_0x497c1e:_0x50fe26),_0x26d9e5['bind']('icon')['to'](_0x44705b,'isMaximized',_0x530e68=>_0x530e68?to:_0x546b68),_0x26d9e5['bind']('isOn')['to'](_0x44705b,'isMaximized'),_0x26d9e5['on']('execute',()=>{_0x44705b['fire']('resizeTabs');}),_0x26d9e5;}function ze(_0x5bb8a0){return _0x133e39(_0x5bb8a0);}function St(_0x372988){return _0x2e70cb(_0x372988);}function Dt(_0x50b171,_0x59c114,_0x280060){const _0x240fb5=null!==_0x59c114?_0xeefc5e=>_0xeefc5e['attribs'][_0x50b171]===_0x59c114:_0x32dcbf=>Boolean(_0x32dcbf['attribs'][_0x50b171]);return wt(_0x550575=>_0xf0837b(_0x550575)&&_0x240fb5(_0x550575),_0x280060);}function Xe(_0xba5bbd,_0x398a13,_0x4f53ae){const _0x589350=null!==_0x398a13?_0x55e92b=>_0x55e92b['attribs'][_0xba5bbd]===_0x398a13:_0x241f7f=>Boolean(_0x241f7f['attribs'][_0xba5bbd]);return _0x2c33af(_0x3515d8=>_0xf0837b(_0x3515d8)&&_0x589350(_0x3515d8),_0x4f53ae);}function Et(_0x54b5cb,_0xbd72d){return _0x54b5cb&&_0xf0837b(_0x54b5cb)?_0x54b5cb['attribs'][_0xbd72d]:null;}function Ji(_0x1fb77e,_0xa05616,_0x1aad1c){_0xf0837b(_0x1fb77e)&&(null===_0x1aad1c?delete _0x1fb77e['attribs'][_0xa05616]:_0x1fb77e['attribs'][_0xa05616]=_0x1aad1c);}function Bi(_0x431610,_0x14f26b,_0x2abc19){const _0x4ba8f2=_0x14f26b['cloneNode'](!0x0);'beforebegin'===_0x2abc19?_0x20a345(_0x431610,_0x4ba8f2):'afterbegin'===_0x2abc19?_0x2c1cf5(_0x431610,_0x4ba8f2):'beforeend'===_0x2abc19?_0xec0d69(_0x431610,_0x4ba8f2):'afterend'===_0x2abc19&&_0x5c93f3(_0x431610,_0x4ba8f2);}function qe(_0x33ef8f){const _0x352d33=[];let _0x352bfb=_0x33ef8f;for(;_0x352bfb;)_0x352bfb=_0x1116a3(_0x352bfb),_0x352bfb&&_0x352d33['push'](_0x352bfb);return _0x352d33;}function Jn(_0x5bbf04){return _0x5bbf04['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Xi(_0x4fba14){let _0x73b010=0x0;for(;_0x4fba14['parentNode'];)_0x4fba14=_0x4fba14['parentNode'],_0x73b010++;return _0x73b010;}function $i(_0x591de5){const _0x5130f2=[];let _0x3857cf=_0x591de5['nextSibling'];for(;_0x3857cf;)_0x5130f2['push'](_0x3857cf),_0x3857cf=_0x3857cf['nextSibling'];_0x5130f2['forEach'](_0x3fbd6b=>{_0x40dbe2(_0x3fbd6b);});}class Je extends/* #__PURE__ -- @preserve */
25
- ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x3fb7e0();}['convertMarkdownToHTML'](_0x4ee14e){const _0x34c7a4=this['_m2html']['parse'](_0x4ee14e);return this['parseAndNormalizeHTML'](_0x34c7a4);}['parseAndNormalizeHTML'](_0x4abc23){return this['_parseHTML'](_0x4abc23);}['_parseHTML'](_0x7a277c){const _0x9b1fd2=ze('<dummy>'+_0x7a277c['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x9b1fd2['children']=_0x9b1fd2['children'][0x0]['children'],_0x9b1fd2;}}class Ke extends/* #__PURE__ -- @preserve */
26
- ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x300f02){super(),this['_generateUid']=_0x300f02||_0x4237d5;}['merge'](_0x393d1d,_0x5e0061,_0xa6227e){const _0x404357=_0x393d1d['cloneNode'](!0x0);if(0x0===_0x5e0061['childNodes']['length']){const _0x531a8d=[];return Xe('data-id','new-element',_0x404357)['forEach'](_0x216837=>{const _0x107db6=this['_generateUid']();Ji(_0x216837,'data-id',_0x107db6),_0x531a8d['push'](_0x107db6);}),this['_removeSpecialComments'](_0x404357),{'parsedContent':_0x404357,'newNodeIds':_0x531a8d,'modifiedNodeIds':[],'removedNodeIds':[]};}_0xa6227e&&_0xa6227e['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x404357),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Xe('data-id',null,_0x5e0061)['map'](_0x2d8cb4=>Et(_0x2d8cb4,'data-id'))['filter'](_0x3d35d0=>!!_0x3d35d0));let _0x4ddc8d=-0x1,_0x245506=!0x1;const _0x797504=_0x404357['childNodes'],_0x41a89a=Array['from'](_0x797504)['filter'](_0x388e18=>!(0x3===_0x388e18['nodeType']&&''===St(_0x388e18)['trim']())),_0x14d3e6=_0x41a89a['length'];for(let _0x4cbdf4=0x0;_0x4cbdf4<_0x14d3e6;_0x4cbdf4++){const _0x2f5642=_0x41a89a[_0x4cbdf4],_0xb1ca86=_0x41a89a[_0x4cbdf4+0x1];if(this['_isNewNode'](_0x2f5642)){if(-0x1===_0x4ddc8d&&(_0x4ddc8d=_0x4cbdf4),this['_markWrappedElements'](_0x2f5642),!this['_isNewNode'](_0xb1ca86)){const [_0x1af144,_0x21d6cc]=this['_findReferenceNode'](_0x2f5642,_0x245506,_0x5e0061);if(_0x1af144){const _0x550671=Array['from'](_0x41a89a)['slice'](_0x4ddc8d,_0x4cbdf4+0x1);this['_insertNodes'](_0x1af144,_0x550671,_0x21d6cc),_0x4ddc8d=-0x1;}}}else{if(this['_isExistingContentComment'](_0x2f5642))_0x245506=!0x0;else{if(this['_isExistingNode'](_0x2f5642)){const _0x5195c8=Et(_0x2f5642,'data-id');if(_0x5195c8&&this['_existingDataIds']['has'](_0x5195c8)){const _0x302915=Dt('data-id',_0x5195c8,_0x5e0061);this['_replaceNode'](_0x302915,_0x2f5642);}if(this['_touchedNodesState']['removedIds']['includes'](_0x5195c8)){const _0x128ff1=this['_touchedNodesState']['removedIds']['indexOf'](_0x5195c8);this['_touchedNodesState']['removedIds']['splice'](_0x128ff1,0x1);}}else{if(this['_isDelNode'](_0x2f5642)){const _0x5f3988=Et(_0x2f5642,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x5f3988)||this['_storeDeletedElementIds'](_0x2f5642);}}}}}for(const _0x273366 of this['_touchedNodesState']['removedIds']){const _0x3d1df3=Dt('data-id',_0x273366,_0x5e0061);if(_0x3d1df3){if(_0xa6227e&&_0xa6227e['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x273366;const _0x48ca12=_0xa6227e['replaceRemovedWith']['cloneNode'](!0x0);Ji(_0x48ca12,'data-id',_0x273366),Ji(_0x48ca12,'data-removed','true'),_0x53ed79(_0x3d1df3,_0x48ca12);}else _0x40dbe2(_0x3d1df3);}}if(Xe('data-wrapped-id',null,_0x5e0061)['forEach'](_0x5c352d=>{const _0x2672c1=Dt('data-id',Et(_0x5c352d,'data-wrapped-id'),_0x5e0061);var _0x28108c,_0x1266f7;_0x2672c1&&(_0x1266f7=_0x5c352d,_0x40dbe2(_0x28108c=_0x2672c1),_0x53ed79(_0x1266f7,_0x28108c));}),Xe('data-id','new-element',_0x5e0061)['forEach'](_0x2d2b4a=>{const _0x1afe4b=this['_getUid'](_0x2d2b4a);Ji(_0x2d2b4a,'data-id',_0x1afe4b),this['_touchedNodesState']['newIds']['push'](_0x1afe4b);}),this['_removeSpecialComments'](_0x5e0061),_0xa6227e&&_0xa6227e['markUnstableElements']&&this['_markUnstableElements'](_0x5e0061,_0xa6227e['markUnstableElementsDepth']||0x0),_0xa6227e&&_0xa6227e['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x24aa84=Dt('data-id',this['_touchedNodesState']['lastTouchedId'],_0x5e0061);for(;_0x24aa84;)$i(_0x24aa84),_0x24aa84=_0x24aa84['parentNode'];}return{'parsedContent':_0x5e0061,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x221dbd,_0x36e9ea,_0x254e1e){for(const _0xa03c68 of _0x36e9ea){const _0x11f02c=this['_getUid'](_0xa03c68);Ji(_0xa03c68,'data-id',_0x11f02c),this['_touchedNodesState']['newIds']['push'](_0x11f02c),this['_touchedNodesState']['lastTouchedId']=_0x11f02c;}const _0x3eddc9='afterbegin'===_0x254e1e||'afterend'===_0x254e1e?_0x36e9ea['reverse']():_0x36e9ea;for(const _0x3a289a of _0x3eddc9)Bi(_0x221dbd,_0x3a289a,_0x254e1e);}['_replaceNode'](_0x192c01,_0x1360d2){if(!_0x192c01)return;if(_0x189b89=_0x1360d2,Jn(St(_0x192c01))===Jn(St(_0x189b89)))return;var _0x189b89;const _0x575b23=this['_getUid'](_0x192c01);Ji(_0x1360d2,'data-id',_0x575b23),this['_touchedNodesState']['modifiedIds']['push'](_0x575b23),this['_touchedNodesState']['lastTouchedId']=_0x575b23,_0x53ed79(_0x192c01,_0x1360d2['cloneNode'](!0x0));}['_findReferenceNode'](_0x3f95c4,_0x235f4a,_0x35733b){const _0x53afe4=this['_findPrevElementWithDataId'](_0x3f95c4,!0x1);if(_0x53afe4){const _0x59d7a2=this['_getNodeDataId'](_0x53afe4),_0x3c6df8=Dt('data-id',_0x59d7a2,_0x35733b);if(_0x3c6df8)return[_0x3c6df8,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x59d7a2);}const _0x27d7c2=this['_findNextElementWithDataId'](_0x3f95c4,!0x1);if(_0x27d7c2){const _0x183204=this['_getNodeDataId'](_0x27d7c2),_0x2bac86=Dt('data-id',_0x183204,_0x35733b);if(_0x2bac86)return[_0x2bac86,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x183204);}return _0x235f4a?_0x3f95c4['nextSibling']?this['_findFallbackReferenceNode'](_0x3f95c4,_0x35733b):[_0x35733b['childNodes'][_0x35733b['childNodes']['length']-0x1],'afterend']:[_0x35733b['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x1b58b9,_0x199752){const _0x27758e=[],_0x41c7d1=this['_findPrevElementWithDataId'](_0x1b58b9,!0x0);if(_0x41c7d1){const _0x4c6d05=Dt('data-id',this['_getNodeDataId'](_0x41c7d1),_0x199752);_0x4c6d05&&_0x27758e['push']([_0x4c6d05,'afterend']);}const _0x7521eb=this['_findNextElementWithDataId'](_0x1b58b9,!0x0);if(_0x7521eb){const _0x1c1d0e=Dt('data-id',this['_getNodeDataId'](_0x7521eb),_0x199752);_0x1c1d0e&&_0x27758e['push']([_0x1c1d0e,'beforebegin']);}if(_0x27758e['length']>0x1)return Xi(_0x27758e[0x0][0x0])<=Xi(_0x27758e[0x1][0x0])?_0x27758e[0x0]:_0x27758e[0x1];return 0x1===_0x27758e['length']?_0x27758e[0x0]:[_0x199752['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x245944,_0xbb0ff1){let _0x5e1149=_0x245944['nextSibling'],_0x30464b=null,_0x3f6aa6=!0x1;for(;_0x5e1149;){if(_0x44d98b(_0x5e1149)){if(this['_isDelNode'](_0x5e1149)&&(_0x30464b=_0x5e1149),this['_isExistingContentComment'](_0x5e1149)&&_0xbb0ff1&&!_0x3f6aa6){_0x3f6aa6=!0x0,_0x5e1149=_0x5e1149['nextSibling'];continue;}break;}const _0x3b8c19=Et(_0x5e1149,'data-id');if(_0x3b8c19&&'new-element'!==_0x3b8c19&&this['_existingDataIds']['has'](_0x3b8c19)){_0x30464b=_0x5e1149;break;}_0x5e1149=_0x5e1149['nextSibling'];}return _0x30464b;}['_findPrevElementWithDataId'](_0x3d5f3a,_0x194fe){let _0x49b552=_0x3d5f3a['previousSibling'],_0x3bf854=null,_0x6f5951=!0x1;for(;_0x49b552;){if(_0x44d98b(_0x49b552)){if(this['_isDelNode'](_0x49b552)&&(_0x3bf854=_0x49b552),this['_isExistingContentComment'](_0x49b552)&&_0x194fe&&!_0x6f5951){_0x6f5951=!0x0,_0x49b552=_0x49b552['previousSibling'];continue;}break;}const _0x573919=Et(_0x49b552,'data-id');if(_0x573919&&'new-element'!==_0x573919&&this['_existingDataIds']['has'](_0x573919)){_0x3bf854=_0x49b552;break;}_0x49b552=_0x49b552['previousSibling'];}return _0x3bf854;}['_markWrappedElements'](_0x3f7b8f){_0xf0837b(_0x3f7b8f)&&Xe('data-id',null,_0x3f7b8f)['forEach'](_0x3e04e7=>{this['_isExistingNode'](_0x3e04e7)&&!this['_hasWrappedParent'](_0x3e04e7)&&(Ji(_0x3e04e7,'data-wrapped-id',Et(_0x3e04e7,'data-id')),Ji(_0x3e04e7,'data-id',null));});}['_getNodeDataId'](_0x4ec1e2){if(!_0x4ec1e2)return null;if(_0xf0837b(_0x4ec1e2))return Et(_0x4ec1e2,'data-id');if(_0x44d98b(_0x4ec1e2)){const _0xd75bc5=St(_0x4ec1e2)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0xd75bc5&&_0xd75bc5[0x1])return _0xd75bc5[0x1];}return null;}['_storeDeletedElementIds'](_0x1defd6){if(_0x44d98b(_0x1defd6)){const _0xc7f417=St(_0x1defd6)['match'](/removed[\s*-]data-id="([^"]+)"/);_0xc7f417&&_0xc7f417[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0xc7f417[0x1]);}}['_getUid'](_0x4d1190){return this['_isExistingNode'](_0x4d1190)?Et(_0x4d1190,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x12a6e6){(function(_0x2bf5fc){return _0x24523c(_0x3da84f=>_0x44d98b(_0x3da84f),_0x2bf5fc,!0x0,0x1/0x0);}(_0x12a6e6)['filter'](_0x3de4b4=>this['_isDelNode'](_0x3de4b4)||this['_isExistingContentComment'](_0x3de4b4))['forEach'](_0x3de0b8=>{_0x40dbe2(_0x3de0b8);}));}['_markLastTagElementUnstable'](_0x1677e8){const _0x43f79a=_0x1677e8['childNodes'],_0x48e3cc=_0x43f79a[_0x43f79a['length']-0x1];_0x48e3cc&&_0xf0837b(_0x48e3cc)&&Ji(_0x48e3cc,'data-unstable','true');}['_markUnstableElements'](_0x51e17f,_0x33cf73){const _0x4d6394=Dt('data-unstable','true',_0x51e17f);if(!_0x4d6394)return;const _0x22ca4c=qe(_0x4d6394)['slice'](0x0,-0x1),_0x1c4131=_0x22ca4c['length'];let _0x15a61f=_0x4d6394;if(_0x1c4131>_0x33cf73){let _0x585458=_0x1c4131,_0x6737f1=null;for(;_0x585458>_0x33cf73&&_0x585458>=0x0;)_0x585458--,_0x6737f1=_0x22ca4c[_0x585458];_0x6737f1&&(_0x15a61f=_0x6737f1,Ji(_0x4d6394,'data-unstable',null),Ji(_0x6737f1,'data-unstable','true'));}else{if(_0x1c4131<_0x33cf73){let _0x2c0525=_0x1c4131,_0xc0a4f8=_0x4d6394;for(;_0x2c0525<_0x33cf73;){const _0x2f5081=_0xc0a4f8['childNodes']['filter'](_0x458a29=>_0xf0837b(_0x458a29));if(0x0===_0x2f5081['length'])break;_0x2c0525++,_0xc0a4f8=_0x2f5081[_0x2f5081['length']-0x1];}_0xc0a4f8&&(_0x15a61f=_0xc0a4f8,Ji(_0x4d6394,'data-unstable',null),Ji(_0xc0a4f8,'data-unstable','true'));}}let _0xdd27b2=_0x15a61f;for(;_0xdd27b2;){for(;_0xdd27b2['nextSibling'];)_0xdd27b2=_0xdd27b2['nextSibling'],_0xf0837b(_0xdd27b2)&&Ji(_0xdd27b2,'data-unstable','true');_0xdd27b2=_0xdd27b2['parentNode'];}}['_isNewNode'](_0x23a4f0){return Boolean('new-element'===Et(_0x23a4f0,'data-id'));}['_isExistingNode'](_0x4378e7){return Boolean((Et(_0x4378e7,'data-id')||'')['length']>0x0&&'new-element'!==Et(_0x4378e7,'data-id'));}['_isDelNode'](_0x3923d5){return!!_0x3923d5&&Boolean(_0x44d98b(_0x3923d5)&&St(_0x3923d5)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x42ee14){let _0x763ce5=_0x42ee14['parentNode'];for(;_0x763ce5;){if(Et(_0x763ce5,'data-wrapped-id'))return!0x0;_0x763ce5=_0x763ce5['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x198bd6){return Boolean(_0x44d98b(_0x198bd6)&&St(_0x198bd6)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function W({editor:_0x5c1fe3,changeGroups:_0x2e98d3,documentContextContent:_0x35d440,showDiff:_0x543cb6,trimUnchanged:_0x20a172=!0x0}){return _0x2e98d3['map'](_0x597b60=>{const _0x7e4434=new Rt([]),_0x960ca=new Rt([]);for(const _0x2f7155 of _0x597b60['changes'])if(_0x543cb6&&'removed'==_0x2f7155['type']||_0x960ca['children']['push'](_0x2f7155['node']['cloneNode'](!0x0)),'new'!=_0x2f7155['type']&&(_0x543cb6||'removed'!=_0x2f7155['type'])){const _0x33e80c=wt(_0x7fde95=>Et(_0x7fde95,'data-id')==_0x2f7155['id'],_0x35d440,!0x0);_0x33e80c&&_0x7e4434['children']['push'](_0x33e80c['cloneNode'](!0x0));}const {content:_0x3ca871,hasChanges:_0xc98bbb}=function(_0x10f713,_0x913ef4,_0x559ef1,_0x20d85f,_0x59d844=!0x0){const _0x101c8c=_0x10f713['plugins']['get']('DocumentCompare'),_0x4b3c0a=St(_0x913ef4),_0x11e052=St(_0x559ef1),_0x543a97=_0x10f713['data']['parse'](_0x4b3c0a,'$root'),_0x12d625=_0x10f713['model']['createPositionAt'](_0x543a97,0x0),_0x1b96ce=_0x101c8c['getDiff'](_0x4b3c0a,_0x11e052,{'anchor':_0x12d625,'markDeletions':_0x20d85f}),_0x23eb22=_0x1b96ce['getOperations']();if(0x0==_0x23eb22['length'])return{'content':_0x913ef4['cloneNode'](!0x0),'hasChanges':!0x1};_0x20d85f?function(_0x462728,_0x10010a,_0x5c7e3e){if(0x0==_0x462728['length'])return;const _0x39f74f=_0x5c7e3e['plugins']['get']('DocumentCompare'),_0x342c45=_0x5c7e3e['plugins']['get']('SuggestionsConversion');_0x5c7e3e['model']['change'](_0x51ff6b=>{const _0x18090a=new Set();for(let _0x7a5728=0x0;_0x7a5728<_0x462728['length'];_0x7a5728++){const _0x2402ae=_0x462728[_0x7a5728];if(_0x2402ae['baseVersion']=null,_0x2402ae['isDocumentOperation']=!0x1,_0x39f74f['isMarkedRemoveOperation'](_0x2402ae)){const _0x4f64b4=_0x34d451(_0x2402ae['newRange'],_0x5c7e3e['model']),_0x56fd1d='suggestion:deletion:'+_0x4237d5()+':$aiSuggestion';_0x10010a['markers']['set'](_0x56fd1d,_0x4f64b4);}else switch(_0x2402ae['type']){case'rename':{if(_0x2402ae['oldName']==_0x2402ae['newName'])break;_0x51ff6b['batch']['addOperation'](_0x2402ae),_0x5c7e3e['model']['applyOperation'](_0x2402ae);const _0x2e73a1='$elementName',_0x3a44b4=_0x2402ae['position'],_0x4825aa=_0x5c7e3e['model']['createRange'](_0x3a44b4,_0x5c7e3e['model']['createPositionAt'](_0x3a44b4['nodeAfter'],'end')),_0x5efc2b='suggestion:attribute:'+_0x2e73a1+':'+_0x4237d5()+':$aiSuggestion';_0x10010a['markers']['set'](_0x5efc2b,_0x4825aa);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x2402ae['oldValue']==_0x2402ae['newValue'])break;_0x51ff6b['batch']['addOperation'](_0x2402ae),_0x5c7e3e['model']['applyOperation'](_0x2402ae);const _0x2c7a8e=_0x2402ae['key'];if(!_0x342c45['isRegisteredAttribute'](_0x2c7a8e))break;const _0x3a4af4=_0x34d451(_0x2402ae['range'],_0x5c7e3e['model']),_0x3b18e1='suggestion:attribute:'+_0x2c7a8e+':'+_0x4237d5()+':$aiSuggestion';_0x10010a['markers']['set'](_0x3b18e1,_0x3a4af4);break;}case'insert':{_0x51ff6b['batch']['addOperation'](_0x2402ae),_0x5c7e3e['model']['applyOperation'](_0x2402ae);if(_0x462728[_0x7a5728+0x1]&&'move'==_0x462728[_0x7a5728+0x1]['type']){ro(_0x10010a,_0x2402ae);break;}const _0xca1353=_0x2402ae['position'],_0x21d3e0=_0x2402ae['howMany'],_0x4f4f07=_0x34d451(_0x5c7e3e['model']['createRange'](_0xca1353,_0xca1353['getShiftedBy'](_0x21d3e0)),_0x5c7e3e['model']),_0x53a0c7='suggestion:insertion:'+_0x4237d5()+':$aiSuggestion';_0x10010a['markers']['set'](_0x53a0c7,_0x4f4f07);break;}case'split':{_0x51ff6b['batch']['addOperation'](_0x2402ae),_0x5c7e3e['model']['applyOperation'](_0x2402ae);const _0x121936=_0x2402ae['splitPosition'],_0x2c8711=_0x2402ae['moveTargetPosition'],_0x11ed15=_0x5c7e3e['model']['createRange'](_0x121936,_0x2c8711),_0x486731='suggestion:insertion:'+_0x4237d5()+':$aiSuggestion';_0x10010a['markers']['set'](_0x486731,_0x11ed15);break;}case'move':{_0x51ff6b['batch']['addOperation'](_0x2402ae),_0x5c7e3e['model']['applyOperation'](_0x2402ae),_0x462728[_0x7a5728-0x1]&&'insert'==_0x462728[_0x7a5728-0x1]['type']&&ro(_0x10010a,_0x2402ae);const _0x583bef=_0x2402ae['getMovedRangeStart'](),_0x5de0b3=_0x2402ae['howMany'];for(let _0x29ef14=0x0;_0x29ef14<_0x5de0b3;_0x29ef14++){const _0x2683a6=_0x583bef['getShiftedBy'](_0x29ef14)['nodeAfter'];_0x18090a['add'](_0x2683a6);}break;}case'remove':{const _0x5a66e2=_0x2402ae['sourcePosition'],_0x34638e=_0x2402ae['howMany'],_0x38288e=new tt(_0x5a66e2,_0x34638e);_0x51ff6b['batch']['addOperation'](_0x38288e),_0x5c7e3e['model']['applyOperation'](_0x38288e);break;}}}for(const _0x5f56b3 of _0x18090a){const _0x4e6f5a=_0x5c7e3e['model']['createRangeOn'](_0x5f56b3),_0x3203ad='suggestion:formatBlock:$fakeWrap:'+_0x4237d5()+':$aiSuggestion';_0x10010a['markers']['set'](_0x3203ad,_0x34d451(_0x4e6f5a,_0x5c7e3e['model']));}});}(_0x23eb22,_0x543a97,_0x10f713):_0x10f713['model']['change'](_0x57f04b=>{for(const _0x131f02 of _0x23eb22)if('remove'==_0x131f02['type']){const _0x4fca1f=_0x131f02['sourcePosition'],_0x41de5b=_0x131f02['howMany'],_0x18cc15=new tt(_0x4fca1f,_0x41de5b);_0x57f04b['batch']['addOperation'](_0x18cc15),_0x10f713['model']['applyOperation'](_0x18cc15);}else{if('marker'==_0x131f02['type']){const _0x2c98eb=_0x131f02['name'],_0x329dd4=_0x131f02['newRange'];_0x543a97['markers']['set'](_0x2c98eb,_0x329dd4);}else _0x131f02['baseVersion']=null,_0x131f02['isDocumentOperation']=!0x1,_0x57f04b['batch']['addOperation'](_0x131f02),_0x10f713['model']['applyOperation'](_0x131f02);}});if(_0x59d844){const _0xd5a212=vt(_0x10f713,_0x23eb22,_0x543a97);At(_0x10f713['model'],_0xd5a212),function(_0x4e75b3,_0x49ef2b){const _0x562156=_0x49ef2b['getFirstRange']()['start'];let _0x109c55=_0x49ef2b['getFirstRange']()['end'];const _0x6c7797=_0x562156['root'];(_0x109c55['textNode']||_0x109c55['nodeAfter']&&_0x109c55['nodeAfter']['is']('$text'))&&(_0x5f381e(_0x109c55,'...'),_0x109c55=_0x109c55['getShiftedBy'](0x3)),(_0x562156['textNode']||_0x562156['nodeBefore']&&_0x562156['nodeBefore']['is']('$text'))&&(_0x5f381e(_0x562156,'...'),function(_0x1a93ce,_0x5ab0e4,_0x4ece55){for(let [_0x307201,_0x25d39a]of _0x1a93ce['markers']){const _0x466957=_0x25d39a['_getTransformedByInsertion'](_0x5ab0e4,_0x4ece55,!0x1);_0x25d39a=_0x466957[0x0],_0x1a93ce['markers']['set'](_0x307201,_0x25d39a);}}(_0x6c7797,_0x562156,0x3),_0x562156['parent']==_0x109c55['parent']&&(_0x109c55=_0x109c55['getShiftedBy'](0x3)));const _0x544152=_0x4e75b3['createRange'](_0x4e75b3['createPositionAt'](_0x6c7797,0x0),_0x562156),_0xab2afd=_0x4e75b3['createRange'](_0x109c55,_0x4e75b3['createPositionAt'](_0x6c7797,'end')),_0x51cc74=[..._0x544152['getMinimalFlatRanges'](),..._0xab2afd['getMinimalFlatRanges']()];_0x51cc74['reverse']();for(const _0x2170f7 of _0x51cc74)_0x555785(_0x2170f7),Zn(_0x6c7797,_0x2170f7);}(_0x10f713['model'],_0xd5a212);}const _0x17f046=_0x10f713['data']['stringify'](_0x543a97,{'showSuggestionHighlights':!0x0});return{'content':ze(_0x17f046),'hasChanges':!0x0};}(_0x5c1fe3,_0x7e4434,_0x960ca,_0x543cb6,_0x20a172);return{'type':_0x597b60['changes'][0x0]['type'],'index':_0x597b60['index'],'content':_0x3ca871,'hasChanges':_0xc98bbb};});}function ro(_0x34607d,_0x165003){for(const [_0x559d65,_0x11a462]of _0x34607d['markers']){const _0x24c655=_0x10f501['_createFromRanges'](_0x11a462['getTransformedByOperation'](_0x165003));_0x34607d['markers']['set'](_0x559d65,_0x24c655);}}function vt(_0x169fb1,_0x5918af,_0x546bdb){const _0x1b73ea=_0x169fb1['plugins']['get']('DocumentCompare');let _0x4dce41=_0x169fb1['model']['createPositionAt'](_0x546bdb,Number['POSITIVE_INFINITY']),_0x4d0b35=_0x169fb1['model']['createPositionAt'](_0x546bdb,0x0);for(const _0x971011 of _0x5918af){let _0x1eac7b,_0x366190;if(_0x1b73ea['isMarkedRemoveOperation'](_0x971011))_0x1eac7b=_0x971011['newRange']['start'],_0x366190=_0x971011['newRange']['end'];else switch(_0x4dce41=_0x4dce41['getTransformedByOperation'](_0x971011),_0x4d0b35=_0x4d0b35['getTransformedByOperation'](_0x971011),_0x971011['type']){case'rename':_0x1eac7b=_0x971011['position'],_0x366190=_0x1eac7b['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x1eac7b=_0x971011['range']['start'],_0x366190=_0x971011['range']['end'];break;case'insert':_0x1eac7b=_0x971011['position'],_0x366190=_0x1eac7b['getShiftedBy'](_0x971011['howMany']);break;case'split':_0x1eac7b=_0x971011['splitPosition'],_0x366190=_0x971011['moveTargetPosition'];break;case'merge':{const _0x53df08=_0x971011['targetPosition']['path']['slice'](0x0,-0x1);_0x1eac7b=_0x169fb1['model']['createPositionFromPath'](_0x546bdb,_0x53df08),_0x366190=_0x1eac7b['getShiftedBy'](0x1);break;}case'remove':{const _0x338b9c=_0x971011['howMany'],_0x599269=_0x971011['sourcePosition']['_getTransformedByInsertion'](_0x971011['targetPosition'],_0x338b9c),_0x5ef3d7=_0x971011['getMovedRangeStart']();'remove'==_0x971011['type']?(_0x1eac7b=_0x599269,_0x366190=_0x599269):(_0x1eac7b=_0x5ef3d7,_0x366190=_0x5ef3d7['getShiftedBy'](_0x338b9c));break;}}_0x1eac7b&&_0x1eac7b['isBefore'](_0x4dce41)&&(_0x4dce41=_0x1eac7b['clone'](),_0x4dce41['stickiness']='toNone'),_0x366190&&_0x366190['isAfter'](_0x4d0b35)&&(_0x4d0b35=_0x366190['clone'](),_0x4d0b35['stickiness']='toNone');}return _0x169fb1['model']['createSelection'](_0x169fb1['model']['createRange'](_0x4dce41,_0x4d0b35));}function At(_0x5a67de,_0x5bdf11){so(_0x5a67de,_0x5bdf11,'forward');const _0x2a5e25=_0x5bdf11['getFirstRange']();_0x5bdf11['setTo']([]),_0x5bdf11['setTo'](_0x2a5e25,{'backward':!0x0}),so(_0x5a67de,_0x5bdf11,'backward');}function so(_0x171de5,_0x59eda2,_0x2cfca7){let _0x5caa86=0x14;for(;_0x5caa86;){_0x171de5['modifySelection'](_0x59eda2,{'unit':'word','direction':_0x2cfca7}),_0x5caa86--;const _0xc02b7f=_0x59eda2['focus']['forward'==_0x2cfca7?'nodeBefore':'nodeAfter'];if(_0xc02b7f&&_0xc02b7f['is']('element')&&_0x171de5['schema']['isBlock'](_0xc02b7f)&&_0x171de5['schema']['isObject'](_0xc02b7f))break;}}function Zn(_0x2ce2c3,_0x5485ed){for(const [_0x40091f,_0x516fff]of _0x2ce2c3['markers']){const _0x3d0ada=_0x516fff['_getTransformedByDeletion'](_0x5485ed['start'],_0x5485ed['end']['offset']-_0x5485ed['start']['offset']);null!=_0x3d0ada?_0x2ce2c3['markers']['set'](_0x40091f,_0x3d0ada):_0x2ce2c3['markers']['delete'](_0x40091f);}}const Ur=['modification-delta','text-delta','web-search','reasoning'],Wr=['conversation-title'];class ke extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new Rt([]);['parsedMergedContent']=new Rt([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0xcf764b,content:_0x3de71a='',isDone:_0x21474a=!0x1,interactionId:_0x4c7c7d,areActionsDisabled:_0x200a2b,documentContextContent:_0xedc0be,editor:_0x945517,id:_0x42d320}){super(),this['id']=_0x42d320||_0x4237d5(),this['interactionId']=_0x4c7c7d,this['type']=_0xcf764b,this['areActionsDisabled']=!!_0x200a2b,this['editor']=_0x945517,this['aiResponseParser']=new Je(),this['aiResponseApplier']=new Ke(),this['documentContextContent']=ze(_0xedc0be||''),this['set']('isDone',_0x21474a),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x3de71a);}['appendContent'](_0x501569){this['set']('content',this['content']+_0x501569);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0xf0a0cb,_0x3cdb19){this['changeGroups'][_0xf0a0cb]['state']=_0x3cdb19,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0xf0a0cb,'state':_0x3cdb19});}['getContentParts']({showDiff:_0x4d558a,groupIndex:_0x3d0031}){if(!this['editor'])throw new _0x2520c7('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0xe9ff11=this['_getCachedContentParts'](_0x4d558a,_0x3d0031);if(_0xe9ff11)return _0xe9ff11;let _0x5cf8fe=[];if(void 0x0===_0x3d0031)_0x5cf8fe=this['changeGroups'];else{const _0x5d5d40=this['changeGroups']['find'](({index:_0x21259d})=>_0x21259d===_0x3d0031);if(!_0x5d5d40)throw new _0x2520c7('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x3d0031});_0x5cf8fe=[_0x5d5d40];}const _0x1fca8c=W({'editor':this['editor'],'showDiff':_0x4d558a,'changeGroups':_0x5cf8fe,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x4d558a,_0x1fca8c),_0x1fca8c;}['_getCachedContentParts'](_0x119ede,_0x793895){const _0x58882a=_0x119ede?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x58882a]['length'])return null;const _0x5ec8a3=this['cachedSuggestionContentParts'][_0x58882a];if(void 0x0===_0x793895)return _0x38ac24(_0x5ec8a3);{const _0x1fc313=_0x5ec8a3['find'](({index:_0x4399c3})=>_0x4399c3===_0x793895);if(_0x1fc313)return[_0x38ac24(_0x1fc313)];}return null;}['_setCachedContentParts'](_0x57c42b,_0x5ef415){const _0x23ee91=_0x57c42b?'withDiff':'withoutDiff';_0x5ef415['forEach'](_0x1a343f=>{const _0x3acef3=this['cachedSuggestionContentParts'][_0x23ee91],_0x373366=_0x3acef3['find'](({index:_0x4485ee})=>_0x4485ee===_0x1a343f['index']);if(_0x373366){const _0x555df4=_0x3acef3['indexOf'](_0x373366);_0x3acef3['splice'](_0x555df4,0x1,_0x1a343f);}else _0x3acef3['push'](_0x1a343f);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x2d717a=this['changeGroups'];this['updateChangeGroups']();const _0x53ed55=this['_getDifferentChangeGroups'](_0x2d717a,this['changeGroups']);(_0x53ed55['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x53ed55),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x5b26ac,_0x32d293){const _0x5e6646=[];for(const _0x192085 of _0x32d293){const _0x2d963f=_0x5b26ac[_0x192085['index']];_0x2d963f?_0x2d963f['changes']['length']!==_0x192085['changes']['length']?_0x5e6646['push'](_0x192085):_0x2d963f['changes']['forEach']((_0x34e418,_0x3bdf5a)=>{const _0x5ebf7e=_0x192085['changes'][_0x3bdf5a];_0x34e418['id']!==_0x5ebf7e['id']&&_0x5e6646['push'](_0x192085);}):_0x5e6646['push'](_0x192085);}return _0x5e6646;}['updateChangeGroups'](){const _0x4c1c34=new _0x245d41('p',{},[new _0x245d41('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x106f4b(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x2d8626=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x4c1c34,'cutAfterLastChange':!this['isDone']});if(!_0x2d8626['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x2d8626['parsedContent'];let _0x49e3da=[];if(_0x2c33af(_0x2691f7=>{const _0x2c3c1a=Et(_0x2691f7,'data-id');if(!_0x2c3c1a||!_0x2b97e9(_0x2c3c1a))return!0x1;const _0x1da792=[_0x2691f7,...qe(_0x2691f7)]['at'](-0x2);if(_0x2691f7!=_0x1da792){const _0x18baa8=Et(_0x1da792,'data-id');_0x2b97e9(_0x18baa8)||(_0x49e3da['push']({'node':_0x1da792,'id':_0x18baa8,'type':'modified'}),_0x2d8626['modifiedNodeIds']['push'](_0x18baa8));}else _0x2d8626['modifiedNodeIds']['includes'](_0x2c3c1a)?_0x49e3da['push']({'node':_0x2691f7,'type':'modified','id':_0x2c3c1a}):_0x2d8626['newNodeIds']['includes'](_0x2c3c1a)?_0x49e3da['push']({'node':_0x2691f7,'type':'new','id':_0x2c3c1a,'anchorId':Et(_0x2691f7['previousSibling'],'data-id')}):_0x49e3da['push']({'node':_0x2691f7,'type':'removed','id':_0x2c3c1a});return!0x0;},this['parsedMergedContent']),_0x49e3da=_0x49e3da['filter'](({node:_0x4cae70})=>[...qe(_0x4cae70),_0x4cae70]['every'](_0x24e0eb=>!Et(_0x24e0eb,'data-unstable'))),0x0==_0x49e3da['length'])return;const _0x2ee0ad=[[_0x49e3da[0x0]]];for(let _0x3d0d3b=0x1;_0x3d0d3b<_0x49e3da['length'];_0x3d0d3b++){const _0x24999c=_0x2ee0ad[_0x2ee0ad['length']-0x1],_0x152e03=_0x24999c[_0x24999c['length']-0x1];_0x49e3da[_0x3d0d3b]['node']['previousSibling']==_0x152e03['node']&&'modified'!=_0x49e3da[_0x3d0d3b]['type']&&'modified'!=_0x152e03['type']?_0x24999c['push'](_0x49e3da[_0x3d0d3b]):_0x2ee0ad['push']([_0x49e3da[_0x3d0d3b]]);}for(const _0x6d2c3e of _0x2ee0ad){const _0x29667a=_0x6d2c3e[0x0],_0x2dd91a=_0x6d2c3e[_0x6d2c3e['length']-0x1],_0x525e2f=_0x981388(_0x29667a['node']['previousSibling']);_0x525e2f&&_0x6d2c3e['unshift'](_0x525e2f);const _0x388488=_0x981388(_0x2dd91a['node']['nextSibling']);_0x388488&&_0x6d2c3e['push'](_0x388488);}function _0x2b97e9(_0x695067){return _0x2d8626['modifiedNodeIds']['includes'](_0x695067)||_0x2d8626['newNodeIds']['includes'](_0x695067)||_0x2d8626['removedNodeIds']['includes'](_0x695067);}function _0x981388(_0x2c5b88){if(_0x2c5b88&&Et(_0x2c5b88,'data-id')&&!Et(_0x2c5b88,'data-unstable')){const _0x1bf276=Et(_0x2c5b88,'data-id');if(!_0x2b97e9(_0x1bf276))return{'node':_0x2c5b88,'type':'context','id':_0x1bf276};}return null;}this['changeGroups']=_0x2ee0ad['map']((_0x1ab2b2,_0x1b51ae)=>({'changes':_0x1ab2b2,'state':'pending','index':_0x1b51ae}));}}function Ui(_0x4c6e60){return Object['values'](Ur)['includes'](_0x4c6e60);}function Fi(_0x489c82){return Wr['includes'](_0x489c82);}function qi(_0x393e46){return'conversation-title'===_0x393e46;}function zi(_0x593cf9){return'source'===_0x593cf9;}const je=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class xe extends _0x42ebaf(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x525d12,editor:_0xacd834}){super(),this['id']=_0x4237d5(),this['connector']=_0x525d12,this['isStopped']=!0x0,this['editor']=_0xacd834;}async['start'](){let _0x5ded8e;const _0xdea64f=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x72dc7c=await this['currentRequest']['getStream']();for await(const _0x45574c of _0x72dc7c){if(this['isStopped'])return;if('error'===_0x45574c['event'])return void this['fire']('error',{'error':new _0x2520c7('ai-chat-interaction-error',this)});if('message-metadata'!==_0x45574c['event']){if('action-metadata'!==_0x45574c['event']){if(qi(_0x45574c['event'])&&this['setConversationTitle'](_0x45574c['data']['conversationTitle'],!0x0),zi(_0x45574c['event']))_0xdea64f['push'](_0x45574c['data']['source']);else{if(Ui(_0x45574c['event'])){if(_0x45574c['event']!==_0x5ded8e){if(_0x5ded8e=_0x45574c['event'],'web-search'===_0x45574c['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x45574c['event']){this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));continue;}this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this)),this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this)),this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x45574c['event'],'interactionId':this['id'],'id':_0x45574c['data']?.['id']}),_0xdea64f['length']>0x0&&'modification-delta'===_0x45574c['event']&&(this['currentReply']['sources']=_0xdea64f['splice'](0x0));}_0x45574c['data']['textDelta']&&this['currentReply']['appendContent'](_0x45574c['data']['textDelta']);}else Fi(_0x45574c['event'])||_0x2db034('ai-interaction-invalid-event-type',{'chunk':_0x45574c});}}else this['actionCallId']=_0x45574c['data']['callId'];}else this['messageId']=_0x45574c['data']['messageId'];}}finally{this['isStopped']||(_0xdea64f['length']>0x0&&(this['currentReply']['sources']=_0xdea64f['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x1fea69){return this['replies']['find'](_0x9d46f4=>_0x9d46f4['id']===_0x1fea69);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x19a0ec=>_0x19a0ec['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x3db029){const _0x29f41b=new ke({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x3db029});return this['replies']['push'](_0x29f41b),_0x29f41b['delegate'](...je)['to'](this),this['fire']('replyCreated',_0x29f41b),_0x29f41b;}['setConversationTitle'](_0x28400c,_0x54980a=!0x1){this['fire']('setConversationTitle',_0x28400c,_0x54980a);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Ie=function(_0x18f21c){return _0x18f21c['FILE']='file',_0x18f21c['DOCUMENT']='document',_0x18f21c['URL']='web-resource',_0x18f21c['TEXT']='text',_0x18f21c['SELECTION']='selection',_0x18f21c;}({}),be=function(_0x2e2a49){return _0x2e2a49['TEXT']='text',_0x2e2a49['MARKDOWN']='markdown',_0x2e2a49['HTML']='html',_0x2e2a49;}({});const vi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class wi extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x3cf2ba,config:_0x5db67f,ownerId:_0x6375e1}){super(),this['_connector']=_0x3cf2ba,this['_config']=_0x5db67f,this['_ownerId']=_0x6375e1;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x39cde8){const _0x36f7ce=await this['_createContextItemFromContent'](_0x39cde8);return this['_addToConversationContextItem'](_0x36f7ce),'current-document'===_0x36f7ce['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x36f7ce;}async['_createContextItemFromContent'](_0x3658a3){if(_0x3658a3['type']===Ie['DOCUMENT']){const _0x490309=await this['_connector']['fetchDocument'](this['_ownerId'],_0x3658a3['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x3658a3['type'],'content':_0x490309['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x490309['attributes']?.['version'],'sessionId':_0x490309['attributes']?.['sessionId']};}return{'id':_0x3658a3['id'],'uiId':_0x3658a3['id'],'label':_0x3658a3['attributes']?.['label']||_0x3658a3['name']||_0x3658a3['url']||_0x3658a3['id'],'type':_0x3658a3['type'],..._0x3658a3?.['attributes']?.['resourceId']?{'resourceId':_0x3658a3['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x2441a6){const _0x25b688=this['_pendingContextItems']['get'](_0x2441a6);_0x25b688?.['isReadOnly']||this['_removeContextItem'](_0x2441a6);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x28903a of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x28903a['uiId']);const _0x3f088f=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x3f088f&&this['_addContextItem']({..._0x3f088f,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x4ed4f3){for(const _0x17df78 of _0x4ed4f3['values']())this['_addToConversationContextItem'](_0x17df78);this['clearPendingContextItems'](),this['fire']('contextSent',{'contextItems':Array['from'](this['getSentContextItems']()['values']())});}['isCurrentDocumentInContext'](){return this['_pendingContextItems']['has']('current-document');}['isSelectionInContext'](){return this['_pendingContextItems']['has']('selection');}['isCurrentDocumentInConversation'](){return this['_conversationContextItems']['has']('current-document');}static['mapContextItemsToRequestData'](_0x3bb124){return Array['from'](_0x3bb124['values']())['map'](_0x537a8d=>this['_mapContextItemToRequestData'](_0x537a8d))['filter'](_0x347b7f=>null!==_0x347b7f);}async['addFilesToContext'](_0x39aaa2,_0x184df1,_0x28c995=Ie['FILE']){const _0x336edc='files-'+_0x4237d5();this['_startUploadOperation'](_0x336edc);try{await Promise['all'](_0x39aaa2['map'](async _0x571460=>{const _0xfa80d7='file-'+_0x4237d5(),_0x302767=_0x2b58c0(_0x571460['name']);try{this['_addContextItem']({'type':_0x28c995,'label':_0x184df1?.['label']||_0x302767,'uiId':_0xfa80d7,'resourceId':_0x184df1?.['resourceId']},!0x0);const _0x18ba93=this['_connector']['uploadFile'](this['_ownerId'],_0x571460,_0x184df1);this['_ongoingUploads']['set'](_0xfa80d7,_0x18ba93['abortController']);const {id:_0x244b44}=await _0x18ba93['getId']();this['_ongoingUploads']['delete'](_0xfa80d7),this['_finishContextItemLoading']({'type':_0x28c995,'id':_0x244b44,'label':_0x184df1?.['label']||_0x302767,'uiId':_0xfa80d7,'resourceId':_0x184df1?.['resourceId']},!0x1);}catch(_0x237fe3){this['_ongoingUploads']['delete'](_0xfa80d7);if(!_0x237fe3['message']['startsWith']('ai-request-aborted')){const _0x2a32c0=new _0x2520c7('ai-chat-file-upload-failed',null,{'fileName':_0x302767});_0x2a32c0['stack']=_0x237fe3['stack'],this['fire']('error',{'error':_0x2a32c0,'fileName':_0x302767});}this['_removeContextItem'](_0xfa80d7);}}));}finally{this['_finishUploadOperation'](_0x336edc);}}['addCurrentDocumentToContext'](_0x3f1d37){if(this['isCurrentDocumentInContext']())return;const _0x17de69={'type':Ie['DOCUMENT'],'uiId':'current-document','label':_0x3f1d37,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x17de69);}async['updateCurrentDocument'](_0xe42ed5,_0x1f0650,_0x1bccc0,_0x51e237){const _0x2de08a=this['_pendingContextItems']['get']('current-document');if(_0x2de08a&&_0xe42ed5){_0x2de08a['selection']=_0x51e237?_0x51e237['map'](_0x15bb6=>({'start':_0x15bb6['start'],'end':_0x15bb6['end']})):[];try{if(_0x2de08a['version']===_0x1f0650)return;const {id:_0x166377}=await this['_connector']['uploadDocument'](this['_ownerId'],_0xe42ed5,{'version':_0x1f0650,'sessionId':_0x1bccc0})['getId']();_0x2de08a['id']=_0x166377,_0x2de08a['content']=_0xe42ed5,_0x2de08a['version']=_0x1f0650,_0x2de08a['sessionId']=_0x1bccc0;}catch(_0x332882){const _0x3fb528=new _0x2520c7('ai-chat-document-upload-failed',null);_0x3fb528['stack']=_0x332882['stack'],this['fire']('error',{'error':_0x3fb528});}}}['addSelectionToContext'](_0x280790){this['_addContextItem']({'type':Ie['SELECTION'],'label':_0x280790,'uiId':'selection','content':_0x280790});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x4f6168,_0x24cb93){const _0x1ef3d9='url-'+_0x4237d5();this['_startUploadOperation'](_0x1ef3d9);const _0x4fb7b6='url-'+_0x4237d5();try{this['_addContextItem']({'type':Ie['URL'],'label':_0x24cb93?.['label']||_0x4f6168,'uiId':_0x4fb7b6,'resourceId':_0x24cb93?.['resourceId']},!0x0);const _0x27ba4d=this['_connector']['uploadUrl'](this['_ownerId'],_0x4f6168,_0x24cb93);this['_ongoingUploads']['set'](_0x4fb7b6,_0x27ba4d['abortController']);const {id:_0x2c2645}=await _0x27ba4d['getId']();this['_ongoingUploads']['delete'](_0x4fb7b6),this['_finishContextItemLoading']({'type':Ie['URL'],'id':_0x2c2645,'label':_0x24cb93?.['label']||_0x4f6168,'uiId':_0x4fb7b6,'resourceId':_0x24cb93?.['resourceId']},!0x1);}catch(_0x26c2ef){this['_ongoingUploads']['delete'](_0x4fb7b6),(_0x26c2ef['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x2520c7('ai-chat-url-upload-failed',this,{'url':_0x4f6168,'originalError':_0x26c2ef}),'url':_0x4f6168}),this['_removeContextItem'](_0x4fb7b6));}finally{this['_finishUploadOperation'](_0x1ef3d9);}}async['loadSourceResources'](_0x157d6b,_0x325822,_0x4b4d31){const _0x28b031=this['_addContextOptionsState']['sources']['find'](_0x5b4893=>_0x5b4893['id']===_0x157d6b);if(!_0x28b031)return this['fire']('error',{'error':new _0x2520c7('ai-chat-source-not-found',this,{'sourceId':_0x157d6b}),'sourceId':_0x157d6b}),[];try{const _0x7255c9=(await _0x28b031['getResources'](_0x325822))['map'](_0x2a9575=>{const _0x3488b7=this['_isResourceInContext'](_0x2a9575['id']);return{..._0x2a9575,'isInContext':_0x3488b7};});return _0x28b031['resources']=_0x7255c9,this['fire']('sourceResourcesLoaded',{'sourceId':_0x157d6b,'source':_0x28b031,'resources':_0x7255c9,'uid':_0x4b4d31}),_0x7255c9;}catch(_0x85068d){return this['fire']('error',{'error':new _0x2520c7('ai-chat-source-resources-load-failed',this,{'sourceId':_0x157d6b,'originalError':_0x85068d}),'sourceId':_0x157d6b,'sourceLabel':_0x28b031['label']}),[];}}async['addResourceToContext'](_0x502f1f,_0x259c13){if(this['_isResourceInContext'](_0x259c13['id']))return;let _0x541ade=_0x259c13['data'];if(!_0x541ade&&_0x502f1f['getData'])try{_0x541ade=await _0x502f1f['getData'](_0x259c13['id']);}catch(_0x39cffb){return void this['fire']('error',{'error':new _0x2520c7('ai-chat-resource-load-failed',this,{'resourceId':_0x259c13['id'],'sourceId':_0x502f1f['id'],'originalError':_0x39cffb}),'resourceId':_0x259c13['id'],'sourceId':_0x502f1f['id']});}if(_0x541ade)switch(_0x259c13['type']){case Ie['URL']:if('string'!=typeof _0x541ade)return void this['fire']('error',{'error':new _0x2520c7('ai-chat-context-invalid-data',this,{'resourceId':_0x259c13['id'],'sourceId':_0x502f1f['id'],'expectedType':'string','actualType':typeof _0x541ade}),'resourceId':_0x259c13['id'],'sourceId':_0x502f1f['id']});await this['addUrlToContext'](_0x541ade,{'label':_0x259c13['label'],'resourceId':_0x259c13['id']});break;case Ie['FILE']:if(!(_0x541ade instanceof File))return void this['fire']('error',{'error':new _0x2520c7('ai-chat-context-invalid-data',this,{'resourceId':_0x259c13['id'],'sourceId':_0x502f1f['id'],'expectedType':'File','actualType':typeof _0x541ade}),'resourceId':_0x259c13['id'],'sourceId':_0x502f1f['id']});await this['addFilesToContext']([_0x541ade],{'label':_0x259c13['label'],'resourceId':_0x259c13['id']});break;case Ie['TEXT']:if('object'!=typeof _0x541ade||!('content'in _0x541ade)||!('type'in _0x541ade))return void this['fire']('error',{'error':new _0x2520c7('ai-chat-context-invalid-data',this,{'resourceId':_0x259c13['id'],'sourceId':_0x502f1f['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x541ade}),'resourceId':_0x259c13['id'],'sourceId':_0x502f1f['id']});_0x541ade=wi['_convertTextResourceToFile'](_0x541ade,_0x259c13['label']),await this['addFilesToContext']([_0x541ade],{'label':_0x259c13['label'],'resourceId':_0x259c13['id']},Ie['TEXT']);break;default:this['fire']('error',{'error':new _0x2520c7('ai-chat-context-unsupported-type',this,{'resourceId':_0x259c13['id'],'sourceId':_0x502f1f['id'],'resourceType':_0x259c13['type']}),'resourceId':_0x259c13['id'],'sourceId':_0x502f1f['id']});}else this['fire']('error',{'error':new _0x2520c7('ai-chat-resource-no-data',this,{'resourceId':_0x259c13['id'],'sourceId':_0x502f1f['id']}),'resourceId':_0x259c13['id'],'sourceId':_0x502f1f['id']});}static['_convertTextResourceToFile'](_0x47b1b3,_0x49cf54){switch(_0x47b1b3['type']){case be['MARKDOWN']:return new File([_0x47b1b3['content']],_0x49cf54,{'type':'text/markdown'});case be['HTML']:return new File([_0x47b1b3['content']],_0x49cf54,{'type':'text/html'});default:return new File([_0x47b1b3['content']],_0x49cf54,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x2b72e2){switch(_0x2b72e2['type']){case Ie['FILE']:return{'type':Ie['FILE'],'id':_0x2b72e2['id']};case Ie['URL']:return{'type':Ie['URL'],'id':_0x2b72e2['id']};case Ie['DOCUMENT']:return{'type':Ie['DOCUMENT'],'id':_0x2b72e2['id'],..._0x2b72e2['selection']?.['length']&&{'selection':_0x2b72e2['selection']}};case Ie['TEXT']:return{'type':Ie['FILE'],'id':_0x2b72e2['id']};default:return null;}}['_addContextItem'](_0xf84f16,_0x27c48a=!0x1){if(this['_pendingContextItems']['set'](_0xf84f16['uiId'],_0xf84f16),_0xf84f16['hidden']||this['fire']('contextItemAdded',{'contextItem':_0xf84f16,'isLoading':_0x27c48a}),'current-document'===_0xf84f16['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0xf84f16['resourceId']){const _0x3e70e0=this['_findSourceIdsByResourceId'](_0xf84f16['resourceId']);_0x3e70e0&&_0x3e70e0['forEach'](_0x1c5948=>{this['_updateResourceInContextState'](_0x1c5948,_0xf84f16['resourceId'],!0x0);});}}['_removeContextItem'](_0x5cfff8){const _0x24c319=this['_pendingContextItems']['get'](_0x5cfff8),_0x81df92=this['_ongoingUploads']['get'](_0x5cfff8);if(_0x81df92&&(_0x81df92['abort'](),this['_ongoingUploads']['delete'](_0x5cfff8)),_0x24c319?.['resourceId']){const _0x26a4c9=this['_findSourceIdsByResourceId'](_0x24c319['resourceId']);_0x26a4c9&&_0x26a4c9['forEach'](_0x2388dd=>{this['_updateResourceInContextState'](_0x2388dd,_0x24c319['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x5cfff8),this['fire']('contextItemRemoved',{'uiId':_0x5cfff8,'type':_0x24c319?.['type']}),'current-document'===_0x5cfff8&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x4b971e,_0x537b9d){if(this['_pendingContextItems']['has'](_0x4b971e['uiId'])&&(this['_pendingContextItems']['set'](_0x4b971e['uiId'],_0x4b971e),this['fire']('contextItemLoadingEnded',{'contextItem':_0x4b971e,'isLoading':_0x537b9d}),_0x4b971e['resourceId'])){const _0x316fce=this['_findSourceIdsByResourceId'](_0x4b971e['resourceId']);_0x316fce&&_0x316fce['forEach'](_0x5f2219=>{this['_updateResourceInContextState'](_0x5f2219,_0x4b971e['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x181d38){this['_conversationContextItems']['set'](_0x181d38['uiId'],_0x181d38);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x45133b=>({..._0x45133b,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x4c51a4=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x4c51a4,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x4e419f){for(const _0x102af0 of this['_pendingContextItems']['values']())if(_0x102af0['resourceId']===_0x4e419f)return!0x0;for(const _0x5f44a7 of this['_conversationContextItems']['values']())if(_0x5f44a7['resourceId']===_0x4e419f)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x3258e8){const _0x53ba31=[];for(const _0x248bc4 of this['_addContextOptionsState']['sources']){_0x248bc4['resources']['find'](_0x3ef041=>_0x3ef041['id']===_0x3258e8)&&_0x53ba31['push'](_0x248bc4['id']);}return 0x0===_0x53ba31['length']?null:_0x53ba31;}['_updateResourceInContextState'](_0x226ac9,_0x490e08,_0x30f07d){const _0x2af1bc=this['_addContextOptionsState']['sources']['find'](_0x3282e1=>_0x3282e1['id']===_0x226ac9);if(!_0x2af1bc)return;const _0x89d2d5=_0x2af1bc['resources']['find'](_0x1c3455=>_0x1c3455['id']===_0x490e08);_0x89d2d5&&(_0x89d2d5['isInContext']=_0x30f07d,this['fire']('resourceStateChanged',{'sourceId':_0x226ac9,'resourceId':_0x490e08,'isInContext':_0x30f07d}));}['_startUploadOperation'](_0xc5c33a){this['_ongoingUploadOperations']['set'](_0xc5c33a,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x8d7257){this['_ongoingUploadOperations']['delete'](_0x8d7257),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const fi=['capabilitiesUpdated'];class Ii extends _0x42ebaf(){['_isWebSearchEnabled'];['_isReasoningEnabled'];constructor(){super(),this['_isWebSearchEnabled']=!0x1,this['_isReasoningEnabled']=!0x1;}['init'](){this['reset']();}['reset'](){this['setWebSearch'](!0x1),this['setReasoning'](!0x1);}['getCapabilitiesConfig'](){return{'isWebSearchEnabled':this['_isWebSearchEnabled'],'isReasoningEnabled':this['_isReasoningEnabled']};}static['getCapabilitiesRequestData'](_0x396801){const _0x577f92={};return _0x396801&&_0x396801['isWebSearchEnabled']&&(_0x577f92['webSearch']={}),_0x396801&&_0x396801['isReasoningEnabled']&&(_0x577f92['reasoning']={}),_0x577f92;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x22d1ea){_0x22d1ea!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x22d1ea,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x2ca96f){_0x2ca96f!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x2ca96f,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ci extends xe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x3c99a3){super(_0x3c99a3),this['conversationId']=_0x3c99a3['conversationId'],this['contextItems']=_0x3c99a3['contextItems'],this['capabilities']=_0x3c99a3['capabilities'],this['userMessage']=_0x3c99a3['userMessage'],this['model']=_0x3c99a3['model'],this['quickActionData']=_0x3c99a3['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':wi['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ii['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class _t extends _0x42ebaf(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x318b8c){super(),this['options']=_0x318b8c,this['connector']=_0x318b8c['connector'],this['chatModels']=_0x318b8c['chatModels'],this['id']=_0x318b8c['conversationId'];}async['init'](_0x3fb001){try{this['chatContext']=new wi({'connector':this['connector'],'config':_0x3fb001,'ownerId':this['id']}),this['chatContext']['delegate'](...vi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ii(),this['chatCapabilities']['delegate'](...fi)['to'](this),this['chatCapabilities']['init']();const _0x4dbbd6=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x4dbbd6});const _0x121ba8=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x121ba8&&await this['setModel'](_0x121ba8);}catch(_0x5d38a9){const _0x3583ef=new _0x2520c7('ai-chat-conversation-init-failed',null,{'message':_0x5d38a9['message']});_0x3583ef['stack']=_0x5d38a9['stack'],this['fire']('error',{'error':_0x3583ef});}}async['start'](){if(this['isStarted'])throw new _0x2520c7('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x2520c7('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x52ddb6}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x52ddb6,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x35a49e){const _0x273c75=new _0x2520c7('ai-chat-conversation-start-failed',null,{'message':_0x35a49e['message']});_0x273c75['stack']=_0x35a49e['stack'],this['fire']('error',{'error':_0x273c75});}}async['load'](_0x1d7aa,_0x4efbef){try{const _0x33298a=await this['connector']['fetchConversation'](_0x1d7aa)['getConversation'](),_0x1ed9dc=await this['connector']['fetchConversationMessages'](_0x1d7aa)['getMessages'](),_0x18afc6=_0x1ed9dc[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x33298a['id'],'title'in _0x33298a?this['fire']('setConversationTitle',_0x33298a['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x5090c3=(await this['chatModels']['getAll']())['find'](_0x47c2e1=>_0x47c2e1['id']['toLowerCase']()===_0x18afc6['toLowerCase']());return this['selectedModel']=_0x5090c3,this['fire']('modelSelected',{'selectedModel':_0x5090c3,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x1ed9dc,_0x4efbef,_0x18afc6),this['currentInteraction']=void 0x0,this;}catch(_0x2e4efa){const _0x180756=new _0x2520c7('ai-chat-conversation-init-from-id-failed',null,{'message':_0x2e4efa['message'],'conversationId':_0x1d7aa});throw _0x180756['stack']=_0x2e4efa['stack'],this['fire']('error',{'error':_0x180756}),_0x180756;}}async['_processMessagesToInteractions'](_0x4b0f08,_0x249b55,_0x52f78b){let _0x318dcf;for(const _0x215657 of _0x4b0f08)if('user'===_0x215657['role']){const _0x3c1e08=await this['_extractContextItems'](_0x215657),_0x186ae4={'isReasoningEnabled':Object['hasOwn'](_0x215657['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x215657['capabilities'],'webSearch')};_0x318dcf=this['createInteraction']({'userMessage':_0x215657['prompt'],'contextItems':_0x3c1e08,'capabilities':_0x186ae4,'modelId':_0x52f78b,'quickActionData':_0x215657['attributes']?.['quickActionData']}),this['currentInteraction']=_0x318dcf,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x215657['role']&&_0x318dcf)for(const _0x2e4795 of _0x215657['content']){const _0x3b4e92='text'===_0x2e4795['type']?'text-delta':'modification-delta',_0x58c97a=_0x318dcf['getDocumentContext']()?.['sessionId']!==_0x249b55;_0x318dcf['currentReply']=_0x318dcf['createReply']({'type':_0x3b4e92,'isDone':!0x0,'interactionId':_0x318dcf['id'],'areActionsDisabled':_0x58c97a}),_0x318dcf['currentReply']['appendContent'](_0x2e4795['content']);}}}async['_extractContextItems'](_0xd66386){const _0x4c411f=new Map();if(!_0xd66386['content'])return _0x4c411f;for(const _0x322610 of _0xd66386['content']){const _0x196def=await this['chatContext']['populateFromMessage'](_0x322610);_0x196def&&_0x4c411f['set'](_0x196def['id'],_0x196def);}return _0x4c411f;}async['handleUserInteraction']({userMessage:_0x578358,quickActionData:_0x4235b7}){if(!this['isStarted'])throw new _0x2520c7('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x2520c7('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x5bdce2=this['chatContext']['getPendingContextItems'](),_0x3d3964=this['chatCapabilities']['getCapabilitiesConfig'](),_0x25083b=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x578358,'contextItems':_0x5bdce2,'capabilities':_0x3d3964,'modelId':_0x25083b,'quickActionData':_0x4235b7}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x537830){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x537830});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0xea6072,contextItems:_0x2594d1,capabilities:_0x2c071a,modelId:_0x32c758,quickActionData:_0x95dcaa}){const _0x2661f2=new Ci({'userMessage':_0xea6072,'contextItems':_0x2594d1,'capabilities':_0x2c071a,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x32c758,'quickActionData':_0x95dcaa});return _0x2661f2['delegate'](...je)['to'](this),this['interactions']['push'](_0x2661f2),this['fire']('interactionCreated',_0x2661f2),_0x2661f2;}['getInteraction'](_0xc62724){return this['interactions']['find'](_0x401ab2=>_0x401ab2['id']===_0xc62724);}['removeInteraction'](_0x3cff73){const _0xd86ae2=this['getInteraction'](_0x3cff73);_0xd86ae2&&(_0xd86ae2['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0xd86ae2),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x57cd1a){this['chatContext']['addCurrentDocumentToContext'](_0x57cd1a);}async['updateCurrentDocumentInContext']({content:_0x9ee66f,version:_0x4285b0,sessionId:_0x1e8b06,selections:_0x4edd78}){await this['chatContext']['updateCurrentDocument'](_0x9ee66f,_0x4285b0,_0x1e8b06,_0x4edd78);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x585be0){this['chatContext']['addSelectionToContext'](_0x585be0);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x58d661){this['chatContext']['addFilesToContext'](_0x58d661);}['addUrlToContext'](_0x2731e5){this['chatContext']['addUrlToContext'](_0x2731e5);}['addResourceToContext'](_0x21fde8,_0x4b9288){this['chatContext']['addResourceToContext'](_0x21fde8,_0x4b9288);}['loadSourceResources'](_0x2a0e9e,_0x436f35,_0x2152b1){return this['chatContext']['loadSourceResources'](_0x2a0e9e,_0x436f35,_0x2152b1);}['removeFromContext'](_0x3193f3){this['chatContext']['removeFromContext'](_0x3193f3);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x6cfad9){_0x6cfad9?!0x1===await this['chatModels']['isAvailable'](_0x6cfad9)&&(_0x2db034('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x6cfad9}),_0x6cfad9=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x2db034('ai-chat-conversation-set-model-null',{'conversation':this}),_0x6cfad9=(await this['chatModels']['getAvailableModels']())[0x0]),_0x6cfad9['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x6cfad9,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x6cfad9}));}}function ht(_0x26f09f){if(_0x26f09f instanceof pt)return _0x26f09f;if(_0x26f09f?.['editors']&&_0x26f09f['editors']['get'](0x0))return _0x26f09f['editors']['length']>0x1&&console['warn']('AIChat:\x20Multiple\x20editor\x20instances\x20detected.\x20Only\x20the\x20first\x20editor\x20instance\x20will\x20be\x20used\x20for\x20AI\x20operations.\x20This\x20configuration\x20is\x20not\x20fully\x20supported\x20and\x20may\x20lead\x20to\x20unexpected\x20behavior.'),_0x26f09f['editors']['get'](0x0);throw new _0x2520c7('ai-get-editor-from-context-no-editor');}const yt='ai-selection';class R extends ot{['_displayedFakeSelectionId']=null;['_displayedFakeSelectionLocked']=!0x1;['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x25d71a=ht(this['context']),_0xa1a510=_0x25d71a['plugins']['has']('RealTimeCollaborationClient')&&_0x25d71a['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0xa1a510||_0x4237d5();}return this['_sessionId'];}['getDocumentData'](){const _0x492504=ht(this['context']),_0x4ab549=_0x492504['model'],_0x5eb48b=_0x492504['data']['toView'](_0x4ab549['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x22ac36=new kt(_0x492504['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x5eb48b,_0x22ac36);let _0x6b612e=_0x492504['data']['processor']['toData'](_0x5eb48b);const _0x1be90e=this['_getMarkersInDocumentOrder'](),_0xcc7e31=[];for(const _0x5f3f7b of _0x1be90e){const _0x543839='<'+_0x5f3f7b['name']+':start></'+_0x5f3f7b['name']+':start>',_0x5bbc9a=_0x6b612e['indexOf'](_0x543839);_0x6b612e=_0x6b612e['substring'](0x0,_0x5bbc9a)+_0x6b612e['substring'](_0x5bbc9a+_0x543839['length']);const _0x4c9154='<'+_0x5f3f7b['name']+':end></'+_0x5f3f7b['name']+':end>',_0x543d2a=_0x6b612e['indexOf'](_0x4c9154);_0x6b612e=_0x6b612e['substring'](0x0,_0x543d2a)+_0x6b612e['substring'](_0x543d2a+_0x4c9154['length']),_0xcc7e31['push']({'markerName':_0x5f3f7b['name'],'start':_0x5bbc9a,'end':_0x543d2a,'htmlFragment':_0x6b612e['substring'](_0x5bbc9a,_0x543d2a)});}return{'content':_0x6b612e,'version':_0x492504['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0xcc7e31};}async['afterInit'](){this['context']instanceof pt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2485dd,_0x219654)=>{_0x219654['on']('ready',()=>{this['_integrateEditor'](_0x219654);});});}['_integrateEditor'](_0x8c986d){_0x8c986d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':yt,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x8c986d['conversion']['for']('dataDowncast')['markerToElement']({'model':yt,'view':(_0x231ebd,{writer:_0x1f5d67,options:_0x519f6d})=>_0x519f6d['convertAiChatSelectionMarker']?_0x1f5d67['createUIElement'](_0x231ebd['markerName']+':'+(_0x231ebd['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x470a5d,_0xb9698f,_0x9909d4=!0x1,_0x379e7c=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x379e7c)return!0x1;const _0x508bd2=ht(this['context'])['model'];return _0x508bd2['change'](_0x2fb94f=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0xb9698f,this['_displayedFakeSelectionLocked']=_0x9909d4;let _0x188828=0x0;for(let _0x2324cf of _0x470a5d){const _0x4e16bd=yt+':'+_0x188828;if(_0x2324cf['start']['isAtEnd']){const _0x2f1f99=_0x2324cf['start']['getLastMatchingPosition'](({item:_0x145aec})=>!_0x508bd2['schema']['isContent'](_0x145aec),{'boundaries':_0x2324cf});_0x2324cf=_0x2fb94f['createRange'](_0x2f1f99,_0x2324cf['end']);}_0x2fb94f['addMarker'](_0x4e16bd,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2324cf}),_0x188828++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x1b138c){if(this['_displayedFakeSelectionId']!=_0x1b138c)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x4673d5=ht(this['context']),_0x39e54a=_0x4673d5['model']['markers']['getMarkersGroup'](yt);return _0x4673d5['model']['change'](_0x39c74c=>{for(const _0x3e9c9a of _0x39e54a)_0x39c74c['removeMarker'](_0x3e9c9a);}),!0x0;}['modelToViewWithIds'](_0x170bb2){const _0x1a9194=ht(this['context']),_0x5db55e=_0x1a9194['data']['toView'](_0x170bb2),_0x15b682=new kt(_0x1a9194['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x5db55e,_0x15b682),_0x5db55e;}['_setDataIdsOnChildren'](_0x1558f4,_0x9ad938){let _0x2ebdda=!0x1;const _0x118491=new Set();for(const _0x4a36c5 of _0x1558f4['getChildren']()){const _0x228c51=_0x4a36c5['is']('emptyElement')||_0x4a36c5['is']('containerElement');if(!_0x4a36c5['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x4a36c5,_0x9ad938)||_0x228c51)&&(_0x9ad938['setAttribute']('data-id',this['_nextDataId'](_0x118491),_0x4a36c5),_0x2ebdda=!0x0);}return _0x2ebdda;}['_nextDataId'](_0x53677c){let _0x36dc32;do{_0x36dc32='';for(let _0x1ccd50=0x0;_0x1ccd50<0x4;_0x1ccd50++)_0x36dc32+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x53677c['has'](_0x36dc32));return _0x53677c['add'](_0x36dc32),_0x36dc32;}['getSelectionText'](){const {model:_0x572fb3}=ht(this['context']),_0x2fa439=_0x572fb3['document']['selection'],_0x19a1eb=_0x572fb3['getSelectedContent'](_0x2fa439),_0x4339ee=[],_0x2f246b=_0x572fb3['createRangeIn'](_0x19a1eb)['getWalker']();for(const {item:_0x155f70}of _0x2f246b)_0x155f70['is']('$textProxy')?_0x4339ee['push'](_0x155f70['data']):_0x155f70['is']('element')&&_0x4339ee['length']>0x0&&'\x20'!==_0x4339ee[_0x4339ee['length']-0x1]&&_0x4339ee['push']('\x20');return'\x22'+_0x4339ee['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x2e81a8=ht(this['context'])['model'];return Array['from'](_0x2e81a8['markers']['getMarkersGroup'](yt))['sort']((_0xc8b7b6,_0x1467e4)=>_0xc8b7b6['getStart']()['isBefore'](_0x1467e4['getStart']())?-0x1:_0xc8b7b6['getStart']()['isAfter'](_0x1467e4['getStart']())?0x1:0x0);}}const st=['applySuggestion','insertSuggestion','showChangeInText'];class nh extends _0xe56eb6{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0x26cbf3,_0x167527){super(_0x26cbf3),this['_dropdownOriginalConfig']=_0x167527||[...st],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x28522e=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0xa62dc5({'label':Hn('applySuggestion',_0x26cbf3,this['_partsCount']),'icon':_0xde42e2,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0xa62dc5({'label':Hn('showChangeInText',_0x26cbf3,this['_partsCount']),'icon':_0x44f5fb,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0xa62dc5({'label':Hn('insertSuggestion',_0x26cbf3,this['_partsCount']),'icon':_0x59808a,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x26cbf3),this['children']=this['createCollection'](),this['actionsButton']&&this['children']['add'](this['actionsButton']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x28522e['if']('isVisible','ck-hidden',_0x9dfcc3=>!_0x9dfcc3)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x20e183=>'applySuggestion'!==_0x20e183):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0x26cbf3);});}['_updateDropdownActions'](_0x9ebf57){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x9ebf57),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x47fe33){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0x312cca=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x47fe33):this['_createActionsDropdown'](_0x47fe33),_0xdc6d65=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0x312cca['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x47fe33,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x47fe33,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0xdc6d65});for(const _0xfcd17b of this['_dropdownCurrentConfig'])_0x312cca['on'](_0xfcd17b,()=>{this['fire'](_0xfcd17b);});return this['_firstRender']=!0x1,_0x312cca;}['_createActionsButton'](_0x194471){const _0x3e02ca=new _0x32eaf5(_0x194471);return _0x3e02ca['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x3e02ca['on']('execute',()=>{_0x3e02ca['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x3e02ca;}['_createActionsDropdown'](_0x494e2e){const _0x21769d=new Gn(_0x494e2e,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x2afb07=>{switch(_0x2afb07){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x21769d['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x494e2e,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x494e2e,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x21769d['bind']('isEnabled')['to'](this),_0x21769d;}['updateLabels'](_0x516186){const _0x5af5d9=this['locale'];this['_partsCount']=_0x516186||this['_partsCount'],this['actionsButton']['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x5af5d9,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x5af5d9,this['_partsCount'])}),this['applySuggestionModel']['label']=Hn('applySuggestion',_0x5af5d9,this['_partsCount']),this['showChangeInTextModel']['label']=Hn('showChangeInText',_0x5af5d9,this['_partsCount']),this['insertSuggestionModel']['label']=Hn('insertSuggestion',_0x5af5d9,this['_partsCount']);}}class Gn extends _0x323de6{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x31b19f,_0x2afba0){super(_0x31b19f),this['balloonPanelView']=new _0xbb1014(this['locale']),this['bodyCollection']=new _0x1c0188(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x2afba0['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',i(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0x1f75b9=_0x2afba0['listItemModels'][0x0]['actionName'];this['fire'](_0x1f75b9),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?yn:Pn]}),this['listView']['focus']());}),_0x3cc083({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x492ff5){const _0x1fab0e=this['locale'],_0xda91fc=new _0x3cd02e(_0x1fab0e);for(const _0x69c7b5 of _0x492ff5){const _0x154a74=new _0x256274(_0x1fab0e),_0x5a4b92=new _0x1afbe6(_0x1fab0e);_0x5a4b92['bind'](...Object['keys'](_0x69c7b5))['to'](_0x69c7b5),_0x5a4b92['delegate']('execute')['to'](_0xda91fc),_0x154a74['children']['add'](_0x5a4b92),_0xda91fc['items']['add'](_0x154a74);}return _0xda91fc['items']['delegate']('execute')['to'](this),_0xda91fc['on']('execute',_0x13887a=>{const _0x14da49=_0x13887a['source'];this['fire'](_0x14da49['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0xda91fc;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0xa0e91d(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x3a7fda,_0x23ba5a)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x23ba5a();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function yn(_0x2f0e59){return{'top':_0x2f0e59['bottom'],'left':_0x2f0e59['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function Pn(_0x5d609e,_0x42a54e){return{'top':_0x5d609e['bottom'],'left':_0x5d609e['left']-(_0x42a54e['width']-_0x5d609e['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Hn(_0x3ad11f,_0x439d7d,_0x12b972){switch(_0x3ad11f){case'applySuggestion':return i(_0x439d7d,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x12b972);case'showChangeInText':return i(_0x439d7d,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x12b972);case'insertSuggestion':return i(_0x439d7d,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x12b972);}}function Ln(_0x5deb80,_0xd3575c,_0x49b6c3){switch(_0x5deb80){case'applySuggestion':return i(_0xd3575c,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x49b6c3);case'showChangeInText':return i(_0xd3575c,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x49b6c3);case'insertSuggestion':return i(_0xd3575c,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x49b6c3);}}class ni extends _0x42ebaf(){['_connector'];['_availableModels'];['_defaultModelId'];['_modelList']=[];constructor({connector:_0x21fca4,availableModels:_0x493520,defaultModelId:_0x274390}){super(),this['_connector']=_0x21fca4,this['_availableModels']=_0x493520,this['_defaultModelId']=_0x274390;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x49a145=this['_connector']['getModels'](),_0x3720bc=await _0x49a145['list']();this['_modelList']=_0x3720bc['items'];}catch(_0x12c88c){throw new _0x2520c7('ai-models-unable-to-retrieve',null,{'error':_0x12c88c});}return[...this['_modelList']];}async['getAvailableModels'](){const _0x4d1767=await this['getAll']();return this['_filterModels'](_0x4d1767,this['_availableModels']);}async['getModel'](_0x50dba0){const _0x3f0fb2=await this['getAll']();if(!_0x3f0fb2['length'])return null;if(_0x50dba0){const _0x10a36e=this['_getModelById'](_0x3f0fb2,_0x50dba0);if(_0x10a36e)return _0x10a36e;_0x2db034('ai-chat-model-id-unrecognized',{'modelId':_0x50dba0,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x813f3a=await this['getAvailableModels']();if(!_0x813f3a['length'])return null;if(this['_defaultModelId']){const _0x2ca243=this['_getModelById'](_0x813f3a,this['_defaultModelId']);if(_0x2ca243)return _0x2ca243;_0x2db034('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x813f3a[0x0]['id']});}return _0x813f3a[0x0];}async['isAvailable'](_0x121a92){return(await this['getAvailableModels']())['some'](_0x16f58d=>_0x16f58d['name']===_0x121a92['name']&&_0x16f58d['provider']===_0x121a92['provider']);}['_filterModels'](_0x589d13,_0x48ed95){let _0x588cf6;if(_0x48ed95){_0x588cf6=[];const _0xb9af90='string'==typeof _0x48ed95?[_0x48ed95['toLocaleLowerCase']()]:_0x48ed95['map'](_0x4c74cf=>_0x4c74cf['toLocaleLowerCase']());for(const _0x5d0afe of _0xb9af90)for(const _0x369a47 of _0x589d13)(_0x369a47['id']['toLocaleLowerCase']()===_0x5d0afe||_0x369a47['name']['toLocaleLowerCase']()===_0x5d0afe||Ne(_0x369a47)&&'auto'===_0x5d0afe||_0x369a47['provider']['toLocaleLowerCase']()===_0x5d0afe||_0x369a47['id']['toLocaleLowerCase']()['startsWith'](_0x5d0afe))&&_0x588cf6['push'](_0x369a47);}else _0x588cf6=_0x589d13;return _0x588cf6;}['_getModelById'](_0x18a93,_0x2325ae){return _0x18a93['find'](_0xa1f90b=>Ne(_0xa1f90b)&&'auto'===_0x2325ae?_0xa1f90b:_0xa1f90b['id']===_0x2325ae)||null;}static['getLocalized'](_0x1a4fc7,_0x3dcec6){return _0x3dcec6['map'](_0x390674=>{if(Ne(_0x390674))_0x390674['name']=i(_0x1a4fc7,'AI_MODEL_NAME_AUTO'),_0x390674['description']=i(_0x1a4fc7,'AI_MODEL_DESCRIPTION_AUTO');else i(_0x1a4fc7,'AI_MODEL_DESCRIPTION_'+_0x390674['id']['toUpperCase']())['startsWith']('AI_MODEL_DESCRIPTION_')||(_0x390674['description']=i(_0x1a4fc7,'AI_MODEL_DESCRIPTION_'+_0x390674['id']['toUpperCase']()));return _0x390674;});}}function Ne(_0x324497){return _0x324497['id']['startsWith']('agent');}class It extends ni{async['getAll'](){return(await super['getAll']())['sort']((_0x54b1bf,_0x4ec41b)=>{const _0x459b5d=Object['values'](_0x54b1bf['capabilities'])['filter'](_0x4f6a31=>_0x4f6a31['enabled'])['length'];return Object['values'](_0x4ec41b['capabilities'])['filter'](_0x53d5d2=>_0x53d5d2['enabled'])['length']-_0x459b5d;});}}function Y({editor:_0x1ad5f8,interaction:_0x39a088,reply:_0x295260,groups:_0x154422,transform:_0x2889bf,documentCompare:_0xb49bc8,documentCompareOptions:_0x54c415}){const _0x35837f=_0x39a088['getDocumentContext']();if(!_0x35837f)return[];const _0x190b22=_0x35837f['content'],_0x21fbaf=_0x35837f['version'],_0x2587b4=_0x295260['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x1161ee}of _0x154422){const _0x25eec6=_0x1161ee['filter'](_0x1b47c7=>'new'!=_0x1b47c7['type'])['map'](_0xac8d6c=>Dt('data-id',_0xac8d6c['id'],_0x2587b4)),_0x389a95=_0x1161ee['filter'](_0x334da7=>'removed'!=_0x334da7['type'])['map'](_0x15a222=>_0x15a222['node']['cloneNode'](!0x0));let _0x1e9032=null;if(_0x25eec6['length']){_0x1e9032=_0x25eec6[0x0]['previousSibling'];for(let _0x5f1e66=0x0;_0x5f1e66<_0x25eec6['length'];_0x5f1e66++)_0x40dbe2(_0x25eec6[_0x5f1e66]);}if(_0x389a95['length']){_0x1e9032||(_0x1161ee[0x0]['anchorId']?_0x1e9032=Dt('data-id',_0x1161ee[0x0]['anchorId'],_0x2587b4):(_0x1e9032=_0x389a95['shift'](),_0x2c1cf5(_0x2587b4,_0x1e9032)));for(let _0x135f56=0x0;_0x135f56<_0x389a95['length'];_0x135f56++)_0x5c93f3(_0x1e9032,_0x389a95[_0x135f56]),_0x1e9032=_0x389a95[_0x135f56];}}const _0x353729=St(_0x2587b4),_0x104e90=_0xb49bc8['getDiff'](_0x190b22,_0x353729,_0x54c415)['getOperations']();if(_0x2889bf){const _0x922d57=_0x1ad5f8['model']['document']['history']['getOperations'](_0x21fbaf),_0x31d701={'document':_0x1ad5f8['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return it(_0x104e90,_0x922d57,_0x31d701)['operationsA'];}return _0x104e90;}function X(_0x4b1897,_0x16a1e9){if('marker'!=_0x16a1e9['type'])return;const _0x3212f7=_0x4b1897['model']['markers']['get'](_0x16a1e9['name']);_0x3212f7&&(_0x16a1e9['oldRange']=_0x3212f7['getRange']());}class Vr extends _0x231138{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x37aad4,_0x480caf={},_0x743b7c){super(_0x37aad4),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x480caf};const _0x48ffd2=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x48ffd2?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](_0x743b7c),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['_setupRatingButtons'](){this['likeButton']=new _0x32eaf5(this['locale']),this['likeButton']['set']({'icon':_0x153791,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3219e1=>!_0x3219e1),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x32eaf5(this['locale']),this['dislikeButton']['set']({'icon':_0x19395a,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x38b7fa=>!_0x38b7fa),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x32eaf5(this['locale']),this['copyButton']['set']({'icon':_0x5375d8,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x39d2a6=>!_0x39d2a6);const _0x17df13=new _0x2c655b();_0x17df13['set']({'content':_0x5d441a}),_0x17df13['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied',setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button';},0x7d0);}),this['copyButton']['children']['add'](_0x17df13);}['_setupShowChangesButton'](_0x274c87){this['showChangesButton']=new _0x32eaf5(this['locale']),this['showChangesButton']['set']({'icon':_0x2677d0,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0x274c87}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x26370a=>!_0x26370a),this['showChangesButton']['on']('execute',()=>{const _0x3c1e6d=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x3c1e6d,'icon':_0x3c1e6d?_0x35a902:_0x2677d0}),this['fire']('toggleShowChanges',_0x3c1e6d);});}}class Lr extends _0xe56eb6{['showChangesToggleView'];constructor(_0x42f134,_0x1f5edf){super(_0x42f134),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Yr(_0x42f134),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x42f134,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x1f5edf['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x1198db=>_0x1198db?_0x38adf9:_0x7debf1),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x7be136=new _0x2c655b();_0x7be136['content']=_0x559ebe,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x1f5edf['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x7be136,{'tag':'span','children':[i(_0x42f134,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Yr extends _0x32eaf5{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x4e026b){this['options']={'delay':_0x4e026b['delay']??0x14,'textNodeStyle':_0x4e026b['textNodeStyle'],'onStreamUpdate':_0x4e026b['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x1819cf,targetElement:_0x246d43,abortSignal:_0x308204}){this['isStreaming']&&this['stop'](),_0x308204?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x134b10(_0x1819cf,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x2db034('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x4d1bd5=0x0;_0x4d1bd5<this['currentIndex'];_0x4d1bd5++)this['nodesList'][_0x4d1bd5]['shouldBeStreamed']=!0x0;let _0x3901b0=0x0;for(let _0x275ff1=this['currentIndex'];_0x275ff1<this['nodesList']['length'];_0x275ff1++){const _0x4b5ea9=Date['now'](),_0xdd12fb=this['nodesList'][_0x275ff1],_0x287722=_0x4b5ea9-_0x3901b0;_0xdd12fb['shouldBeStreamed']=!0x0;let _0x43a9cc=_0xdd12fb['parent'];for(;_0x43a9cc;)_0x43a9cc['shouldBeStreamed']=!0x0,_0x43a9cc=_0x43a9cc['parent'];if(_0x287722<this['options']['delay'])try{const {promise:_0xf910a9,abortController:_0x60c3b6}=pr(this['options']['delay']-_0x287722);this['timeoutAbortController']=_0x60c3b6,await _0xf910a9;}catch(_0x147a3f){return;}_0x4392b3(_0x246d43,'<'+_0x246d43['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x246d43['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x275ff1,_0x3901b0=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x53649f}){Array['from'](_0x53649f['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x688cec=>{_0x688cec['replaceWith'](_0x688cec['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0xcf1e41){let _0x3b9d69='';if(function(_0x262366){return _0x48e3f7(_0x262366);}(_0xcf1e41)){for(const _0x2bf1dc of _0xcf1e41['children'])_0x3b9d69+=this['renderNode'](_0x2bf1dc);}else{if(dr(_0xcf1e41)){if(!_0xcf1e41['shouldBeStreamed'])return'';const _0x2aa26c=_0xcf1e41,_0x414add=Object['entries'](_0x2aa26c['attribs'])['map'](([_0x350123,_0x132fc4])=>_0x350123+'=\x22'+_0x132fc4+'\x22')['join']('\x20');_0x3b9d69+='<'+_0x2aa26c['tagName']+(_0x414add?'\x20'+_0x414add:'')+'>';for(const _0x2e4244 of _0x244914(_0x2aa26c))_0x3b9d69+=this['renderNode'](_0x2e4244);_0x3b9d69+='</'+_0x2aa26c['tagName']+'>';}else{if(!ar(_0xcf1e41))return'';if(!_0xcf1e41['shouldBeStreamed'])return'';!function(_0x246e90){if(!_0x246e90['parent']||!dr(_0x246e90['parent']))return!0x1;if(!cr['includes'](_0x246e90['parent']['tagName']))return!0x1;return!_0x4a27c9(_0x246e90)['match'](/^\s*[<>]\s*$/);}(_0xcf1e41)?_0x3b9d69+=_0x2e70cb(_0xcf1e41):_0x3b9d69+=_0x2e70cb(new _0x245d41('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0xcf1e41]));}}return _0x3b9d69;}['getParsedDocumentNodeList'](){const _0xf4552f=[];return function(_0x20cf07,_0x52972c){const _0x456b5d=_0x97ed90=>{if(_0x52972c(_0x97ed90),_0x97ed90 instanceof _0x5d77f3)for(let _0x5bc218=0x0;_0x5bc218<_0x97ed90['children']['length'];_0x5bc218++){const _0x30dfd5=_0x97ed90['children'][_0x5bc218];_0x456b5d(_0x30dfd5);}};for(let _0x54ee74=0x0;_0x54ee74<_0x20cf07['children']['length'];_0x54ee74++)_0x456b5d(_0x20cf07['children'][_0x54ee74]);}(this['document'],_0x289678=>{if(ar(_0x289678)){const _0x3f69e9=this['splitTextNodeIntoWordNodes'](_0x289678);_0x3f69e9['length']&&_0xf4552f['push'](..._0x3f69e9);}_0x289678['isWordSplitSource']||_0x289678['isWordSplitResult']||_0xf4552f['push'](_0x289678);}),_0xf4552f;}['splitTextNodeIntoWordNodes'](_0x58ab29){if(_0x58ab29['isWordSplitSource']||_0x58ab29['isWordSplitResult'])return[];const _0x1e67fd=_0x4a27c9(_0x58ab29)['match'](/(?:\s*\S+\s*)/g),_0x1fabd8=[];if(_0x1e67fd&&_0x1e67fd['length']>0x1){for(const _0x172ce1 of _0x1e67fd){const _0x562ca0=new _0x106f4b(_0x172ce1);_0x562ca0['isWordSplitResult']=!0x0,_0x20a345(_0x58ab29,_0x562ca0),_0x1fabd8['push'](_0x562ca0);}_0x58ab29['isWordSplitSource']=!0x0,_0x40dbe2(_0x58ab29);}return _0x1fabd8;}}const cr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ar(_0x5e3f11){return _0x25daad(_0x5e3f11);}function dr(_0x1dd185){return _0xf0837b(_0x1dd185);}function pr(_0x442971){const _0x3c5df9=new AbortController();return{'promise':new Promise((_0x1a8bbf,_0x2669a3)=>{const _0xbff720=setTimeout(_0x1a8bbf,_0x442971);_0x3c5df9['signal']['addEventListener']('abort',()=>{clearTimeout(_0xbff720),_0x2669a3();});}),'abortController':_0x3c5df9};}const Ee=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends _0xe56eb6{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0xf49799,{part:_0x348846,uiIndex:_0xfa5745,areActionsDisabled:_0xc4e10,availableActions:_0x509064}){super(_0xf49799),this['set']('partDefinition',_0x348846),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x4420c7=>'pending'==_0x4420c7&&!_0xc4e10),this['children']=this['createCollection'](),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Un(_0xf49799,{'part':_0x348846,'uiIndex':_0xfa5745,'availableActions':_0x509064}),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ee)['to'](this);const _0xc82d30=this['bindTemplate'];this['contentView']=new _0xe56eb6(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0xc82d30['to']('state',_0xdf7ee9=>'ck-ai-suggestion__body__content-part_'+_0xdf7ee9),_0xc82d30['to']('isEnabled',_0x1704a6=>_0x1704a6?'ck-ai-suggestion__body__content-part_active':void 0x0),_0xc82d30['if']('isVisible','ck-hidden',_0x52466b=>!_0x52466b)]},'children':this['children'],'on':{'mouseenter':_0xc82d30['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x348846['index']});}),'mouseleave':_0xc82d30['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x348846['index']});})}});}async['updateContent']({part:_0x445af5,renderingStrategy:_0x57449d,showUnchangedParts:_0x40fb62=!0x1,abortSignal:_0x1df166}){this['partDefinition']=_0x445af5,this['isVisible']=this['partDefinition']['hasChanges']||_0x40fb62,this['isVisible']&&('streaming'===_0x57449d?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x1df166}):this['contentView']['element']['innerHTML']=St(this['partDefinition']['content']));}['toggleHeader'](_0x310191){_0x310191?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Un extends _0xe56eb6{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0xefdd3,{part:_0xedf5e,uiIndex:_0x3037c9,availableActions:_0x385973}){super(_0xefdd3),this['set']('partDefinition',_0xedf5e),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x4f60ac=new _0x2c655b();_0x4f60ac['content']=_0x5200bc,_0x4f60ac['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x56fbe8=[];if(_0x385973['includes']('showChangeInText')){const _0x35b9f6=new _0x32eaf5(_0xefdd3);_0x35b9f6['set']({'label':i(_0xefdd3,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x44f5fb}),_0x35b9f6['bind']('isEnabled')['to'](this),_0x35b9f6['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0xedf5e['index']});}),_0x56fbe8['push'](_0x35b9f6);}if(_0x385973['includes']('insertSuggestion')){const _0x3cae87=new _0x32eaf5(_0xefdd3);_0x3cae87['set']({'label':i(_0xefdd3,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x59808a}),_0x3cae87['bind']('isEnabled')['to'](this),_0x3cae87['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0xedf5e['index']});}),_0x56fbe8['push'](_0x3cae87);}const _0x5911da=new _0x32eaf5(_0xefdd3);_0x5911da['set']({'label':i(_0xefdd3,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x2d117b}),_0x5911da['bind']('isEnabled')['to'](this),_0x5911da['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0xedf5e['index']});}),_0x56fbe8['push'](_0x5911da),this['_toolbarView']=new _0x231138(_0xefdd3),this['_toolbarView']['items']['addMany'](_0x56fbe8),this['_iconStateAccepted']=new _0x2c655b(),this['_iconStateAccepted']['content']=_0x1ae4a5,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':i(_0xefdd3,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x2c655b(),this['_iconStateRejected']['content']=_0x47ae46,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':i(_0xefdd3,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x2c655b(),this['_iconStateOutdated']['content']=_0x47ae46,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':i(_0xefdd3,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x292170=new _0xe56eb6(_0xefdd3);_0x292170['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0xefdd3,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x3037c9['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x4f60ac,_0x292170,this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x19fe16,_0xfb168,_0x6f190,_0x4b7324)=>{switch(_0x4b7324){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);break;case'outdated':this['children']['remove'](this['_iconStateOutdated']);}switch(_0x6f190){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);break;case'outdated':this['children']['add'](this['_iconStateOutdated']);}});}}class H extends _0x42ebaf(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x72230f){const _0x59ea84=this['createTask'](_0x72230f);return this['queue']['push'](_0x59ea84),this['_processQueue'](),_0x59ea84['completePromise'];}['abort'](){this['isProcessing']&&(this['_abortController']['abort'](),this['_abortController']=void 0x0,this['queue']=[],this['fire']('_queueEmpty'),this['isProcessing']=!0x1);}get['queueEmptyPromise'](){return this['queue']['length']||this['isProcessing']?new Promise(_0x15e56b=>{this['once']('_queueEmpty',()=>{_0x15e56b();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x352be3=this['queue']['shift']();try{await _0x352be3['callback'](this['_abortController']['signal']),_0x352be3['resolve']();}catch(_0x3c85a6){_0x352be3['reject'](_0x3c85a6);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0xdf58b3){let _0x354993,_0x26daf2;const _0x10dcc7=new Promise((_0x2299e4,_0x4b4126)=>{_0x354993=_0x2299e4,_0x26daf2=_0x4b4126;});return{'callback':_0xdf58b3,'resolve':_0x354993,'reject':_0x26daf2,'completePromise':_0x10dcc7};}}class jr extends _0xe56eb6{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x25599d){super();const _0x1fbc10=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x25599d,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x1fbc10['if']('isDone','ck-ai-chat__feed__item_done'),_0x1fbc10['if']('isVisible','ck-hidden',_0x45564c=>!_0x45564c),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){this['htmlStreamer']['cleanUpAnimations']({'targetElement':this['element']}),this['element']['querySelectorAll']('[data-id]')['forEach'](_0x8aa9fb=>{_0x8aa9fb['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x4917fc,_0x4879c6,_0x4a8be7){await this['htmlStreamer']['stream']({'document':_0x4917fc,'targetElement':_0x4879c6,'abortSignal':_0x4a8be7});}}class Oe extends jr{constructor(_0x211334){super(_0x211334),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0x211334['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x5c0a00){this['element']['innerHTML']=_0x5c0a00;}}class Dr extends _0xe56eb6{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x5f3eae,_0x2409d3){super(_0x5f3eae);const {areActionsDisabled:_0x15f007,showUnchangedParts:_0x3a4f6e,availableActions:_0xfcce90}=_0x2409d3;this['_areActionsDisabled']=_0x15f007,this['_showUnchangedParts']=_0x3a4f6e,this['_availableActions']=_0xfcce90,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new H(),this['_emptyPartsWarningView']=new Oe({'id':'empty-parts-warning','initialContent':i(_0x5f3eae,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0xc51e1c,renderingStrategy:_0x2b39bf,abortSignal:_0x19d01a}){this['_children']['length']?_0xc51e1c['forEach'](_0x4dd554=>{const _0x18a24a=this['_cachedContentParts']['findIndex'](_0xb6656d=>_0xb6656d['index']==_0x4dd554['index']);-0x1===_0x18a24a?this['_cachedContentParts']['push'](_0x4dd554):this['_cachedContentParts'][_0x18a24a]=_0x4dd554;}):this['_cachedContentParts']=_0xc51e1c;for(const _0x1a46d7 of _0xc51e1c['filter'](_0x8bdbe=>_0x8bdbe['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x243cf5=>{let _0x3c5a6c=this['getPartView'](_0x1a46d7['index']);_0x3c5a6c||(_0x3c5a6c=new na(this['locale'],{'part':_0x1a46d7,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x3c5a6c['delegate'](...Ee)['to'](this),this['_children']['add'](_0x3c5a6c),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x3c5a6c['toggleHeader'](this['_children']['length']>0x1),await _0x3c5a6c['updateContent']({'part':_0x1a46d7,'renderingStrategy':_0x2b39bf,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x243cf5});});return _0x19d01a?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x4e7df2,_0x53f1c2){const _0x3b8295=this['getPartView'](_0x4e7df2);_0x3b8295&&(_0x3b8295['state']=_0x53f1c2),this['hasPendingParts']='pending'==_0x53f1c2||Array['from'](this['_children'])['some'](_0x17b194=>'pending'==_0x17b194['state']);}['getPartView'](_0x525872){return this['_children']['find'](_0x5714bb=>_0x5714bb['partDefinition']['index']==_0x525872)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x1804b9=!this['_cachedContentParts']['find'](({hasChanges:_0x52af65})=>_0x52af65),_0x5a5ca4=!!this['_cachedContentParts']['find'](({hasChanges:_0x26c207})=>!_0x26c207);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x5a5ca4,_0x1804b9?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x3bae6c=>_0x3bae6c['partDefinition']['hasChanges']);}}class De extends _0xad8088{constructor(_0x370936=void 0x0){super();const _0x4f9ad3=_0x370936?'ck-ai-spinner_'+_0x370936:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x4f9ad3]}});}}class N extends _0xe56eb6{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];constructor(_0x4ab794,_0x59f063){super(_0x4ab794);const {showDiff:_0x283e4c,areActionsDisabled:_0x93077a,miniToolbarConfig:_0x250c8b,hideHeader:_0x1867aa,showLoader:_0x283e34,showUnchangedParts:_0x1e46aa,availableActions:_0x2f529b}=_0x59f063;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x283e34),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x1867aa||(this['headerView']=new Lr(_0x4ab794,{'showDiff':_0x283e4c}),this['headerView']['on']('toggleShowChanges',(_0x13efb3,_0x53dc08)=>{this['areChangesVisible']=_0x53dc08['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x53dc08['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Dr(_0x4ab794,{'areActionsDisabled':_0x93077a,'showUnchangedParts':!!_0x1e46aa,'availableActions':_0x2f529b}),this['bodyView']['delegate'](...Ee)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Vr(_0x4ab794,_0x250c8b,_0x283e4c),this['miniToolbarView']['delegate'](...Ee)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x5eb2d1,_0x8dab04)=>{this['areChangesVisible']=_0x8dab04,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x8dab04});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new Sr(this['locale']),this['children']['add'](this['sourcesView']),_0x283e34&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['errorView']=this['_createErrorView'](),this['children']['add'](this['errorView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x5b87b3){await this['bodyView']['updateContentParts'](_0x5b87b3);}['updateSources'](_0x568af1){this['sourcesView']['children']['addMany'](_0x568af1['map'](_0x3d0d58=>new Fr(this['locale'],_0x3d0d58))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0x197bfc){if(this['errorView']){const _0xf7391=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0xf7391&&(_0xf7391['textContent']=_0x197bfc),this['isErrorVisible']=!0x0;}}['hideError'](){this['errorView']&&(this['isErrorVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x0),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x1);}['clearErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x1),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x0);}['addNavigationItem'](_0x33b208){this['miniToolbarView']['items']['add'](_0x33b208);}['removeNavigationItem'](_0x387af5){this['miniToolbarView']['items']['remove'](_0x387af5);}['_createLoaderView'](){const _0x2f9569=new _0xe56eb6(this['locale']),_0x167666=new De('small');_0x167666['isVisible']=!0x0;const _0x49949e=new _0xe56eb6(this['locale']);return _0x49949e['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x2f9569['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x2e75e5=>!_0x2e75e5)]},'children':[_0x167666,_0x49949e]}),_0x2f9569;}['_createErrorView'](){const _0x2f999e=new _0xe56eb6(this['locale']),_0x3954e4=new _0xe56eb6(this['locale']);return _0x3954e4['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[i(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x2f999e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x4f7f19=>!_0x4f7f19)]},'children':[_0x3954e4]}),_0x2f999e;}}class Sr extends _0xe56eb6{['children'];constructor(_0xc72f3a){super(_0xc72f3a),this['children']=this['createCollection'](),this['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources',this['bindTemplate']['if']('isVisible','ck-hidden',_0x585b48=>!_0x585b48)]},'children':this['children']});const _0x5371b5=new _0xe56eb6(this['locale']),_0x2a5824=new _0x2c655b();_0x2a5824['content']=_0x1de698,_0x5371b5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x2a5824,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x5371b5);}}class Fr extends _0x32eaf5{constructor(_0x3c1cad,_0x3056d4){super(_0x3c1cad),this['set']({'label':_0x3056d4['title'],'tooltip':_0x3056d4['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x5bee79=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x5bee79['to'](()=>{window['open'](_0x3056d4['url'],'_blank');})}}),_0x3056d4['favicon']){const _0x13fbac=new _0xe56eb6(_0x3c1cad);_0x13fbac['setTemplate']({'tag':'img','attributes':{'src':_0x3056d4['favicon']||_0x1de698,'alt':_0x3056d4['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x13fbac);}else this['set']('icon',_0x1de698);}}class cs extends _0x231138{constructor(_0xd535dd,_0x168772=!0x0,_0x2ec622=!0x0){super(_0xd535dd),this['set']('isLoading',!0x1),_0x168772&&(this['applyButton']=this['_createButton'](i(_0xd535dd,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0xb3468=>!_0xb3468),this['items']['add'](this['applyButton'])),_0x2ec622&&(this['suggestButton']=this['_createButton'](i(_0xd535dd,'AI_BALLOON_SUGGEST_BUTTON'),_0x168772?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x45cc2b=>!_0x45cc2b),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x5bc718,_0x3827d5){const _0x4044bf=new _0x32eaf5(this['locale']);return _0x4044bf['set']({'label':_0x5bc718,'class':_0x3827d5||'','isVisible':!0x0,'withText':!0x0}),_0x4044bf;}}class ls extends _0xe56eb6{constructor(_0x51c6f6){super(_0x51c6f6),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':i(_0x51c6f6,'AI_DISCLAIMER_TEXT')}]}]});}}const et=['applySuggestion','insertSuggestion','showNext','showPrevious'];class nt extends _0xe56eb6{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];constructor(_0x2ea1cd,_0x1647bc,_0xecc59,_0x1f7257){super(_0x2ea1cd),this['_availableActions']=_0xecc59,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x1f7257),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new _0x57a285(),this['keystrokes']=new _0xa0e91d(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x90a56c({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x2a5a90(),this['_addContentView'](_0x1647bc['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x1647bc['showApplyButton'],_0x1647bc['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_dialogContent']['remove'](this['toolbar']),this['_addToolbar'](_0x1647bc['showApplyButton'],_0x1647bc['showSuggestButton']);});}['render'](){super['render']();for(const _0x3fbbcf of this['_focusables'])this['focusTracker']['add'](_0x3fbbcf['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x3f23e4){-0x1===_0x3f23e4?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x42d5d6){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x42d5d6,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0x9f77cd){this['showError'](_0x9f77cd);}['showBlockingError'](_0x24dfb5){this['showError'](_0x24dfb5),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x58626a){const _0x276bc4=this['_createNextButtonView'](),_0x29420e=this['_createPreviousButtonView']();_0x58626a['view']['headerView']['children']['add'](_0x276bc4,0x2),_0x58626a['view']['headerView']['children']['add'](_0x29420e,0x0),this['_focusables']['addMany']([_0x276bc4,_0x29420e]),this['focusTracker']['add'](_0x276bc4['element']),this['focusTracker']['add'](_0x29420e['element']);}['_addContentView'](_0x16f3eb){this['_mainView']=_0x16f3eb,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0x465104){const _0x64fd85=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0x465104,this['_dialogContent']['add'](this['_mainView'],_0x64fd85),this['hideError']();}['_addDisclaimerView'](){this['disclaimerView']=new ls(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x368f4c=!0x0,_0x21bbd5=!0x0){_0x368f4c=_0x368f4c&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x21bbd5=_0x21bbd5&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new cs(this['locale'],_0x368f4c,_0x21bbd5),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x49c895=new _0x32eaf5(this['locale']);return _0x49c895['set']({'icon':_0x33f48f,'tooltip':i(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x49c895['on']('execute',()=>{this['fire']('showNext');}),_0x49c895;}['_createPreviousButtonView'](){const _0x28d3c9=new _0x32eaf5(this['locale']);return _0x28d3c9['set']({'icon':_0x1a5b12,'tooltip':i(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x28d3c9['on']('execute',()=>{this['fire']('showPrevious');}),_0x28d3c9;}['_createErrorView'](){const _0x48d245=new _0xe56eb6(this['locale']),_0x4c7685=new _0xe56eb6(this['locale']);return _0x4c7685['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0x48d245['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x2291d0=>!_0x2291d0)]},'children':[_0x4c7685]}),_0x48d245;}}const ut=0xa;class $ extends ot{static get['requires'](){return[S,R];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['_isUpdatingMarkers']=!0x1;['_pendingRenderCallback']=null;['open'](_0x5814a6){const _0x56ae76=ht(this['context']);if(this['_config']=_0x5814a6,this['isOpen'])return void this['_updateBalloon'](_0x5814a6);const _0x539e2c=this['context']['config']['get']('ai.availableReplyActions')||[...st],_0x1e9dce=_0x56ae76?.['commands']['get']('trackChanges'),_0x176e01=_0x1e9dce?.['value'];this['balloonView']=new nt(_0x56ae76['locale'],_0x5814a6,_0x539e2c,!!_0x176e01),this['balloonView']['delegate'](...et)['to'](this),_0x1e9dce&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x1e9dce,'value'),this['_showDialog'](_0x5814a6);}['close'](){ht(this['context'])['plugins']['get']('Dialog')['hide']();}['_updateBalloon'](_0x3d6b5d){const _0x5a6a87=ht(this['context']),_0x110666=_0x5a6a87['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x5a6a87['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x110666['view']?.['headerView']&&(_0x110666['view']['headerView']['label']=_0x3d6b5d['title'],_0x110666['view']['headerView']['iconView']&&_0x3d6b5d['icon']&&(_0x110666['view']['headerView']['iconView']['content']=_0x3d6b5d['icon'])),this['balloonView']['updateContent'](_0x3d6b5d['mainView']),this['_setupVisualSelection'](_0x3d6b5d['ranges'],_0x3d6b5d['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x110666['view']&&_0x110666['view']['updatePosition']();},_0x5a6a87['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0x38f2f2,_0x277afb){this['context']['plugins']['get'](R)['showFakeVisualSelection'](_0x38f2f2,'ai-balloon-'+_0x277afb,!0x0,!0x0);}['_showDialog'](_0x4453d0){const _0x45527c=ht(this['context']);this['_setupVisualSelection'](_0x4453d0['ranges'],_0x4453d0['index']);const _0x4e5491=this['_getSelectionElements']();_0x4e5491&&_0x4e5491[0x0]&&ct({'target':_0x4e5491[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0x45527c['plugins']['get']('Dialog')['show']({'title':_0x4453d0['title'],'icon':_0x4453d0['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x4453d0['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x342742=>{_0x4453d0['showRotator']&&this['balloonView']['setupRotator'](_0x342742),this['_setupMarkerRemovalListener'](),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+this['_config']['index']),this['_cleanupMarkerRemovalListener'](),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x1192f2,_0x3f6346){if(!_0x3f6346)return null;const _0x28dcd5=this['_getSelectionElements']();if(!_0x28dcd5||0x0===_0x28dcd5['length'])return{'left':Math['round'](_0x3f6346['left']+_0x3f6346['width']/0x2-_0x1192f2['width']/0x2),'top':Math['round'](_0x3f6346['top']+_0x3f6346['height']/0x2-_0x1192f2['height']/0x2)};const _0x436646=Math['round'](_0x3f6346['left']+_0x3f6346['width']/0x2-_0x1192f2['width']/0x2),_0x49f862=new lt(_0x28dcd5[0x0]),_0xfe485f=new lt(_0x28dcd5[_0x28dcd5['length']-0x1]),_0x2d0682=_0x1192f2['height'],_0x3b50bc=this['_config']['showRotator']?0x8:0x0;return{'left':_0x436646,'top':this['_calculateOptimalTopPosition'](_0x49f862,_0xfe485f,_0x2d0682,_0x3b50bc,_0x3f6346)};}['_calculateOptimalTopPosition'](_0x1a1a8f,_0xbe782f,_0x513466,_0x550ba6=0x0,_0x22e51b){const _0x117df1=_0x513466+_0x550ba6,_0x507071=new lt(rt['window']),_0x5e0289=[_0x1a1a8f['getVisible'](),_0xbe782f['getVisible']()]['filter'](_0x42bbae=>_0x42bbae),_0x212939=lt['getBoundingRect'](_0x5e0289);if(!_0x212939)return Math['round'](_0x22e51b['top']+_0x22e51b['height']/0x2);const _0x19a20c=_0x507071['getIntersection'](_0x212939);if(!_0x19a20c)return Math['round'](_0x22e51b['top']+_0x22e51b['height']/0x2);const _0x5501ec=_0x22e51b['getVisible'](),_0x2e08e5=_0x5501ec&&_0x212939['height']>_0x5501ec['height'],_0x535994=_0x19a20c['top'],_0x4c586d=_0x19a20c['bottom'];if(_0x2e08e5){const _0x580bb1=(_0x5501ec||_0x507071)['height']/0x2-_0x117df1/0x2,_0x1d7a93=_0x535994-ut-_0x22e51b['top'],_0x2ea339=_0x22e51b['bottom']-_0x4c586d-ut;return _0x1d7a93>=_0x117df1?Math['max'](ut,_0x535994-_0x117df1-ut):_0x2ea339>=_0x117df1?_0x4c586d+ut:Math['max'](ut,_0x580bb1);}const _0x26ca4a=_0x535994-_0x117df1,_0x216c4f=_0x22e51b['bottom']-_0x4c586d-ut,_0x13ec63=_0x535994-ut-_0x22e51b['top'];let _0x58f752;if(_0x216c4f>=_0x117df1)_0x58f752=_0x4c586d+ut;else{if(_0x13ec63>=_0x117df1)_0x58f752=_0x26ca4a-ut;else _0x58f752=_0x535994+_0x212939['height']/0x2-_0x117df1/0x2;}return _0x58f752;}['_setupMarkerRemovalListener'](){const _0x4aa14d=ht(this['context']);this['listenTo'](_0x4aa14d['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x23ad2b,data:{newRange:_0x23db87}}of _0x4aa14d['model']['document']['differ']['getChangedMarkers']())if(_0x23ad2b['startsWith']('ai-selection:')&&(_0x23db87&&(_0x23db87['start']['isEqual'](_0x23db87['end'])||'$graveyard'==_0x23db87['root']['rootName'])||null==_0x23db87)){const _0x1bfc63=i(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x1bfc63),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x27cfce=ht(this['context']);this['stopListening'](_0x27cfce['model']['document']);}['_getSelectionElements'](){const _0xbe4051=ht(this['context']);return at(_0xbe4051['editing'],[..._0xbe4051['model']['markers']['getMarkersGroup']('ai-selection'),..._0xbe4051['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class mt extends ot{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[S,$,_0x568068];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new It({'connector':this['_aiConnector'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId')});const _0x4732c9=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x1af036,_0x16ec55)=>{this['_handleUIUserMessage']({'userMessage':_0x16ec55});}),this['listenTo'](_0x4732c9,'resizedTabs',(_0x7a7955,_0x5c8bf9)=>{this['_setIsMaximized'](_0x5c8bf9);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x4732c9['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x3d3b4d,_0x288456)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x288456));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x1cc01d,_0x4b0b52)=>{this['activeConversation']?.['addUrlToContext'](_0x4b0b52);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0xd7cb43,_0x3c9840)=>{this['activeConversation']?.['addResourceToContext'](_0x3c9840['source'],_0x3c9840['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x478798,_0x534101)=>{this['_removeFromContext'](_0x534101);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x2c4bea,_0x3df034)=>{this['activeConversation']?.['loadSourceResources'](_0x3df034['sourceId'],_0x3df034['query'],_0x3df034['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x27d08f,_0x472a5f)=>{this['activeConversation']?.['setModel'](_0x472a5f);}),this['listenTo'](this['_aiChatUi'],'like',(_0x160710,{replyId:_0x57ac0d})=>{console['log']('Liked\x20response',_0x57ac0d);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x107465,{replyId:_0x11d478})=>{console['log']('Disliked\x20response',_0x11d478);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x221517,_0x345e52)=>{this['context']['plugins']['get']($)['close'](),this['_insertSuggestion'](_0x345e52);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x4eb1a4,{replyId:_0x321e98,partIndex:_0x53e15d})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x321e98,_0x53e15d);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x32351e,{replyId:_0x1471e8,partIndex:_0x201d63})=>{const _0x124755=this['_getDocumentRangeForReplyChanges'](_0x1471e8,_0x201d63);_0x124755&&'$graveyard'!=_0x124755['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x124755['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x8a0541,_0x1e1112)=>{this['context']['plugins']['get']($)['close'](),this['_applySuggestion'](_0x1e1112);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x103244,{replyId:_0x4d416b,showDiff:_0x15ef00})=>{const {reply:_0x16a4e1}=this['getInteractionAndReplyById'](_0x4d416b),_0x5866ca=_0x16a4e1['getContentParts']({'showDiff':_0x15ef00});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x16a4e1['id'],'parts':_0x5866ca,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x5d9ee4,{replyId:_0x1e3dca,partIndex:_0x4921b3})=>{this['_previewedChangeGroup']?.['replyId']==_0x1e3dca&&this['_previewedChangeGroup']?.['partIndex']==_0x4921b3&&this['context']['plugins']['get']($)['close']();const {reply:_0x2ef788}=this['getInteractionAndReplyById'](_0x1e3dca);_0x2ef788['setChangeGroupState'](_0x4921b3,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof pt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x896bbb,_0x1e8fe0)=>{_0x1e8fe0['on']('ready',()=>{this['_integrateEditor'](_0x1e8fe0);});}),await this['_startConversationSafely']();}['_insertSuggestion'](_0x15fdc9){const _0x39308f=ht(this['context']);if(!_0x39308f['plugins']['has']('TrackChanges'))throw new _0x2520c7('ai-no-track-changes',null);const _0x1767b3=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x2664d1,interaction:_0x544495}=this['getInteractionAndReplyById'](_0x15fdc9['replyId']),_0x28aba4=this['_getDocumentRangeForReplyChanges'](_0x15fdc9['replyId'],_0x15fdc9['partIndex']),_0x21dd7c=void 0x0!==_0x15fdc9['partIndex']?[_0x2664d1['changeGroups'][_0x15fdc9['partIndex']]]:_0x2664d1['changeGroups']['filter'](_0x37237d=>'pending'==_0x37237d['state']),_0x11a08a=_0x21dd7c['map'](_0x5e6a30=>_0x2664d1['changeGroups']['indexOf'](_0x5e6a30));if(!_0x28aba4||'$graveyard'==_0x28aba4['range']['root']['rootName'])return void _0x11a08a['forEach'](_0x37483a=>_0x2664d1['setChangeGroupState'](_0x37483a,'outdated'));_0x11a08a['forEach'](_0x21983b=>_0x2664d1['setChangeGroupState'](_0x21983b,'accepted'));const _0x8da056=Y({'editor':_0x39308f,'reply':_0x2664d1,'interaction':_0x544495,'groups':_0x21dd7c,'transform':!0x0,'documentCompare':_0x1767b3,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x4021a6;_0x28aba4&&this['_scrollToSuggestionRange'](_0x28aba4['range']),_0x39308f['model']['change'](_0xf812d3=>{_0x4021a6=_0xf812d3['batch'],_0x39308f['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x8da056),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x4021a6,{'interactionId':_0x544495['id'],'replyId':_0x2664d1['id'],'indexes':_0x11a08a['slice']()}),this['_updateRatings'](_0x2664d1);}['_applySuggestion'](_0x386c48){const _0x70b0c5=ht(this['context']),_0x182514=this['context']['plugins']['get'](_0x568068),{reply:_0x5b1b4b,interaction:_0x5e0e65}=this['getInteractionAndReplyById'](_0x386c48['replyId']),_0x3b4816=this['_getDocumentRangeForReplyChanges'](_0x386c48['replyId'],_0x386c48['partIndex']),_0x22e159=void 0x0!==_0x386c48['partIndex']?[_0x5b1b4b['changeGroups'][_0x386c48['partIndex']]]:_0x5b1b4b['changeGroups']['filter'](_0x447c7c=>'pending'==_0x447c7c['state']),_0x556ca5=_0x22e159['map'](_0x46a36c=>_0x5b1b4b['changeGroups']['indexOf'](_0x46a36c));if(!_0x3b4816||'$graveyard'==_0x3b4816['range']['root']['rootName'])return void _0x556ca5['forEach'](_0x1cafee=>_0x5b1b4b['setChangeGroupState'](_0x1cafee,'outdated'));_0x556ca5['forEach'](_0x253c2e=>_0x5b1b4b['setChangeGroupState'](_0x253c2e,'accepted'));const _0x31e9c0=Y({'editor':_0x70b0c5,'reply':_0x5b1b4b,'interaction':_0x5e0e65,'groups':_0x22e159,'transform':!0x0,'documentCompare':_0x182514,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x31a462;_0x3b4816&&this['_scrollToSuggestionRange'](_0x3b4816['range']),_0x70b0c5['model']['change'](_0x26438d=>{_0x31a462=_0x26438d['batch'];for(const _0x5272f9 of _0x31e9c0)_0x5272f9['baseVersion']=_0x70b0c5['model']['document']['version'],X(_0x70b0c5,_0x5272f9),_0x26438d['batch']['addOperation'](_0x5272f9),_0x70b0c5['model']['applyOperation'](_0x5272f9);}),this['_batchToChanges']['set'](_0x31a462,{'interactionId':_0x5e0e65['id'],'replyId':_0x5b1b4b['id'],'indexes':_0x556ca5['slice']()}),this['_updateRatings'](_0x5b1b4b);}['_openBalloonFor'](_0xe0441e,_0x5b060c){const _0x518153=ht(this['context']),_0x3bc7dc=this['_getDocumentRangeForReplyChanges'](_0xe0441e,_0x5b060c),_0x5da72a=this['context']['plugins']['get']($);if(!_0x3bc7dc)return void _0x5da72a['close']();const {range:_0x3c54e6,currentIndex:_0x5557e0}=_0x3bc7dc;if('$graveyard'==_0x3c54e6['root']['rootName']){const {reply:_0x43d3e1}=this['getInteractionAndReplyById'](_0xe0441e);return _0x43d3e1['setChangeGroupState'](_0x5557e0,'outdated'),void _0x5da72a['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0xe0441e&&this['_previewedChangeGroup']?.['partIndex']==_0x5557e0)return;this['stopListening'](_0x5da72a),this['_previewedChangeGroup']={'replyId':_0xe0441e,'partIndex':_0x5557e0};let _0x1a36ed=_0x518153['config']['get']('ai.availableReplyActions')||[...st];_0x518153['plugins']['has']('TrackChanges')||(_0x1a36ed=_0x1a36ed['filter'](_0x2f7149=>'insertSuggestion'!=_0x2f7149));const _0x30c99a=new N(_0x518153['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x1a36ed});this['stopListening'](_0x30c99a);const {reply:_0x110726}=this['getInteractionAndReplyById'](_0xe0441e),_0x4bad2b=_0x110726['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x4f9d74=>_0x4f9d74['hasChanges']),_0x8827e6=_0x4bad2b['findIndex'](_0x3a7776=>_0x3a7776['index']==_0x5557e0);if(-0x1==_0x8827e6)return;const _0x5a208c=_0x4bad2b[_0x8827e6],_0x19cc93=_0x4bad2b['at']((_0x8827e6-0x1)%_0x4bad2b['length'])?.['index'],_0x288d6a=_0x4bad2b['at']((_0x8827e6+0x1)%_0x4bad2b['length'])?.['index'];_0x30c99a['updateContent']({'parts':[_0x5a208c],'renderingStrategy':'static'});const _0x4b125b=_0x5557e0!==_0x19cc93;this['_scrollToSuggestionRange'](_0x3c54e6,!0x0),_0x5da72a['open']({'index':_0x5557e0,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x8827e6+0x1)['toString']()),'icon':Ot,'mainView':_0x30c99a,'showRotator':_0x4b125b,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':[_0x3c54e6]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0xe0441e,_0x5557e0),this['listenTo'](_0x30c99a,'toggleSuggestionDisplayMode',(_0x1050c5,{showDiff:_0x21d756})=>{this['_balloonShowDiff']=_0x21d756;const {reply:_0x3249c8}=this['getInteractionAndReplyById'](_0xe0441e),_0x517031=_0x3249c8['getContentParts']({'showDiff':_0x21d756,'groupIndex':_0x5557e0});_0x30c99a['updateContent']({'parts':_0x517031,'renderingStrategy':'static'});}),this['listenTo'](_0x5da72a,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0xe0441e,'partIndex':_0x5557e0}),_0x4b125b?this['_openBalloonFor'](_0xe0441e,_0x288d6a):_0x5da72a['close']();}),this['listenTo'](_0x5da72a,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0xe0441e,'partIndex':_0x5557e0}),_0x4b125b?this['_openBalloonFor'](_0xe0441e,_0x288d6a):_0x5da72a['close']();}),_0x4b125b&&(this['listenTo'](_0x5da72a,'showNext',()=>{this['_openBalloonFor'](_0xe0441e,_0x288d6a);}),this['listenTo'](_0x5da72a,'showPrevious',()=>{this['_openBalloonFor'](_0xe0441e,_0x19cc93);})),this['listenTo'](_0x5da72a,'dialogClosed',()=>{this['stopListening'](_0x5da72a),this['stopListening'](_0x30c99a),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x2def5e,_0xbc103f){const _0x42024c=ht(this['context']),{reply:_0x332d57,interaction:_0x5525aa}=this['getInteractionAndReplyById'](_0x2def5e),_0x4d715c=_0x332d57['changeGroups']['filter'](_0x586913=>'pending'==_0x586913['state']),_0x56181e=_0x4d715c['map'](_0x1cd325=>_0x332d57['changeGroups']['indexOf'](_0x1cd325));void 0x0===_0xbc103f&&(_0xbc103f=_0x56181e[0x0]);const _0x7b9597=_0x56181e['indexOf'](_0xbc103f);if(-0x1==_0x7b9597)return null;const _0x5308e5=_0x4d715c[_0x7b9597],_0x5bc948=new Rt([]),_0x4e2f95=new Rt([]);for(const _0x2e5f57 of _0x5308e5['changes'])if('removed'!=_0x2e5f57['type']&&_0x4e2f95['children']['push'](_0x2e5f57['node']['cloneNode'](!0x0)),'new'!=_0x2e5f57['type']){const _0x5c2260=wt(_0x22ce3d=>Et(_0x22ce3d,'data-id')==_0x2e5f57['id'],_0x332d57['documentContextContent'],!0x0);_0x5bc948['children']['push'](_0x5c2260['cloneNode'](!0x0));}if(0x0==_0x5bc948['children']['length']){if(_0x5308e5['changes'][0x0]['anchorId']){const _0x5199c9=Dt('data-id',_0x5308e5['changes'][0x0]['anchorId'],_0x332d57['documentContextContent']);_0x5bc948['children']['unshift'](_0x5199c9['cloneNode'](!0x0)),_0x4e2f95['children']['unshift'](_0x5199c9['cloneNode'](!0x0)),_0x5199c9['nextSibling']&&(_0x5bc948['children']['push'](_0x5199c9['nextSibling']['cloneNode'](!0x0)),_0x4e2f95['children']['push'](_0x5199c9['nextSibling']['cloneNode'](!0x0)));}else{const _0x4fec92=_0x332d57['documentContextContent']['children'][0x0];if(!_0x4fec92)return null;_0x5bc948['children']['push'](_0x4fec92['cloneNode'](!0x0)),_0x4e2f95['children']['push'](_0x4fec92['cloneNode'](!0x0));}}const _0x4f10ca=_0x5525aa['getDocumentContext'](),_0x236127=_0x42024c['data']['parse'](_0x4f10ca['content']),_0x5ef56e=St(_0x5bc948),_0x4c2507=_0x42024c['data']['parse'](_0x5ef56e),_0x175c99=_0x42024c['data']['parse'](_0x5ef56e),_0x48031a=_0x42024c['model']['createPositionAt'](_0x4c2507,0x0),_0x5d25ba=St(_0x4e2f95),_0xf29243={'anchor':_0x48031a,'markDeletions':!0x1},_0x3b7c8f=_0x42024c['plugins']['get'](_0x568068)['getDiff'](_0x5ef56e,_0x5d25ba,_0xf29243)['getOperations']();if(!_0x3b7c8f['length'])return null;_0x42024c['model']['change'](_0x3de139=>{for(const _0x3d401f of _0x3b7c8f)if('remove'==_0x3d401f['type']){const _0x44ec38=_0x3d401f['sourcePosition'],_0x594404=_0x3d401f['howMany'],_0x3e8572=new tt(_0x44ec38,_0x594404);_0x3de139['batch']['addOperation'](_0x3e8572),_0x42024c['model']['applyOperation'](_0x3e8572);}else'marker'!==_0x3d401f['type']&&(_0x3d401f['baseVersion']=null,_0x3d401f['isDocumentOperation']=!0x1,_0x3de139['batch']['addOperation'](_0x3d401f),_0x42024c['model']['applyOperation'](_0x3d401f));});const _0xf691c2=vt(_0x42024c,_0x3b7c8f,_0x4c2507);At(_0x42024c['model'],_0xf691c2);const _0x3e15f9=_0xf691c2['getFirstRange']()['start']['path']['slice'](),_0x530aa0=_0xf691c2['getFirstRange']()['end']['path']['slice'](),_0x58a795=[];let _0x2a3413=_0x4c2507,_0x44009a=_0x175c99;for(let _0x54922e=0x0;_0x54922e<_0x530aa0['length'];_0x54922e++){const _0x2cad7b=_0x2a3413['maxOffset']-_0x530aa0[_0x54922e];_0x58a795[_0x54922e]=_0x44009a['maxOffset']-_0x2cad7b,_0x2a3413=_0x2a3413['getChildAtOffset'](_0x530aa0[_0x54922e]),_0x44009a=_0x44009a['getChildAtOffset'](_0x58a795[_0x54922e]);}const _0x41019a=_0x42024c['model']['createRange'](_0x42024c['model']['createPositionFromPath'](_0x175c99,_0x3e15f9),_0x42024c['model']['createPositionFromPath'](_0x175c99,_0x58a795)),_0x1ae424=_0x175c99['getChild'](0x0)['getAttribute'](Tt),_0x587724=Array['from'](_0x236127['getChildren']())['find'](_0x1ef5f6=>_0x1ef5f6['getAttribute'](Tt)==_0x1ae424)['getPath'](),_0x1cab1d=_0x41019a['start']['path']['slice'](),_0x55d711=_0x41019a['end']['path']['slice']();_0x1cab1d[0x0]=_0x587724[0x0]+_0x1cab1d[0x0],_0x55d711[0x0]=_0x587724[0x0]+_0x55d711[0x0];let _0x645765=_0x42024c['model']['createRange'](_0x42024c['model']['createPositionFromPath'](_0x42024c['model']['document']['getRoot'](),_0x1cab1d),_0x42024c['model']['createPositionFromPath'](_0x42024c['model']['document']['getRoot'](),_0x55d711));const _0x16d6bf=_0x42024c['model']['document']['history']['getOperations'](_0x4f10ca['version']);for(const _0x1e3a8a of _0x16d6bf)_0x645765=_0x10f501['_createFromRanges'](_0x645765['getTransformedByOperation'](_0x1e3a8a));return{'range':_0x645765,'currentIndex':_0xbc103f};}['_integrateEditor'](_0x5941f5){if(!_0x5941f5['plugins']['has']('Undo'))return;const _0x388126=_0x5941f5['commands']['get']('undo'),_0x1a4baa=_0x5941f5['commands']['get']('redo');this['listenTo'](_0x388126,'revert',(_0x154dbe,_0x44afd5,_0x24ca2f)=>{const _0x184056=this['_batchToChanges']['get'](_0x44afd5);if(!_0x184056)return;const _0x31c811=this['activeConversation']['getInteraction'](_0x184056['interactionId'])['getReply'](_0x184056['replyId']);_0x184056['indexes']['forEach'](_0x4271da=>_0x31c811['setChangeGroupState'](_0x4271da,'pending')),this['_batchToChanges']['delete'](_0x44afd5),this['_batchToChanges']['set'](_0x24ca2f,_0x184056);}),this['listenTo'](_0x1a4baa,'revert',(_0x2172fe,_0x90d712,_0x48c9a5)=>{const _0x29d707=this['_batchToChanges']['get'](_0x90d712);if(!_0x29d707)return;const _0x4ba1a3=this['activeConversation']['getInteraction'](_0x29d707['interactionId'])['getReply'](_0x29d707['replyId']);_0x29d707['indexes']['forEach'](_0x150692=>_0x4ba1a3['setChangeGroupState'](_0x150692,'accepted')),this['_batchToChanges']['delete'](_0x90d712),this['_batchToChanges']['set'](_0x48c9a5,_0x29d707);});}async['loadConversation'](_0x3d7e69){this['context']['plugins']['get']($)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x4c6194=this['context']['plugins']['get'](Ct);this['updateConversationTitle']('\x20'),_0x4c6194['view']['activateTab']('chat'),await this['_startConversationSafely'](_0x3d7e69);const {sessionId:_0x3e6cc2}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x3d7e69,_0x3e6cc2),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x256c10){console['error']('Failed\x20to\x20load\x20conversation',_0x256c10);}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x37e97e){this['activeConversation']['id']===_0x37e97e&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x5cd0a4=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x5cd0a4),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x4c1c0a,quickActionData:_0x3c1a93}){await this['_handleUIUserMessage']({'userMessage':_0x4c1c0a,'quickActionData':_0x3c1a93});}['getGroupId'](){const _0x1a833b=this['context']['config']['get']('collaboration.channelId');if(!_0x1a833b)throw new _0x2520c7('ai-chat-missing-channel-id',this);return _0x1a833b;}async['_startConversationSafely'](_0x4a6190){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x4a6190);}catch(_0x50ca48){ft('ai-chat-conversation-start-failed',_0x50ca48),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x3e2693){const _0x2400bc=this['context']['plugins']['get']($);let _0x2d2b78;_0x2400bc['isOpen']&&_0x2400bc['close'](),_0x3e2693||!this['activeConversation']?_0x2d2b78=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x2d2b78=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x3ea905=this['getGroupId'](),_0x46ce1b=_0x3e2693||_0x4237d5();this['activeConversation']=new _t({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x2d2b78,'conversationId':_0x46ce1b,'group':_0x3ea905,'getEditor':()=>ht(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x21ce68,_0x515d57)=>{this['_aiChatUi']['createConversation'](_0x515d57),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x3e2693||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x2e74c6,_0xdba0f)=>{this['_aiChatUi']['setIsUploadInProgress'](_0xdba0f['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x212373,_0x173999)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x173999);}),this['activeConversation']['on']('webSearchStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('webSearchFinished',(_0xd6eb21,_0x34701e)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x34701e,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x14474a,_0x55892a)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x55892a,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x197f39,_0x553af7)=>{this['_aiChatUi']['removeFeedInteraction'](_0x553af7['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x43d325,_0x57b534,_0x54ae2c)=>{this['updateConversationTitle'](_0x57b534,_0x54ae2c);}),this['activeConversation']['on']('replyCreated',(_0x4dbddf,_0x1ab172)=>{'text-delta'===_0x1ab172['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x1ab172):this['_aiChatUi']['addFeedItemAISuggestion'](_0x1ab172);}),this['activeConversation']['on']('replyContentUpdated',async(_0x159649,_0xa18f5c)=>{await this['_updateReplyContent']({'reply':_0xa18f5c});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x3bb9c1,{reply:_0x27f514,index:_0x483e89,state:_0x5d806b})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x27f514['id'],'index':_0x483e89,'state':_0x5d806b});}),this['activeConversation']['on']('contextItemAdded',(_0x487cbc,_0x3edf38)=>{if(this['_aiChatUi']['addContextItem'](_0x3edf38['contextItem'],_0x3edf38['isLoading']),'selection'===_0x3edf38['contextItem']['type']){const _0x126239=[...ht(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x126239,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x149719,_0x4c59a2)=>{this['_aiChatUi']['removeContextItem'](_0x4c59a2['uiId']),'current-document'==_0x4c59a2['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x4c59a2['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x15f5f2,_0x2f3b47)=>{this['_aiChatUi']['setContextItemLoading'](_0x2f3b47['contextItem']['uiId'],_0x2f3b47['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x559c20,_0x3de411)=>{this['_aiChatUi']['setConversationContext'](_0x3de411['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x49f7f8,_0x3c9d7a)=>{this['_aiChatUi']['setAddContextOptions'](_0x3c9d7a['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x16397f,_0x4e1d36)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x4e1d36['sourceId'],_0x4e1d36['source'],_0x4e1d36['resources'],_0x4e1d36['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x10e082,_0x2944bc)=>{this['_aiChatUi']['updateResourceState'](_0x2944bc['sourceId'],_0x2944bc['resourceId'],_0x2944bc['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x278765,_0x43a1a1)=>{this['_aiChatUi']['updateCapabilities'](_0x43a1a1);}),this['activeConversation']['on']('modelSelected',(_0x41d50a,_0x2f7643)=>{this['_aiChatUi']['setSelectedModel'](_0x2f7643['selectedModel'],_0x2f7643['isDisabled']);}),this['activeConversation']['on']('error',(_0x3d4918,{error:_0x3757ae,interactionId:_0x19eee0,fileName:_0x5ebdc,url:_0x12cfa0,sourceId:_0xadcc04,sourceLabel:_0x1de395})=>{const _0x4ba678=_0x19eee0?_0x19eee0+':'+_0x4237d5():_0x4237d5();_0x3757ae['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x4ba678}):_0x3757ae['message']['startsWith']('ai-chat-conversation-init-failed')||_0x3757ae['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x4ba678}),this['_logError'](_0x3757ae)):_0x3757ae['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x5ebdc),'id':_0x4ba678}):_0x3757ae['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x12cfa0),'id':_0x4ba678}):_0x3757ae['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x4ba678}):_0x3757ae['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x4ba678}):_0x3757ae['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0xadcc04&&this['_aiChatUi']['closeSourceResourceBalloon'](_0xadcc04),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x1de395||'source'),'id':_0x4ba678}),this['_logError'](_0x3757ae)):_0x3757ae['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x4ba678}),this['_logError'](_0x3757ae)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x4ba678}),this['_logError'](_0x3757ae));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x3e2693||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x13ffa0,quickActionData:_0x47f462}){if(!this['activeConversation'])throw new _0x2520c7('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x13ffa0,'quickActionData':_0x47f462}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x302c4a=ht(this['context'])['model'],_0x5b8886=Array['from'](_0x302c4a['markers']['getMarkersGroup'](yt));_0x302c4a['change'](_0x8cecec=>{_0x5b8886['forEach'](_0x5577fb=>_0x8cecec['removeMarker'](_0x5577fb));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x5ca4cb){this['_aiChatUi']['setIsMaximized'](_0x5ca4cb);}['_logError'](_0x17ce63){ft(_0x17ce63['message']);}['_removeFromContext'](_0xfed39b){this['activeConversation']?.['removeFromContext'](_0xfed39b);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x5d784c){const [_0x3c3d61,_0x552a7f]=_0x5d784c['split'](':'),_0x3e751b=this['activeConversation']['getInteraction'](_0x3c3d61),_0xcc8e60=_0x3e751b['getReply'](_0x552a7f);return{'interaction':_0x3e751b,'reply':_0xcc8e60};}['_scrollToSuggestionRange'](_0x19c0a8,_0x56906b=!0x1){const _0x2fba26=ht(this['context']),_0x333938={'target':_0x2fba26['editing']['view']['domConverter']['viewRangeToDom'](_0x2fba26['editing']['mapper']['toViewRange'](_0x19c0a8)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x56906b};_0x56906b&&(_0x333938['alignToTop']=!0x0),ct(_0x333938);}['updateConversationTitle'](_0x20f50d,_0x20615f=!0x1){this['_aiChatUi']['setConversationTitle'](_0x20f50d||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x20615f);}async['_updateReplyContent']({reply:_0x36b9e0,renderingStrategy:_0x14490a}){const {id:_0x1cba84,isDone:_0x523669,type:_0x1e202a,parsedContent:_0x3cdfd4}=_0x36b9e0;if('modification-delta'===_0x1e202a){const _0x4cb8cb=_0x36b9e0['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x1cba84,'parts':_0x4cb8cb,'renderingStrategy':_0x14490a,'isDone':_0x523669});}else'text-delta'===_0x1e202a&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x1cba84,'parsedContent':_0x3cdfd4,'renderingStrategy':_0x14490a,'isDone':_0x523669});_0x523669&&_0x36b9e0['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x1cba84,_0x36b9e0['sources']);}async['_stopLastInteraction'](){const _0x5d65aa=this['activeConversation']?.['lastInteraction'];_0x5d65aa&&(_0x5d65aa['stop'](),this['_aiChatUi']['stopInteraction'](_0x5d65aa));}async['_flushLastInteractionUI'](){const _0x57e72c=this['activeConversation']?.['lastInteraction'];if(_0x57e72c){for await(const _0x2e46ae of _0x57e72c['replies'])await this['_updateReplyContent']({'reply':_0x2e46ae,'renderingStrategy':'static'});}}['_updateRatings'](_0x5d32ea){const _0x4fbbf8={'positiveCount':_0x5d32ea['changeGroups']['filter'](_0x42d93f=>'accepted'===_0x42d93f['state'])['length'],'totalCount':_0x5d32ea['changeGroups']['length'],'modificationId':_0x5d32ea['id']},_0x5830d7=this['activeConversation']['getInteraction'](_0x5d32ea['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x5830d7,_0x4fbbf8);}}const Mt=[...Ee,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class Le extends jr{['containerView'];['actionsView'];constructor(_0x57e11e,_0x2e4ba7){super(_0x2e4ba7),this['set']('isTrackChangesOn',!0x1),this['containerView']=new N(_0x57e11e,{'showDiff':_0x2e4ba7['showDiff'],'areActionsDisabled':_0x2e4ba7['areActionsDisabled'],'availableActions':_0x2e4ba7['availableActions']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x4938a8,_0x32d414)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x32d414['showDiff']});}),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x5bb3a4,{index:_0x1354fa})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x1354fa});}),this['containerView']['on']('insertSuggestion',(_0x4ef7f7,{index:_0x4d3180})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4d3180});}),this['containerView']['on']('rejectSuggestion',(_0xb70bc9,{index:_0x17e5ad})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x17e5ad});}),this['containerView']['on']('mouseOverSuggestion',(_0x20c493,{index:_0x214cfa})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x214cfa});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x5cff0f,{index:_0x1f4dc9})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1f4dc9});}),this['actionsView']=new nh(_0x57e11e,this['options']['availableActions']),this['actionsView']['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn'),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0x2e4ba7['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x47c900){await this['containerView']['updateContent'](_0x47c900),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x4f6fe6,_0x385618){this['containerView']['bodyView']['updatePartState'](_0x4f6fe6,_0x385618);}['updateSources'](_0xd7a645){this['containerView']['updateSources'](_0xd7a645);}['getPartView'](_0x2b2692){return this['containerView']['bodyView']['getPartView'](_0x2b2692);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Ve extends jr{['replyContainer'];constructor(_0x22c533,_0x40110d){super(_0x40110d),this['locale']=_0x22c533,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0xe56eb6(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':ze(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x5d98a9,renderingStrategy:_0x1c6793,abortSignal:_0x2acde7}){'streaming'===_0x1c6793?await this['streamIntoElement'](_0x5d98a9,this['replyContainer']['element'],_0x2acde7):this['replyContainer']['element']['innerHTML']=_0x2e70cb(_0x5d98a9);}['updateSources'](_0x146394){const _0x2997ab=new Sr(this['locale']);_0x2997ab['children']['addMany'](_0x146394['map'](_0x441cff=>new Fr(this['locale'],_0x441cff))),_0x2997ab['isVisible']=!0x0,this['children']['add'](_0x2997ab);}}const xn={'file':_0x1b7f7f,'document':_0x32a474,'web-resource':_0xf06db1,'text':_0x1b7f7f,'selection':_0x3fc565},$r='ck-ai-chat-context-chip',Qr='ck-ai-chat-context-chip_wide',Jr='ck-ai-chat-context-chip_document',Zr='ck-ai-chat-context-chip__label',ra='ck-ai-chat-context-chip__type-icon',oa='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class bo extends _0x32eaf5{constructor(_0x402406,_0x45f9e3,_0x41cc6a,_0xbc0aa1,_0x3576ba=!0x1){super(_0x402406),this['_isAnimationOnEnterEnabled']=_0xbc0aa1,this['_initializeProperties'](_0x45f9e3,_0x41cc6a,_0x3576ba),this['_setupTemplate']();}['render'](){super['render'](),this['_isAnimationOnEnterEnabled']&&this['element']&&(this['element']['classList']['add']('ck-ai-chat-context-chip_new-chip'),this['_handleAnimationEndOnce'](this['element'],()=>{this['element']&&this['element']['classList']['remove']('ck-ai-chat-context-chip_new-chip');}));}['disableAnimationOnEnter'](){this['_isAnimationOnEnterEnabled']=!0x1,this['element']&&this['element']['classList']['remove']('ck-ai-chat-context-chip_new-chip');}['_initializeProperties'](_0x3114ab,_0x290892,_0x41b98e){this['set']('label',_0x3114ab['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x3114ab['type']),this['set']('id',_0x3114ab['uiId']),this['set']('readonly',_0x290892),this['set']('isLoading',_0x41b98e);}['_setupTemplate'](){const _0x84b275=this['_createIconView'](),_0x441ea8=this['_createRemoveButton'](),_0x228641=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x228641),'children':this['_createTemplateChildren'](_0x84b275,_0x441ea8,_0x228641)});}['_createTemplateAttributes'](_0x1bec8f){return{'class':[$r,_0x1bec8f['if']('itemType',Jr,_0x411a2f=>'document'==_0x411a2f),_0x1bec8f['if']('itemType',Qr,_0x17b74b=>'selection'==_0x17b74b)],'data-cke-tooltip-text':_0x1bec8f['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':oa};}['_createTemplateChildren'](_0x169bbc,_0xde0ab4,_0x1e22f1){const _0x46e01e=this['_createLabelElement'](_0x1e22f1),_0xd8b672=this['_createLoaderIcon']();return this['readonly']?[_0x169bbc,_0x46e01e]:[_0x169bbc,_0xd8b672,_0x46e01e,_0xde0ab4];}['_createLabelElement'](_0x47c095){return{'tag':'span','attributes':{'class':Zr},'children':[{'text':_0x47c095['to']('label')}]};}['_createRemoveButton'](){const _0x22cf21=new _0x32eaf5(this['locale']);return _0x22cf21['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x3bb86e}),this['_setupRemoveButtonEvent'](_0x22cf21),_0x22cf21;}['_setupRemoveButtonEvent'](_0x3ae1e1){_0x3ae1e1['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x2c23f5=this['bindTemplate'],_0x1dfb27=new _0x2c655b();return _0x1dfb27['content']=xn[this['itemType']],_0x1dfb27['extendTemplate']({'attributes':{'class':[ra,_0x2c23f5['if']('isLoading','ck-hidden',_0x16e0e4=>_0x16e0e4)]}}),_0x1dfb27;}['_handleAnimationEndOnce'](_0x56f3ad,_0xde0b79){if(!_0x56f3ad)return;const _0xfa6d81=()=>{_0xde0b79(),_0x56f3ad['removeEventListener']('animationend',_0xfa6d81),_0x56f3ad['removeEventListener']('webkitAnimationEnd',_0xfa6d81);};_0x56f3ad['addEventListener']('animationend',_0xfa6d81),_0x56f3ad['addEventListener']('webkitAnimationEnd',_0xfa6d81);}['_createLoaderIcon'](){const _0x127215=new De('small');return _0x127215['bind']('isVisible')['to'](this,'isLoading',_0x482721=>_0x482721),_0x127215;}}function In(_0x380f8d){if(!_0x380f8d)return _0x380f8d;if(_0x380f8d['length']<=0x78)return _0x380f8d;const _0x18c4fc=_0x380f8d['slice'](0x0,0x78),_0x14a1c7=_0x18c4fc['lastIndexOf']('\x20');return(_0x14a1c7>0x0?_0x18c4fc['slice'](0x0,_0x14a1c7):_0x18c4fc)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Ao{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x39812e,_0x19c043,_0x4260d9,_0x257545,_0x292bba){this['_locale']=_0x39812e,this['_visibleChips']=_0x19c043,this['_config']={...hn,..._0x4260d9,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x4260d9['cssClasses']}},this['_overflowChips']=new _0x3a64b1(),this['_bodyCollection']=_0x257545,this['_parentView']=_0x292bba||null;}['setContainerElement'](_0x29434b){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x29434b,this['_setupVisibilityObserver']();}get['showMoreButtonView'](){return this['_showMoreButtonView'];}get['overflowChips'](){return this['_overflowChips'];}['reorganizeChips'](){requestAnimationFrame(()=>{this['_checkAndHandleOverflow']();});}['showBalloonPanel'](){this['_showMoreButtonView']&&this['_showMoreBalloonPanelView']&&(this['_updateBalloonContent'](),this['_showMoreButtonView']['isOn']=!0x0,this['_showMoreBalloonPanelView']['show'](),this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':document['querySelector']('.ck-ai-chat')}));}['hideBalloonPanel'](){this['_showMoreButtonView']&&this['_showMoreBalloonPanelView']&&(this['_showMoreButtonView']['isOn']=!0x1,this['_showMoreBalloonPanelView']['hide']());}['clear'](){this['_overflowChips']['clear'](),this['hideBalloonPanel'](),this['_updateShowMoreButtonVisibility'](),this['_showMoreButtonView']&&(this['_showMoreButtonView']['label']=''),this['_showMoreBalloonPanelView']&&this['_showMoreBalloonPanelView']['content']['clear']();}['destroy'](){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_showMoreButtonView']&&(this['_showMoreButtonView']['destroy'](),this['_showMoreButtonView']=null),this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['destroy'](),this['_showMoreBalloonPanelView']=null);}['_checkAndHandleOverflow'](){if(!this['_containerElement'])return;if(!this['_isContainerVisible']())return void(this['_pendingCalculation']=!0x0);this['_pendingCalculation']=!0x1;const _0x4d9585=[...this['_visibleChips'],...this['_overflowChips']],_0x2829ff=this['_createCalculationContainer'](),_0x384299=this['_calculateOverflowInContainer'](_0x2829ff,_0x4d9585),_0x379107=_0x2829ff['_ancestorsToRestore'];_0x379107&&this['_restoreAncestorVisibility'](_0x379107),_0x2829ff['remove'](),this['_applyOverflowResults'](_0x4d9585,_0x384299);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x3cc083({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x231ad8=new _0x32eaf5(this['_locale']);_0x231ad8['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x2ba07c=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x2ba07c['push'](this['_config']['cssClasses']['controlsButton']),_0x231ad8['extendTemplate']({'attributes':{'class':_0x2ba07c}}),_0x231ad8;}['_createShowMoreBalloonPanelView'](){const _0x3ca12c=new _0xbb1014(this['_locale']);return _0x3ca12c['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x3ca12c),_0x3ca12c;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x14f9d1=>{_0x14f9d1['disableAnimationOnEnter']();});const _0x1da678=new _0xe56eb6(this['_locale']);_0x1da678['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x1da678);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x381eb7=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x381eb7?'':'none');}['_repinBalloonPanel'](){this['_showMoreButtonView']?.['isOn']&&this['_showMoreBalloonPanelView']?.['isVisible']&&this['_showMoreButtonView']['element']&&this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':document['querySelector']('.ck-ai-chat')});}['_findTargetContainer'](_0x57433b){const _0x6e2cec=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x4f38cf=this['_containerElement']?.['classList'];if(_0x4f38cf){const _0x2f62b8=_0x4f38cf[0x0]||'',_0x3776e8=_0x57433b['querySelector']('.'+_0x2f62b8),_0x39d8d4=_0x57433b['querySelector'](_0x6e2cec);return _0x3776e8||_0x39d8d4||_0x57433b;}return _0x57433b['querySelector'](_0x6e2cec)||_0x57433b;}['_calculateContainerWidth'](){const _0x149d2d=this['_parentView']?.['element']||this['_containerElement'];if(!_0x149d2d)return an;const _0x148bfe=window['getComputedStyle'](_0x149d2d)['width'];if('auto'===_0x148bfe||'0px'===_0x148bfe||!_0x148bfe){const _0x3046c0=_0x149d2d['parentElement'];if(_0x3046c0){const _0x54d309=window['getComputedStyle'](_0x3046c0);return'auto'!==_0x54d309['width']?_0x54d309['width']:an;}return an;}return _0x148bfe;}['_applyCalculationStyles'](_0x10b950,_0x329f91){this['_config']['cssClasses']['calculationContainer']&&_0x10b950['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x10b950['style']['width']=_0x329f91,_0x10b950['style']['position']='absolute',_0x10b950['style']['top']='-9999px',_0x10b950['style']['left']='-9999px',_0x10b950['style']['opacity']='0',_0x10b950['style']['pointerEvents']='none',_0x10b950['style']['zIndex']='-1',_0x10b950['style']['visibility']='visible\x20!important',_0x10b950['style']['display']='block\x20!important',_0x10b950['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x3cad8f){_0x3cad8f['forEach'](({element:_0x3acf23,originalDisplay:_0x49f298,originalVisibility:_0x3dd8d2})=>{_0x3acf23['style']['display']=_0x49f298,_0x3acf23['style']['visibility']=_0x3dd8d2;});}['_makeAncestorsVisible'](_0x1c5aa5){const _0x35ebae=[];let _0x1d94b0=_0x1c5aa5;for(;_0x1d94b0&&_0x1d94b0!==document['body'];){const _0x4d8ff5=window['getComputedStyle'](_0x1d94b0);'none'!==_0x4d8ff5['display']&&'hidden'!==_0x4d8ff5['visibility']||(_0x35ebae['push']({'element':_0x1d94b0,'originalDisplay':_0x1d94b0['style']['display'],'originalVisibility':_0x1d94b0['style']['visibility']}),_0x1d94b0['style']['display']='block',_0x1d94b0['style']['visibility']='visible'),_0x1d94b0=_0x1d94b0['parentElement'];}return _0x35ebae;}['_createContainerElements'](){let _0x2f1ba9,_0x39bd4b;return this['_parentView']?.['element']?(_0x2f1ba9=this['_parentView']['element']['cloneNode'](!0x0),_0x39bd4b=this['_findTargetContainer'](_0x2f1ba9)):(_0x2f1ba9=document['createElement']('div'),_0x39bd4b=_0x2f1ba9),{'calculationContainer':_0x2f1ba9,'targetContainer':_0x39bd4b};}['_createCalculationContainer'](){const {calculationContainer:_0x58b1c1,targetContainer:_0x1ecfe8}=this['_createContainerElements'](),_0x389cfc=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x58b1c1,_0x389cfc);const _0xf0a2e1=this['_parentView']?.['element']||this['_containerElement'],_0x4ca586=_0xf0a2e1?.['parentElement'];_0x4ca586?_0x4ca586['appendChild'](_0x58b1c1):document['body']['appendChild'](_0x58b1c1),_0x58b1c1['_targetContainer']=_0x1ecfe8;const _0x4e2ce4=this['_makeAncestorsVisible'](_0x4ca586||null);return _0x58b1c1['offsetWidth'],_0x58b1c1['_ancestorsToRestore']=_0x4e2ce4,_0x58b1c1;}['_calculateOverflowInContainer'](_0x385829,_0x47777f){const _0x5a9ce1=_0x385829['_targetContainer']||_0x385829,_0x58e4eb=[],{rowCount:_0x59d74c}=this['_renderChipsAndCountRows'](_0x5a9ce1,_0x47777f);if(_0x59d74c<=this['_config']['maxVisibleRows'])return _0x58e4eb;const _0x1ec794=_0x47777f['slice']();for(;_0x1ec794['length']>0x0;){if(this['_testButtonFit'](_0x385829,_0x5a9ce1,_0x1ec794)){const _0x2a8bad=_0x47777f['filter'](_0x4f4a82=>!_0x1ec794['includes'](_0x4f4a82));_0x58e4eb['push'](..._0x2a8bad);break;}if(!_0x1ec794['pop']())break;}return _0x58e4eb;}['_renderChipsAndCountRows'](_0x219835,_0x2939fb){_0x219835['innerHTML']='',_0x2939fb['forEach'](_0x42f78c=>{if(_0x42f78c['element']){const _0x10b079=_0x42f78c['element']['cloneNode'](!0x0);_0x219835['appendChild'](_0x10b079);}}),_0x219835['offsetWidth'];const _0x37bd78=_0x219835['children'],_0x4910c9=[];return Array['from'](_0x37bd78)['forEach'](_0x3442d1=>{const _0x4dbf1b=_0x3442d1['getBoundingClientRect']()['top'];_0x4910c9['some'](_0x5ed836=>Math['abs'](_0x5ed836-_0x4dbf1b)<this['_config']['rowDetectionTolerance'])||_0x4910c9['push'](_0x4dbf1b);}),{'rowCount':_0x4910c9['length']};}['_createMockButton'](){const _0x528173=document['createElement']('button');return _0x528173['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x528173['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x528173['textContent']='+\x201',_0x528173;}['_testButtonFit'](_0x106c4b,_0x52ea07,_0x53cb85){this['_renderChipsAndCountRows'](_0x52ea07,_0x53cb85);const _0x3c629d=this['_createMockButton']();_0x106c4b['appendChild'](_0x3c629d),_0x106c4b['offsetWidth'];const _0x5e89e4=[..._0x52ea07['children'],_0x3c629d],_0x26e45f=[];_0x5e89e4['forEach'](_0x4c4b62=>{const _0x10878f=_0x4c4b62['getBoundingClientRect']()['top'];_0x26e45f['some'](_0x248406=>Math['abs'](_0x248406-_0x10878f)<this['_config']['rowDetectionTolerance'])||_0x26e45f['push'](_0x10878f);});const _0x5ae688=_0x26e45f['length'];return _0x3c629d['remove'](),_0x5ae688<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x332a3d,_0x1a7d9a){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x332a3d['forEach'](_0x372c8b=>{_0x1a7d9a['includes'](_0x372c8b)?this['_overflowChips']['add'](_0x372c8b):this['_visibleChips']['add'](_0x372c8b);});}['_updateOverflowUI'](_0x9cb230){if(_0x9cb230>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x9cb230>0x0&&this['_showMoreButtonView']){const _0x388199=''+this['_config']['showMoreLabelPrefix']+(_0x9cb230<0x63?_0x9cb230:'99');this['_showMoreButtonView']['label']=_0x388199;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x148dbb,_0x43e6f4){this['_distributeChips'](_0x148dbb,_0x43e6f4),this['_updateOverflowUI'](_0x43e6f4['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x52d3e2=>{_0x52d3e2[0x0]['isIntersecting']&&this['_pendingCalculation']&&requestAnimationFrame(()=>{this['_checkAndHandleOverflow']();});},{'threshold':0.01,'rootMargin':'50px'}),this['_intersectionObserver']['observe'](this['_containerElement']));}['_isContainerVisible'](){if(!this['_containerElement'])return!0x1;if(!this['_containerElement']['isConnected'])return!0x1;const _0x22509c=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x22509c['width']||0x0===_0x22509c['height'])return!0x1;const _0x1a83f0=window['innerHeight']||document['documentElement']['clientHeight'],_0x518230=window['innerWidth']||document['documentElement']['clientWidth'],_0x89ca3d=0xc8;return _0x22509c['bottom']>=-0xc8&&_0x22509c['top']<=_0x1a83f0+_0x89ca3d&&_0x22509c['right']>=-0xc8&&_0x22509c['left']<=_0x518230+_0x89ca3d;}}const ca='ck-ai-chat__feed__context-chips',la='ck-ai-chat-context-chips-wrapper',da='ck-ai-chat-context-chips-wrapper-balloon',ua='ck-ai-chat-controls-button',_a='ck-ai-chat-controls_context_show-more-button',Ia='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0xe56eb6{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x1baf80,_0x353afb,_0x47e315){super(_0x1baf80),this['_bodyCollection']=_0x47e315,this['_createContextChips'](_0x353afb);const _0xc6ab94={'cssClasses':{'showMoreButton':_a,'showMoreBalloon':Ia,'overflowContainer':da,'controlsButton':ua}};this['_overflowManager']=new Ao(_0x1baf80,this['_contextChips'],_0xc6ab94,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[ca,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':la},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x5f21c6=this['element']['querySelector']('.'+la);_0x5f21c6&&(this['_overflowManager']['setContainerElement'](_0x5f21c6),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x33e60f){for(const _0x3f36ad of _0x33e60f){const _0x267a21=new bo(this['locale'],_0x3f36ad,!0x0,!0x1);this['_contextChips']['add'](_0x267a21);}}}class Me extends jr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x53f675,_0x472cc4,_0x175b77){super(_0x472cc4),this['_locale']=_0x53f675,this['_bodyCollection']=_0x175b77,this['_createContextChipsView'](),this['_createMessageContentView'](),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__user-message']}});}['_createContextChipsView'](){this['options']['contextItems']&&this['options']['contextItems']['length']>0x0&&(this['_contextChipsView']=new ah(this['_locale'],this['options']['contextItems']['filter'](_0x5c9a1e=>!_0x5c9a1e['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0xe56eb6(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Lt extends jr{['capabilities'];constructor(_0x750857,_0x1c0384){super(_0x1c0384);const {isWebSearchEnabled:_0x51f898,isReasoningEnabled:_0x186178}=_0x1c0384['capabilities'],_0xb27071=[];let _0x2bda79='';_0x51f898&&_0x186178?(_0x2bda79=i(_0x750857,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0xb27071['push'](aa(_0x1de698)),_0xb27071['push'](aa(_0x41561c))):_0x51f898?(_0x2bda79=i(_0x750857,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0xb27071['push'](aa(_0x1de698))):_0x186178&&(_0x2bda79=i(_0x750857,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0xb27071['push'](aa(_0x41561c))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x2bda79?'':'ck-hidden']}});const _0x1f254f=new _0xe56eb6();_0x1f254f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0xb27071,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x2bda79]}]}),this['children']['add'](_0x1f254f),this['capabilities']=_0x1c0384['capabilities'];}}function aa(_0x3b8b8f){const _0x59951d=new _0x2c655b();return _0x59951d['content']=_0x3b8b8f,_0x59951d;}const ws=['wheel','touchstart','pointerdown','keydown'],fs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Fe{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x3e6f14){this['element']=_0x3e6f14,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x1c2c6d of ws){const _0x71482f='keydown'!==_0x1c2c6d;this['element']['addEventListener'](_0x1c2c6d,this['_onUserEvent']['bind'](this),{'passive':_0x71482f,'signal':this['abortController']['signal']});}}['start'](){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}['stop'](){requestAnimationFrame(()=>{this['_stop']();});}['destroy'](){this['_stop'](),this['abortController']['abort']();}['_stop'](){null!==this['animationFrameId']&&(cancelAnimationFrame(this['animationFrameId']),this['animationFrameId']=null),this['isRunning']&&(this['isRunning']=!0x1),this['isUserPaused']=!0x1;}['_onUserEvent'](_0x1c9a3f){if(this['isRunning']){if('keydown'===_0x1c9a3f['type']){const _0x18b218=_0x1c9a3f['key'];if(!fs['includes'](_0x18b218))return;}_0x1c9a3f instanceof WheelEvent?_0x1c9a3f['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x511f21,scrollHeight:_0x56aec3,clientHeight:_0x36661a}=this['element'];return _0x56aec3-_0x511f21-_0x36661a<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Pe extends _0xe56eb6{constructor(_0xa99cb1,_0x4bbd08){super(_0xa99cb1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x4bbd08)});}['_createSkeletonItems'](_0x2f42d3){const _0x56ca36=['ck','ck-ai-skeleton__item'];return _0x2f42d3['map'](_0x5ad0a6=>{let _0x296ba9='';switch(_0x5ad0a6['attributes']['align']){case'right':_0x296ba9='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x296ba9='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x296ba9='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x5ad0a6['tag'],'attributes':{'class':[..._0x56ca36,_0x5ad0a6['attributes']['class']?_0x5ad0a6['attributes']['class']:''],'style':'width:\x20'+_0x5ad0a6['attributes']['width']+';\x20height:\x20'+_0x5ad0a6['attributes']['height']+';'+_0x296ba9}};});}}const Be={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':ta(0x5,'100%','44px','right'),'aiChatResources':ta(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function ta(_0x527abf,_0x123020,_0x2fd567,_0x1d4d76){return new Array(_0x527abf)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x123020,'height':_0x2fd567,'align':_0x1d4d76}}));}class ji extends _0xe56eb6{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x5805fa,_0x238343){super(_0x5805fa),this['_bodyCollection']=_0x238343,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Mt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Fe(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x526f39,_0x5f5ee5){let _0x59aaaf;'ai-reply'===_0x526f39?_0x59aaaf=new Ve(this['locale'],_0x5f5ee5):'ai-suggestion-reply'===_0x526f39?(_0x59aaaf=new Le(this['locale'],_0x5f5ee5),_0x59aaaf['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0x59aaaf='user-message'===_0x526f39?new Me(this['locale'],_0x5f5ee5,this['_bodyCollection']):'interaction-header'===_0x526f39?new Lt(this['locale'],_0x5f5ee5):new Oe(_0x5f5ee5),this['children']['add'](_0x59aaaf);}async['updateReplyItem']({id:_0x205a16,parsedContent:_0x225070,renderingStrategy:_0x207173,abortSignal:_0xcbc146}){const _0x5f54d7=this['getItemById'](_0x205a16);if(!(_0x5f54d7 instanceof Ve))throw new _0x2520c7('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x5f54d7,'id':_0x205a16,'parsedContent':_0x225070});await _0x5f54d7['updateContent']({'parsedContent':_0x225070,'renderingStrategy':_0x207173,'abortSignal':_0xcbc146});}async['updateWebSources'](_0x119edc,_0x207a55){const _0x2a80f4=this['getItemById'](_0x119edc);if(_0x2a80f4 instanceof Le)_0x2a80f4['updateSources'](_0x207a55);else{if(!(_0x2a80f4 instanceof Ve))throw new _0x2520c7('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x2a80f4,'id':_0x119edc,'sources':_0x207a55});_0x2a80f4['updateSources'](_0x207a55);}}async['updateSuggestionItem']({id:_0x130500,parts:_0x26310b,renderingStrategy:_0x59f82d,abortSignal:_0xaf8820}){const _0x366594=this['getItemById'](_0x130500);if(!(_0x366594 instanceof Le))throw new _0x2520c7('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x366594,'id':_0x130500,'parts':_0x26310b});await _0x366594['updateContent']({'parts':_0x26310b,'renderingStrategy':_0x59f82d,'abortSignal':_0xaf8820});}['updateSuggestionPartState']({id:_0x4e4702,index:_0x39b1f3,state:_0x3916ba}){const _0x222fb2=this['getItemById'](_0x4e4702);if(!(_0x222fb2 instanceof Le))throw new _0x2520c7('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x4e4702});_0x222fb2['updatePartState'](_0x39b1f3,_0x3916ba);}['markItemAsDone'](_0x2f3c18){this['getItemById'](_0x2f3c18)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x5658f9=>_0x5658f9['options']['id']);}['removeItem'](_0x26fbb3){this['children']['remove'](this['getItemById'](_0x26fbb3));}['scrollToSuggestion'](_0x39e672,_0x32b8a6){const _0x5a12f3=this['getItemById'](_0x39e672);if(!(_0x5a12f3 instanceof Le))return void _0x2db034('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x39e672,'partIndex':_0x32b8a6});const _0x183689=_0x5a12f3['getPartView'](_0x32b8a6);_0x183689?ct({'target':_0x183689['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x2db034('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x39e672,'partIndex':_0x32b8a6});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x4a0194=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x4a0194,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x1ab03e=new Pe(this['locale'],Be['aiFeed']);return _0x1ab03e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x50b26e=>!_0x50b26e)]}}),_0x1ab03e;}['_createFeedItems'](){const _0xad24c9=new _0xe56eb6(this['locale']);return _0xad24c9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0xad24c9;}['_createFeedLoader'](){const _0x1385b0=new _0xe56eb6(this['locale']);return _0x1385b0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x586fe0=>!_0x586fe0)]},'children':this['_createLoaderChildren']()}),_0x1385b0;}['_createLoaderChildren'](){const _0x4c88c6=new De();return _0x4c88c6['isVisible']=!0x0,[_0x4c88c6,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x38ac3d){const _0x36b3f9=this['children']['find'](_0x57464c=>_0x57464c['options']['id']['includes'](_0x38ac3d));if(!_0x36b3f9)throw new _0x2520c7('ai-chat-feed-view-item-not-found',this,{'id':_0x38ac3d});return _0x36b3f9;}['setLoadingMessage'](_0x45e72e){this['set']('loadingMessage',_0x45e72e);}['toggleLoadingSkeleton'](_0x1d1368){this['set']('isLoadingSkeletonVisible',_0x1d1368);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Ir extends _0x3cd02e{['filter'](){let _0x36e8b7=0x0;for(const _0x250c68 of this['items'])_0x36e8b7+=_0x250c68['items']['length'];return{'resultsCount':_0x36e8b7,'totalItemsCount':_0x36e8b7};}}class ps extends _0x36a3f6{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x28d8bd,_0x4e85b8){super(_0x28d8bd,{'queryView':{'label':'','creator':_0x2972cd,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Ir(_0x28d8bd),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x4e85b8,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ps['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ps['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x5a71ba,_0x2e7b40)=>!_0x5a71ba&&!_0x2e7b40),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x229b54,_0x5be7fc)=>{this['isUploadInProgress']||this['isEmpty']||_0x229b54['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5be7fc());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x2073c8=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x2073c8)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x152d71=_0x2b58c0(_0x2073c8);this['fire']('sendUserMessage',_0x152d71),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x2756ca){this['queryView']['fieldView']['set']('placeholder',_0x2756ca);}['_createSubmitButton'](){const _0x3a5e4c=new _0x32eaf5(this['locale']);return _0x3a5e4c['set']({'icon':_0x50c2db,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x3a5e4c['on']('execute',()=>{this['submit']();}),_0x3a5e4c;}['setIsUploadInProgress'](_0x1764ba){this['isUploadInProgress']=_0x1764ba;}['_setUpAddContextButtonPositioning'](){const _0x3ce52=this['locale'],_0x33e2c6=()=>{rt['window']['requestAnimationFrame'](()=>{if(_0x3c2798(this['element'])){const _0x4331d1=new lt(this['queryView']['fieldView']['element']),_0x2a0f23=new lt(this['_addContextButtonView']['element']),_0x137a54=_0x4331d1['width'],_0x41ebcb='rtl'===_0x3ce52['uiLanguageDirection']?'right':'left';_0x4331d1['excludeScrollbarsAndBorders']();const _0x121138=_0x137a54-_0x4331d1['width']+0x1;this['_addContextButtonView']['element']['style'][_0x41ebcb]='calc('+(_0x137a54-_0x2a0f23['width']-_0x121138)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x33e2c6),this['on']('render',()=>{_0x33e2c6(),this['_queryViewResizeObserver']=new _0x124fc4(this['queryView']['fieldView']['element'],()=>{_0x33e2c6();});});}}const Aa='ck-ai-chat__prompt-capabilities',ga='ck-ai-chat-controls-button',Ea='ck-ai-chat-controls-button--commands',ma='ck-ai-chat-controls__model-selection',pa='ck-ai-chat-controls__model-selection__item-name',Ta='ck-ai-chat-controls__model-selection__item-description',Ca='ck-ai-chat-controls__model-selection__item-capabilities',wa='n';class us extends _0xe56eb6{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x49e285){super(_0x49e285),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelSelectorVisible',_0xd37d86=>_0xd37d86),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x38ab8a=>_0x38ab8a?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x38d7ae=>_0x38d7ae),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x14af33=>_0x14af33),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x2b2590=>!_0x2b2590),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x3e5aab=>i(this['locale'],_0x3e5aab?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x1c9976=>_0x1c9976),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x3223a8=>!_0x3223a8),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x328210=>i(this['locale'],_0x328210?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Aa]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x3a64b1(),_0x5be927(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x469974,_0x1e0da5){if(this['set']('modelSelectorVisible',!(_0x1e0da5&&_0x469974['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x469974?.['length']){const _0x2e5844=ni['getLocalized'](this['locale'],_0x469974);for(const _0x7f8836 of _0x2e5844){const _0x404b4a=new _0xa62dc5({'label':_0x7f8836['name'],'withText':!0x0,'role':'menuitemradio','id':_0x7f8836['id'],'model':_0x7f8836});_0x404b4a['bind']('isOn')['to'](this,'activeModelId',_0x1e5e5d=>_0x1e5e5d===_0x7f8836['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x404b4a,'labelView':new fa(this['locale'],_0x7f8836)});}}}['setWebSearch'](_0x28a320){this['set']('webSearchActive',_0x28a320);}['setReasoning'](_0x349ee9){this['set']('reasoningActive',_0x349ee9);}['setModel'](_0x23b5b1){if(!_0x23b5b1)return;this['activeModelId']=_0x23b5b1['id'],this['activeModelName']=_0x23b5b1['name']||_0x23b5b1['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x23b5b1['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x23b5b1['name']);const _0x4e2ea3=_0x23b5b1['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x4e2ea3),this['_webSearchButton']['set']('isVisible',_0x4e2ea3);const _0x55cb19=_0x23b5b1['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x55cb19),this['_reasoningButton']['set']('isVisible',_0x55cb19);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x18e40d){this['set']('modelSelectorEnabled',!0x1),_0x18e40d&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x36e7e4=new _0x32eaf5();return _0x36e7e4['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x1de698,'class':ga,'isToggleable':!0x0,'tooltipPosition':wa}),_0x36e7e4['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x36e7e4;}['_createReasoningButton'](){const _0x14f577=new _0x32eaf5();return _0x14f577['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x41561c,'class':ga,'isToggleable':!0x0,'tooltipPosition':wa}),_0x14f577['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x14f577;}['_createCommandsButton'](){const _0xb613d6=new _0x32eaf5();return _0xb613d6['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':Ot,'withText':!0x0,'class':ga,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':wa}),_0xb613d6['extendTemplate']({'attributes':{'class':[Ea]}}),_0xb613d6['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0xb613d6;}['_createModelSelectionDropdown'](){const _0x36afa6=_0x4f8f4d(this['locale']);return _0x36afa6['set']({'panelPosition':'ne','class':[ma]}),_0x36afa6['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':wa}),this['listenTo'](_0x36afa6,'execute',_0x599418=>{this['fire']('selectModel',_0x599418['source']['model']);}),_0x36afa6;}['_createModelNameView'](){const _0x4c1ec7=new Ko(this['locale']);return _0x4c1ec7['bind']('text')['to'](this,'activeModelName',_0x58aca4=>_0x58aca4??''),_0x4c1ec7['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x4bced8,_0x1b5ae0)=>!_0x4bced8&&!_0x1b5ae0?.['toLowerCase']()['startsWith']('agent')),_0x4c1ec7;}}let fa=class extends _0x102c6c{constructor(_0x1f37e3,_0x365a0a){super();const _0x4e24fe=this['bindTemplate'],_0x12bb0c=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x4e24fe['to']('style'),'id':_0x4e24fe['to']('id')},'children':[{'tag':'div','attributes':{'class':[pa]},'children':[{'text':_0x4e24fe['to']('text')}]},{'tag':'div','attributes':{'class':[Ta]},'children':[{'tag':'span','children':[{'text':_0x365a0a['description']}]}]},{'tag':'div','attributes':{'class':[Ca]},'children':_0x12bb0c}]}),_0x12bb0c['addMany'](this['_getCapabilityParts'](_0x1f37e3,_0x1de698,'AI_CHAT_SEARCH_WEB',_0x365a0a['capabilities']['webSearch']?.['enabled']??!0x1)),_0x12bb0c['addMany'](this['_getCapabilityParts'](_0x1f37e3,_0x41561c,'AI_CHAT_REASONING',_0x365a0a['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x41c4a0,_0x3c2e9b,_0x53e0b6,_0x28ffbc){const _0x51b135=new _0x2c655b();_0x51b135['content']=_0x3c2e9b;const _0x214221=new _0xe56eb6(_0x41c4a0);_0x214221['setTemplate']({'tag':'span','children':[{'text':i(_0x41c4a0,_0x53e0b6)+':\x20'}]});const _0x4eca84=new _0xe56eb6(_0x41c4a0);return _0x4eca84['setTemplate']({'tag':'span','children':[{'text':i(_0x41c4a0,_0x28ffbc?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x51b135,_0x214221,_0x4eca84];}};class Ko extends _0xe56eb6{constructor(_0x1a791a){super(_0x1a791a),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x11d11a=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x11d11a['if']('isVisible','ck-hidden',_0x35cfc1=>!_0x35cfc1)]},'children':[{'text':_0x11d11a['to']('text')}]});}}const Sa='ck-ai-chat-context-controls__url-form',Oa='ck-ai-chat-context-controls__url-input-section';class To extends _0xe56eb6{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x5796b0){super(_0x5796b0),this['focusTracker']=new _0x57a285(),this['keystrokes']=new _0xa0e91d(),this['backButton']=this['_createBackButton'](),this['urlInputField']=this['_createUrlInputField'](),this['confirmButton']=this['_createConfirmButton'](),this['_focusables']=this['createCollection']([this['backButton'],this['urlInputField'],this['confirmButton']]),this['focusCycler']=new _0x90a56c({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x5c8635=>{this['focusTracker']['add'](_0x5c8635['element']),this['keystrokes']['listenTo'](_0x5c8635['element']);}),_0xde76b({'view':this}),this['focus']();}['destroy'](){super['destroy'](),this['focusTracker']['destroy'](),this['keystrokes']['destroy']();}['focus'](){this['urlInputField']['focus']();}['getValue'](){return this['urlInputField']['fieldView']['element']?.['value']?.['trim']()||'';}['clear'](){this['urlInputField']['fieldView']['element']['value']='',this['urlInputField']['errorText']=null,this['confirmButton']['isEnabled']=!0x1;}['setError'](_0x147870){this['urlInputField']['errorText']=_0x147870,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x251109=new _0x32eaf5(this['locale']);return _0x251109['set']({'icon':_0x1a5b12,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x251109;}['_createUrlInputField'](){const _0xca2e98=new _0x555191(this['locale'],th);return _0xca2e98['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0xca2e98['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0xca2e98;}['_createConfirmButton'](){const _0x5751ab=new _0x32eaf5(this['locale']);return _0x5751ab['set']({'icon':_0x5d441a,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x5751ab;}['_setupTemplate'](){const _0x4ca59a=new _0x565fd0(this['locale'],{'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x4ca59a['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Sa,'tabindex':'-1'},'children':[_0x4ca59a,{'tag':'div','attributes':{'class':Oa},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0x2c58b3=>{_0x2c58b3['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x38a5ea,_0x4d9bf1)=>{this['clear'](),this['fire']('cancel'),_0x4d9bf1();});}['_handleSubmit'](){const _0x8dc728=this['getValue']()['trim']();_0x8dc728?this['_isValidUrl'](_0x8dc728)?(this['clearError'](),this['fire']('submitUrl',_0x8dc728)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x4e223d=this['getValue']()['trim'](),_0x4ea2ff=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x4e223d['length']>0x0&&!_0x4ea2ff;}['_isValidUrl'](_0x1bb65a){try{return!!new URL(_0x1bb65a);}catch{return!0x1;}}}const Ra='ck-ai-chat-resources__item',ba='ck-ai-chat-resources__item--in-context',Na='ck-ai-chat-resources__item-title',ka='ck-ai-chat-resources__item__icon';class tc extends _0x256274{['resource'];['_titleView'];['_iconView'];constructor(_0x2ff7c6,_0x4fe7b4){super(_0x2ff7c6),this['resource']=_0x4fe7b4,this['set']('isInContext',!!_0x4fe7b4['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0xdeab19){if(_0xdeab19['isInContext'])return _0x5d441a;switch(_0xdeab19['type']){case Ie['DOCUMENT']:return _0x32a474;case Ie['URL']:return _0xf06db1;case Ie['FILE']:case Ie['TEXT']:return _0x1b7f7f;default:return _0x5d99e2;}}['highlightText'](_0x31b6f0){if(!_0x31b6f0||''===_0x31b6f0['trim']())return void this['_titleView']['highlightText'](null);const _0x484715=new RegExp(_0x224fd3(_0x31b6f0),'gi');this['_titleView']['highlightText'](_0x484715);}['updateResourceState'](_0x3dcfff){this['resource']['isInContext']=_0x3dcfff,this['isInContext']=_0x3dcfff,this['_updateIcon']();}['_createTitleView'](){const _0x42fbbe=new _0x5a4cd5();return _0x42fbbe['text']=this['resource']['label'],_0x42fbbe['extendTemplate']({'tag':'span','attributes':{'class':[Na]}}),_0x42fbbe;}['_createIconView'](){const _0x59c754=new _0x2c655b();return _0x59c754['content']=this['getResourceIcon'](this['resource']),_0x59c754;}['_setupTemplate'](){const _0x4ecb81=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Ra,_0x4ecb81['if']('isVisible','ck-hidden',_0x44f161=>!_0x44f161),_0x4ecb81['if']('isInContext',ba)]},'children':[{'tag':'div','attributes':{'class':[ka]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x4ecb81['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const ya='ck-ai-chat-resources__list';class Rr extends _0x3cd02e{['_source'];constructor(_0x4da860,_0x1ef36f){super(_0x4da860),this['_source']=_0x1ef36f,this['extendTemplate']({'attributes':{'class':[ya]}});}['setResources'](_0x32c008,_0x2d2d1a){this['items']['clear']();let _0x514c79=_0x32c008;if(this['_source']['useDefaultFiltering']&&_0x2d2d1a&&''!==_0x2d2d1a['trim']()){const _0x49f783=new RegExp(_0x2d2d1a['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x514c79=_0x32c008['filter'](_0x500d9c=>_0x49f783['test'](_0x500d9c['label']));}for(const _0x1fd750 of _0x514c79){const _0x105f2d=new tc(this['locale'],_0x1fd750);_0x105f2d['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x1fd750);}),this['items']['add'](_0x105f2d);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x2d2d1a);}['highlightText'](_0x50f493){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x3e5091=>{_0x3e5091['highlightText'](_0x50f493);});}['updateResourceState'](_0x54db32,_0x18da3e){for(const _0x442d29 of this['items']){const _0x446963=_0x442d29;_0x446963['resource']['id']===_0x54db32&&_0x446963['updateResourceState'](_0x18da3e);}}['_handleResourceSelection'](_0x4dbeaf,_0x1f6914){this['fire']('addResourceToContext',{'source':_0x4dbeaf,'resource':_0x1f6914});}}class qr extends _0x555191{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x48fbfd){const t=_0x48fbfd['t'],_0x26a862={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':i(_0x48fbfd,'AI_CHAT_SEARCH_RESOURCES')};super(_0x48fbfd,_0x26a862['creator']),this['label']=_0x26a862['label'],this['_viewConfig']=_0x26a862,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x48fbfd,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x58801f){this['fire']('search',_0x58801f);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x2c655b(),this['iconView']['content']=_0xb4883c,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x177ec6,t){this['resetButtonView']=new _0x32eaf5(_0x177ec6),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x5e4164,'class':'ck-search__reset','isVisible':!0x1,'tooltip':!0x0}),this['resetButtonView']['on']('execute',()=>{this['reset'](),this['focus'](),this['fire']('reset');}),this['resetButtonView']['bind']('isVisible')['to'](this['fieldView'],'isEmpty',_0x2935b2=>!_0x2935b2),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class Or extends _0xe56eb6{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x4590b4,_0x38ca58){super(_0x4590b4),this['_source']=_0x38ca58['source'],this['_searchInputVisibleFrom']=_0x38ca58['searchInputVisibleFrom']??0x7,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView'](),this['_searchSection']=this['_createSearchSection'](),this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x2a5a90([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new qr(this['locale']);}['_createSearchSection'](){const _0x3a97a2=new _0xe56eb6(this['locale']);return _0x3a97a2['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x5bce73,_0x46424d)=>{this['loadResources'](_0x46424d),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x46424d);}),_0x3a97a2;}['_createResourcesListView'](){const _0x59b2b7=new Rr(this['locale'],this['_source']);return _0x59b2b7['delegate']('addResourceToContext')['to'](this),_0x59b2b7['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x59b2b7;}['_createSkeletonView'](){const _0x4efef0=new Pe(this['locale'],Be['aiChatResources']);return _0x4efef0['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x5b1e9e=>!_0x5b1e9e)]}}),_0x4efef0;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x1c2754){const _0x1a62f8=_0x4237d5();this['_latestLoadResourcesUid']=_0x1a62f8,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x1c2754,'uid':_0x1a62f8}),this['isLoading']=!0x0;}['setResources'](_0x997f09,_0x415317){if(_0x415317&&_0x415317!==this['_latestLoadResourcesUid'])return;const _0x19d47b=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x997f09,_0x19d47b),_0x997f09['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x573063,_0x5a4a9d){this['_resourcesListView']['updateResourceState'](_0x573063,_0x5a4a9d);}}const va='ck-ai-chat-context-controls__source-balloon-panel',xa='ck-button-icon\x20ck-button-back',La='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class ko{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x1b206c,_0x23474b,_0x4c162f){this['_locale']=_0x1b206c,this['_bodyCollection']=_0x23474b,this['_config']=_0x4c162f;}['showSourceResourcesBalloon'](_0x8f6b46){let _0x1e2b2e=this['_sourceResourceBalloons']['get'](_0x8f6b46['id']);_0x1e2b2e||(_0x1e2b2e=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x8f6b46['id'],_0x1e2b2e),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x1e2b2e)),this['_addSourceResourceContent'](_0x1e2b2e,_0x8f6b46),_0x1e2b2e['show']();const _0xcb4e3e=this['_config']['getTargetElement']();_0xcb4e3e&&_0x1e2b2e['pin']({'target':_0xcb4e3e,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x159dde,_0x15b921,_0x1efdd9){const _0x2f56bf=this['_sourceResourceBalloons']['get'](_0x159dde);if(!_0x2f56bf)return;const _0x5f1577=this['_getResourcesViewFromBalloon'](_0x2f56bf);_0x5f1577&&(_0x5f1577['setResources'](_0x15b921,_0x1efdd9),_0x5f1577['once']('change:isLoading',()=>{_0x2f56bf['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x29fb59){const _0x3748d2=this['_sourceResourceBalloons']['get'](_0x29fb59);_0x3748d2&&requestAnimationFrame(()=>{_0x3748d2['hide'](),this['_sourceResourceBalloons']['delete'](_0x29fb59),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x3cf35e of this['_sourceResourceBalloons']['values']())if(_0x3cf35e['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x37d9a7,_0x1714cf,_0x5e6531){const _0x2fb312=this['_sourceResourceBalloons']['get'](_0x37d9a7);if(!_0x2fb312||!_0x2fb312['isVisible'])return;const _0x1a9f61=this['_config']['getTargetElement']();if(!_0x1a9f61)return;_0x2fb312['pin']({'target':_0x1a9f61,'limiter':this['_config']['getLimiterElement']()});const _0x9a5668=this['_getResourcesViewFromBalloon'](_0x2fb312);_0x9a5668&&_0x9a5668['updateResourceState'](_0x1714cf,_0x5e6531);}['destroy'](){for(const _0xaa69e5 of this['_sourceResourceBalloons']['values']())_0xaa69e5['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x4d07db=new _0xbb1014(this['_locale']);return _0x4d07db['extendTemplate']({'attributes':{'class':va}}),this['_bodyCollection']['add'](_0x4d07db),_0x4d07db;}['_addSourceResourceContent'](_0x5163bf,_0x29b294){_0x5163bf['content']['clear']();const _0x545f9a=this['_createBalloonHeader'](_0x5163bf,_0x29b294);_0x5163bf['content']['add'](_0x545f9a);const _0x585b38=this['_createBalloonResourcesView'](_0x29b294);_0x5163bf['content']['add'](_0x585b38);}['_createBalloonHeader'](_0x121de5,_0x48bc11){const _0x1e7f54=this['_createBackButton'](_0x121de5),_0x4a98d8=new _0x565fd0(this['_locale'],{'label':_0x48bc11['label'],'class':La});return _0x4a98d8['children']['add'](_0x1e7f54,0x0),_0x4a98d8;}['_createBackButton'](_0x563769){const _0x4d3114=new _0x32eaf5(this['_locale']);return _0x4d3114['set']({'icon':_0x1a5b12,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':xa}),_0x4d3114['on']('execute',()=>{_0x563769['hide'](),this['_config']['onBackToContext']();}),_0x4d3114;}['_createBalloonResourcesView'](_0x9b0bf2){const _0x458f85=new Or(this['_locale'],{'source':_0x9b0bf2,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x458f85['on']('loadSourceResources',(_0x20188d,_0x185cd9)=>{this['_config']['onLoadSourceResources'](_0x185cd9);}),_0x458f85['on']('addResourceToContext',(_0x118a5b,_0x10c939)=>{this['_config']['onResourceSelected'](_0x10c939['source'],_0x10c939['resource']),this['closeSourceResourceBalloon'](_0x9b0bf2['id']);}),_0x458f85;}['_getResourcesViewFromBalloon'](_0x52d5b7){const _0x329154=_0x52d5b7['content']['get'](0x1);return _0x329154 instanceof Or?_0x329154:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x27818f){_0x3cc083({'emitter':_0x27818f,'contextElements':[_0x27818f['element']],'callback':()=>{_0x27818f['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x27818f['isVisible']});}}const bs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],Eo='ck-ai-chat-context-controls',vo='ck-ai-chat-context-controls__pending-contexts',Vo='ck-ai-chat-context-controls__add-context-balloon-panel',Io='ck-ai-chat-context-controls__add-context-button',Po='ck-ai-chat-context-controls__url-balloon-panel',Ro='ck-ai-chat-context-controls__balloon-button',Uo='ck-ai-chat-context-controls__balloon-button-source',Lo='ck-ai-chat-controls-button',No='ck-ai-chat-context-chips-wrapper-balloon',Oo='ck-ai-chat-controls_context_show-more-button',Mo='ck-ai-chat-context-controls__show-more-balloon-panel',Ho='ck-ai-chat',jo=[_0xbb1014['defaultPositions']['northArrowSouthWest'],_0xbb1014['defaultPositions']['northArrowSouth'],_0xbb1014['defaultPositions']['northArrowSouthEast'],_0xbb1014['defaultPositions']['southArrowNorthWest'],_0xbb1014['defaultPositions']['southArrowNorth'],_0xbb1014['defaultPositions']['southArrowNorthEast']];class ms extends _0xe56eb6{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x36dbee,_0x9acb27){super(_0x36dbee),this['bodyCollection']=_0x9acb27['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x36dbee),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x36dbee),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x36dbee),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x36dbee,_0x9acb27);const _0x271ac6={'cssClasses':{'showMoreButton':Oo,'showMoreBalloon':Mo,'overflowContainer':No,'controlsButton':Lo}};this['_overflowManager']=new Ao(_0x36dbee,this['_currentContextsChips'],_0x271ac6,this['bodyCollection'],this),this['_addContextBalloonConfig']={'buttonView':this['addContextButtonView'],'balloonView':this['_addContextBalloonPanelView'],'hideMethod':this['hideAddContextBalloonPanel']['bind'](this),'showMethod':this['showAddContextBalloonPanel']['bind'](this)},this['_setupTemplate'](),this['_bindEventHandlers']();}['render'](){super['render'](),this['_setupAllBalloonClickOutsideHandlers'](),this['_overflowManager']['setContainerElement'](this['element']),this['_overflowManager']['reorganizeChips']();}['destroy'](){super['destroy'](),this['_overflowManager']['destroy'](),this['_resourcesBalloonView']['destroy']();}['addContextItem'](_0x521779,_0x4a068d){const _0x3f6dae=this['_createContextButton'](_0x521779,'current',!0x0,_0x4a068d);this['_addContextToCollection'](_0x3f6dae,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x49f411){this['_removeContextFromCollection'](_0x49f411,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x49f411,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x5de0cf,_0x15f67c){let _0x13bb1e=this['_currentContextsChips']['find'](_0x419209=>_0x419209['id']===_0x5de0cf);_0x13bb1e||(_0x13bb1e=this['_overflowManager']['overflowChips']['find'](_0xd385ba=>_0xd385ba['id']===_0x5de0cf)),_0x13bb1e&&(_0x13bb1e['isLoading']=_0x15f67c);}['setConversationContext'](_0x5fdf5e){this['_conversationContextsChips']['clear']();for(const _0x362f0f of _0x5fdf5e){const _0x39ece1=this['_createContextButton'](_0x362f0f,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x39ece1,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x362e76,_0x7c653,_0x35245f){this['_resourcesBalloonView']['updateResourceState'](_0x362e76,_0x7c653,_0x35245f);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['_showSourceResourcesBalloon'](_0x402ae0){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x402ae0),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x1edd99,_0x36b608,_0x219e4d,_0x15e798){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x1edd99,_0x219e4d,_0x15e798);}['closeSourceResourceBalloon'](_0x478680){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x478680),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x5c5787){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x5c5787),this['_setAddContextButtonEnabled'](_0x5c5787);}['_setAddContextButtonEnabled'](_0x4a61b4){const _0x563c2d=!_0x4a61b4['document']['isHidden']&&_0x4a61b4['document']['enabled'],_0x302352=_0x4a61b4['urls']['enabled'],_0x323c2c=_0x4a61b4['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x563c2d||_0x302352||_0x323c2c;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Eo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':vo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x502cd2){const _0x1bd3f4=new _0x32eaf5(_0x502cd2);return _0x1bd3f4['set']({'label':i(_0x502cd2,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Lo+'\x20'+Io,'icon':_0x5d25cb,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x1bd3f4;}['_createAddContextBalloonPanelView'](_0x56631b){return this['_createBaseBalloonPanel'](_0x56631b,Vo);}['_createUrlBalloonPanelView'](_0x4374cf){const _0x56e82c=this['_createBaseBalloonPanel'](_0x4374cf,Po);return this['_addUrlContent'](_0x56e82c,_0x4374cf),_0x56e82c;}['_createResourcesBalloonView'](_0x2da29f,_0xadecf2){const _0x4092f5={'searchInputVisibleFrom':_0xadecf2['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});},'onResourceSelected':(_0x2f7d7a,_0x1110ca)=>{this['fire']('addResourceToContext',{'source':_0x2f7d7a,'resource':_0x1110ca});},'onLoadSourceResources':_0x5d1e60=>{this['fire']('loadSourceResources',_0x5d1e60);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new ko(_0x2da29f,_0xadecf2['bodyCollection'],_0x4092f5);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Ho)||document['body'];}['_createBaseBalloonPanel'](_0x11795f,_0x50daef){const _0x45e9d0=new _0xbb1014(_0x11795f);return _0x45e9d0['extendTemplate']({'attributes':{'class':_0x50daef}}),this['bodyCollection']['add'](_0x45e9d0),_0x45e9d0;}['_setBalloonPanelContent'](_0x3c651b,_0x1e2270,_0x25e6e2){if(_0x3c651b['content']['clear'](),!_0x25e6e2['document']['isHidden']&&_0x25e6e2['document']['enabled']){const _0x40cfd3=this['_createBalloonButton'](_0x1e2270,{'label':i(_0x1e2270,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x32a474});_0x40cfd3['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x3c651b['content']['add'](_0x40cfd3);}if(_0x25e6e2['urls']['enabled']){const _0x44532a=this['_createBalloonButton'](_0x1e2270,{'label':i(_0x1e2270,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0xf06db1});_0x44532a['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}),this['_urlInputView']['focus']();}),_0x3c651b['content']['add'](_0x44532a);}if(_0x25e6e2['files']['enabled']){const _0x4015f0=new _0x3e98e0(_0x1e2270);_0x4015f0['set']({'label':i(_0x1e2270,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x491498,'withText':!0x0,'tooltip':!0x0,'class':Ro,'allowMultipleFiles':!0x0}),_0x4015f0['on']('done',(_0x50be43,_0x1f6f8b)=>{this['fire']('addFileToContext',_0x1f6f8b),this['hideAddContextBalloonPanel']();}),_0x4015f0['tooltip']=!0x0,_0x3c651b['content']['add'](_0x4015f0);}for(const _0x77b451 of _0x25e6e2['sources']){const _0x580cb9=this['_createBalloonButton'](_0x1e2270,{'label':_0x77b451['label'],'icon':_0x77b451['icon']||_0x5d99e2,'type':'source'});_0x3c651b['content']['add'](_0x580cb9),_0x580cb9['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x77b451);});}}['_addUrlContent'](_0x3ec2ff,_0x4c1703){this['_urlInputView']=new To(_0x4c1703),this['_urlInputView']['on']('submitUrl',(_0x2f9782,_0xf4fa54)=>{this['_handleUrlSubmit'](_0xf4fa54);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});}),_0x3ec2ff['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x1aa6c7,_0x4f8039){const _0x32b863='source'===_0x4f8039['type']?new Da(_0x1aa6c7):new _0x32eaf5(_0x1aa6c7);return _0x32b863['set']({'label':_0x4f8039['label'],'icon':_0x4f8039['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Ro}),_0x32b863;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x3cc083({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x41fa99){const _0x3e7931=this['_addContextBalloonConfig'];_0x3e7931['buttonView']['isOn']=_0x41fa99,_0x41fa99?_0x3e7931['balloonView']['show']():_0x3e7931['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x3c321a,buttonView:_0x482979,hideMethod:_0x41fcfc}=this['_addContextBalloonConfig'];_0x3cc083({'emitter':_0x3c321a,'contextElements':[_0x3c321a['element'],_0x482979['element']],'callback':()=>{_0x41fcfc();},'activator':()=>_0x482979['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0xb2fe92,_0x34b8ee,_0x2b11d4=!0x1,_0x1a5ac9=!0x1){const _0x216b08='conversation'===_0x34b8ee||!0x0===_0xb2fe92['isReadOnly'],_0xb08925=new bo(this['locale'],_0xb2fe92,_0x216b08,_0x2b11d4,_0x1a5ac9);return _0x216b08||_0xb08925['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0xb08925['id']);}),_0xb08925;}['_addContextToCollection'](_0x422d74,_0x531ff1){_0x531ff1['add'](_0x422d74,0x0);}['_removeContextFromCollection'](_0xc30e5d,_0x56c053){const _0x158d1=_0x56c053['find'](_0x1794cc=>_0x1794cc['id']===_0xc30e5d);_0x158d1&&_0x56c053['remove'](_0x158d1);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}));}['_handleUrlSubmit'](_0x274ac3){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x274ac3);}}class Da extends _0x32eaf5{['arrowView'];constructor(_0x21b486){super(_0x21b486),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Uo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x3ae377=new _0x2c655b();return _0x3ae377['content']=_0x3f1131,_0x3ae377['extendTemplate']({'attributes':{'class':Uo+'__arrow'}}),_0x3ae377;}}class gs extends _0xe56eb6{['_cancelButtonView'];['_loaderView'];constructor(_0x178163){super(_0x178163),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_loaderView']=this['_createLoaderView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-loader-wrapper','ck-reset_all']},'children':[this['_loaderView'],this['_cancelButtonView']]});}['_createCancelButtonView'](){const _0x16fd9f=new _0x32eaf5(this['locale']);return _0x16fd9f['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x5591c2}),_0x16fd9f['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x16fd9f;}['_createLoaderView'](){const _0x5e1dd3=new _0xe56eb6(this['locale']);return _0x5e1dd3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':i(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x5e1dd3;}}class ki extends _0xe56eb6{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x1e8dd8,_0x3af5bc){super(_0x1e8dd8),this['_contextPanelView']=this['_createContextPanelView'](_0x1e8dd8,{'bodyCollection':_0x3af5bc['bodyCollection'],'searchInputVisibleFrom':_0x3af5bc['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x1e8dd8),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x1e8dd8),this['_loaderView']=this['_createLoaderView'](_0x1e8dd8),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x1e8dd8),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...bs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x558b1b=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x558b1b['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x558b1b['if']('isLoading','ck-hidden',_0x380913=>_0x380913||!this['isModelAvailable']),_0x558b1b['if']('isModelAvailable','ck-hidden',_0x3760ac=>!_0x3760ac||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x558b1b['if']('isLoading','ck-hidden',_0x2b85b7=>!_0x2b85b7)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x558b1b['if']('isModelAvailable','ck-hidden',_0x270867=>_0x270867)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x3cc083({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x1d72c6,_0x38042a){return new ms(_0x1d72c6,_0x38042a);}['_createPromptInputView'](_0x2b6ed4){return new ps(_0x2b6ed4,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x4fcced){return new us(_0x4fcced);}['_createLoaderView'](_0x48477f){return new gs(_0x48477f);}['_createModelUnavailableMessageView'](_0x313b59){const _0x22052d=new _s(_0x313b59);return _0x22052d['delegate']('startConversation')['to'](this),_0x22052d;}['_handlePromptInputFocus'](_0x5443e9,_0x31b111,_0x132852){_0x132852?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x5bf7e3,_0x1c052b){this['_contextPanelView']['addContextItem'](_0x5bf7e3,_0x1c052b);}['removeContextItem'](_0x47ac44){this['_contextPanelView']['removeContextItem'](_0x47ac44);}['setContextItemLoading'](_0x4193f0,_0x579153){this['_contextPanelView']['setContextItemLoading'](_0x4193f0,_0x579153);}['setIsUploadInProgress'](_0x44c07a){this['_promptInputView']['setIsUploadInProgress'](_0x44c07a);}['setConversationContext'](_0x367e70){this['_contextPanelView']['setConversationContext'](_0x367e70);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x554c15,_0x41080b,_0x389d99){this['_contextPanelView']['updateResourceState'](_0x554c15,_0x41080b,_0x389d99);}['setWebSearch'](_0x4e2741){this['_promptCapabilitiesView']['setWebSearch'](_0x4e2741);}['setReasoning'](_0xc54821){this['_promptCapabilitiesView']['setReasoning'](_0xc54821);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x5ed739){this['_contextPanelView']['setAddContextOptions'](_0x5ed739);}['setInputPlaceholder'](_0x22dc9a){this['_promptInputView']['setPlaceholderText'](_0x22dc9a);}['setModelList'](_0x578231,_0x39222f){this['_displayedModels']=_0x578231,this['_promptCapabilitiesView']['setModelList'](_0x578231,_0x39222f);}['setModel'](_0x200584){(_0x200584?this['_displayedModels']['find'](_0x2ffed1=>_0x2ffed1['id']===_0x200584['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x200584)):_0x200584?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x47006b){this['_promptCapabilitiesView']['disableModelSelector'](_0x47006b);}['populateSourceResourceBalloon'](_0x5373c4,_0x5d9dd7,_0x323b6f,_0xd8966b){this['_contextPanelView']['populateSourceResourceBalloon'](_0x5373c4,_0x5d9dd7,_0x323b6f,_0xd8966b);}['closeSourceResourceBalloon'](_0x49e7f5){this['_contextPanelView']['closeSourceResourceBalloon'](_0x49e7f5);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class _s extends _0xe56eb6{constructor(_0x505aea){super(_0x505aea);const _0x2d7e55=new _0x32eaf5(_0x505aea);_0x2d7e55['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x2d7e55['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x2d7e55]}]});}}class bi extends _0x565fd0{['conversationStartButton'];['resizeButton'];constructor(_0x553103,_0xa95bb9){super(_0x553103,{'label':i(_0x553103,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Ht}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x553103),this['children']['add'](this['conversationStartButton']),_0xa95bb9&&(this['resizeButton']=ks(_0x553103,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x2ded88){const _0x443b3e=new _0x32eaf5(_0x2ded88);return _0x443b3e['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x1b9cf9,'class':'ck-ai-chat__start-conversation'}),_0x443b3e['on']('execute',()=>{this['fire']('startConversation');}),_0x443b3e;}}class xi extends _0xe56eb6{constructor(_0x29c868){super(_0x29c868),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x29c868,'AI_DISCLAIMER_TEXT')}]}]});}}class bt extends _0xe56eb6{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x2df297,_0x55a2fb){super(_0x2df297),this['_bodyCollection']=new _0x1c0188(_0x2df297),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new bi(_0x2df297,_0x55a2fb['showResizeButton']),this['chatHeader']['delegate'](...Mt)['to'](this),this['chatFeed']=new ji(_0x2df297,this['_bodyCollection']),this['chatFeed']['delegate'](...Mt)['to'](this),this['chatControls']=new ki(_0x2df297,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x55a2fb['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Mt)['to'](this),this['chatDisclaimer']=new xi(_0x2df297),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x2df297['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x43a482,_0x1f19ad,_0x377217,_0x13f0c1){this['chatControls']['populateSourceResourceBalloon'](_0x43a482,_0x1f19ad,_0x377217,_0x13f0c1);}['closeSourceResourceBalloon'](_0xacf180){this['chatControls']['closeSourceResourceBalloon'](_0xacf180);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class dt extends ot{static get['requires'](){return[Ct];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x4b21cb){super(_0x4b21cb);const _0x55d05c=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new H(),this['_view']=new bt(this['context']['locale'],{'showResizeButton':_0x55d05c['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Mt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x17eead,{showDiff:_0x28c527})=>{this['showDiff']=_0x28c527;}),_0x55d05c['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x37b2fb=>_0x37b2fb),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x370451=>_0x370451),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x5424a3){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x5424a3['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x2977a7,staticMessage:_0x216767}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x2977a7,'initialContent':'<p>'+_0x216767+'</p>'});}['addFeedItemUserMessage'](_0x21609a){const _0xeb2043=_0x21609a['quickActionData']?.['displayedPrompt']||_0x21609a['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x21609a['contextItems']['values']()),'initialContent':'<p>'+_0xeb2043+'</p>','id':_0x21609a['id']});}['addFeedItemError']({errorMessage:_0x530821,id:_0xe0cf40}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x530821+'</p>','id':_0xe0cf40});}['addFeedItemAIReply'](_0x287b4b){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x287b4b['interactionId']+':'+_0x287b4b['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x172929){const _0x3acd2f=ht(this['context']);let _0x5b1745=_0x3acd2f['config']['get']('ai.availableReplyActions')||[...st];if(_0x3acd2f['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x5ca759=_0x3acd2f['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x5ca759,'value');}}else _0x5b1745=_0x5b1745['filter'](_0x3830fc=>'insertSuggestion'!=_0x3830fc);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x172929['interactionId']+':'+_0x172929['id'],'areActionsDisabled':_0x172929['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x5b1745}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x1d6348,_0x129073){const _0x573e04=this['_view']['chatFeed']['children']['last'];if(_0x573e04 instanceof Lt)return this['_view']['chatFeed']['children']['remove'](_0x573e04),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1d6348['id'],'capabilities':{'isWebSearchEnabled':_0x573e04['capabilities']['isWebSearchEnabled']||_0x129073['isWebSearchEnabled'],'isReasoningEnabled':_0x573e04['capabilities']['isReasoningEnabled']||_0x129073['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1d6348['id'],'capabilities':_0x129073});}['updateFeedInteractionHeader'](_0x570093){const _0xe41e01=this['_view']['chatFeed']['children']['find'](_0x5129a2=>_0x5129a2['options']['id']==_0x570093['id']&&_0x5129a2 instanceof Lt);_0xe41e01&&_0xe41e01['set']('isVisible',_0x570093['isVisible']);}async['updateFeedItemAIReplyContent'](_0x4a5213){const _0x14a958=_0x4a5213['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x5f354c=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x4a5213,'abortSignal':_0x5f354c,'renderingStrategy':_0x14a958}),_0x4a5213['isDone']&&this['markFeedItemAsDone'](_0x4a5213['id']);});}['updateFeedItemAIReplySources'](_0x1ae3f3,_0x40897d){this['_view']['chatFeed']['updateWebSources'](_0x1ae3f3,_0x40897d);}async['updateFeedItemAIReplySuggestionContent'](_0x16d4fc){const _0x210188=_0x16d4fc['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x30ff59=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x16d4fc,'abortSignal':_0x30ff59,'renderingStrategy':_0x210188}),_0x16d4fc['isDone']&&this['markFeedItemAsDone'](_0x16d4fc['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x2d9713){this['_view']['chatFeed']['updateSuggestionPartState'](_0x2d9713);}['markFeedItemAsDone'](_0x3a4cfe){this['_view']['chatFeed']['markItemAsDone'](_0x3a4cfe);}['removeFeedInteraction'](_0x338b6f){this['_view']['chatFeed']['getItemIds']()['filter'](_0x2ad5d5=>_0x2ad5d5['startsWith'](_0x338b6f))['forEach'](_0x45a40b=>this['_view']['chatFeed']['removeItem'](_0x45a40b));}['startInteraction'](){this['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1}),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x3a12e4){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x4f2e95=>_0x4f2e95['startsWith'](_0x3a12e4['id']))['forEach'](_0x2baedf=>this['markFeedItemAsDone'](_0x2baedf)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x54f1da,_0x685341){this['_view']['chatControls']['addContextItem'](_0x54f1da,_0x685341);}['removeContextItem'](_0x4eee4a){this['_view']['chatControls']['removeContextItem'](_0x4eee4a);}['setContextItemLoading'](_0x13e91c,_0x12bdb5){this['_view']['chatControls']['setContextItemLoading'](_0x13e91c,_0x12bdb5);}['setIsUploadInProgress'](_0x294c61){this['_view']['chatControls']['setIsUploadInProgress'](_0x294c61);}['setConversationContext'](_0x508bbf){this['_view']['chatControls']['setConversationContext'](_0x508bbf);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0xa06ec6,_0x41c72c,_0x43c9e0){this['_view']['chatControls']['updateResourceState'](_0xa06ec6,_0x41c72c,_0x43c9e0);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x121584){this['_view']['chatControls']['setAddContextOptions'](_0x121584);}['updateCapabilities'](_0x197770){this['_view']['chatControls']['setWebSearch'](_0x197770['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x197770['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x197770));}['setSelectedModel'](_0x44a731,_0x27aabd){this['_view']['chatControls']['setModel'](_0x44a731),_0x27aabd&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x49c6fc){this['feedItemRenderingStrategy']=_0x49c6fc;}['toggleLoadingSkeleton'](_0x23b808){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x23b808);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x32ce5b,_0x4ea688=!0x1){if(_0x4ea688&&!Pt()&&_0x32ce5b['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x32ce5b);this['_view']['chatHeader']['label']=_0x32ce5b;}['setLoadingMessage'](_0x383ccf){const _0x111358=this['_getLoadingMessage'](_0x383ccf);this['_view']['chatFeed']['setLoadingMessage'](_0x111358);}['_animateConversationTitle'](_0x555d2f){let _0x11ca62=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x555d2f[_0x11ca62],_0x11ca62++,_0x11ca62===_0x555d2f['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x3e24ed){this['_view']['chatHeader']['isMaximized']=_0x3e24ed;}['_getLoadingMessage'](_0x155173){return _0x155173?_0x155173['isWebSearchEnabled']&&_0x155173['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x155173['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x155173['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x6a05f1){return _0x6a05f1?_0x6a05f1['isWebSearchEnabled']&&_0x6a05f1['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x6a05f1['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x6a05f1['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0xca1459,_0x27f97b,_0x45e95e,_0x78de8b){this['_view']['populateSourceResourceBalloon'](_0xca1459,_0x27f97b,_0x45e95e,_0x78de8b);}['closeSourceResourceBalloon'](_0x7b6714){this['_view']['closeSourceResourceBalloon'](_0x7b6714);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x37468a,_0x599b36){this['_view']['chatFeed']['scrollToSuggestion'](_0x37468a,_0x599b36);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Li extends _0x3cd02e{['sections'];constructor(_0x22e969,_0x1cc1e3){super(_0x22e969),this['sections']=_0x1cc1e3,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x233978){let _0x5c15bc=0x0,_0x2756ba=0x0;for(const _0xf4e5f0 of this['sections']){const {resultsCount:_0x517caf,totalItemsCount:_0x322cec}=_0xf4e5f0['filter'](_0x233978);_0x5c15bc+=_0x517caf,_0x2756ba+=_0x322cec;}return{'resultsCount':_0x5c15bc,'totalItemsCount':_0x2756ba};}}class Mi extends _0x256274{['title'];['itemsViews'];['_itemsListView'];constructor(_0xa8d73d,{title:_0x45bd9c,items:_0x103bdb}){super(_0xa8d73d);const _0x3e0bce=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x45bd9c,this['itemsViews']=_0x103bdb;const _0x5384da=new _0xe56eb6(_0xa8d73d);_0x5384da['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x3cd02e(_0xa8d73d),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x3e0bce['if']('isVisible','ck-hidden',_0x304800=>!_0x304800)]},'children':[_0x5384da,this['_itemsListView']]});}['filter'](_0x15db75){const _0x577068=this['itemsViews']['length'];let _0x1be5bb=0x0;for(const _0x4cd1ee of this['itemsViews']){if(_0x15db75){const _0x3bcfb5=_0x4cd1ee['isMatching'](_0x15db75);_0x4cd1ee['isVisible']=!!_0x3bcfb5,_0x4cd1ee['highlightText'](_0x15db75);}else _0x4cd1ee['isVisible']=!0x0,_0x4cd1ee['highlightText'](null);_0x4cd1ee['isVisible']&&_0x1be5bb++;}return this['isVisible']=_0x1be5bb>0x0,{'resultsCount':_0x1be5bb,'totalItemsCount':_0x577068};}['getItem'](_0x4f97b4){return this['itemsViews']['find'](_0x12d280=>_0x12d280['id']===_0x4f97b4);}['removeItem'](_0x4b8aa9){const _0x1bfcab=this['itemsViews']['indexOf'](_0x4b8aa9);-0x1!==_0x1bfcab&&(this['itemsViews']['splice'](_0x1bfcab,0x1),this['_itemsListView']['items']['remove'](_0x4b8aa9));}}class Yi extends/* #__PURE__ -- @preserve */
27
- _0x4308cc(_0x256274){['id'];static ['LOADING_LABELS']={'remove':'AI_CHAT_HISTORY_LOADING_REMOVING','rename':'AI_CHAT_HISTORY_LOADING_RENAMING','pin':'AI_CHAT_HISTORY_LOADING_PINNING','unpin':'AI_CHAT_HISTORY_LOADING_UNPINNING'};['actions'];['mainContent'];['_titleView'];constructor(_0x5bc9d5,_0x2cb616){super(_0x5bc9d5);const _0x5158d0=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x2cb616['pinned']),this['set']('loadingState',null),this['id']=_0x2cb616['id'];const {title:_0x5a63b0,createdAt:_0x4f9cb7,active:_0x3746fd=!0x1}=_0x2cb616;this['_titleView']=new _0x5a4cd5(),this['_titleView']['text']=_0x5a63b0,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x5aa3e4=this['_createCheckView'](),_0x140127=this['_createPinButtonView'](_0x5bc9d5),_0x361994=this['_createMenuDropdownView'](),_0x239096=this['_createEditInputView'](_0x5bc9d5,_0x5a63b0),_0x4219f6=this['_createAcceptEditButtonView'](_0x5bc9d5,_0x239096),_0x423e1f=this['_createCancelEditButtonView'](_0x5bc9d5,_0x239096);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x140127),this['actions']['add'](_0x361994),this['on']('change:isEdit',(_0x39966d,_0x1d237f,_0x3a60ab)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x3a60ab?(this['actions']['add'](_0x4219f6),this['actions']['add'](_0x423e1f),this['mainContent']['add'](_0x239096),_0x239096['element']['focus']()):(this['actions']['add'](_0x140127),this['actions']['add'](_0x361994),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x3746fd?'ck-ai-chat-history__item--active':'',_0x5158d0['if']('isVisible','ck-hidden',_0x2ec000=>!_0x2ec000),_0x5158d0['if']('isEdit','ck-ai-chat-history__item--edit')],'role':'listitem'},'children':[{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-check-container']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-check',_0x5158d0['if']('loadingState','ck-hidden',_0x5d91fa=>!!_0x5d91fa)]},'children':_0x3746fd?[_0x5aa3e4]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x5158d0['if']('loadingState','ck-hidden',_0x42263f=>!_0x42263f)]},'children':[this['_createSpinnerView']()]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-row']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-content']},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-title',_0x5158d0['if']('loadingState','ck-hidden',_0x4d04c1=>!!_0x4d04c1)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x5158d0['if']('loadingState','ck-hidden',_0x9e04dc=>!_0x9e04dc)]},'children':[{'text':_0x5158d0['to']('loadingState',_0x5a2fbe=>_0x5a2fbe?i(this['locale'],Yi['LOADING_LABELS'][_0x5a2fbe]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x4f9cb7]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-actions']},'children':this['actions']}]}]}),this['on']('click',()=>{this['isEdit']||this['fire']('selectConversation',{'id':this['id']});});}['updateTitle'](_0x4f2223){this['_titleView']['text']=_0x2b58c0(_0x4f2223);}['updateLoadingState'](_0x4c023d,_0x85cac4){this['set']('loadingState',_0x85cac4?_0x4c023d:null);}['_createCheckView'](){const _0x2e7197=new _0x2c655b();return _0x2e7197['set']({'content':_0xde42e2}),_0x2e7197;}['_createPinButtonView'](_0x55da37){const _0x185fe1=new _0x32eaf5(_0x55da37);return _0x185fe1['set']({'label':i(_0x55da37,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x382323,'withText':!0x1,'tooltip':!0x0}),_0x185fe1['bind']('isOn')['to'](this,'pinned'),_0x185fe1['on']('execute',()=>{const _0x2d1844=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x2d1844});}),_0x185fe1;}['_createMenuDropdownView'](){const _0x186054=_0x4f8f4d(this['locale'],_0x50daf7),_0x656752=_0x186054['panelView']['children'];_0x186054['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x157c65}),_0x186054['panelPosition']='sw';const _0x5a1c8a=new _0x32eaf5(this['locale']);_0x5a1c8a['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x5a1c8a['withText']=!0x0,_0x5a1c8a['on']('execute',()=>{this['isEdit']=!0x0;});const _0x12cb1e=new _0x32eaf5(this['locale']);_0x12cb1e['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x12cb1e['withText']=!0x0,_0x12cb1e['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x57944f=new _0x3cd02e(this['locale']),_0xac5da=new _0x256274(this['locale']);_0xac5da['children']['add'](_0x5a1c8a);const _0x3ee89e=new _0x256274(this['locale']);return _0x3ee89e['children']['add'](_0x12cb1e),_0x57944f['items']['addMany']([_0xac5da,_0x3ee89e]),_0x656752['add'](_0x57944f),_0x186054;}['_createEditInputView'](_0x26cdce,_0x2adece){const _0x4574d8=new _0x1fd503(_0x26cdce),_0x355c42=_0x4574d8['bindTemplate'];return _0x4574d8['value']=_0x2adece,_0x4574d8['extendTemplate']({'on':{'keydown':_0x355c42['to'](_0x22271f=>{'Enter'==_0x22271f['key']&&this['_commitEditInputValue'](_0x4574d8);})}}),_0x4574d8;}['_createAcceptEditButtonView'](_0x344761,_0x19bee6){const _0x708296=new _0x32eaf5(_0x344761);return _0x708296['set']({'icon':_0xde42e2,'withText':!0x1,'tooltip':i(_0x344761,'AI_CHAT_HISTORY_ACCEPT')}),_0x708296['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x708296['on']('execute',()=>{this['_commitEditInputValue'](_0x19bee6);}),_0x708296;}['_commitEditInputValue'](_0x3100ff){const _0x5e5450=_0x3100ff['element']['value']||'';this['_titleView']['text']=_0x5e5450,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x5e5450});}['_createCancelEditButtonView'](_0x38cd78,_0x53ff5a){const _0x50f29a=new _0x32eaf5(_0x38cd78);return _0x50f29a['set']({'icon':_0x5e4164,'withText':!0x1,'tooltip':i(_0x38cd78,'AI_CHAT_HISTORY_CANCEL')}),_0x50f29a['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x50f29a['on']('execute',()=>{this['isEdit']=!0x1,_0x53ff5a['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x50f29a;}['_createSpinnerView'](){const _0x46080a=new De('tiny');return _0x46080a['isVisible']=!0x0,_0x46080a;}['isMatching'](_0x4bdcd6){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x4bdcd6)?{'title':!0x0}:null;}['highlightText'](_0xbc601e){this['_titleView']['highlightText'](_0xbc601e);}}class Ut extends _0xe56eb6{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x327c68,_0x389ea4){super(_0x327c68),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x35eab9=new _0x565fd0(_0x327c68,{'label':i(_0x327c68,'AI_CHAT_HISTORY_HEADING'),'icon':Nt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x389ea4&&(this['resizeButton']=ks(_0x327c68,this),_0x35eab9['children']['add'](this['resizeButton'])),this['sectionsView']=new Li(_0x327c68,[]),this['sectionsView']['delegate'](...Di)['to'](this),this['errorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['on']('change:isLoading',()=>this['_updateViewVisibility']()),this['on']('change:hasItems',()=>this['_updateViewVisibility']()),this['on']('change:errorMessage',()=>this['_updateViewVisibility']()),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat-history','ck-rounded-corners'],'dir':'ltr'},'children':[_0x35eab9,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['errorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems']&&!this['errorMessage'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'];}['_createSearchView'](){const _0x3e3e33=new _0x8f42ae(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x5aff54=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x5aff54),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x3e3e33['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x3e3e33['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x1792f3=>!_0x1792f3)]}}),_0x3e3e33;}['_createSkeletonView'](){const _0xe09716=new Pe(this['locale'],Be['aiHistory']);return _0xe09716['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x2beb5c=>!_0x2beb5c)]}}),_0xe09716;}['_createErrorView'](){const _0x110f61=new _0xe56eb6(this['locale']),_0x220511=new _0x32eaf5(this['locale']);return _0x220511['set']({'withText':!0x1,'icon':_0x5e4164,'class':'ck-ai-chat-error__dismiss-button'}),_0x220511['bind']('isVisible')['to'](this,'hasItems',_0x150ef4=>!!_0x150ef4),_0x220511['on']('execute',()=>{this['errorMessage']='';}),_0x110f61['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x7b50cd=>!_0x7b50cd)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x220511]}),_0x110f61;}['_createEmptyStateView'](){const _0x288086=new _0x32eaf5(this['locale']);_0x288086['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x1b9cf9,'class':'ck-ai-chat__start-conversation'}),_0x288086['on']('execute',()=>{this['fire']('openChat');});const _0x1e2192=new _0xe56eb6(this['locale']);return _0x1e2192['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x3d684a=>!_0x3d684a)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x288086]}),_0x1e2192;}['_createListItemViews'](_0x41e3f8,_0x20783b){const _0x1e9850=[];for(const _0x401337 of _0x41e3f8){const _0x5c8a81=new Yi(_0x20783b,_0x401337);_0x5c8a81['delegate'](...Di)['to'](this),_0x1e9850['push'](_0x5c8a81);}return _0x1e9850;}['updateHistoryItemsWithCategories'](_0x2b8a5a){const _0xd407f3=this['locale']||'en',_0x42f145=[];for(const _0x21c195 of _0x2b8a5a){const _0x3c7ef7=this['_createListItemViews'](_0x21c195['items'],_0xd407f3);_0x42f145['push'](new Mi(_0xd407f3,{'title':_0x21c195['title'],'items':_0x3c7ef7}));}this['sectionsView']['sections']=_0x42f145,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x42f145),this['hasItems']=_0x2b8a5a['some'](_0x29efbd=>_0x29efbd['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x57e02b){for(const _0x31d2b7 of this['sectionsView']['sections']){const _0x3af226=_0x31d2b7['getItem'](_0x57e02b);if(_0x3af226){if(_0x31d2b7['removeItem'](_0x3af226),0x0===_0x31d2b7['itemsViews']['length']){const _0x38356f=this['sectionsView']['sections']['indexOf'](_0x31d2b7);-0x1!==_0x38356f&&(this['sectionsView']['sections']['splice'](_0x38356f,0x1),this['sectionsView']['items']['remove'](_0x31d2b7));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x188cd4,_0x860567){for(const _0x22c445 of this['sectionsView']['sections']){const _0x1e2f4d=_0x22c445['getItem'](_0x188cd4);if(_0x1e2f4d){_0x1e2f4d['updateTitle'](_0x860567);break;}}}['updateItemLoadingState'](_0x3a84ea,_0x3cc380,_0x3ef7e2){for(const _0x46dd66 of this['sectionsView']['sections']){const _0x5ce818=_0x46dd66['getItem'](_0x3a84ea);if(_0x5ce818){_0x5ce818['updateLoadingState'](_0x3cc380,_0x3ef7e2);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x870c5=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x870c5);}}}const Di=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends ot{static get['requires'](){return[Ct];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1394fa){super(_0x1394fa);const _0x1461a3=this['context']['plugins']['get']('AITabs');this['_historyView']=new Ut(this['context']['locale'],_0x1461a3['showResizeButton']),this['_historyView']['delegate'](...Di)['to'](this),_0x1461a3['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Nt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x2acfec){this['_historyView']['removeHistoryItem'](_0x2acfec);}['updateItems'](_0x3e2dc7){this['_historyView']['updateHistoryItemsWithCategories'](_0x3e2dc7);}['updateItemTitle'](_0x52cd8e,_0x28f203){this['_historyView']['updateItemTitle'](_0x52cd8e,_0x28f203);}['updateItemLoadingState'](_0x4b0dd2,_0x124ff7,_0x83f0f2){this['_historyView']['updateItemLoadingState'](_0x4b0dd2,_0x124ff7,_0x83f0f2);}['setLoadingSkeleton'](_0x34d6b6){this['_historyView']['isLoading']=_0x34d6b6;}['showError'](_0x21e5b2){this['_historyView']['errorMessage']=_0x21e5b2;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x21186b){this['_historyView']['isMaximized']=_0x21186b;}}class Ue extends ts(){['id'];['createdAt'];constructor({id:_0x478ed3,title:_0x4e1d2f,createdAt:_0x36eaa7,updatedAt:_0x4f222e,pinned:_0xd26ca}){super(),this['id']=_0x478ed3,this['createdAt']=new Date(_0x36eaa7),this['set']('title',_0x4e1d2f),this['set']('updatedAt',_0x4f222e?new Date(_0x4f222e):null),this['set']('pinned',_0xd26ca||!0x1);}['updateTitle'](_0x2e77c3){this['set']('title',_0x2b58c0(_0x2e77c3)),this['updatedAt']=new Date();}['updatePinned'](_0x5031e3){this['set']('pinned',_0x5031e3),this['updatedAt']=new Date();}}class Yt extends _0x42ebaf(){['items']=[];['connector'];['group'];constructor({connector:_0x5d8bf5,group:_0x108414}){super(),this['connector']=_0x5d8bf5,this['group']=_0x108414;}async['init'](){try{const _0x55a678=this['connector']['fetchConversations'](this['group']),_0x16a372=await _0x55a678['getConversations']();this['loadItems'](_0x16a372);}catch(_0x306d11){this['fire']('error',{'error':_0x306d11,'operation':'init'});}}['addItem'](_0x1b0b25){this['items']['push'](_0x1b0b25);}async['removeItem'](_0x714d64){const _0x78fe66=this['items']['findIndex'](_0x536e64=>_0x536e64['id']===_0x714d64);if(-0x1===_0x78fe66)return!0x1;try{return await this['connector']['deleteConversation'](_0x714d64)['execute'](),this['items']['splice'](_0x78fe66,0x1),this['fire']('itemRemoved',{'itemId':_0x714d64}),!0x0;}catch(_0x3cbf19){return this['fire']('error',{'error':_0x3cbf19,'operation':'removeItem','itemId':_0x714d64}),!0x1;}}['getItem'](_0x4ba2ca){return this['items']['find'](_0x5aa8b9=>_0x5aa8b9['id']===_0x4ba2ca);}async['updateItemTitle'](_0x42f624,_0xdc95c3){const _0x579b7c=this['getItem'](_0x42f624);if(!_0x579b7c)return!0x1;try{return await this['connector']['updateConversation'](_0x42f624,{'title':_0xdc95c3})['getResult'](),_0x579b7c['updateTitle'](_0xdc95c3),this['fire']('itemUpdated',{'itemId':_0x42f624,'updates':{'title':_0xdc95c3}}),!0x0;}catch(_0x29433){return this['fire']('error',{'error':_0x29433,'operation':'updateItemTitle','itemId':_0x42f624}),!0x1;}}async['updateItemPinned'](_0x307f34,_0x3372e1){const _0x48c6dd=this['getItem'](_0x307f34);if(!_0x48c6dd)return!0x1;try{return await this['connector']['updateConversation'](_0x307f34,{'pinned':_0x3372e1})['getResult'](),_0x48c6dd['updatePinned'](_0x3372e1),this['fire']('itemUpdated',{'itemId':_0x307f34,'updates':{'pinned':_0x3372e1}}),!0x0;}catch(_0x46bb10){return this['fire']('error',{'error':_0x46bb10,'operation':'updateItemPinned','itemId':_0x307f34}),!0x1;}}['loadItems'](_0x2ba0eb){try{this['items']=[],_0x2ba0eb['map'](_0x56518a=>{this['addItem'](new Ue(_0x56518a));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0xbd3b0b){this['fire']('error',{'error':_0xbd3b0b,'operation':'loadItems'});}}['getItems'](_0x316755={}){const _0x9a0ff9=void 0x0!==_0x316755['pinned']&&_0x316755['pinned'],_0x1abd17=_0x316755['from']?new Date(_0x316755['from']['getFullYear'](),_0x316755['from']['getMonth'](),_0x316755['from']['getDate']()):null,_0x1140f3=_0x316755['to']?new Date(_0x316755['to']['getFullYear'](),_0x316755['to']['getMonth'](),_0x316755['to']['getDate']()):null;return this['items']['filter'](_0x4ef707=>{if(_0x4ef707['pinned']!==_0x9a0ff9)return!0x1;if(_0x1140f3){const _0x5b7ecc=new Date(_0x4ef707['createdAt']['getFullYear'](),_0x4ef707['createdAt']['getMonth'](),_0x4ef707['createdAt']['getDate']());return _0x1abd17?_0x1abd17['getTime']()===_0x1140f3['getTime']()?_0x5b7ecc['getTime']()===_0x1abd17['getTime']():_0x5b7ecc<_0x1140f3&&_0x5b7ecc>=_0x1abd17:_0x5b7ecc<_0x1140f3;}return!0x0;});}}class jt extends ot{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[S,mt,xt,Ct];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](S),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](mt);const _0x40c27c=this['context']['plugins']['get'](Ct),_0x2a4b38=this['_aiChatController']['getGroupId']();this['history']=new Yt({'connector':this['_aiConnector'],'group':_0x2a4b38}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x43deec,_0x1b8d66)=>{this['_setItemLoading'](_0x1b8d66['id'],'remove'),this['_handleRemove'](_0x1b8d66['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x1215b1,_0x5e0622)=>{this['_setItemLoading'](_0x5e0622['id'],'rename'),this['_handleEditTitle'](_0x5e0622['id'],_0x5e0622['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x69cf12,_0x492516)=>{void 0x0!==_0x492516['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x492516['itemId'],_0x492516['updates']['title']),void 0x0!==_0x492516['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x492516['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x2080b5,_0x27a5e4)=>{this['_aiChatController']['handleRemovedConversation'](_0x27a5e4['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x27a5e4['itemId']),this['_clearItemLoading'](_0x27a5e4['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x5fa969,_0x35eb88)=>{this['_handleHistoryErrorUI'](_0x35eb88['error'],_0x35eb88['operation'],_0x35eb88['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x4a0e72,_0x32038e)=>{this['_handleSelectConversation'](_0x32038e['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x58eb07,_0x3c200d)=>{const _0x1a6400=_0x3c200d['pinned']?'pin':'unpin';this['_setItemLoading'](_0x3c200d['id'],_0x1a6400),this['_handleTogglePin'](_0x3c200d['id'],_0x3c200d['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x40c27c['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x40c27c['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x40c27c,'resizedTabs',(_0x2aaeb7,_0x5b0b06)=>{this['_setIsMaximized'](_0x5b0b06);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x40c27c['resize']();});}async['_handleEditTitle'](_0x42df54,_0x299bc7){await this['history']['updateItemTitle'](_0x42df54,_0x299bc7);}async['_handleTogglePin'](_0x29d75e,_0x3ec963){await this['history']['updateItemPinned'](_0x29d75e,_0x3ec963);}async['_handleRemove'](_0x12a787){await this['history']['removeItem'](_0x12a787);}async['_handleSelectConversation'](_0x3537a3){await this['_aiChatController']['loadConversation'](_0x3537a3);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x5d8fcd=this['_aiChatController']['activeConversation']?.['id'],_0x22d385=this['_getCategorizedItems']()['map'](_0x4df814=>({'title':_0x4df814['title'],'items':_0x4df814['items']['map'](_0x855cf3=>({'id':_0x855cf3['id'],'title':_0x855cf3['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x855cf3['createdAt'])['toLocaleDateString'](),'active':_0x855cf3['id']===_0x5d8fcd,'pinned':_0x855cf3['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x22d385);}['_setItemLoading'](_0x699e50,_0x2bb1be){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x699e50,_0x2bb1be,!0x0);}['_clearItemLoading'](_0x48d970){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x48d970,null,!0x1);}['_handleHistoryErrorUI'](_0x1907a3,_0x5e0c83,_0x58651c){const _0x595373=this['_generateErrorMessage'](_0x5e0c83,_0x58651c);this['_aiChatHistoryUi']['showError'](_0x595373),_0x58651c&&this['_clearItemLoading'](_0x58651c),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x544a85,_0x4c675f){const _0x5f12d1=_0x4c675f?this['history']['getItem'](_0x4c675f):null,_0x2c249c=_0x5f12d1?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x544a85){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x2c249c);case'updateItemPinned':{const _0x794b21=i(this['context']['locale'],_0x5f12d1?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x794b21,_0x2c249c]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x2c249c);case'init':case'loadItems':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x3d3b3e=new Date(),_0x5bc15c=new Date(_0x3d3b3e['getFullYear'](),_0x3d3b3e['getMonth'](),_0x3d3b3e['getDate']()),_0x55c55e=new Date(_0x5bc15c);_0x55c55e['setDate'](_0x55c55e['getDate']()-0x1);const _0x3085e9=new Date(_0x5bc15c);_0x3085e9['setDate'](_0x3085e9['getDate']()-0xe);const _0x21bb2b=this['history']['getItems']({'pinned':!0x0}),_0x311f2b=this['history']['getItems']({'from':_0x5bc15c,'to':_0x5bc15c}),_0x5e6c64=this['history']['getItems']({'from':_0x55c55e,'to':_0x55c55e}),_0x181310=this['history']['getItems']({'from':_0x3085e9,'to':_0x55c55e}),_0xf2e0a=this['history']['getItems']({'to':_0x3085e9}),_0x113881=[];return _0x21bb2b['length']>0x0&&_0x113881['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x21bb2b}),_0x311f2b['length']>0x0&&_0x113881['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x311f2b}),_0x5e6c64['length']>0x0&&_0x113881['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x5e6c64}),_0x181310['length']>0x0&&_0x113881['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x181310}),_0xf2e0a['length']>0x0&&_0x113881['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0xf2e0a}),_0x113881;}['_setIsMaximized'](_0x2b4f8a){this['_aiChatHistoryUi']['setIsMaximized'](_0x2b4f8a);}}class gt extends ot{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Pa extends ot{static get['requires'](){return[mt,R,dt,gt];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x366a87){super(_0x366a87),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](mt)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](mt)['startConversation']();}async['sendMessage']({message:_0x422a1b,quickActionData:_0x2539ac}){await this['context']['plugins']['get'](mt)['sendMessage']({'message':_0x422a1b,'quickActionData':_0x2539ac});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](mt)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](mt)['focusPromptInput']();}}class co extends Qt{constructor(_0x457778){super(_0x457778);const _0x44a982=_0x457778['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x44a982,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x1676d1=this['editor']['plugins']['get']('AITabs')['view'];_0x1676d1['isVisible']=!_0x1676d1['isVisible'];}}class qt extends _0x473589{static get['requires'](){return[Ct];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2d7b96=this['editor'];_0x2d7b96['commands']['add']('toggleAi',new co(_0x2d7b96)),_0x2d7b96['ui']['componentFactory']['add']('toggleAi',()=>{const _0x164de4=this['_createAIUIButton'](_0x32eaf5);return _0x164de4['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x164de4;}),_0x2d7b96['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x477d52=this['_createAIUIButton'](_0x267e6c);return _0x477d52['set']({'role':'menuitemcheckbox'}),_0x477d52;});}['_createAIUIButton'](_0x959cd1){const _0x21256f=this['editor'],_0x3597d8=_0x21256f['commands']['get']('toggleAi'),_0x3abf6d=new _0x959cd1(_0x21256f['locale']);return _0x3abf6d['set']({'label':i(_0x21256f['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x1479aa,'isToggleable':!0x0}),_0x3abf6d['bind']('isEnabled')['to'](_0x3597d8),_0x3abf6d['bind']('isOn')['to'](_0x3597d8,'value',_0x3628c6=>!!_0x3628c6),this['listenTo'](_0x3abf6d,'execute',()=>{_0x3597d8['execute']();}),_0x3abf6d;}}class Ha extends _0x473589{static get['requires'](){return[qt,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function ee(_0x25fbe0,_0xd03cab,_0x24bc62=!0x1,_0x93dc72=!0x0,_0x56581f=!0x0){return()=>{const _0x477900=_0x25fbe0['locale'],_0xb752da=new _0x32eaf5(_0x477900),_0x162b2b=_0xb752da['bindTemplate'];_0x56581f&&_0xb752da['extendTemplate']({'on':{'mouseenter':_0x162b2b['to'](()=>{_0xb752da['focus']();})}});const _0x3ad82c=_0xd03cab['icon']??_0xd03cab['parent']?.['icon'];return _0xb752da['set']({'label':_0xd03cab['displayedPrompt'],'withText':_0x24bc62,'role':'menuitem','icon':_0x93dc72?_0x3ad82c??_0x58ae49:void 0x0,'tooltip':!_0x24bc62,'class':'ck-ai-quick-actions-button'}),_0xb752da['on']('execute',()=>{_0x25fbe0['editing']['view']['focus'](),_0x25fbe0['commands']['execute']('aiQuickAction',_0xd03cab);}),_0xb752da;};}const Ls='menu',Ns='menuitem';class ao extends _0xe56eb6{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x52a9f8,_0x1990bf,_0x192b6a,_0x3f6685){const _0x1737fd=_0x52a9f8['locale'];super(_0x1737fd),this['_bodyCollection']=_0x3f6685;const _0x255d96=this['_createListItems'](_0x52a9f8,_0x1990bf,_0x192b6a);this['optionsListView']=new _0x3cd02e(_0x1737fd),this['optionsListView']['role']=Ls,this['optionsListView']['items']['addMany'](_0x255d96),this['focusTracker']=new _0x57a285(),this['keystrokes']=new _0xa0e91d(),this['_focusables']=_0x255d96,this['focusCycler']=new _0x90a56c({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x1737fd['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0x519a09,_0x2531af,_0x5c1503){const _0x16baac=new _0x2a5a90();return _0x2531af['forEach'](_0x39e75b=>{'actions'in _0x39e75b?_0x16baac['add'](this['_createActionGroupButton'](_0x519a09,_0x39e75b,_0x5c1503)):_0x16baac['add'](this['_createActionButton'](_0x519a09,_0x39e75b));}),_0x16baac;}['_createActionButton'](_0x4a29e0,_0x16f161){const _0x55c2bb=new _0x256274(this['locale']),_0x534b7b=ee(_0x4a29e0,_0x16f161,!0x0,void 0x0!==_0x16f161['icon'])();return _0x55c2bb['children']['add'](_0x534b7b),_0x55c2bb;}['_createActionGroupButton'](_0x5a97cf,_0x14d428,_0x281597){const _0x5eed4e=new _0x256274(this['locale']),_0x1ab352=new _0x39b6e6(this['locale']),_0x348300=_0x1ab352['bindTemplate'],_0x70614d='rtl'===_0x281597['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x3cf78d=this['_createGroupActionsList'](_0x5a97cf,_0x14d428['actions'],_0x281597);_0x1ab352['set']({'label':_0x14d428['label'],'withText':!0x0,'role':Ns,'icon':_0x14d428['icon']??_0x58ae49}),_0x1ab352['extendTemplate']({'on':{'mouseenter':_0x348300['to'](()=>{_0x1ab352['focus']();})}});const _0x14fd83=new _0xbb1014(this['locale']);return _0x14fd83['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x348300['to'](_0x5f4ace=>{_0x5f4ace['key']==_0x70614d&&(_0x1ab352['focus'](),this['_hideNestedPanel'](_0x14fd83));})}}),_0x1ab352['bind']('isOn')['to'](_0x14fd83,'isVisible'),this['_bodyCollection']['add'](_0x14fd83),_0x14fd83['content']['add'](_0x3cf78d),this['_setupGroupMenuBehavior'](_0x1ab352,_0x14fd83),_0x5eed4e['children']['add'](_0x1ab352),_0x5eed4e;}['_createGroupActionsList'](_0x3998a1,_0x1d88e3,_0x37552b){const _0x356e4a=new _0x3cd02e(this['locale']);return _0x356e4a['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x1d88e3['forEach'](_0x22f69d=>{const _0x2bf697=new _0x256274(this['locale']),_0x397835=ee(_0x3998a1,_0x22f69d,!0x0,!0x1)();_0x2bf697['children']['add'](_0x397835),_0x37552b['focusTracker']['add'](_0x397835),_0x356e4a['items']['add'](_0x2bf697);}),_0x356e4a;}['_setupGroupMenuBehavior'](_0x34ec65,_0xd23e5d){const _0x46c8c8=_0x34ec65['bindTemplate'],_0x5200d6='rtl'===_0x34ec65['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x34ec65['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x46c8c8['to'](()=>{this['_showNestedPanel'](_0xd23e5d,_0x34ec65);}),'mouseleave':_0x46c8c8['to'](_0x22c090=>{const _0x281ca6=_0x22c090['relatedTarget'];this['_isMovingToNestedMenu'](_0x281ca6,_0xd23e5d)||this['_hideNestedPanel'](_0xd23e5d);}),'keydown':_0x46c8c8['to'](_0xe12598=>{_0xe12598['key']==_0x5200d6&&(this['_showNestedPanel'](_0xd23e5d,_0x34ec65),_0xd23e5d['content']['get'](0x0)['focus']());})}}),_0xd23e5d['on']('render',()=>{_0xd23e5d['element']?.['addEventListener']('mouseleave',_0x397243=>{const _0x7f4ad9=_0x397243['relatedTarget'];_0x34ec65['element']?.['contains'](_0x7f4ad9)||this['_isMovingToNestedMenu'](_0x7f4ad9,_0xd23e5d)||this['_hideNestedPanel'](_0xd23e5d);});});}['_showNestedPanel'](_0x528877,_0x4812bd){this['_openNestedPanels']['forEach'](_0x389d83=>{_0x389d83!==_0x528877&&_0x389d83['isVisible']&&_0x389d83['hide']();}),_0x528877['show'](),_0x528877['pin']({'positions':[_0x1c984b['eastSouth']],'target':_0x4812bd['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x528877);}['_hideNestedPanel'](_0x521faf){_0x521faf['hide'](),this['_openNestedPanels']['delete'](_0x521faf);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x5333d9=>_0x5333d9['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x15c3f1,_0x2e400f){if(!_0x15c3f1)return!0x1;if(_0x2e400f['element']?.['contains'](_0x15c3f1))return!0x0;const _0x2f18e8=_0x15c3f1;return _0x2f18e8['closest']&&(null!==_0x2f18e8['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x2f18e8['closest']('.ck-ai-quick-actions-group-list')||null!==_0x2f18e8['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function te(_0x32da70,_0x1bca13,_0x1af7be,_0x384a33){return()=>{const _0x4a0773=_0x32da70['locale'],_0x54818d=_0x4f8f4d(_0x4a0773);_0x54818d['buttonView']['set']({'icon':_0x1af7be['icon']??_0x58ae49,'label':_0x1af7be['label'],'tooltip':!0x0}),_0x54818d['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x358dde=new ao(_0x32da70,_0x1bca13,_0x54818d,_0x384a33);return _0x54818d['panelView']['children']['add'](_0x358dde),_0x54818d;};}const oe='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',ae='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',se='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form.-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var Ft=function(_0x4eaaf4){return _0x4eaaf4['CHAT']='CHAT',_0x4eaaf4['ACTION']='ACTION',_0x4eaaf4['REVIEW']='REVIEW',_0x4eaaf4;}({}),Ma=function(_0x29a13c){return _0x29a13c['CHAT']='AIChat',_0x29a13c['ACTION']='AIActions',_0x29a13c['REVIEW']='AIReviewMode',_0x29a13c;}({});class ii extends _0x473589{static get['requires'](){return[_0x58cc86];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x2c8e4e){return function(_0x5dd988){const _0x562f4b=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x5dd988['uiLanguage']),_0x358c3d=_0x562f4b||'English',_0x2a24d1=[{'id':'ask-ai','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Wt},{'id':'chat-commands','label':i(_0x5dd988,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Wt,'actions':[{'id':'explain','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':oe['replace']('%0',_0x358c3d),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ae['replace']('%0',_0x358c3d),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':se['replace']('%0',_0x358c3d),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Vt},{'id':'continue','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Bt},{'id':'fix-grammar','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Jt},{'id':'adjust-length','label':i(_0x5dd988,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x5dd988,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Gt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x5dd988,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Zt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x5dd988,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x5dd988,'AI_QUICK_ACTIONS_OTHER'),'icon':Xt,'actions':[]}];return _0x2a24d1;}(_0x2c8e4e);}['_getDefaultAndCustomActions'](){const _0x555a1b=ii['getDefaultQuickActions'](this['editor']['locale']),_0x1d36c1=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x387ef8=>({..._0x387ef8,'icon':void 0x0}));return _0x555a1b['find'](_0x150890=>'other'===_0x150890['id'])['actions']['push'](..._0x1d36c1),_0x555a1b;}['_initializeQuickActionsComponentsAndCommands'](){const _0x4d35f6=new _0x1c0188(this['editor']['locale']);_0x4d35f6['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x4d35f6),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x4d35f6);}['_initializeQuickActionsDropdown'](_0x484b70){this['editor']['ui']['componentFactory']['add']('aiQuickActions',te(this['editor'],this['_quickActionsDefinition'],{'icon':_0x58ae49,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x484b70));}['_prepareQuickActionsDefinition'](_0x26de67){this['_quickActionsDefinition']=_0x26de67['map'](_0x32201d=>{if('actions'in _0x32201d){const _0x36683b=_0x32201d;return{..._0x36683b,'actions':_0x36683b['actions']['map'](_0x4f4075=>{const {actions:_0x154689,..._0x16ab0b}=_0x36683b;return{..._0x4f4075,'parent':_0x16ab0b};})['filter'](_0x1e92d0=>this['_shouldIncludeAction'](_0x1e92d0))};}return _0x32201d;})['filter'](_0x36062d=>'actions'in _0x36062d?_0x36062d['actions']['length']>0x0:this['_shouldIncludeAction'](_0x36062d));}['_shouldIncludeAction'](_0xbde547){const _0x58fc70=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ma[_0xbde547['type']])&&!_0x58fc70['includes'](_0xbde547['id']);}['_initializeQuickActionsComponents'](_0x277a98){this['_quickActionsDefinition']['forEach'](_0x1fec3d=>{if('actions'in _0x1fec3d){const _0x2f2932=te(this['editor'],_0x1fec3d['actions'],_0x1fec3d,_0x277a98);this['editor']['ui']['componentFactory']['add'](_0x1fec3d['id'],_0x2f2932),_0x1fec3d['actions']['forEach'](_0x1088e0=>{const _0x3fe3a3=ee(this['editor'],_0x1088e0);this['editor']['ui']['componentFactory']['add'](_0x1088e0['id'],_0x3fe3a3);});}else{const _0x3ed4f6=ee(this['editor'],_0x1fec3d,!0x1,!0x0,!0x1);this['editor']['ui']['componentFactory']['add'](_0x1fec3d['id'],_0x3ed4f6);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x22bfa2=>{const _0x1e1d7c=new _0x2ef427(_0x22bfa2),_0x4fa5f1=i(_0x22bfa2,'AI_QUICK_ACTIONS_HEADING');_0x1e1d7c['buttonView']['set']({'label':_0x4fa5f1,'icon':_0x58ae49});const _0x1d5079=new _0x19edac(_0x22bfa2);_0x1d5079['set']({'ariaLabel':_0x4fa5f1,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x45df87=>{if('actions'in _0x45df87){const _0x26d042=_0x45df87,_0x1fa118=new _0x3471e3(_0x22bfa2,_0x1e1d7c),_0x48cc41=new _0x2ef427(_0x22bfa2),_0x2ff740=new _0x19edac(_0x22bfa2);_0x48cc41['buttonView']['set']({'label':_0x26d042['label'],'icon':_0x26d042['icon']}),_0x26d042['actions']['forEach'](_0x3f64fe=>{const _0x48ed3d=new _0x3471e3(_0x22bfa2,_0x48cc41),_0x5822ff=new _0x267e6c(_0x22bfa2);_0x5822ff['set']({'label':_0x3f64fe['displayedPrompt'],'icon':_0x3f64fe['icon'],'role':'menuitem'}),_0x5822ff['on']('execute',()=>{this['_executeQuickAction'](_0x3f64fe);}),_0x5822ff['delegate']('execute')['to'](_0x48cc41),_0x48ed3d['children']['add'](_0x5822ff),_0x2ff740['items']['add'](_0x48ed3d);}),_0x48cc41['panelView']['children']['add'](_0x2ff740),_0x1fa118['children']['add'](_0x48cc41),_0x1d5079['items']['add'](_0x1fa118);}else{const _0x22f0ab=_0x45df87,_0x8cdc3d=new _0x3471e3(_0x22bfa2,_0x1e1d7c),_0x182cbc=new _0x267e6c(_0x22bfa2);_0x182cbc['set']({'label':_0x22f0ab['displayedPrompt'],'icon':_0x22f0ab['icon'],'role':'menuitem'}),_0x182cbc['on']('execute',()=>{this['_executeQuickAction'](_0x22f0ab);}),_0x182cbc['delegate']('execute')['to'](_0x1e1d7c),_0x8cdc3d['children']['add'](_0x182cbc),_0x1d5079['items']['add'](_0x8cdc3d);}});const _0x4eceae=Object['values'](Ma)['some'](_0x542076=>this['editor']['plugins']['has'](_0x542076));return _0x1e1d7c['set']({'isEnabled':_0x4eceae}),_0x1e1d7c['panelView']['children']['add'](_0x1d5079),_0x1e1d7c;});}['_executeQuickAction'](_0x2b893b){const _0x496fa5=this['editor'];_0x496fa5['editing']['view']['focus'](),_0x496fa5['commands']['execute']('aiQuickAction',_0x2b893b);const _0x5913c3=_0x496fa5['ui']['view']['menuBarView'];_0x5913c3&&_0x5913c3['close']&&_0x5913c3['close']();}}class ci extends Qt{['execute'](_0x43178d){switch(this['_expandSelectionIfCollapsed'](),_0x43178d['type']){case Ft['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5c201c=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x2520c7('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5c201c});}this['_handleAIChatAction'](_0x43178d);break;case Ft['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0xce8a54=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x2520c7('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0xce8a54});}this['_handleAIActionsAction'](_0x43178d);break;case Ft['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x5ddfcf=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x2520c7('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5ddfcf});}this['_handleAIReviewAction'](_0x43178d);}}async['_handleAIChatAction'](_0x405cb2){const _0x5c14be=this['editor']['plugins']['get']('AIChat'),_0x2462da=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x405cb2['id'])_0x2462da['removeSelectionFromChatContext'](),await _0x5c14be['addSelectionToChatContext'](),_0x5c14be['focusPromptInput']();else await _0x5c14be['startConversation'](),_0x2462da['removeSelectionFromChatContext'](),await _0x5c14be['addSelectionToChatContext'](),_0x5c14be['focusPromptInput'](),await _0x5c14be['sendMessage']({'message':_0x405cb2['prompt']||_0x405cb2['displayedPrompt'],'quickActionData':{'id':_0x405cb2['id'],'displayedPrompt':_0x405cb2['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x4f3021=this['editor'],_0x52c235=_0x4f3021['model']['document']['selection'];if(!_0x52c235['isCollapsed'])return;const _0x1d18e1=_0x8b356e(_0x52c235['getSelectedBlocks']())||_0x4f3021['model']['schema']['getLimitElement'](_0x52c235);_0x4f3021['model']['change'](_0x3b81df=>{_0x3b81df['setSelection'](_0x1d18e1,'in');});}['_handleAIActionsActionLabel'](_0x4b3205){return _0x4b3205['parent']?.['label']&&'other'!==_0x4b3205['parent']?.['id']?_0x4b3205['parent']['label']+':\x20'+_0x4b3205['displayedPrompt']:_0x4b3205['displayedPrompt'];}async['_handleAIActionsAction'](_0x41f86c){const _0x5a1e90=this['editor']['plugins']['get']('AIActions'),_0x211ce2=_0x41f86c['prompt']?{'userMessage':_0x41f86c['prompt'],'model':_0x41f86c['model']}:{'actionName':_0x41f86c['actionName']||_0x41f86c['id'],'args':_0x41f86c['args']},_0x5b61e6=this['_handleAIActionsActionLabel'](_0x41f86c);await _0x5a1e90['executeAction'](_0x211ce2,_0x5b61e6,_0x41f86c['icon']);}async['_handleAIReviewAction'](_0x42e193){console['log']('handleAIReviewAction',_0x42e193);}}class ti extends _0x473589{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1424b0=this['editor'],_0x1f31b8=new ci(this['editor']);if(_0x1424b0['commands']['add']('aiQuickAction',_0x1f31b8),_0x1424b0['plugins']['has']('AIChat')){const _0x58f28c=this['editor']['plugins']['get']('AIChat');_0x1424b0['model']['document']['selection']['on']('change:range',(_0x12a7f0,_0x34dede)=>{_0x34dede['directChange']&&_0x58f28c['removeSelectionFromChatContext']();});}}}class Ae extends ke{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0xe5d1dc=this['documentContextContent']['children']['map'](_0x10536b=>({'node':_0x10536b,'id':Et(_0x10536b,'data-id')})),_0x4e0d86=this['parsedMergedContent']['children']['map'](_0x29fb3b=>({'node':_0x29fb3b,'id':Et(_0x29fb3b,'data-id')||_0x4237d5()})),_0x269ef9=_0x34d077(_0xe5d1dc,_0x4e0d86,{'comparator':(_0x1ee605,_0x2d64a7)=>_0x1ee605['id']==_0x2d64a7['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x269ef9['length']&&_0x269ef9[_0x269ef9['length']-0x1]['removed'];)_0x269ef9['pop']();}const _0x2f9b9f=_0x269ef9['map'](_0x215a45=>{const _0x53d119=_0x215a45['added']?'new':_0x215a45['removed']?'removed':'modified';return{'node':_0x215a45['value'][0x0]['node'],'type':_0x53d119,'id':_0x215a45['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x2f9b9f,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x4dd2e2,_0x11431d){return _0x11431d;}}class B extends xe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x248b83){super(_0x248b83),this['content']=_0x248b83['content'],this['version']=_0x248b83['version'],this['actionName']=_0x248b83['actionName'],this['args']=_0x248b83['args'],this['userMessage']=_0x248b83['userMessage'],this['model']=_0x248b83['model'];}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':Ie['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x276be7){const _0x121d1=new Ae({'editor':this['editor'],'documentContextContent':this['content'],..._0x276be7});return this['replies']['push'](_0x121d1),_0x121d1['delegate'](...je)['to'](this),this['fire']('replyCreated',_0x121d1),_0x121d1;}}class ri extends _0x473589{static get['requires'](){return[S,_0x452334,R,$,_0x568068];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x2a5a90();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x5ac5f8){super(_0x5ac5f8),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new H(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x16d7c4,_0x5aab37,_0x1844e9){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x1c28f3,anchorData:_0x51d1ce}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x16d7c4,_0x1c28f3,_0x51d1ce,_0x5aab37,_0x1844e9);}}const {modelFragment:_0xa1ddd5,anchorData:_0x5851f1}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x16d7c4,_0xa1ddd5,_0x5851f1,_0x5aab37,_0x1844e9);}['_getExecuteDataRegular'](){const _0xb7ec79=this['editor']['model']['document']['selection'];if(_0xb7ec79['isCollapsed']){const _0x4d4730=_0x8b356e(_0xb7ec79['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0xb7ec79);this['editor']['model']['change'](_0x23b94b=>{_0x23b94b['setSelection'](_0x4d4730,'in');});}const _0x461e9e=_0xb7ec79['getFirstRange'](),_0x57152e=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0xb7ec79),_0x461e9e['start'],_0x461e9e['end']),_0x1166d6=_0xb7ec79['getFirstRange']()['start'],_0x8d88ed=new Map();let _0x352cc5=_0x57152e;for(let _0x536888=0x0;_0x536888<_0x1166d6['path']['length'];_0x536888++)_0x8d88ed['set'](_0x352cc5,_0x1166d6['path'][_0x536888]),_0x352cc5=_0x352cc5['getChild'](0x0);return{'modelFragment':_0x57152e,'anchorData':_0x8d88ed};}['_getExecuteDataInTable'](){const _0x30b1f3=this['editor']['model']['document']['selection'],_0x58ed4a=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x5b6662=_0x30b1f3['getFirstRange']()['start']['parent']['parent'],_0x432084=this['_wrapWithCommonAncestors'](_0x58ed4a,this['editor']['model']['createPositionBefore'](_0x5b6662),this['editor']['model']['createPositionAfter'](_0x5b6662)),_0x1f030a=_0x30b1f3['getFirstRange']()['start'],_0x260716=new Map();let _0x4444f8=_0x432084;for(let _0xc1152=0x0;_0xc1152<_0x1f030a['path']['length'];_0xc1152++)if(_0x260716['set'](_0x4444f8,_0x1f030a['path'][_0xc1152]),_0xc1152<_0x1f030a['path']['length']-0x1)_0x4444f8=_0x4444f8['getChild'](0x0);else{let _0x5d771f=_0x4444f8['nextSibling'];for(;_0x5d771f;)_0x260716['set'](_0x5d771f,_0x1f030a['path'][_0xc1152]),_0x5d771f=_0x5d771f['nextSibling'];}return{'modelFragment':_0x432084,'anchorData':_0x260716};}['_executeAction'](_0x1f1406,_0x1d41bd,_0x52b0a2,_0x5e1beb,_0x158438){const _0x97651=this['editor']['plugins']['get'](R),_0x1eefa8=this['editor']['plugins']['get']($),_0x1f360b=this['editor']['model']['document']['selection'],_0x5a6f89=_0x97651['modelToViewWithIds'](_0x1d41bd),_0x461798=this['editor']['data']['processor']['toData'](_0x5a6f89),_0x441872=this['editor']['model']['document']['version'],_0x5689b3=[..._0x1f360b['getRanges']()];let _0x446f33=this['editor']['config']['get']('ai.availableReplyActions')||[...st];this['editor']['plugins']['has']('TrackChanges')||(_0x446f33=_0x446f33['filter'](_0x1f8e97=>'insertSuggestion'!=_0x1f8e97));const _0x229aa4=new N(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x446f33});return _0x1eefa8['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x5e1beb,'icon':_0x158438||_0x58ae49,'mainView':_0x229aa4,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':_0x5689b3}),this['_setLoadingState'](_0x229aa4,_0x1eefa8),this['listenTo'](_0x1eefa8,'applySuggestion',()=>{this['_applyChanges'](_0x1d41bd,_0x52b0a2,!0x1);}),this['listenTo'](_0x1eefa8,'insertSuggestion',()=>{this['_applyChanges'](_0x1d41bd,_0x52b0a2,!0x0);}),this['listenTo'](_0x1eefa8,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x1eefa8,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x111fc5=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x1de737=_0x111fc5['changeGroups'][0x0];_0x1de737&&'pending'===_0x1de737['state']&&_0x111fc5['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x1eefa8);}),this['_createInteraction'](_0x461798,_0x441872,_0x229aa4,_0x1eefa8,_0x1f1406);}['_wrapWithCommonAncestors'](_0x5c9497,_0x2d0be2,_0x320282){const _0x4aa5ed=this['editor']['model']['createRange'](_0x2d0be2,_0x320282)['getCommonAncestor'](),_0x54b722=_0x4aa5ed['is']('documentFragment')?[]:_0x4aa5ed['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x54b722['length']){const _0x262ce4=_0x54b722['map'](_0x11c033=>_0x11c033['_clone'](!0x1));for(let _0x273685=0x1;_0x273685<_0x262ce4['length'];_0x273685++)_0x262ce4[_0x273685-0x1]['_appendChild'](_0x262ce4[_0x273685]);return _0x262ce4[_0x262ce4['length']-0x1]['_appendChild'](_0x5c9497),new _0x403049(_0x262ce4[0x0]);}return _0x5c9497;}async['_createInteraction'](_0x2ababf,_0x4b64ec,_0x4aa655,_0x2e267e,_0x374161){const _0x5903f2=this['editor'];this['_interactionParams']={'action':_0x374161,'content':_0x2ababf,'version':_0x4b64ec,'mainView':_0x4aa655,'aiBalloon':_0x2e267e};const _0x430b85=new B({'connector':this['_aiConnector'],'editor':_0x5903f2,'content':_0x2ababf,'version':_0x4b64ec,..._0x374161});this['_interactions']['push'](_0x430b85),_0x4aa655['hideError']();const _0x27876d=(_0x694eec,_0x2a29b4,_0x37a29f=!0x1,_0x529afa='streaming')=>this['_promiseQueue']['enqueue'](async _0x1fdba2=>{try{const _0x22db17=W({'editor':_0x5903f2,'changeGroups':_0x694eec['changeGroups'],'documentContextContent':_0x694eec['documentContextContent'],'showDiff':_0x37a29f,'trimUnchanged':!0x1});await _0x2a29b4['updateContent']({'parts':_0x22db17,'renderingStrategy':_0x529afa,'abortSignal':_0x1fdba2});}catch(_0x23075d){if(this['_isAbortError'](_0x23075d))return;throw _0x23075d;}});this['_interaction']['on']('replyCreated',(_0x43e7fc,_0x425f7d)=>{_0x4aa655['hideLoader'](),_0x27876d(_0x425f7d,_0x4aa655)['catch'](_0x5b35e2=>{this['_isAbortError'](_0x5b35e2)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x5b35e2),this['_setErrorState'](_0x430b85,_0x4aa655));});}),this['_interaction']['on']('replyContentUpdated',(_0x174ae6,_0x54cb2a)=>{_0x27876d(_0x54cb2a,_0x4aa655)['catch'](_0x96a5f9=>{this['_isAbortError'](_0x96a5f9)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x96a5f9),this['_setErrorState'](_0x430b85,_0x4aa655));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x4aa655,_0x2e267e),this['_updateNavigationUI']();}catch(_0xb85919){this['_isAbortError'](_0xb85919)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0xb85919),this['_setErrorState'](_0x430b85,_0x4aa655));}}),this['listenTo'](_0x4aa655,'toggleSuggestionDisplayMode',(_0x264f6a,{showDiff:_0x5a168f})=>{this['_balloonShowDiff']=_0x5a168f;const _0x35a78b=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x35a78b&&_0x27876d(_0x35a78b,_0x4aa655,_0x5a168f,'static')['catch'](_0x9637a3=>{this['_isAbortError'](_0x9637a3)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x9637a3),this['_setErrorState'](_0x430b85,_0x4aa655));});}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x2fffc1,{reply:_0x437e6b})=>{const _0x121499={'positiveCount':_0x437e6b['changeGroups']['filter'](_0x3b0579=>'accepted'===_0x3b0579['state'])['length'],'totalCount':_0x437e6b['changeGroups']['length']},_0x540c15=this['_interaction']['actionCallId'],_0x2d7580=this['_interaction']['actionName'];_0x2d7580?this['_aiConnector']['upsertAIActionRating'](_0x2d7580,_0x540c15,_0x121499):this['_aiConnector']['upsertCustomAIActionRating'](_0x540c15,_0x121499);}),this['_setLoadingState'](_0x4aa655,_0x2e267e);try{const _0x480ade=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x480ade;}catch(_0xe2324a){if(this['_isAbortError'](_0xe2324a))return;_0x4aa655['hideLoader'](),this['_setErrorState'](_0x430b85,_0x4aa655);}}['_applyChanges'](_0x55a061,_0x66bafa,_0x16f9b0){const _0x16803b=this['editor'];if(_0x16f9b0&&!_0x16803b['plugins']['has']('TrackChanges'))throw new _0x2520c7('ai-no-track-changes',null);const _0x2f70a8=this['editor']['plugins']['get'](_0x568068),_0x91cde4=this['_interaction'],_0x5eec1a=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x3e8082=_0x5eec1a['changeGroups'];_0x5eec1a['setChangeGroupState'](0x0,'accepted');let _0x4bde49=Y({'editor':_0x16803b,'reply':_0x5eec1a,'interaction':_0x91cde4,'groups':_0x3e8082,'transform':!0x1,'documentCompare':_0x2f70a8,'documentCompareOptions':{'anchor':_0x16803b['model']['createPositionAt'](_0x55a061,0x0),'markDeletions':_0x16f9b0}});_0x4bde49=this['_filterOperationsOutsideRange'](_0x4bde49,_0x66bafa);for(const _0x1ecdba of _0x4bde49)this['_anchorOperation'](_0x66bafa,_0x1ecdba,_0x16803b['model']['document']['getRoot']());const _0x5b6340=_0x91cde4['getDocumentContext']()['version'],_0x185edf=_0x16803b['model']['document']['history']['getOperations'](_0x5b6340),_0x184137={'document':_0x16803b['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x3b1f33=it(_0x4bde49,_0x185edf,_0x184137)['operationsA'];_0x16803b['model']['change'](_0x1ba2c8=>{if(_0x1ba2c8['setSelection'](_0x16803b['model']['document']['selection']['focus']),_0x16f9b0)_0x16803b['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3b1f33);else{for(const _0x33b946 of _0x3b1f33)_0x33b946['baseVersion']=_0x16803b['model']['document']['version'],X(_0x16803b,_0x33b946),_0x1ba2c8['batch']['addOperation'](_0x33b946),_0x16803b['model']['applyOperation'](_0x33b946);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x2503b2,_0x14e278){return _0x2503b2['filter'](_0x285daa=>{if('rename'==_0x285daa['type']){const _0x544039=_0x285daa['position']['nodeAfter'];return!_0x14e278['has'](_0x544039);}if(_0x285daa['type']['indexOf']('Attribute')>-0x1){const _0x3bb6b2=_0x285daa['range']['start']['nodeAfter'];return!_0x14e278['has'](_0x3bb6b2);}return!0x0;});}['_anchorOperation'](_0x1daea5,_0x349952,_0x1abf8e){const _0xbad6c8=_0x349952['clone']();for(const _0x49436f in _0x349952){const _0x2e8cb2=_0x349952[_0x49436f];_0x2e8cb2 instanceof _0x10f501?_0x349952[_0x49436f]=new _0x10f501(_0x30aa8a(_0x2e8cb2['start']),_0x30aa8a(_0x2e8cb2['end'])):_0x2e8cb2 instanceof _0x399771&&(_0x349952[_0x49436f]=_0x30aa8a(_0x2e8cb2));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0xbad6c8['type'])){if(_0xbad6c8['isDocumentOperation']=!0x1,_0xbad6c8['baseVersion']=null,'remove'==_0xbad6c8['type']){const _0x5e3027=_0xbad6c8['sourcePosition'],_0x5f1eef=_0xbad6c8['howMany'];new tt(_0x5e3027,_0x5f1eef)['_execute']();}else _0xbad6c8['_execute']();}function _0x30aa8a(_0x51fde5){if('$graveyard'==_0x51fde5['root']['rootName'])return _0x51fde5;const _0x268d75=[];let _0x4cbac6=_0x51fde5['root'];for(let _0x452c3d=0x0;_0x452c3d<_0x51fde5['path']['length'];_0x452c3d++){const _0x106b4b=_0x1daea5['get'](_0x4cbac6)||0x0;_0x268d75[_0x452c3d]=_0x51fde5['path'][_0x452c3d]+_0x106b4b,_0x4cbac6=_0x4cbac6['getChildAtOffset'](_0x51fde5['path'][_0x452c3d]);}return new _0x399771(_0x1abf8e,_0x268d75,_0x51fde5['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x1712a9,content:_0x484d12,version:_0x4c510a,mainView:_0x1ad45a,aiBalloon:_0x2646e4}=this['_interactionParams'];_0x1ad45a['areChangesVisible']=!0x1,_0x1ad45a['hideError'](),this['_clearErrorState'](_0x1ad45a,_0x2646e4);const _0x841858=_0x1ad45a;_0x841858['miniToolbarView']&&_0x841858['miniToolbarView']['showChangesButton']&&_0x841858['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':_0x2677d0}),this['_clearSuggestionContent'](_0x1ad45a),_0x1ad45a['showLoader'](),this['_updateNavigationUI'](),this['_createInteraction'](_0x484d12,_0x4c510a,_0x1ad45a,_0x2646e4,_0x1712a9)['catch'](_0x4304c0=>{this['_isAbortError'](_0x4304c0)||console['error']('Error\x20refreshing\x20interaction:',_0x4304c0);});}['_clearSuggestionContent'](_0x5162be){const _0x2b6d4c=_0x5162be['bodyView']['_children'];for(;_0x2b6d4c['length']>0x0;)_0x2b6d4c['remove'](_0x2b6d4c['first']);_0x5162be['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x2e289f){return!!_0x2e289f['message']&&_0x2e289f['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_updateNavigationUI']();}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1;}['_setupCustomViews'](){const _0x5b518d=new _0x32eaf5(this['editor']['locale']),_0x29ce3b=new _0x32eaf5(this['editor']['locale']),_0x5ceead=new _0xe56eb6(this['editor']['locale']),_0x537461=new _0x32eaf5(this['editor']['locale']);_0x5b518d['set']({'icon':_0x3e5f8e,'label':i(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x29ce3b['set']({'icon':_0x1a5b12,'tooltip':i(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x5ceead['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x537461['set']({'icon':_0x33f48f,'tooltip':i(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x5b518d['bind']('isEnabled')['to'](this,'isBusy',_0x54e654=>!_0x54e654),_0x5b518d['on']('execute',()=>{this['_refreshInteraction']();}),_0x29ce3b['bind']('isEnabled')['to'](this,'isBusy',_0x94d381=>!_0x94d381),_0x29ce3b['on']('execute',()=>{this['_navigateToPrevious']();}),_0x537461['bind']('isEnabled')['to'](this,'isBusy',_0x548cf0=>!_0x548cf0),_0x537461['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0x29ce3b,this['_navigationCounter']=_0x5ceead,this['_navigationNextButton']=_0x537461,this['_customViews']['add'](_0x5b518d);}['_navigateToPrevious'](){const _0x3e0915=this['_interactions']['length'];this['_currentInteractionIndex']<_0x3e0915-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x220b31){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x220b31;const {mainView:_0x31b6c6}=this['_interactionParams'],_0x1c53e5=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x1c53e5)return;if(_0x1c53e5['hasError'])return this['_setErrorState'](_0x1c53e5,_0x31b6c6),void this['_updateNavigationUI']();if(!_0x1c53e5['replies']['length'])return;_0x31b6c6['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0x31b6c6,this['_interactionParams']['aiBalloon']);const _0x509f85=_0x1c53e5['replies'][_0x1c53e5['replies']['length']-0x1];if(_0x509f85){const _0x1a8799=this['editor'];this['_clearSuggestionContent'](_0x31b6c6);try{const _0x55baa4=W({'editor':_0x1a8799,'changeGroups':_0x509f85['changeGroups'],'documentContextContent':_0x509f85['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0x31b6c6),await new Promise(_0x51b91a=>setTimeout(_0x51b91a,0x32)),await _0x31b6c6['updateContent']({'parts':_0x55baa4,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x1f8163){this['_isAbortError'](_0x1f8163)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x1f8163);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x1a988a=this['_interactions']['length'],_0x5815b1=_0x1a988a>0x1,_0x4756c8=this['_interactionParams']?.['mainView'];if(_0x5815b1){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x4756c8?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x4756c8?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x4756c8?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x3f4511=_0x1a988a-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x3f4511+'/'+_0x1a988a),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x1a988a-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x4756c8?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x4756c8?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x4756c8?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x1f96be,_0x5240a0){_0x1f96be['setLoading'](),_0x5240a0['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x15d1c7,_0x30cb90){const _0x2d886a=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0x30cb90['showError'](_0x2d886a),_0x15d1c7['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0x30cb90['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0x1ee822,_0x7b3e2c){_0x1ee822['clearErrorState'](),_0x7b3e2c['balloonView']['toolbar']&&(_0x7b3e2c['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x1e4286,_0x23b33c){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x1e4286['clearLoading'](),_0x23b33c['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0x44f6df=>{'isEnabled'in _0x44f6df&&(_0x44f6df['isEnabled']=!0x1);});}}class Ua extends _0x473589{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x46d163){super(_0x46d163),_0x46d163['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class js{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x96471,title:_0x57d0a3,description:_0x4c26b9,isParameterized:_0x15d88b,useArgs:_0x46f8aa,options:_0x377dbb}){this['id']=_0x96471,this['title']=_0x57d0a3,this['description']=_0x4c26b9,this['isParameterized']=_0x15d88b,this['useArgs']=_0x46f8aa,this['options']=_0x377dbb;}}class kr extends js{['_models']=[];get['models'](){return this['_models'];}set['models'](_0xaae728){this['_models']=_0xaae728;}}class si extends ts(){['_checks'];constructor(_0x10e489){super(),this['_checks']=this['_mapCheckDefinitions'](_0x10e489);}get['checks'](){return this['_checks'];}['getCheckById'](_0x1a9846){return this['checks']['find'](_0x48b027=>_0x48b027['id']===_0x1a9846);}['_mapCheckDefinitions'](_0x5cdc58){return _0x5cdc58['map'](_0x44b292=>'custom'===_0x44b292['id']?new kr(_0x44b292):new js(_0x44b292));}}class Rs extends _0x42ebaf(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x1989bd,contentNew:_0x258b99,contentInitial:_0x52e799,documentVersion:_0x5b06a5}){super(),this['id']=_0x1989bd,this['contentNew']=_0x258b99,this['contentInitial']=_0x52e799,this['documentVersion']=_0x5b06a5;}}class Is extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x5adffb,_0x25a32d,_0x31a369){super(),this['id']=_0x5adffb,this['parent']=_0x31a369,this['_data']=_0x25a32d,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class Ts extends ts(){['id']=_0x4237d5();['callId'];['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x5c1c60,_0x5753ea,_0x22b9ed,_0x107edc,_0x5bdcbe){super(),this['_documentData']=_0x5c1c60,this['_sourceCheck']=_0x5753ea,this['_aiConnector']=_0x22b9ed,this['_reviewParams']=_0x107edc,this['_reviewArgs']=_0x5bdcbe,this['on']('change:status',(_0x372d39,_0x171dc4,_0x176a0e)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x176a0e,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get['documentData'](){return this['_documentData'];}get['processedResultsCount'](){return this['_results']['size'];}get['title'](){return this['_sourceCheck']['title'];}get['subTitle'](){return'';}get['reviewName'](){return this['_sourceCheck']['id'];}get['hasModifications'](){return!this['_changes']['every'](_0x50414b=>'pending'===_0x50414b['status']);}get['currentError'](){return this['_currentError'];}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x46a3ca=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x113715 of _0x46a3ca)'unmodified'!==_0x113715['data']['operation']&&('error'!==_0x113715['data']['operation']?'review-metadata'!==_0x113715['event']?this['_addReviewCheckResult'](_0x113715['data']['dataId'],_0x113715['data']['textDelta']):this['callId']=_0x113715['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x374750){this['_currentError']=_0x374750,_0x374750 instanceof Error&&_0x374750['message']['includes']('ai-request-aborted')?this['status']='aborted':this['status']='error-general';}finally{this['_activeRequest']=null;}}async['restart'](){this['_results']['clear'](),this['_changes']['length']=0x0,this['_currentError']=void 0x0,await this['start']();}['addResultChanges'](_0x4c04ff,_0x3d33ad){const _0x2454ae=this['_results']['get'](_0x4c04ff);if(!_0x2454ae)return;const _0x48ec3a=[];_0x3d33ad['forEach']((_0x361e10,_0x1f3b77)=>{const _0x1ccb69=new Is(_0x2454ae['id']+'-'+_0x1f3b77,_0x361e10,_0x2454ae);_0x1ccb69['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x1ccb69,'status':_0x1ccb69['status']});}),_0x1ccb69['on']('change:isActivated',()=>{_0x1ccb69['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x1ccb69}):this['fire']('reviewCheckResultDeactivated',{'change':_0x1ccb69});}),this['_changes']['push'](_0x1ccb69),_0x48ec3a['push'](_0x1ccb69);}),this['fire']('reviewCheckResultReady',{'changes':_0x48ec3a,'result':_0x2454ae,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x52ede2){const _0x2a97b1=this['_changes']['find'](_0x175d99=>_0x175d99['id']===_0x52ede2);return!(!_0x2a97b1||'pending'!==_0x2a97b1['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x42f774=>'pending'===_0x42f774['status']);}['markAllChangesAsAccepted'](){for(const _0x548c29 of this['_changes'])'pending'===_0x548c29['status']&&(_0x548c29['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x438b36){const _0x40553b=this['_changes']['find'](_0x1c246f=>_0x1c246f['id']===_0x438b36);_0x40553b&&'pending'===_0x40553b['status']&&(_0x40553b['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x3d5083){const _0x200bca=this['_changes']['find'](_0xc3d2f1=>_0xc3d2f1['id']===_0x3d5083);_0x200bca&&'pending'===_0x200bca['status']&&(_0x200bca['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x36b50d){const _0x1d9dfa=this['_changes']['find'](_0x48e805=>_0x48e805['id']===_0x36b50d);_0x1d9dfa&&'pending'===_0x1d9dfa['status']&&(_0x1d9dfa['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x25c970){const _0x531c50=this['_changes']['find'](_0x51b120=>_0x51b120['id']===_0x25c970);_0x531c50&&'outdated'===_0x531c50['status']&&(_0x531c50['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0xd9f807){this['_changes']['filter'](_0x537363=>_0x537363['isActivated']&&_0x537363['id']!==_0xd9f807)['forEach'](_0xae935f=>{_0xae935f['isActivated']=!0x1;});const _0x587d34=this['_changes']['find'](_0x11656c=>_0x11656c['id']===_0xd9f807);_0x587d34&&'pending'===_0x587d34['status']&&(_0x587d34['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x55deb1=>_0x55deb1['isActivated'])['forEach'](_0x126bec=>{_0x126bec['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x54e168){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x5e81e7;if(_0x54e168){const _0x2a9c8a=this['_changes']['find'](_0x1074c1=>_0x1074c1['id']===_0x54e168);if(_0x2a9c8a&&_0x2a9c8a['isRated'])return;_0x2a9c8a&&(_0x5e81e7=_0x2a9c8a['parent']['id'],_0x2a9c8a['isRated']=!0x0);}const _0xad8e0={'positiveCount':this['_changes']['filter'](_0x21c8e1=>'accepted'===_0x21c8e1['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0xad8e0,this['callId'],_0x5e81e7);}['_addReviewCheckResult'](_0x56cfd9,_0x56804b){const _0x54e503=this['_documentData']['elements']['get'](_0x56cfd9);if(!_0x54e503)return;const _0x151616=_0x54e503['getContent']();if(_0x151616===_0x56804b)return;const _0x26aba0=new Rs({'id':_0x56cfd9,'contentInitial':_0x151616,'contentNew':_0x56804b,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x26aba0['id'],_0x26aba0),this['fire']('reviewCheckResultAdded',{'result':_0x26aba0,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x5ae9e5=>'pending'===_0x5ae9e5['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x323e1d=>'pending'===_0x323e1d['status'])['length']&&(this['status']='finished'));}}class hi extends Ts{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x551481=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x104701=0x0;_0x104701<this['_reviewParams']['length'];_0x104701++){if(!this['_reviewParams'][_0x104701]||!this['_sourceCheck']['options'][_0x104701])continue;const _0x42fea8=this['_sourceCheck']['options'][_0x104701],_0x48dfff=_0x42fea8['data']?.['find'](_0x5b0446=>_0x5b0446['id']===this['_reviewParams'][_0x104701]);_0x48dfff&&_0x551481['push'](_0x48dfff['label']);}return _0x551481['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x6ce131,_0x1779eb,_0x2be42d){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x1779eb,_0x6ce131,_0x2be42d);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class oi extends Ts{['_prompt'];['_model'];constructor(_0x287997,_0x2080a2,_0x411967,_0x4cbdf6,_0x5c5ec8){super(_0x411967,_0x4cbdf6,_0x5c5ec8),this['_prompt']=_0x287997,this['_model']=_0x2080a2;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x24fbbb,_0x20a34d,_0x484c8e){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x20a34d,_0x24fbbb,_0x484c8e);}}const ai=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]}]}];class re extends ot{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[S];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0x11126a=this['context']['config']['get']('ai.reviewMode.translations');if(_0x11126a){for(const _0x59fa07 of ai)'translate'===_0x59fa07['id']&&(_0x59fa07['options'][0x0]['data']=_0x11126a);}const _0x3bdffe=this['_translateReviewChecks'](ai);this['_aiReviewCheckList']=new si(_0x3bdffe);const _0x53c9d6=this['_aiReviewCheckList']['checks']['find'](_0x1486c5=>'custom'===_0x1486c5['id']);if(_0x53c9d6){const _0x2ec317=await new ni({'connector':this['_aiConnector']})['getAll']();_0x53c9d6['models']=_0x2ec317['map'](_0x5d8394=>({..._0x5d8394,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0x5d8394['id']['toUpperCase'](),_0x5d8394['description'])}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x53de78,_0x4db423)=>{const _0xee289e=this['_aiReviewCheckList']['getCheckById'](_0x4db423['id']);if(_0xee289e){this['_onDiffChange'](this['_isDiffOn']),_0x4db423['isCustom']?this['_currentReviewCheckRun']=new oi(_0x4db423['args']['prompt'],_0x4db423['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0xee289e,this['_aiConnector']):this['_currentReviewCheckRun']=new hi(this['_aiReviewModeEditing']['getDocumentData'](),_0xee289e,this['_aiConnector'],_0x4db423['params'],_0x4db423['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x4c0c22,_0x5e09b1)=>{'data'===_0x5e09b1['status']||'loading'===_0x5e09b1['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x5e09b1)):'finished'===_0x5e09b1['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x5e09b1['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x5e09b1['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x5e09b1['status']?(this['_aiReviewModeUi']['showGeneralErrorView'](),this['_logError'](new _0x2520c7('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']))):'error-chunk'===_0x5e09b1['status']?(this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x2520c7('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']))):'aborted'===_0x5e09b1['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0)),'ready'!==_0x5e09b1['status']&&'error-chunk'!==_0x5e09b1['status']&&'error-general'!==_0x5e09b1['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x368f3f,_0x5f20d7)=>{if(!this['_currentReviewCheckRun'])throw new _0x2520c7('ai-review-mode-no-current-check-run',this);const _0x544b65=this['_aiReviewModeEditing']['diffContent'](_0x5f20d7['result']['contentInitial'],_0x5f20d7['result']['contentNew']);_0x5f20d7['source']['addResultChanges'](_0x5f20d7['result']['id'],_0x544b65);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x177426,_0x5dc60a)=>{for(const _0x3d7753 of _0x5dc60a['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x3d7753);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x5dc60a['changes'],_0x5dc60a['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x4512a8,_0x546cc5)=>{this['_aiReviewModeUi']['updateChangeState'](_0x546cc5['change']['id'],_0x546cc5['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x14e25f,_0x49a22b)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x49a22b['change']['id']);const _0x53bc89=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x49a22b['change']['id']);if(_0x53bc89){if('content'===this['_changeActivationSource']){const _0x4718fe=this['_aiReviewModeUi']['getChangeElement'](_0x49a22b['change']['id']);_0x4718fe&&_0x1205da(_0x4718fe['closest']('.ck-ai-review-mode__check-run-result')||_0x4718fe);}else{if('panel'===this['_changeActivationSource']){const _0x334f08={'target':_0x53bc89['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};ct(_0x334f08);}}this['_aiReviewModeUi']['showChangeBalloon'](_0x49a22b['change'],_0x53bc89['domElement']);}}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x338094){_0x338094 instanceof Error&&_0x338094['message']['includes']('ai-request-aborted')||(_0x338094 instanceof _0x2520c7?this['_logError'](_0x338094):this['_logError'](new _0x2520c7('ai-review-mode-check-run-failed',this,{'error':_0x338094})));}}else this['_logError'](new _0x2520c7('ai-review-mode-source-check-not-found',this,{'checkId':_0x4db423['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x389c7f=this['_currentReviewCheckRun']['getActiveChanges']();_0x389c7f['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x389c7f['map'](_0x3ced8b=>_0x3ced8b['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x5edcc1,_0x1fced7)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1fced7['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x1fced7['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x1fced7['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x1fced7['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x5b766c,_0x50e901)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x50e901['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x50e901['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x50e901['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x50e901['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x56325c,_0x5bfc86)=>{this['_isDiffOn']=_0x5bfc86['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&await this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x50788b,_0x282eb9)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x282eb9['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x2221f7,_0x4fb572)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x4fb572['changeId']));}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0xdb7701,_0x3925e9)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x3925e9['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0x4c92e5,_0x145d8a)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x145d8a['changeId']);});}['_onReviewModeRunLeave'](_0x196326=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x196326&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x4249e8=this['_aiReviewModeEditing']['getEditor']();_0x4249e8&&_0x4249e8['editing']['view']['change'](_0x1df617=>{const _0x127c88=_0x4249e8['editing']['view']['document']['getRoot']();_0x1df617['removeClass']('ck-ai-review-mode-diff',_0x127c88),_0x1df617['removeClass']('ck-ai-review-mode-highlights',_0x127c88);});}['_onDiffChange'](_0x4330f7){const _0x21a947=this['_aiReviewModeEditing']['getEditor']();_0x4330f7?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0x21a947&&_0x21a947['editing']['view']['change'](_0x297b17=>{const _0x9e2e84=_0x21a947['editing']['view']['document']['getRoot']();_0x297b17['removeClass']('ck-ai-review-mode-diff',_0x9e2e84),_0x297b17['removeClass']('ck-ai-review-mode-highlights',_0x9e2e84),_0x297b17['addClass'](_0x4330f7?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x9e2e84);});}['_translateReviewChecks'](_0xfad640){return _0xfad640['map'](_0x344eb6=>{const _0x236865='AI_REVIEW_CHECK_'+_0x344eb6['id']['toUpperCase']()['replaceAll']('-','_'),_0x10257c={..._0x344eb6,'title':this['_getTranslationWithDefault'](_0x236865+'_TITLE',_0x344eb6['title']),'description':this['_getTranslationWithDefault'](_0x236865+'_DESCRIPTION',_0x344eb6['description'])};return _0x344eb6['options']&&(_0x10257c['options']=_0x344eb6['options']['map'](_0x263e7d=>({..._0x263e7d,'label':this['_getTranslationWithDefault'](_0x236865+'_OPTIONS_LABEL',_0x263e7d['label']||''),'data':_0x263e7d['data']?_0x263e7d['data']['map'](_0x30540a=>({..._0x30540a,'label':this['_getTranslationWithDefault'](_0x236865+'_OPTIONS_DATA_'+_0x30540a['id']['toUpperCase'](),_0x30540a['label'])})):void 0x0}))),_0x10257c;});}['_getTranslationWithDefault'](_0x3b8b95,_0x208981){const _0x5b7076=i(this['context']['locale'],_0x3b8b95);return _0x5b7076===_0x3b8b95?_0x208981:_0x5b7076;}['_logError'](_0x49c4a4){ft(_0x49c4a4['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class Mr extends _0xe56eb6{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x162cb1,_0x193e0e){super(_0x162cb1),this['_defaultValue']=_0x193e0e['default']||(_0x193e0e['data']['length']>0x0?_0x193e0e['data'][0x0]['id']:''),this['_defaultLabel']=_0x193e0e['data']['find'](_0x48acdf=>_0x48acdf['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x4f8f4d(this['locale']);const _0x5e10e8=this['_prepareListOptions'](_0x193e0e['data']);_0x5be927(this['_dropdownView'],_0x5e10e8,{'role':'menu','ariaLabel':_0x193e0e['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x123c57=>{_0x123c57['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x3d8bcb=>{this['formValue']=_0x3d8bcb['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x3d8bcb['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x1aeb8b=[]){const _0x292609=new _0x3a64b1();this['resetToDefault']();for(const _0x1d5cf6 of _0x1aeb8b){const _0x23b673=new _0xa62dc5({'label':_0x1d5cf6['label'],'withText':!0x0,'role':'menuitemradio','id':_0x1d5cf6['id'],'model':_0x1d5cf6});_0x23b673['bind']('isOn')['to'](this,'formValue',_0x11eb7b=>_0x11eb7b===_0x23b673['id']);const _0x3f86b1={'type':'button','model':_0x23b673};_0x292609['add'](_0x3f86b1);}return _0x292609;}}class Ys extends _0x256274{['_formItem']=null;constructor(_0xf70ed2,_0x694ee,_0x2c03fe){super(_0xf70ed2),this['argsKey']=_0x694ee?.['argsKey'];if('dropdown'===_0x694ee['formType'])this['_formItem']=new Mr(this['locale'],_0x694ee);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x526cef=new _0x3da535(this['locale'],{'children':[this['_formItem']],'class':[_0x2c03fe?'ck-form__row_with-submit':'']});_0x2c03fe&&_0x526cef['children']['add'](_0x2c03fe),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x526cef]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Hs extends _0x238eb9{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x31084b){super(_0x31084b),this['set']('isEmpty',!0x0),this['keystrokes']=new _0xa0e91d(),this['minRows']=Hs['MIN_ROWS'],this['maxRows']=Hs['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class Zs extends _0xe56eb6{['focusTracker']=new _0x57a285();['keystrokes']=new _0xa0e91d();['focusCycler'];['_focusables']=new _0x2a5a90();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x581bf9,_0x130b9b){super(_0x581bf9),this['_check']=_0x130b9b,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x130b9b['models']&&_0x130b9b['models']['length']>0x0?_0x130b9b['models'][0x0]['id']:'',this['_defaultLabel']=_0x130b9b['models']&&_0x130b9b['models']['length']>0x0?_0x130b9b['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x555191(this['locale'],()=>new Hs(_0x581bf9)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0x3a64b1(),this['_setModelList'](),_0x5be927(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x3da535(this['locale'],{'children':[this['promptInputView']]}),new _0x3da535(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x590736,_0x3e9c4c)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x3e9c4c()):_0x3e9c4c();}),this['focusCycler']=new _0x90a56c({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x2ce537=>{this['_focusables']['add'](_0x2ce537),this['focusTracker']['add'](_0x2ce537['element']);}),this['keystrokes']['listenTo'](this['element']));}get['modelDefaultValue'](){return this['_defaultValue'];}get['modelDefaultLabel'](){return this['_defaultLabel'];}['resetToDefault'](){this['prompt']='',this['modelId']=this['modelDefaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['modelDefaultLabel'],this['resetFormValidationStatus']();}['resetFormValidationStatus'](){this['promptInputView']['errorText']='';}['_isValid'](){this['resetFormValidationStatus']();for(const _0x33bafc of this['_getFormValidators']()){const _0x4640b6=_0x33bafc();if(_0x4640b6)return this['promptInputView']['errorText']=_0x4640b6,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return i(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x1e379c=new _0x32eaf5(this['locale']),t=this['locale']['t'];return _0x1e379c['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x1e379c['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x1e379c;}['_createCancelButtonView'](){const _0x49f9f8=new _0x32eaf5(this['locale']),t=this['locale']['t'];return _0x49f9f8['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x49f9f8['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x278d2f=>{_0x278d2f['stopPropagation']();})}}),_0x49f9f8['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x49f9f8;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x218dbc=this['_check']['models'];if(this['resetToDefault'](),_0x218dbc?.['length']){const _0x29c44a=ni['getLocalized'](this['locale'],_0x218dbc);for(const _0x40fad2 of _0x29c44a){const _0x50d3a=new _0xa62dc5({'label':_0x40fad2['name'],'withText':!0x0,'role':'menuitemradio','id':_0x40fad2['id'],'model':_0x40fad2});_0x50d3a['bind']('isOn')['to'](this,'modelId',_0x14f6f2=>_0x14f6f2===_0x40fad2['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x50d3a,'labelView':new Ws(this['locale'],_0x40fad2)});}}}['_createModelSelectionDropdown'](){const _0x1138f3=_0x4f8f4d(this['locale']);return _0x1138f3['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x1138f3['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x1138f3,'execute',_0x3c8b2a=>{this['modelId']=_0x3c8b2a['source']['model']['id'],_0x1138f3['buttonView']['label']=_0x3c8b2a['source']['label'];}),_0x1138f3;}['_createActionsFooterView'](){const _0x27d31e=new _0xe56eb6(this['locale']);return _0x27d31e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x27d31e;}}class Ws extends _0x102c6c{constructor(_0x2e6ec7,_0x1fa16d){super();const _0x438dab=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x438dab['to']('style'),'id':_0x438dab['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x438dab['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x1fa16d['description']||'']}]}]});}}class Gs extends _0x256274{['_formItemsCollection']=new _0x2a5a90();['_customCheckView']=null;constructor(_0x2f0f52,_0xf0cee6,_0x2b7acf){super(_0x2f0f52),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0xf0cee6['isParameterized']);const _0x35a577=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x30fccb=>_0x30fccb),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x5a53ff=>_0x5a53ff)],'style':{'--ck-ai-review-check-list-item-index':_0x2b7acf}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0xf0cee6['title']}]},_0x35a577]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0xf0cee6['description']}]}]}]},..._0xf0cee6['isParameterized']?[this['_createParameterizedView'](_0xf0cee6)]:[],...'custom'===_0xf0cee6['id']?[this['_createCustomView'](_0xf0cee6)]:[]]}),this['on']('click',()=>{_0xf0cee6['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0xf0cee6['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x3cc083({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x5d9e37=>{_0x5d9e37['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x2a6653=new _0x2c655b();return _0x2a6653['content']=_0x3865d7,_0x2a6653['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x2a6653;}['_createParameterizedView'](_0x4de2d6){const _0x113551=new _0xe56eb6(),_0x19fc50=this['_createFormView'](_0x4de2d6);return _0x113551['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x3af936=>!_0x3af936)]},'children':[_0x19fc50]}),_0x113551;}['_createFormView'](_0x5d4244){const _0x4ed960=new _0xe56eb6(),_0x4969f0=Array['isArray'](_0x5d4244['options'])?_0x5d4244['options']:[],_0x1835fb=new _0x32eaf5(this['locale']),t=this['locale']['t'];_0x1835fb['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x1835fb['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5584e8=>{_0x5584e8['stopPropagation']();})}}),_0x1835fb['on']('execute',()=>{const _0x1e7a61=[],_0x4290fc={};this['_formItemsCollection']['forEach'](_0x3343da=>{_0x1e7a61['push'](_0x3343da['value']),_0x5d4244['useArgs']&&_0x5d4244['options']&&(_0x4290fc[_0x3343da['argsKey']]=_0x3343da['value']);}),this['fire']('runReviewCheck',{'id':_0x5d4244['id'],'params':_0x1e7a61['length']?_0x1e7a61:void 0x0,'args':Object['keys'](_0x4290fc)['length']?_0x4290fc:void 0x0});});const _0x56debf=_0x4969f0['length'];return _0x4969f0['forEach']((_0x2c7ac3,_0x328152)=>{const _0x2abc13=_0x328152===_0x56debf-0x1;this['_formItemsCollection']['add'](new Ys(this['locale'],_0x2c7ac3,_0x2abc13?_0x1835fb:null));}),_0x4ed960['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x4ed960;}['_createCustomView'](_0x345c97){return this['_customCheckView']=new Zs(this['locale'],_0x345c97),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x394294=>!_0x394294)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x35c98c,_0x4b322b,_0x1abde3)=>{_0x1abde3||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class $s extends _0x256274{['_checkViews'];constructor(_0x584cc5){super(_0x584cc5),this['_checkViews']=new _0x2a5a90();const _0x1bd70f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x1bd70f['if']('isVisible','ck-hidden',_0x11cfd4=>!_0x11cfd4)]},'children':this['_checkViews']});}['setChecks'](_0x14dce2){this['_checkViews']['clear']();for(const [_0x4b6095,_0x26671d]of _0x14dce2['entries']()){const _0x295368=new Gs(this['locale'],_0x26671d,_0x4b6095);_0x295368['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x295368);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x870fa2 of this['_checkViews'])_0x870fa2 instanceof Gs&&_0x870fa2['resetToDefault']();}}class Bs extends _0xe56eb6{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['statusButtonView'];constructor(_0x276ad2,_0x3ecdce){super(_0x276ad2),this['id']=_0x3ecdce,this['set']('status','pending'),this['set']('changeId',_0x3ecdce),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['statusButtonView']=this['_createStatusButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['statusButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('activateChange',{'id':_0x3ecdce,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x396e6e=new _0xe56eb6(this['locale']);return _0x396e6e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-content-direct-excluded','ck-ai-review-mode__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x159ec7=>!_0x159ec7)]}}),_0x396e6e;}['_createAcceptButtonView'](){const _0x1804c4=new _0x32eaf5(this['locale']);return _0x1804c4['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x1804c4['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x502c57=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x502c57['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0xe4a6e8=>'pending'!==_0xe4a6e8)]}}),_0x1804c4;}['_createDismissButtonView'](){const _0x2feef7=new _0x32eaf5(this['locale']);return _0x2feef7['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x2feef7['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x11b689=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x11b689['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-result-dismiss-button',this['bindTemplate']['if']('status','ck-hidden',_0x2e00e3=>'pending'!==_0x2e00e3)]}}),_0x2feef7;}['_createInfoButtonView'](){const _0x5ee722=new _0x32eaf5(this['locale']);return _0x5ee722['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x5092b4,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x5ee722['bind']('isOn')['to'](this,'isInfoToggleOn',_0x5bd557=>_0x5bd557),_0x5ee722['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x5ee722;}['_createStatusButtonView'](){const _0x50ee29=new _0x32eaf5(this['locale']);return _0x50ee29['set']({'withText':!0x0,'isEnabled':!0x1}),_0x50ee29['bind']('label')['to'](this,'status',_0x5993de=>i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_'+_0x5993de['toUpperCase']())),_0x50ee29['bind']('icon')['to'](this,'status',_0x494fd8=>'ACCEPTED'===_0x494fd8['toUpperCase']()?_0xde42e2:'REJECTED'===_0x494fd8['toUpperCase']()?_0x5e4164:_0x426255),_0x50ee29['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x581631=>'pending'===_0x581631)],'disabled':'disabled'}}),_0x50ee29;}}class Js extends _0x32eaf5{constructor(_0x344bff){super(_0x344bff),this['set']({'label':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class sh extends _0x256274{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x13dc0f){super(_0x13dc0f),this['_resultViews']=new _0x2a5a90(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new xi(_0x13dc0f),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('headerSubtitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general'),this['set']('isCompleted',!0x1);const _0x613c03=this['_createCombinedSkeletonLoader'](),_0x2b6676=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x2b6676['if']('isVisible','ck-hidden',_0x5262dc=>!_0x5262dc)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x4e27b0=>_0x4e27b0)]},'children':this['_resultViews']},_0x613c03]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x506ef9){const _0x257b7e=new Bs(this['locale'],_0x506ef9['id']);_0x257b7e['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x257b7e),_0x257b7e['resultResponseView']['element']['innerHTML']=_0x506ef9['contentDiffed'];}['hideResult'](_0xfb7224,_0x6ff6da){if('pending'===_0x6ff6da)return;const _0x591ec0=this['_resultViews']['find'](_0x380cf5=>_0x380cf5['id']===_0xfb7224);_0x591ec0&&(_0x591ec0['status']=_0x6ff6da,_0x591ec0['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0x2d664b,_0x38ce35){if('pending'!==_0x38ce35)return;const _0x468b71=this['_resultViews']['find'](_0x8f4177=>_0x8f4177['id']===_0x2d664b);_0x468b71&&(_0x468b71['status']=_0x38ce35,_0x468b71['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x38f733,_0x3d4f0e){this['headerTitle']=_0x38f733,this['headerSubtitle']=_0x3d4f0e||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}['resetErrorState'](){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}['_createSkeletonLoader'](){return new Pe(this['locale'],Be['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x7bcf68=new _0xe56eb6(this['locale']),_0x416add=[];for(let _0x312281=0x0;_0x312281<0x10;_0x312281++){const _0x457cb8=this['_createSkeletonLoader']();_0x457cb8['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x416add['push'](_0x457cb8);}return _0x7bcf68['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0xfb482c=>!_0xfb482c)]},'children':_0x416add}),_0x7bcf68;}['_createErrorView'](){const _0x2f305d=new _0xe56eb6(this['locale']),_0x49ec06=new _0x32eaf5(this['locale']),t=this['locale']['t'];return _0x2f305d['delegate']('retryReview')['to'](this),_0x49ec06['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x49ec06['on']('execute',()=>{this['fire']('retryReview');}),_0x2f305d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x2e3087=>!_0x2e3087),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x23f7bf=>'chunk'===_0x23f7bf)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-chat-error','ck-ai-chat-error_full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-chat-error_warning',_0x2d50f9=>'chunk'===_0x2d50f9)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x439f39=>'general'!==_0x439f39)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x366c25=>'chunk'!==_0x366c25)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x49ec06]}),_0x2f305d;}['_createCancelButtonView'](){const _0x8691a2=new _0x32eaf5(this['locale']);return _0x8691a2['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x5591c2}),_0x8691a2['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x262f40=>_0x262f40),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x15d94b=>_0x15d94b)]}}),_0x8691a2['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x8691a2;}['_createToggleDiffButtonView'](){const _0x26c558=new _0x32eaf5(this['locale']);_0x26c558['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x26c558['bind']('isEnabled')['to'](this,'isError',_0x3c2b4f=>!_0x3c2b4f),_0x26c558['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x51d68d=>!_0x51d68d),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x369ef7=>_0x369ef7)]}});const _0xbfcb07=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x4e8c12=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x26c558['bind']('isOn')['to'](this,'isToggleDiffOn',_0x41a240=>_0x41a240),_0x26c558['bind']('icon')['to'](this,'isToggleDiffOn',_0x53ba2d=>_0x53ba2d?_0x51a136:_0x5df65b),_0x26c558['bind']('label')['to'](this,'isToggleDiffOn',_0x4fbd31=>_0x4fbd31?_0xbfcb07:_0x4e8c12),_0x26c558['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x26c558;}['_createAcceptAllButtonView'](){const _0x58dd98=new _0x32eaf5(this['locale']);return _0x58dd98['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x58dd98['bind']('isEnabled')['to'](this,'isError',_0x3eab8d=>!_0x3eab8d),_0x58dd98['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x19a80f=>!_0x19a80f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5f9478=>_0x5f9478)]}}),_0x58dd98['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x58dd98;}['_createExitReviewButtonView'](){const _0x2ba718=new _0x32eaf5(this['locale']);return _0x2ba718['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x2ba718['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4a0842=>!_0x4a0842),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x185033=>_0x185033)]}}),_0x2ba718['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x2ba718;}['_createResultHeaderView'](){const _0x61dc1d=new _0xe56eb6(this['locale']),_0x489e75=this['_createTitleView']();return _0x61dc1d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x40320f=>_0x40320f)]},'children':[_0x489e75,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x61dc1d;}['_createTitleView'](){const _0x4d14de=new _0xe56eb6(this['locale']),_0xc3020b=new De();return _0xc3020b['bind']('isVisible')['to'](this,'isResultReady',_0x238c67=>!_0x238c67),_0x4d14de['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0xc3020b,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x594f10=>_0x594f10)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5785f7=>!_0x5785f7)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x4d14de;}['_createFinishReviewButtonView'](){const _0xcd9a49=new Js(this['locale']);return _0xcd9a49['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x32331f=>!_0x32331f)]}}),_0xcd9a49['delegate']('finishReview')['to'](this),_0xcd9a49;}}class eh extends _0x256274{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x127137){super(_0x127137),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x537bde=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x537bde['if']('isVisible','ck-hidden',_0x262bfe=>!_0x262bfe)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':i(_0x127137,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x3f9702=new Js(this['locale']);return _0x3f9702['delegate']('finishReview')['to'](this),_0x3f9702;}['_createResultHeaderView'](){const _0x561859=new _0xe56eb6(this['locale']);return _0x561859['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x561859;}}class Re extends _0xe56eb6{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x3c075b){super(_0x3c075b),this['reviewModeHeader']=new _0x565fd0(_0x3c075b,{'label':i(_0x3c075b,'AI_REVIEW_MODE'),'icon':_0x2a7e08,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new $s(_0x3c075b),this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=new sh(_0x3c075b),this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=new eh(_0x3c075b),this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0);}['addCheckRunResult'](_0x551a56){this['reviewCheckResultsView']['addResult'](_0x551a56),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class Ce extends _0xbb1014{['resultItemView'];constructor(_0x5beae0,_0x2a6af8){super(_0x5beae0),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['content']['add'](this['_createContentView']()),_0x2a6af8['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x106202){this['resultItemView']['changeId']=_0x106202['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x106202['contentDiffed'];}['showBalloon'](_0x421d8d,_0x3e1da5){this['updateContent'](_0x421d8d),this['show'](),this['pin']({'target':()=>this['_getBestRectPosition'](_0x3e1da5)});}['hideBalloon'](){this['hide'](),this['unpin']();}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange');}['_setupClickOutsideHandler'](){_0x3cc083({'emitter':this,'activator':()=>this['isVisible'],'contextElements':[this['element']],'callback':()=>{this['hideBalloon'](),this['deactivateChange']();}});}['_createContentView'](){const _0x33ae27=new _0xe56eb6();return this['resultItemView']=new Bs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x33ae27['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion']},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0x33ae27;}['_getBestRectPosition'](_0x5f3718){const _0x1e0a1c=Array['from'](_0x5f3718['getClientRects']());return _0x1e0a1c['find'](_0x28e240=>_0x28e240['width']>0x0)||_0x1e0a1c[0x0];}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class me extends ot{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[Ct];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x26f392){super(_0x26f392),this['_bodyCollection']=new _0x1c0188(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new Re(this['context']['locale']),this['_reviewModeView']['delegate'](...ih)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new Ce(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x1419fa=this['context']['plugins']['get']('AITabs');_0x1419fa['view']['on']('activateTab',(_0x26c91d,_0x2c3fcd)=>{'reviewMode'===_0x2c3fcd?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x1419fa['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x2a7e08,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x21bb7a){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x21bb7a),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x2d4fd9){_0x2d4fd9&&('error-general'!==_0x2d4fd9['status']?'error-chunk'!==_0x2d4fd9['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x20ebd6){this['_reviewModeView']['addCheckRunResult'](_0x20ebd6);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x40a06a,_0x35eb14){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x40a06a,_0x35eb14);}['setActiveStateInResults'](_0x38bde5){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x562b4c=>{_0x562b4c['id']===_0x38bde5&&_0x562b4c['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x31d133=>_0x31d133['setItemAsInactive']());}['updateChangeState'](_0x1106e2,_0x1c70d9){'accepted'===_0x1c70d9||'rejected'===_0x1c70d9||'outdated'===_0x1c70d9?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x1106e2,_0x1c70d9):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x1106e2,_0x1c70d9);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x1da456,_0x477f1d){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x1da456,_0x477f1d);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x3d9fb5){const _0x555d37=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x1acca7=>_0x1acca7['id']===_0x3d9fb5);return _0x555d37?_0x555d37['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const we='reviewmode-';class ce extends ot{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x568068,R];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x1f496f){super(_0x1f496f),this['_domEmitter']=new(_0x230d1d())(),this['_eventEmitter']=new(_0x42ebaf())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x282b66=ht(this['context']);_0x282b66['conversion']['for']('editingDowncast')['markerToElement']({'model':we+'insert','view':(_0x506dd6,{writer:_0x3002c8})=>{const _0x8e2fad=this['_markers']['get'](_0x506dd6['markerName']),_0x59e6e3={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x506dd6['markerName']};return _0x3002c8['createUIElement']('span',_0x59e6e3,function(_0x3b29e4){const _0x12f4a7=this['toDomElement'](_0x3b29e4);return _0x12f4a7['innerHTML']=_0x8e2fad?.['text']||'',_0x12f4a7;});}}),_0x282b66['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-only','view':_0x2e5981=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x2e5981['markerName']}})}),_0x282b66['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-context','view':_0x5b609e=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x5b609e['markerName']}})}),_0x282b66['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-text','view':_0x568c54=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x568c54['markerName']}})}),_0x282b66['conversion']['for']('dataDowncast')['markerToElement']({'model':we+'suggestion-context','view':(_0x1dcb2f,{writer:_0x35573a})=>_0x35573a['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x1dcb2f['isOpening']?'start':'end')})}),_0x282b66['conversion']['for']('downcast')['attributeToAttribute']({'model':Tt,'view':_0x22c998}),this['_domEmitter']['listenTo'](document,'click',(_0x2f2fa5,_0x20ef63)=>{const _0x14cb6e=_0x20ef63['target'],_0x5b29a6=this['_findMarkerElement'](_0x14cb6e);if(!_0x5b29a6)return;const _0x46c89f=_0x5b29a6['getAttribute']('data-marker-id'),_0x5c7e12=_0x46c89f['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x46c89f,'changeId':_0x5c7e12});}),_0x282b66['model']['document']['registerPostFixer'](_0x1fe7a8=>this['_validateMarkers'](_0x282b66,_0x1fe7a8)),_0x282b66['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x282b66));}['getDocumentData'](){const _0x1d3d64=this['context']['plugins']['get']('AIEditing'),_0x4868ba=ht(this['context']),_0x1d3352=_0x4868ba['model'],_0x34ca9f=new _0x403049();for(const _0x4126f4 of _0x1d3352['document']['getRoot']()['getChildren']()){const _0x2c7da0=_0x4126f4['_clone'](!0x0);_0x34ca9f['_appendChild'](_0x2c7da0);}for(const _0x449ae5 of _0x1d3352['markers'])_0x34ca9f['markers']['set'](_0x449ae5['name'],this['_changeRangeOwnerDocument'](_0x449ae5['getRange']()['clone'](),_0x34ca9f));const _0x11654f=new _0x44401a({'ignoreElementEnd':!0x0,'startPosition':_0x1d3352['createPositionAt'](_0x34ca9f,0x0)}),_0x4127d6=new Set(),_0x28c960=new Map();for(const {item:_0x1600ef}of _0x11654f){if(!_0x1600ef['is']('$textProxy'))continue;const _0x833236=_0x1600ef['parent'];if((!_0x833236||!_0x833236['is']('element','caption'))&&(_0x833236&&_0x833236['is']('element'))){let _0x48e7cf=_0x833236['getAttribute'](Tt);_0x48e7cf||(_0x48e7cf=_0x1d3d64['_nextDataId'](_0x4127d6),_0x833236['_setAttribute'](Tt,_0x48e7cf)),_0x4127d6['add'](_0x48e7cf);let _0x14cf07=_0x833236;for(;_0x14cf07['parent']&&!_0x14cf07['parent']['is']('documentFragment');)_0x14cf07=_0x14cf07['parent'],_0x14cf07['hasAttribute'](Tt)&&_0x14cf07['_removeAttribute'](Tt);_0x28c960['set'](_0x48e7cf,{'path':_0x833236['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x14cf07['_clone'](!0x0),_0x48e7cf,_0x4868ba['data'])}),_0x11654f['jumpTo'](_0x1d3352['createPositionAfter'](_0x833236));}}return{'content':_0x4868ba['data']['processor']['toData'](_0x4868ba['data']['toView'](_0x34ca9f)),'version':_0x4868ba['model']['document']['version'],'elements':_0x28c960};}['diffContent'](_0xe9cb16,_0x39d7fc){const _0x3cf8b8=[],_0x130cdc=ht(this['context']),_0x3f434d=_0x130cdc['data']['parse'](_0xe9cb16,'$documentFragment'),_0x2ab490=_0x130cdc['model']['createPositionAt'](_0x3f434d,0x0),_0x20bae5=_0x130cdc['data']['parse'](_0x39d7fc,'$documentFragment');if(!this['_hasSameTopLevelElement'](_0x3f434d,_0x20bae5))return _0x3cf8b8;const _0x520af0=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0xe9cb16,_0x39d7fc,{'anchor':_0x2ab490,'markDeletions':!0x0})['getOperations']()['filter'](_0x394b50=>'insert'===_0x394b50['type']||'marker'===_0x394b50['type']&&_0x394b50['name']['startsWith']('$markedRemove')),_0x1a282d=this['_groupAdjacentOperations'](_0x520af0);let _0x3e7b1c=0x0;return _0x130cdc['model']['change'](_0x30cabc=>{for(let _0x374dc7=0x0;_0x374dc7<_0x1a282d['length'];_0x374dc7++){const _0x1ffad1=_0x1a282d[_0x374dc7],_0x21b375=_0x30cabc['createDocumentFragment']();for(const _0x34cd18 of _0x3f434d['getChildren']())_0x30cabc['append'](_0x34cd18['_clone'](!0x0),_0x21b375);for(const _0x59935d of _0x1ffad1['operationsIsolated'])if('insert'===_0x59935d['type']){const _0x5dd729=_0x59935d;_0x5dd729['baseVersion']=null,_0x5dd729['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x5dd729,_0x21b375),_0x30cabc['batch']['addOperation'](_0x59935d),_0x130cdc['model']['applyOperation'](_0x59935d);const _0x3b113e='suggestion:insertion:id:authorId:'+_0x3e7b1c++,_0x43a425=_0x130cdc['model']['createRange'](_0x5dd729['position'],_0x5dd729['position']['getShiftedBy'](_0x5dd729['howMany']));_0x21b375['markers']['set'](_0x3b113e,_0x43a425);}else{if('marker'===_0x59935d['type']&&_0x59935d['name']['startsWith']('$markedRemove')){const _0x53a1d3=_0x59935d,_0x11ef60='suggestion:deletion:id:authorId:'+_0x3e7b1c++;this['_changeOperationOwnerDocument'](_0x53a1d3,_0x21b375),_0x21b375['markers']['set'](_0x11ef60,_0x53a1d3['newRange']);}}const _0x150fc3=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x1ffad1['operationsIsolated'][0x0]),_0x21b375),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x1ffad1['operationsIsolated'][_0x1ffad1['operationsIsolated']['length']-0x1]),_0x21b375));_0x21b375['markers']['set'](we+'suggestion-context',new _0x10f501(_0x150fc3['start'],_0x150fc3['end'])),_0x3cf8b8['push']({..._0x1ffad1,'context':this['_createGetContextFn'](_0x21b375,_0x130cdc['data'],{'ellipsisBefore':_0x150fc3['hasContentBefore'],'ellipsisAfter':_0x150fc3['hasContentAfter']}),'content':this['_createGetContentFn'](_0x21b375,_0x130cdc['data'])});}}),_0x3cf8b8;}['markChangePositionInEditorContent'](_0x51eaa6,_0x3746d5){if(!_0x51eaa6['length'])return;const _0x42d38c=_0x51eaa6[0x0]['parent']['id'],_0x1ca889=_0x3746d5['elements']['get'](_0x42d38c);if(!_0x1ca889)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x42d38c);const _0x10a53b=_0x1ca889['path'],_0x4e9931=ht(this['context']),_0x4ec781=_0x4e9931['model']['document']['history']['getOperations'](_0x3746d5['version']),_0x5788fa=[];for(const _0x3c5b7a of _0x51eaa6){const _0x2be284=_0x3c5b7a['operationsIsolated']['map'](_0x5b995c=>this['_translateOperationToEditorContent'](_0x5b995c,_0x10a53b,_0x4e9931['model']['document']['getRoots']()[0x0]));if(!_0x2be284||!_0x2be284['length'])continue;const _0xcefdf8=_0x2be284['every'](_0x4da47c=>'marker'===_0x4da47c['type']&&_0x4da47c['name']['startsWith']('$markedRemove')),_0x54a8cf={'document':_0x4e9931['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x276d0a=it(_0x2be284,_0x4ec781,_0x54a8cf)['operationsA'];for(const _0x3c0b0c of _0x276d0a)if('insert'===_0x3c0b0c['type']){const _0x812861=_0x3c0b0c,_0x409e0e=_0x812861['nodes'];let _0x1eadd6='';for(const _0xcff6c of _0x409e0e)_0xcff6c&&_0xcff6c['is']('model:$text')&&(_0x1eadd6+=_0xcff6c['data']);_0x5788fa['push']({'start':_0x812861['position'],'end':_0x812861['position'],'type':'insert','groupId':_0x3c5b7a['id'],'text':_0x1eadd6});}else{if('marker'===_0x3c0b0c['type']&&_0x3c0b0c['name']['startsWith']('$markedRemove')){const _0x4bbe7b=_0x3c0b0c;let _0x500f7a='remove-text';if(_0xcefdf8){const _0x3f3856=this['_findAdjacentContextDistance'](_0x4bbe7b['newRange']['start'],'backward',_0x4e9931['model']['schema']),_0x500f30=this['_findAdjacentContextDistance'](_0x4bbe7b['newRange']['end'],'forward',_0x4e9931['model']['schema']);if(_0x3f3856||_0x500f30){const _0x26a668=_0x4bbe7b['newRange']['start']['getShiftedBy'](-_0x3f3856),_0x504cfa=_0x4bbe7b['newRange']['end']['getShiftedBy'](_0x500f30);_0x5788fa['push']({'start':_0x26a668,'end':_0x504cfa,'groupId':_0x3c5b7a['id'],'type':'remove-context'});}else _0x500f7a='remove-only';}_0x5788fa['push']({'start':_0x4bbe7b['newRange']['start'],'end':_0x4bbe7b['newRange']['end'],'groupId':_0x3c5b7a['id'],'type':_0x500f7a});}}}this['_insertMarkers'](_0x5788fa);}['clearAllMarkers'](){const _0x13aade=ht(this['context']);_0x13aade['model']['change'](_0x21bb6a=>{for(const _0x1e1c48 of this['_markers']['keys']())_0x13aade['model']['markers']['get'](_0x1e1c48)&&_0x21bb6a['removeMarker'](_0x1e1c48);}),this['_markers']['clear']();}['switchToReadOnly'](){ht(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){ht(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x344c56){const _0x1fa096=ht(this['context']),_0x5d184a=_0x1fa096['model'],_0x57e11f=_0x344c56['map'](_0x19e73c=>this['_getMarkersDataForGroup'](_0x19e73c))['flat']();_0x5d184a['change'](_0xe28c7b=>{for(const _0x391c05 of _0x57e11f){const _0x55a20b=_0x1fa096['model']['markers']['get'](_0x391c05['id']);_0x55a20b&&('insert'===_0x391c05['type']?_0x5d184a['insertContent'](_0xe28c7b['createText'](_0x391c05['text']||''),_0x55a20b['getRange']()['start']):'remove-text'!==_0x391c05['type']&&'remove-only'!==_0x391c05['type']||_0x5d184a['deleteContent'](_0x5d184a['createSelection'](_0x55a20b['getRange']())),_0xe28c7b['removeMarker'](_0x391c05['id']),this['_markers']['delete'](_0x391c05['id']));}});}['rejectChange'](_0x26ab6d){const _0x4a9252=ht(this['context']),_0x5d848=this['_getMarkersDataForGroup'](_0x26ab6d);_0x4a9252['model']['change'](_0x326319=>{for(const _0xee297 of _0x5d848)_0x326319['removeMarker'](_0xee297['id']),this['_markers']['delete'](_0xee297['id']);});}['getEditor'](){return ht(this['context']);}['getMarkerElementForChange'](_0x530281){const _0x323422=Array['from'](this['_markers']['values']())['filter'](_0x380cd0=>_0x380cd0['groupId']===_0x530281);if(!_0x323422['length'])return null;const _0x4f9ee2=0x1===_0x323422['length']?_0x323422[0x0]:this['_sortMarkers'](_0x323422)[0x0],_0x2c14a1=ht(this['context']),_0x275550=_0x2c14a1['model']['markers']['get'](_0x4f9ee2['id']);if(!_0x275550)return null;const _0x529a8a=_0x275550['getRange'](),_0x4a6a92=_0x2c14a1['editing']['view']['getDomRoot']();if(!_0x4a6a92||!_0x529a8a)return null;const _0x336ae2=_0x4a6a92['querySelector']('[data-marker-id=\x22'+_0x4f9ee2['id']+'\x22]');return _0x336ae2?{'modelRange':_0x529a8a,'domElement':_0x336ae2}:null;}['_validateMarkers'](_0x4af4c8,_0x5cd264){const _0x568d2f=Array['from'](this['_markers']['keys']()),_0x42f84a=new Map();for(const _0x1473c6 of _0x568d2f){const _0x1de8fd=_0x4af4c8['model']['markers']['get'](_0x1473c6);if(!_0x1de8fd)continue;const _0x58d527=_0x1de8fd['getStart']()['path'][0x0];_0x42f84a['has'](_0x58d527)||_0x42f84a['set'](_0x58d527,[]),_0x42f84a['get'](_0x58d527)['push'](_0x1de8fd);}const _0x4379ae=new Set();for(const _0x9cb62a of _0x4af4c8['model']['document']['differ']['getChanges']()){let _0x2d3164=-0x1,_0x15a90e=null;if('insert'===_0x9cb62a['type'])_0x15a90e=new _0x10f501(_0x9cb62a['position'],_0x9cb62a['position']['getShiftedBy'](_0x9cb62a['length'])),_0x2d3164=_0x9cb62a['position']['path'][0x0];else{if('remove'!==_0x9cb62a['type'])continue;_0x15a90e=new _0x10f501(_0x9cb62a['position']),_0x2d3164=_0x9cb62a['position']['path'][0x0];}const _0x35aa7f=_0x42f84a['get'](_0x2d3164)||[];if(_0x35aa7f['length']){for(const _0x3ea3df of _0x35aa7f)if(_0x15a90e['root']['rootName']===_0x3ea3df['getRange']()['root']['rootName']&&('insert'!==_0x9cb62a['type']||!_0x15a90e['containsRange'](_0x3ea3df['getRange']()))&&(_0x15a90e['isIntersecting'](_0x3ea3df['getRange']())||_0x15a90e['start']['isTouching'](_0x3ea3df['getRange']()['end'])||_0x15a90e['end']['isTouching'](_0x3ea3df['getRange']()['start']))){const _0x184c9f=this['_parseMarkerName'](_0x3ea3df['name']);Array['from'](this['_markers']['values']())['filter'](_0xa4d068=>_0xa4d068['groupId']===_0x184c9f['groupId'])['forEach'](_0x21c01a=>_0x4379ae['add'](_0x21c01a['id']));}}}if(_0x4379ae['size']){for(const _0x4d6402 of _0x4379ae)_0x5cd264['removeMarker'](_0x4d6402);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x4b8733){for(const {name:_0x252679,data:_0x5ae843}of _0x4b8733['model']['document']['differ']['getChangedMarkers']()){if(!_0x252679['startsWith'](we))continue;const _0x1230a2=_0x5ae843['oldRange'],_0x19e295=_0x5ae843['newRange'],_0x50dd56=_0x1230a2&&'$graveyard'===_0x1230a2['root']['rootName'],_0x44d841=_0x19e295&&'$graveyard'===_0x19e295['root']['rootName'];if(_0x50dd56&&_0x44d841)continue;const _0x5d26cb=this['_parseMarkerName'](_0x252679);this['_markers']['get'](_0x252679)&&(_0x44d841||!_0x19e295?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x252679,'changeId':_0x5d26cb['groupId']}):_0x50dd56&&_0x19e295&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x252679,'changeId':_0x5d26cb['groupId']}));}}['_parseMarkerName'](_0x1daa27){const _0x4c4521=_0x1daa27['split'](':'),_0x4de88a=(_0x4c4521[0x1]||'')['split']('_');return{'prefix':_0x4c4521[0x0],'groupId':_0x4de88a[0x0],'suffix':_0x4de88a[0x1]};}['_translateOperationToEditorContent'](_0x5e5984,_0x76c08b,_0x3180e7){if('insert'===_0x5e5984['type']){const _0x5bc20c=_0x5e5984;return new _0x37b91e(this['_changePosition'](_0x76c08b['concat'](_0x5bc20c['position']['offset']),_0x3180e7),_0x5bc20c['nodes'],_0x5bc20c['baseVersion']);}if('marker'===_0x5e5984['type']&&_0x5e5984['name']['startsWith']('$markedRemove')){const _0xfb60e=_0x5e5984;return new _0x4bf0e3(_0xfb60e['name'],_0xfb60e['oldRange'],this['_changeRange'](_0xfb60e['newRange'],_0x76c08b['concat'](_0xfb60e['newRange']['start']['offset']),_0x76c08b['concat'](_0xfb60e['newRange']['end']['offset']),_0x3180e7),_0xfb60e['_markers'],_0xfb60e['affectsData'],_0xfb60e['baseVersion']);}return _0x5e5984;}['_groupAdjacentOperations'](_0x38db3a){if(!_0x38db3a['length'])return[];const _0x3b7f27=[];let _0xf6769f=0x0,_0x317b8f=0x0,_0x4c2e81=[];for(let _0xcddd6c=0x0;_0xcddd6c<=_0x38db3a['length'];_0xcddd6c++){const _0x23a80e=_0x38db3a[_0xcddd6c],_0xd96224=_0x38db3a[_0xcddd6c-0x1];!_0x23a80e||_0xd96224&&!this['_getOperationEnd'](_0xd96224)['isTouching'](this['_getOperationStart'](_0x23a80e))?(_0x3b7f27['push']({'operations':_0x4c2e81,'operationsIsolated':_0x4c2e81['map'](_0x5eec3f=>this['_shiftOperation'](_0x5eec3f['clone'](),-_0x317b8f)),'groupOffset':_0xf6769f}),_0x4c2e81=_0x23a80e?[_0x23a80e]:[],_0x317b8f+=_0xf6769f,_0xf6769f=0x0):_0x4c2e81['push'](_0x23a80e),_0x23a80e&&'insert'===_0x23a80e['type']&&(_0xf6769f+=_0x23a80e['howMany']);}return _0x3b7f27;}['_findAdjacentContextDistance'](_0x42e5a2,_0x182719,_0x204d12,_0x1e8642=0x1){const _0x1d7a06=new _0x44401a({'startPosition':_0x42e5a2,'direction':_0x182719});let _0x2a1026=0x0;for(let _0x403e00=0x0;_0x403e00<_0x1e8642;_0x403e00++){let _0x55e4e3=0x0,_0x1b1308=!0x1,_0x908dcb='forward'===_0x182719?/^\W*\w+/:/\w+\W*$/;for(const {item:_0xd69893}of _0x1d7a06)if(_0xd69893['is']('$textProxy')){const _0x37a1ae=_0x908dcb['exec'](_0xd69893['data']);if(_0x37a1ae&&_0x37a1ae['length']){if(_0x55e4e3+='forward'===_0x182719?_0x37a1ae['index']+_0x37a1ae[0x0]['length']:_0xd69893['data']['length']-_0x37a1ae['index'],_0x37a1ae[0x0]['length']!==_0xd69893['data']['length'])break;_0x1b1308=!0x0,_0x908dcb='forward'===_0x182719?/^\w+/:/\w+$/;}else{if(_0x1b1308)break;_0x55e4e3+=_0xd69893['offsetSize'];}}else{if(_0xd69893['is']('element')){_0x204d12['isInline'](_0xd69893)&&!_0x1b1308&&(_0x55e4e3+=0x1);break;}}_0x2a1026+=_0x55e4e3,_0x1d7a06['jumpTo'](_0x42e5a2['getShiftedBy']('forward'===_0x182719?_0x2a1026:-_0x2a1026));}return _0x2a1026;}['_getChangeContext'](_0x314553,_0x58e34b){const _0x396633=ht(this['context'])['model']['schema'],_0x547cac=this['_findAdjacentContextDistance'](_0x314553,'backward',_0x396633,0x6),_0x2e3c59=this['_findAdjacentContextDistance'](_0x58e34b,'forward',_0x396633,0x6),_0x5e0c6c=_0x314553['getShiftedBy'](-_0x547cac),_0x16e205=_0x58e34b['getShiftedBy'](_0x2e3c59);return{'start':_0x5e0c6c,'end':_0x16e205,'hasContentBefore':!_0x5e0c6c['isAtStart'],'hasContentAfter':!_0x16e205['isAtEnd']};}['_insertMarkers'](_0x7f1c33){const _0x4466ff=this['context']['plugins']['get']('AIEditing'),_0x242699=new Set();ht(this['context'])['model']['change'](_0x36612c=>{for(const _0x18fbe8 of _0x7f1c33){const _0x441d69=''+we+_0x18fbe8['type']+':'+_0x18fbe8['groupId']+'_'+_0x4466ff['_nextDataId'](_0x242699);this['_markers']['set'](_0x441d69,{'id':_0x441d69,'groupId':_0x18fbe8['groupId'],'type':_0x18fbe8['type'],'text':_0x18fbe8['text']}),_0x36612c['addMarker'](_0x441d69,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x36612c['createRange'](_0x18fbe8['start'],_0x18fbe8['end'])});}});}['_createGetContextFn'](_0x181516,_0x2ca456,_0x196a5a){let _0x54a0db='';return()=>{if(!_0x54a0db){const _0x2ac9f9=_0x2ca456['toView'](_0x181516,{'showSuggestionHighlights':!0x0}),_0x2e5aaf=_0x2ac9f9['getChild'](0x0);if(!_0x2e5aaf)return'';let _0x47e0bd=!0x1;const _0x559f10=[];for(const _0x5ee3ae of _0x2e5aaf['getChildren']())_0x5ee3ae['is']('element','span')&&_0x5ee3ae['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x47e0bd=!0x1),_0x47e0bd&&_0x559f10['push'](_0x5ee3ae),_0x5ee3ae['is']('element','span')&&_0x5ee3ae['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x47e0bd=!0x0);_0x2e5aaf['_removeChildren'](0x0,_0x2e5aaf['childCount']),_0x196a5a?.['ellipsisBefore']&&_0x2e5aaf['_appendChild']('…'),_0x2e5aaf['_appendChild'](_0x559f10),_0x196a5a?.['ellipsisAfter']&&_0x2e5aaf['_appendChild']('…');const _0x3341b6=_0x2ca456['htmlProcessor']['domConverter']['viewToDom'](_0x2ac9f9),_0x10bef9=_0x2ca456['htmlProcessor']['htmlWriter']['getHtml'](_0x3341b6);_0x54a0db=_0x10bef9;}return _0x54a0db;};}['_createGetContentFn'](_0x24a393,_0x1b7a7b){let _0x5d29ac='';return()=>(_0x5d29ac||(_0x5d29ac=_0x1b7a7b['stringify'](_0x24a393,{'showSuggestionHighlights':!0x0})),_0x5d29ac);}['_createGetContentUsingDataIdFn'](_0x448112,_0x2b3611,_0x552d0a){let _0x446af9='';return()=>{if(!_0x446af9){const _0x2d5b54=_0x552d0a['toView'](new _0x403049(_0x448112)),_0x8d7e1d=_0x552d0a['htmlProcessor']['domConverter']['viewToDom'](_0x2d5b54)['querySelector']('[data-id=\x22'+_0x2b3611+'\x22]');_0x446af9=_0x8d7e1d?.['outerHTML']||'';}return _0x446af9;};}['_findMarkerElement'](_0x2053cf,_0x17f4ab=0x5){let _0x57f7d4=_0x2053cf,_0x4b9d2b=null;for(let _0x16e0e3=0x0;_0x16e0e3<_0x17f4ab&&_0x57f7d4;_0x16e0e3++){if(!_0x57f7d4['className']){_0x57f7d4=_0x57f7d4['parentElement'];continue;}if(!(''+_0x57f7d4['className'])['includes']('ck-ai_review-mode-marker_')){_0x57f7d4=_0x57f7d4['parentElement'];continue;}if(!_0x57f7d4['getAttribute']('data-marker-id'))break;_0x4b9d2b=_0x57f7d4;break;}return _0x4b9d2b;}['_getMarkersDataForGroup'](_0x376cf1){return Array['from'](this['_markers']['values']())['filter'](_0x56d7ba=>_0x56d7ba['groupId']===_0x376cf1);}['_getOperationStart'](_0x2208d5){return'insert'===_0x2208d5['type']?_0x2208d5['position']:_0x2208d5['newRange']['start'];}['_getOperationEnd'](_0x4a6b14,_0x803432=!0x1){return'insert'===_0x4a6b14['type']?_0x803432?_0x4a6b14['position']:_0x4a6b14['position']['getShiftedBy'](_0x4a6b14['howMany']):_0x4a6b14['newRange']['end'];}['_shiftOperation'](_0x829e91,_0x38715c){return'insert'===_0x829e91['type']?_0x829e91['position']=_0x829e91['position']['getShiftedBy'](_0x38715c):'marker'===_0x829e91['type']&&_0x829e91['newRange']&&(_0x829e91['newRange']=new _0x10f501(_0x829e91['newRange']['start']['getShiftedBy'](_0x38715c),_0x829e91['newRange']['end']['getShiftedBy'](_0x38715c))),_0x829e91;}['_changeOperationOwnerDocument'](_0x32eef5,_0x919b51){'insert'===_0x32eef5['type']?_0x32eef5['position']=this['_changePositionOwnerDocument'](_0x32eef5['position'],_0x919b51):'marker'===_0x32eef5['type']&&_0x32eef5['newRange']&&(_0x32eef5['newRange']=this['_changeRangeOwnerDocument'](_0x32eef5['newRange'],_0x919b51));}['_changePositionOwnerDocument'](_0x41af96,_0x163c9a){return new _0x399771(_0x163c9a,_0x41af96['path']);}['_changeRangeOwnerDocument'](_0x2df59a,_0x41269c){return new _0x10f501(this['_changePositionOwnerDocument'](_0x2df59a['start'],_0x41269c),this['_changePositionOwnerDocument'](_0x2df59a['end'],_0x41269c));}['_changePosition'](_0x5536f5,_0x428d5b){return new _0x399771(_0x428d5b,[..._0x5536f5]);}['_changeRange'](_0x24e846,_0x12d5ba,_0x5beaf9,_0x4fedb0){return new _0x10f501(this['_changePosition'](_0x12d5ba,_0x4fedb0),this['_changePosition'](_0x5beaf9,_0x4fedb0));}['_sortMarkers'](_0x5e9226){const _0x21616a=_0x279336=>{switch(_0x279336){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x5e9226['sort']((_0x29564a,_0x55ae95)=>_0x21616a(_0x29564a['type'])-_0x21616a(_0x55ae95['type']));}['_hasSameTopLevelElement'](_0xb8daa5,_0x33354a){const _0x19db3e=_0xb8daa5['getChild'](0x0),_0x5e35bb=_0x33354a['getChild'](0x0);return!(!_0x19db3e||!_0x5e35bb)&&((!_0x19db3e['is']('element')||!_0x5e35bb['is']('element')||_0x19db3e['name']===_0x5e35bb['name'])&&!(_0x19db3e['is']('element')&&!_0x5e35bb['is']('element')||!_0x19db3e['is']('element')&&_0x5e35bb['is']('element')));}}class Va extends ot{static get['requires'](){return[re,me,ce];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,x as AIAdapter,qn as AIAssistant,n as AIAssistantUI,$ as AIBalloon,Pa as AIChat,mt as AIChatController,gt as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,dt as AIChatUI,S as AIConnector,R as AIEditing,Ha as AIEditorIntegration,Ft as AIQuickActionType,Ua as AIQuickActions,ii as AIQuickActionsUI,tr as AIRequestError,js as AIReviewCheck,Rs as AIReviewCheckResult,Ts as AIReviewCheckRun,Va as AIReviewMode,re as AIReviewModeController,ce as AIReviewModeEditing,me as AIReviewModeUI,Ct as AITabs,pe as AITextAdapter,qt as AIToggleButtonUI,zn as AWSTextAdapter,Xn as OpenAITextAdapter,E as ShowAIAssistantCommand,co as ToggleAICommand,ks as createResizeButton,Qn as getDefaultAICommands};
23
+ import{Plugin as _0x24349a,Command as Nt,ContextPlugin as _0x1bcf21,Editor as st}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5ddadb,IconCheck as _0xb9bffe,IconError as _0x39489b,IconSubmit as _0x15a18a,IconAIHistory as Ht,IconMagicWand as _0x3499d0,IconRobotPencil as _0x4a15cf,IconMaximize as _0x19452d,IconMinimize as to,IconDocumentWithLoupe as _0x47de8d,IconAddComment as _0x199daf,IconShowChangesOn as _0x1300c4,IconShowChangesOff as _0x3e637d,IconDocument as _0x2a33e9,IconThreeStars as _0x4d2f65,IconRemove as _0x3d606e,IconDocumentWithCheckmark as _0x51e75b,IconDocumentWithCross as _0x175e95,IconLoupe as _0x37f845,IconCancel as _0x417878,IconStop as _0x4eb42b,IconAIChat as _t,IconPlus as _0x25c434,IconPin as _0x1215aa,IconThreeHorizontalDots as _0x2c2132,IconChevronRight as _0x33c9a8,IconInfo as _0x39984d,IconOutdated as _0x37f2d8,IconEye as _0x145e51,IconEyeCrossedOut as _0x455890,IconAIReview as _0x283cc3}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x50fe7e,CKEditorError as _0xb61eac,ObservableMixin as _0x33fb62,global as _0x43815f,isVisible as _0x15f5a3,Rect as _0x3863bd,Collection as _0x3addd2,FocusTracker as ts,KeystrokeHandler as _0x25a17d,first as _0x111a74,toArray as _0x1238ba,EmitterMixin as _0x2ebfa6,logWarning as _0x2398b2,scrollViewportToShowTarget as _0x568df9,logError as ot,ResizeObserver as _0x56775d,_isMotionReduced as It,scrollAncestorsToShowTarget as _0x5bd77a,DomEmitterMixin as _0x5aa562}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x427ffd,ButtonView as _0x3d6e77,View as _0x262350,SpinnerView as _0x449591,IconView as _0x3a2ec3,AutocompleteView as _0x207cdb,ListView as _0x4a993d,ListItemGroupView as _0x9a3abe,ListItemView as _0x321758,ButtonLabelView as _0x9b3e62,FocusCycler as $t,createLabeledTextarea as _0x3708a3,Dialog as _0xb21972,createDropdown as _0x33079d,addMenuToDropdown as _0x410c32,MenuBarMenuView as _0x3cd2d0,MenuBarMenuListItemButtonView as _0x470b70,DialogViewPosition as _0x3c6257,MenuBarMenuListView as ti,MenuBarMenuListItemView as _0x426725,UIModel as _0x948671,SplitButtonView as _0xd26e7b,BalloonPanelView as _0x51cd8c,BodyCollection as qt,clickOutsideHandler as _0x3bd809,ListItemButtonView as _0x299f96,ViewCollection as _0x2f454a,addListToDropdown as _0x162dc1,submitHandler as _0x49a30d,LabeledFieldView as _0x5d33a3,createLabeledInputText as th,FormHeaderView as _0x20ce21,HighlightedTextView as _0x4063f0,FileDialogButtonView as _0x28699f,InputTextView as _0x3e9226,SearchTextView as _0x4a200b,DropdownMenuButtonView as _0x270dfe,DropdownMenuPanelPositioningFunctions as _0x6092f6,BalloonToolbar as zt,FormRowView as _0x17466f,TextareaView as _0x587f99}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x10d8b8,ClipboardMarkersUtils as _0xd64c30}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x16627d,ViewDataTransfer as _0x3eafaf,ViewUpcastWriter as _0x359ecb,Matcher as _0x1cbd06,_DetachOperation as _0xb3c868,_insertIntoModelNodeList as _0x4fa1cc,_removeFromModelNodeList as _0x4e3c48,ModelRange as _0x33fc08,ViewDowncastWriter as kt,transformOperationSets as _0x226818,ModelDocumentFragment as _0x3c80b2,ModelPosition as _0xf3918b,ModelTreeWalker as _0x43fa8d,InsertOperation as te,MarkerOperation as _0x1a656e}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x57a797,escape as _0xb7774e,escapeRegExp as _0x58ed47}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x495225,InvokeModelWithResponseStreamCommand as _0x48bd50,InvokeModelCommand as _0x4283cb}from'@aws-sdk/client-bedrock-runtime';import{createParser as wt}from'eventsource-parser';import{parseDocument as _0x31b175}from'htmlparser2';import{isTag as _0x32c662,findOne as gt,getParent as _0x2e679f,findAll as _0x45b719,removeElement as _0x462fa1,replaceElement as _0x8e05b3,prepend as _0x56a186,prependChild as _0x15972e,appendChild as _0x23b438,append as _0x44af25,find as _0x58d58d,isComment as _0x524bb7,getChildren as _0x36fc4e,textContent as _0x1cfcc2}from'domutils';import _0x20aeb7 from'dom-serializer';import{Document as mt,Element as _0x2708d9,Text as _0x54e177,cloneNode as _0x16a7a4,isDocument as _0x2f796e,isText as _0x44d02d,NodeWithChildren as _0x1f43c2}from'domhandler';import{MarkdownGfmMdToHtml as _0x5bc621}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x5d26f1,getAllMarkersDomElementsSorted as _0x1b6680,DocumentCompare as _0x11fc7b,DATA_ID_MODEL_ATTRIBUTE as ct,ConfirmMixin as _0x4b3894,LateFocusDropdownButtonView as _0x1d9ea1,DATA_ID_VIEW_ATTRIBUTE as _0x18e402}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x28cce4}from'es-toolkit';import{IconThumbUp as _0x5c6ba3,IconThumbDown as _0x3816ea,IconCopy as _0x287257,IconCheck as _0x223d65,IconShowChangesOff as _0xd2a692,IconShowChangesOn as _0x58b84a,IconWeb as _0x533bf1,IconNextArrow as _0x3f932b,IconPreviousArrow as _0x488fbf,IconAI as Ct,IconClose as _0x3843a6,IconSelection as _0x4147de,IconFileUpload as _0x3f89c6,IconLink as _0x39c37d,IconDocument as _0x2adc4e,IconBulb as _0x255204,IconDocumentOutline as _0x301d1a,IconPaperClip as _0x5a3b98,IconBrowseFiles as _0x31c9bb,IconDropdownArrow as _0x4a36c6,IconAIAskAI as _0x208fd0,IconAIQuickActions as _0x3133c5,IconAIChatCommands as Ut,IconAIImproveWriting as Mt,IconAIContinueWriting as Kt,IconAIGrammarCheck as Rt,IconAIAdjustLength as Qt,IconAIChangeTone as xt,IconAITranslate as Dt,IconAIOther as Lt,IconRefresh as _0x218209}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x20dcf6 from'morphdom';import{SuggestionsConversion as Pt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0x235f0d}from'diff';const ei='_ungrouppedCommands';function z(_0x388ef2,_0x17bfcc){const _0x1cb42d=(0x0,_0x17bfcc['t'])('Other');return _0x388ef2['length']?'groupId'in _0x388ef2[0x0]?_0x388ef2:[{'groupId':ei,'groupLabel':_0x1cb42d,'order':0x1/0x0,'commands':_0x388ef2}]:[{'groupId':ei,'groupLabel':_0x1cb42d,'order':0x1/0x0,'commands':[]}];}const Fn=globalThis['DataTransfer'],q='ai-ui';class F extends _0x24349a{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x48710c}=this,_0xa8186b=['ck-fake-ai-selection'];_0x48710c['config']['get']('ai.assistant.useTheme')&&_0xa8186b['push']('ck-ai-assistant-ui_theme'),_0x48710c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':q,'view':{'classes':_0xa8186b,'priority':0xc}}),_0x48710c['conversion']['for']('editingDowncast')['markerToElement']({'model':q,'view':(_0xfd4796,{writer:_0x492bfb})=>{if(!_0xfd4796['markerRange']['isCollapsed'])return null;const _0x20b36a=_0x492bfb['createUIElement']('span');return _0x492bfb['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x20b36a),_0x20b36a;}});}['afterInit'](){!async function(_0xc019c){const _0x1cf9f5=_0x560f88([0x6e,0x41,0x37,0x79,0x75,0x72,0x67,0x4f,0x48,0x62,0x5a,0x76,0x44,0x70,0x6c,0x52,0x6b,0x4a,0x73,0x63,0x64,0x49,0x43,0x6d,0x38,0x36,0x6f,0x50,0x57,0x78,0x39,0x32,0x66,0x31,0x71,0x46,0x30,0x4c,0x61,0x53,0x58,0x33,0x4e,0x47,0x77,0x54,0x4d,0x4b,0x34,0x6a,0x56,0x74,0x59,0x55,0x42,0x51,0x69,0x35,0x7a,0x68,0x65,0x45]),_0x2984ed=0x3dffc4e1,_0x359cf9=0x3df8b349^_0x2984ed,_0x5a5b1b=window[_0x560f88([0x44,0x61,0x74,0x65])][_0x560f88([0x6e,0x6f,0x77])](),_0x57638d=_0xc019c[_0x560f88([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4ef897=new window[(_0x560f88([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5d2e43=>{_0x57638d[_0x560f88([0x6f,0x6e,0x63,0x65])](_0x560f88([0x72,0x65,0x61,0x64,0x79]),_0x5d2e43);}),_0x459703={[_0x560f88([0x6b,0x74,0x79])]:_0x560f88([0x45,0x43]),[_0x560f88([0x75,0x73,0x65])]:_0x560f88([0x73,0x69,0x67]),[_0x560f88([0x63,0x72,0x76])]:_0x560f88([0x50,0x2d,0x32,0x35,0x36]),[_0x560f88([0x78])]:_0x560f88([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]),[_0x560f88([0x79])]:_0x560f88([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]),[_0x560f88([0x61,0x6c,0x67])]:_0x560f88([0x45,0x53,0x32,0x35,0x36])},_0x2565b3=_0x57638d[_0x560f88([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x560f88([0x67,0x65,0x74])](_0x560f88([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x2ba0f3(){let _0x2c4526,_0x46fe67=null,_0x304052=null;try{if(_0x2565b3==_0x560f88([0x47,0x50,0x4c]))return _0x560f88([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x2c4526=_0x2b57f2(),!_0x2c4526)return _0x560f88([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x2c4526[_0x560f88([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x304052=_0x1a5fbf(_0x2c4526[_0x560f88([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x2c4526[_0x560f88([0x6a,0x74,0x69])])),await _0xa6b463()?_0x467654()?_0x453c89()?_0x560f88([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x2ad4d5()?(_0x2c4526[_0x560f88([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x560f88([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x46fe67=_0x3f0e14(_0x560f88([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x2c4526[_0x560f88([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x560f88([0x74,0x72,0x69,0x61,0x6c])&&(_0x46fe67=_0x3f0e14(_0x560f88([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x10f4ee()):_0x560f88([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x560f88([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x560f88([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x560f88([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x453c89(){const _0x538cc4=[_0x560f88([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x560f88([0x74,0x72,0x69,0x61,0x6c])][_0x560f88([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2c4526[_0x560f88([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5a5b1b/0x3e8:0xe10*_0x359cf9;return _0x2c4526[_0x560f88([0x65,0x78,0x70])]<_0x538cc4;}function _0x467654(){const _0x326bf4=_0x2c4526[_0x560f88([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x326bf4&&(!!_0x326bf4[_0x560f88([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x560f88([0x2a]))||!!_0x326bf4[_0x560f88([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x560f88([0x41,0x49])));}function _0x2ad4d5(){const _0x2dc880=_0x2c4526[_0x560f88([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x2dc880||0x0==_0x2dc880[_0x560f88([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0xd1d607}=new URL(window[_0x560f88([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x2dc880[_0x560f88([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xd1d607))return!0x0;const _0x486011=_0xd1d607[_0x560f88([0x73,0x70,0x6c,0x69,0x74])](_0x560f88([0x2e]));return _0x2dc880[_0x560f88([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1e4bf6=>_0x1e4bf6[_0x560f88([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x560f88([0x2a])))[_0x560f88([0x6d,0x61,0x70])](_0x22f0db=>_0x22f0db[_0x560f88([0x73,0x70,0x6c,0x69,0x74])](_0x560f88([0x2e])))[_0x560f88([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x21f63f=>_0x21f63f[_0x560f88([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x486011[_0x560f88([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x560f88([0x6d,0x61,0x70])](_0x4e7595=>Array(_0x486011[_0x560f88([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x4e7595[_0x560f88([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x560f88([0x66,0x69,0x6c,0x6c])](_0x4e7595[0x0]===_0x560f88([0x2a])?_0x560f88([0x2a]):'')[_0x560f88([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x4e7595))[_0x560f88([0x73,0x6f,0x6d,0x65])](_0x144286=>_0x486011[_0x560f88([0x65,0x76,0x65,0x72,0x79])]((_0x434929,_0x5760e7)=>_0x144286[_0x5760e7]===_0x434929||_0x144286[_0x5760e7]===_0x560f88([0x2a])));}function _0x10f4ee(){return _0x46fe67&&_0x304052?new window[(_0x560f88([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4a20d0,_0x7b73f4)=>{_0x46fe67[_0x560f88([0x74,0x68,0x65,0x6e])](_0x4a20d0,_0x7b73f4),_0x304052[_0x560f88([0x74,0x68,0x65,0x6e])](_0x20edde=>{_0x20edde!=_0x560f88([0x56,0x61,0x6c,0x69,0x64])&&_0x4a20d0(_0x20edde);},_0x7b73f4);}):_0x46fe67||_0x304052||_0x560f88([0x56,0x61,0x6c,0x69,0x64]);}}function _0x1a5fbf(_0x199239,_0x2af882){return new window[(_0x560f88([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3251cb=>{if(_0x5e6db0())return _0x3251cb(_0x560f88([0x56,0x61,0x6c,0x69,0x64]));_0x275ae5(),_0x57638d[_0x560f88([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x560f88([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x474c1a=!0x1;const _0x38817e=_0x50fe7e();function _0x5b743e(_0x5e165b){return!!_0x5e165b&&(typeof _0x5e165b===_0x560f88([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x5e165b===_0x560f88([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x5e165b[_0x560f88([0x74,0x68,0x65,0x6e])]===_0x560f88([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x5e165b[_0x560f88([0x63,0x61,0x74,0x63,0x68])]===_0x560f88([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x56beac(_0xc080ca){_0x1ba80c(_0xc080ca)[_0x560f88([0x74,0x68,0x65,0x6e])](_0x6cc6d=>{if(!_0x6cc6d||_0x6cc6d[_0x560f88([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x560f88([0x6f,0x6b]))return _0x560f88([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x18168b(_0x401c93(_0x38817e+_0x2af882))!=_0x6cc6d[_0x560f88([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x560f88([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x560f88([0x56,0x61,0x6c,0x69,0x64]);})[_0x560f88([0x74,0x68,0x65,0x6e])](_0x204b7f=>(_0x1ab35a(),_0x204b7f),()=>{const _0x35b168=_0x543b41();return null==_0x35b168?(_0x1ab35a(),_0x560f88([0x56,0x61,0x6c,0x69,0x64])):_0x560f88(_0x5a5b1b-_0x35b168>(0x19f340e1^_0x2984ed)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x560f88([0x74,0x68,0x65,0x6e])](_0x3251cb)[_0x560f88([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3251cb(_0x560f88([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x3a41e1=0x3dc92a61^_0x2984ed;function _0x1ab35a(){const _0x267d4a=_0x560f88([0x6c,0x6c,0x63,0x74,0x2d])+_0x18168b(_0x401c93(_0x199239)),_0x5ecce4=_0x15f7e4(_0x18168b(window[_0x560f88([0x4d,0x61,0x74,0x68])][_0x560f88([0x63,0x65,0x69,0x6c])](_0x5a5b1b/_0x3a41e1)));window[_0x560f88([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x560f88([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x267d4a,_0x5ecce4);}function _0x543b41(){const _0x4bb4a1=_0x560f88([0x6c,0x6c,0x63,0x74,0x2d])+_0x18168b(_0x401c93(_0x199239)),_0x55d7b7=window[_0x560f88([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x560f88([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4bb4a1);return _0x55d7b7?window[_0x560f88([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x15f7e4(_0x55d7b7),0x10)*_0x3a41e1:null;}function _0x1ba80c(_0xaec002){return new window[(_0x560f88([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x502776,_0xd0b5b7)=>{_0xaec002[_0x560f88([0x74,0x68,0x65,0x6e])](_0x502776,_0xd0b5b7),window[_0x560f88([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0xd0b5b7,0x3dfe1021^_0x2984ed);});}}_0x57638d[_0x560f88([0x6f,0x6e])](_0x560f88([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x36fc0f,_0x381763)=>{if(_0x381763[0x0]!=_0x199239)return _0x3251cb(_0x560f88([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x381763[0x1]={..._0x381763[0x1],[_0x560f88([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x38817e};},{[_0x560f88([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x560f88([0x68,0x69,0x67,0x68])}),_0x57638d[_0x560f88([0x6f,0x6e])](_0x560f88([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x13a3e3=>{_0x5b743e(_0x13a3e3[_0x560f88([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x474c1a=!0x0,_0x56beac(_0x13a3e3[_0x560f88([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x560f88([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x560f88([0x6c,0x6f,0x77])}),_0x4ef897[_0x560f88([0x74,0x68,0x65,0x6e])](()=>{_0x474c1a||_0x3251cb(_0x560f88([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5e6db0(){return _0x57638d[_0x560f88([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x560f88([0x76,0x69,0x65,0x77])][_0x560f88([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x560f88([0x61,0x75,0x74,0x6f]);}function _0x275ae5(){_0x57638d[_0x560f88([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x560f88([0x76,0x69,0x65,0x77])][_0x560f88([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x560f88([0x61,0x75,0x74,0x6f]);}}function _0x3f0e14(_0x375865){const _0x4e4221=[new window[(_0x560f88([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2afd7f=>setTimeout(_0x2afd7f,0x3df6fa2d^_0x2984ed)),_0x4ef897[_0x560f88([0x74,0x68,0x65,0x6e])](()=>new window[(_0x560f88([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x172f9c=>{let _0x4c421f=0x0;_0x57638d[_0x560f88([0x6d,0x6f,0x64,0x65,0x6c])][_0x560f88([0x6f,0x6e])](_0x560f88([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x317adc,_0xa87ecf)=>{_0xa87ecf[0x0][_0x560f88([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4c421f++,_0x4c421f==(0x3dffc519^_0x2984ed)&&(_0x172f9c(),_0x317adc[_0x560f88([0x6f,0x66,0x66])]());});}))];return window[_0x560f88([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x560f88([0x72,0x61,0x63,0x65])](_0x4e4221)[_0x560f88([0x74,0x68,0x65,0x6e])](()=>_0x375865);}async function _0x2eabe5(){await _0x4ef897,_0x57638d[_0x560f88([0x6d,0x6f,0x64,0x65,0x6c])][_0x560f88([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x26c14e,_0x57638d[_0x560f88([0x6d,0x6f,0x64,0x65,0x6c])][_0x560f88([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x26c14e,_0x57638d[_0x560f88([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x560f88([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x4baca0(_0x23b2f4){const _0x481267=_0x161c9e();_0x57638d[_0x481267]=_0x560f88([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x23b2f4,_0x23b2f4!=_0x560f88([0x56,0x61,0x6c,0x69,0x64])&&_0x2eabe5();}function _0x161c9e(){const _0x290a38=window[_0x560f88([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x560f88([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x560f88([0x6e,0x6f,0x77])]())[_0x560f88([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x560f88([0x2e]),'');let _0x4c8fa3=_0x560f88([0x6e]);for(let _0x76c68d=0x0;_0x76c68d<_0x290a38[_0x560f88([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x76c68d+=0x2){let _0x33479d=window[_0x560f88([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x290a38[_0x560f88([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x76c68d,_0x76c68d+0x2));_0x33479d>=_0x1cf9f5[_0x560f88([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x33479d-=_0x1cf9f5[_0x560f88([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x4c8fa3+=_0x1cf9f5[_0x33479d];}return _0x4c8fa3;}function _0x2b57f2(){const _0x39e097=_0x2565b3[_0x560f88([0x73,0x70,0x6c,0x69,0x74])](_0x560f88([0x2e]));if(0x3!=_0x39e097[_0x560f88([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4dd849(_0x39e097[0x1]);function _0x4dd849(_0x5ece08){const _0x1711bb=_0x36f8f0(_0x5ece08);return _0x1711bb&&_0x4f4dd0()?_0x1711bb:null;function _0x4f4dd0(){const _0x12c961=_0x1711bb[_0x560f88([0x6a,0x74,0x69])],_0x22faf7=window[_0x560f88([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x12c961[_0x560f88([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x12c961[_0x560f88([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x130039={..._0x1711bb,[_0x560f88([0x6a,0x74,0x69])]:_0x12c961[_0x560f88([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x12c961[_0x560f88([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x130039[_0x560f88([0x76,0x63])],_0x401c93(_0x130039)==_0x22faf7;}}}async function _0xa6b463(){let _0x22a752=!0x0;try{const _0x2c3f44=_0x2565b3[_0x560f88([0x73,0x70,0x6c,0x69,0x74])](_0x560f88([0x2e])),[_0x5c79f8,_0x150eb0,_0x56013f]=_0x2c3f44;return _0x33c20f(_0x5c79f8),await _0x193636(_0x5c79f8,_0x150eb0,_0x56013f),_0x22a752;}catch{return!0x1;}function _0x33c20f(_0x48487a){const _0x550514=_0x36f8f0(_0x48487a);_0x550514&&_0x550514[_0x560f88([0x61,0x6c,0x67])]==_0x560f88([0x45,0x53,0x32,0x35,0x36])||(_0x22a752=!0x1);}async function _0x193636(_0x30bda5,_0x2d0daa,_0x22e9ff){const _0xc048ec=window[_0x560f88([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x560f88([0x66,0x72,0x6f,0x6d])](_0x410c74(_0x22e9ff),_0x5b3bb3=>_0x5b3bb3[_0x560f88([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x5b10a3=new window[(_0x560f88([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x560f88([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x30bda5+_0x560f88([0x2e])+_0x2d0daa),_0x2eb6b5=window[_0x560f88([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x560f88([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x2eb6b5)return;const _0x2cb918=await _0x2eb6b5[_0x560f88([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x560f88([0x6a,0x77,0x6b]),_0x459703,{[_0x560f88([0x6e,0x61,0x6d,0x65])]:_0x560f88([0x45,0x43,0x44,0x53,0x41]),[_0x560f88([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x560f88([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x560f88([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x2eb6b5[_0x560f88([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x560f88([0x6e,0x61,0x6d,0x65])]:_0x560f88([0x45,0x43,0x44,0x53,0x41]),[_0x560f88([0x68,0x61,0x73,0x68])]:{[_0x560f88([0x6e,0x61,0x6d,0x65])]:_0x560f88([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2cb918,_0xc048ec,_0x5b10a3)||(_0x22a752=!0x1);}}function _0x36f8f0(_0x349671){return _0x349671[_0x560f88([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x560f88([0x65,0x79]))?JSON[_0x560f88([0x70,0x61,0x72,0x73,0x65])](_0x410c74(_0x349671)):null;}function _0x410c74(_0x172029){return window[_0x560f88([0x61,0x74,0x6f,0x62])](_0x172029[_0x560f88([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x560f88([0x2b]))[_0x560f88([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x560f88([0x2f])));}function _0x401c93(_0x3633ec){let _0x3cf120=0x1505;function _0x321b12(_0x3cea22){for(let _0x1c14d5=0x0;_0x1c14d5<_0x3cea22[_0x560f88([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1c14d5++){const _0x459a4b=_0x3cea22[_0x560f88([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1c14d5);_0x3cf120=(_0x3cf120<<0x5)+_0x3cf120+_0x459a4b,_0x3cf120&=_0x3cf120;}}function _0x2b6762(_0x18d792){Array[_0x560f88([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x18d792)?_0x18d792[_0x560f88([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x2b6762):_0x18d792&&typeof _0x18d792==_0x560f88([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x560f88([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x18d792)[_0x560f88([0x73,0x6f,0x72,0x74])]()[_0x560f88([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x193889,_0x4b70f8])=>{_0x321b12(_0x193889),_0x2b6762(_0x4b70f8);}):_0x321b12(window[_0x560f88([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x18d792));}return _0x2b6762(_0x3633ec),_0x3cf120>>>0x0;}function _0x18168b(_0x329624){return _0x329624[_0x560f88([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x560f88([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x560f88([0x30]));}function _0x15f7e4(_0x23e7a7){return _0x23e7a7[_0x560f88([0x73,0x70,0x6c,0x69,0x74])]('')[_0x560f88([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x560f88([0x6a,0x6f,0x69,0x6e])]('');}function _0x26c14e(){}function _0x560f88(_0x578eab){return _0x578eab['map'](_0x1e3134=>String['fromCharCode'](_0x1e3134))['join']('');}_0x4baca0(await _0x2ba0f3());}(this);}['showFakeVisualSelection'](){const _0x177277=this['editor']['model'];_0x177277['change'](_0x3c6ab5=>{const _0x3e3512=_0x177277['document']['selection']['getRanges']();let _0x38a13b=0x0;for(const _0x1f454b of _0x3e3512){const _0x44a41d=q+':'+_0x38a13b;if(_0x177277['markers']['has'](_0x44a41d))_0x3c6ab5['updateMarker'](_0x44a41d,{'range':_0x1f454b});else{if(_0x1f454b['start']['isAtEnd']){const _0x5c3516=_0x1f454b['start']['getLastMatchingPosition'](({item:_0x6a97b0})=>!_0x177277['schema']['isContent'](_0x6a97b0),{'boundaries':_0x1f454b});_0x3c6ab5['addMarker'](_0x44a41d,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3c6ab5['createRange'](_0x5c3516,_0x1f454b['end'])});}else _0x3c6ab5['addMarker'](_0x44a41d,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1f454b});}_0x38a13b++;}});}['hideFakeVisualSelection'](){const _0x3a26c3=this['editor']['model'],_0x58eb74=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](q));_0x58eb74['length']&&_0x3a26c3['change'](_0x44a6bc=>{_0x58eb74['forEach'](_0x3b02b5=>{_0x44a6bc['removeMarker'](_0x3b02b5);});});}['insertContent'](_0x1ab749,_0x410e6c){const _0x59fe03=this['_getAISelection'](),_0x428e9c=_0x410e6c||_0x59fe03['getFirstRange']();this['editor']['model']['canEditAt'](_0x428e9c)&&this['editor']['model']['change'](_0x1a5c13=>{this['hideFakeVisualSelection'](),_0x410e6c||this['_resetContentOfSelectedTableCells'](_0x1a5c13,_0x59fe03),this['_pasteHTMLUsingClipboard']({'insertAt':_0x428e9c,'writer':_0x1a5c13,'html':_0x1ab749});});}['insertContentBelow'](_0xade921){const {model:_0x10a1c7}=this['editor'],_0x4308e8=this['_getAISelection']();_0x10a1c7['change'](()=>{const _0x23bb51=this['_prepareTableInsertBelowPosition'](_0xade921,_0x4308e8)||this['_getDefaultInsertBelowPosition'](_0x4308e8);this['insertContent'](_0xade921,_0x23bb51);});}['_getAISelection'](){const _0x14722c=this['editor']['model'],_0x4f921e=Array['from'](_0x14722c['markers']['getMarkersGroup'](q))['map'](_0x57c6b7=>_0x57c6b7['getRange']());return _0x14722c['createSelection'](_0x4f921e);}['_pasteHTMLUsingClipboard']({writer:_0x5b7681,html:_0x845e9d,insertAt:_0x42bdd1}){const {view:_0x34bf5d}=this['editor']['editing'],_0xdd691=this['editor']['plugins']['get'](_0x10d8b8),_0x5919a8=new Fn();_0x5919a8['setData']('text/html',_0x845e9d);const _0x1ad6cb=new ClipboardEvent('paste',{'clipboardData':_0x5919a8}),_0x1a860f=new _0x16627d(_0x34bf5d,_0x1ad6cb,{'dataTransfer':new _0x3eafaf(_0x5919a8)});_0x5b7681['setSelection'](_0x42bdd1);const _0x3adf0e=(_0x4ab1ef,_0x13cacf)=>{_0x13cacf['resultRange']&&_0x5b7681['setSelection'](_0x13cacf['resultRange']);};_0xdd691['once']('contentInsertion',_0x3adf0e,{'priority':'lowest'}),_0x34bf5d['document']['fire']('paste',_0x1a860f),_0xdd691['off']('contentInsertion',_0x3adf0e);}['_getDefaultInsertBelowPosition'](_0x429cc4){const {model:_0x1b94bf}=this['editor'],_0x3d534e=Array['from'](_0x429cc4['getSelectedBlocks']());return _0x3d534e['length']?_0x1b94bf['createPositionAfter'](_0x3d534e['pop']()):_0x429cc4['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x402122,_0x37064b){const {model:_0x598f41,plugins:_0x22141c}=this['editor'];if(_0x22141c['has']('TableUtils')){const _0x1e244e=_0x22141c['get']('TableUtils')['getSelectedTableCells'](_0x37064b);if(_0x1e244e['length']){const _0x16c1b1=this['_getTableRowCountFromContent'](_0x402122),_0x468cd4=this['_createEmptyTableRows'](_0x1e244e,_0x16c1b1);return _0x598f41['createPositionAt'](_0x468cd4,0x0);}}return null;}['_getTableRowCountFromContent'](_0x3fa21c){const _0x21cd67=this['editor']['plugins']['get']('TableUtils'),_0x71ed21=this['editor']['data']['parse'](_0x3fa21c),_0x378f33=Array['from'](_0x71ed21['getChildren']())['filter'](_0x237004=>_0x237004['is']('element','table'));let _0x43fa42=0x0;return _0x378f33['forEach'](_0x3058cc=>{_0x43fa42+=_0x21cd67['getRows'](_0x3058cc);}),_0x43fa42;}['_createEmptyTableRows'](_0x2f8e6a,_0x43a5f4){const _0x4857a9=this['editor']['plugins']['get']('TableUtils'),_0x22a6eb=_0x4857a9['getRowIndexes'](_0x2f8e6a),_0x55b26f=_0x4857a9['getColumnIndexes'](_0x2f8e6a),_0x27085a=_0x22a6eb['last']+0x1,_0x8aa5c0=_0x55b26f['first'],_0x3b4f96=_0x2f8e6a[0x0]['findAncestor']('table');for(let _0x48b157=0x0;_0x48b157<_0x43a5f4;_0x48b157++)_0x4857a9['insertRows'](_0x3b4f96,{'at':_0x27085a});return _0x3b4f96['getChild'](_0x27085a)['getChild'](_0x8aa5c0);}['_resetContentOfSelectedTableCells'](_0x477f93,_0x2d9c4e){const {plugins:_0x108812}=this['editor'],{model:_0x1c9e37}=_0x477f93;if(!_0x108812['has']('TableUtils'))return;_0x108812['get']('TableUtils')['getSelectedTableCells'](_0x2d9c4e)['length']&&_0x1c9e37['deleteContent'](_0x2d9c4e);}}class ni extends _0x24349a{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0xb61eac('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x455d08){super(_0x455d08),this['name']='AIRequestError';}}function Yn(_0x31d15f,_0x5f1af6,_0x486ef1){const t=_0x31d15f['t'];switch(_0x5f1af6){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',_0x486ef1);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x486ef1);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'},_0x486ef1);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 _0x5f1af6;}}class ai extends Nt{['_commandDefinitions'];constructor(_0x4f2f09,_0x6379a){super(_0x4f2f09),this['_commandDefinitions']=_0x6379a,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0xff3c8d,_0x106f1b,_0xe53a95)=>{this['isEnabled']&&(this['enabledCommandsIds']=cs(this['_commandDefinitions'],_0xe53a95));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x5e0bee,_0x4e2fc7,_0x55241c)=>{this['enabledCommandsIds']=_0x55241c?cs(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x465c86=this['editor']['model'];this['_hasContext']=function(_0x3d00d4){const _0x56f81b=_0x3d00d4['document']['selection'];return _0x56f81b['isCollapsed']?0x0!==[..._0x56f81b['getSelectedBlocks']()]['length']&&![..._0x56f81b['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x3d00d4['hasContent'](_0x56f81b['getFirstRange']());}(_0x465c86);const _0x35d301=_0x465c86['document']['selection'],_0x5415b5=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x28012e of _0x35d301['getRanges']())for(const _0x3c195f of _0x28012e['getItems']())if(_0x3c195f['is']('element')&&_0x5415b5['includes'](_0x3c195f['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x1cf8f0='',_0x4b740c='',_0x770c00='custom'){this['editor']['plugins']['get'](G)['showUI'](_0x1cf8f0,_0x4b740c,_0x770c00);}}function cs(_0x451a38,_0x4cbbf4){const _0x4ad1d9=new Set();for(const _0x4cce99 of _0x451a38['values']())(_0x4cbbf4||!0x1===_0x4cce99['requiresContent'])&&_0x4ad1d9['add'](_0x4cce99['id']);return Array['from'](_0x4ad1d9);}const as=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class oi extends/* #__PURE__ -- @preserve */
24
+ _0x33fb62(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x49dd29,_0x36ef58,_0x58780e){super(),this['editor']=_0x49dd29,this['textAdapter']=_0x36ef58,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x58780e,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x443d13,_0x7f71e1,_0x412230)=>{this['view']['value']=this['_sanitizeHTML'](_0x412230);}),this['listenTo'](this['view'],'submitPrompt',(_0x384f64,_0x2b7f46)=>{const _0x3c79ec=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x2b7f46,_0x3c79ec,'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:_0x10dfe7,query:_0x12bf91,htmlContent:_0x1c2632,label:_0x2c3ba2,mainActionLabel:_0xcc9fae}){this['view']['prompt']=_0x2c3ba2,this['view']['mainAction']=_0xcc9fae,this['initialContext']=_0x1c2632,_0x12bf91&&(this['view']['isRendered']?this['_handleQuery'](_0x12bf91,_0x1c2632,_0x10dfe7,_0x2c3ba2):this['view']['once']('render',()=>{this['_handleQuery'](_0x12bf91,_0x1c2632,_0x10dfe7,_0x2c3ba2);}));}['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'](_0x4cabdd,_0x1f2812,_0x464622,_0x20cf8c){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x1f2812,this['previousQuery']=_0x4cabdd,this['previousLabel']=_0x20cf8c||_0x4cabdd,this['previousActionId']=_0x464622,new Promise(_0x126ad0=>{this['textAdapter']['makeRequest']({'query':_0x4cabdd,'context':_0x1f2812,'onData':_0x1bd951=>{this['currentResponse']=_0x1bd951,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x464622})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x4cbe38=>{_0x4cbe38 instanceof tr?this['view']['handleError'](_0x4cbe38['message']):this['view']['handleError'](),_0x126ad0();})['finally'](()=>{this['stopProcessing'](),_0x126ad0();});});}['_parseAndNormalizeContent'](_0x4240d7,_0x17e59f=!0x1){const _0x477f1f=as['exec'](_0x4240d7);_0x4240d7=_0x477f1f?_0x4240d7['substring'](_0x477f1f[0x1]['length']):_0x4240d7['length']<0x64&&!_0x17e59f?'':this['_stripMarkdownSyntax'](_0x4240d7);const _0x269e70=this['_domParser']['parseFromString'](_0x4240d7,'text/html');if(_0x477f1f){const _0x50daa0=Array['from'](_0x269e70['body']['childNodes']);_0x50daa0['reverse']();for(const _0x18b53d of _0x50daa0){if(_0x18b53d['nodeType']==Node['ELEMENT_NODE'])break;_0x18b53d['remove']();}}const _0x5ec931=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x269e70['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x5ec931);const _0x1ac5aa=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x210942=this['editor']['data']['toModel'](_0x5ec931);return _0x1ac5aa||_0x210942['markers']['clear'](),this['editor']['data']['stringify'](_0x210942);}['_normalizeResponseHeadings'](_0x55e62c){const _0x2b87fa=new _0x359ecb(this['editor']['editing']['view']['document']),_0x5c3090=new _0x1cbd06({'name':/^h[1-5]$/}),_0x13ea52=[];let _0x1b3895=!0x1;for(const _0x411eb4 of _0x55e62c)_0x411eb4['is']('element')&&_0x5c3090['match'](_0x411eb4)&&(_0x13ea52['push'](_0x411eb4),'h1'==_0x411eb4['name']&&(_0x1b3895=!0x0));if(_0x1b3895){for(const _0x2a1b5a of _0x13ea52)_0x2b87fa['rename']('h'+(parseInt(_0x2a1b5a['name'][0x1])+0x1),_0x2a1b5a);}}['_isH1TagSupportEnabled'](){const {data:_0x212570,editing:_0x8872be}=this['editor'],_0x25fbe6=_0x212570['htmlProcessor']['toView']('<h1></h1>'),_0x519e6c=_0x212570['toView'](_0x212570['toModel'](_0x25fbe6));return!!_0x8872be['view']['domConverter']['viewToDom'](_0x519e6c)['querySelector']('h1');}['_sanitizeHTML'](_0x5b65ee){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x5b65ee),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x50ef72){const _0x4ef23f=_0x50ef72['trim']();return _0x4ef23f['startsWith']('```html')?_0x4ef23f['endsWith']('```')?_0x4ef23f['substring'](0x7,_0x4ef23f['length']-0x3):_0x4ef23f['substring'](0x7):_0x50ef72;}}const ci={'REPLACE':'replace','INSERT':'insert'};class wr extends _0x427ffd{constructor(_0x9bbfb7){super(_0x9bbfb7),this['set']('isVisible',!0x1),this['set']('mainAction',ci['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x3decb2=>Yn(_0x9bbfb7,'AI_'+_0x3decb2['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Yn(_0x9bbfb7,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Yn(_0x9bbfb7,'Try\x20again')),this['stopButton']=this['_createButton'](Yn(_0x9bbfb7,'Stop'));const _0x18dd60=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x18dd60['if']('isVisible','ck-hidden',_0x50ce35=>!_0x50ce35)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x309f05,_0x16e669){const _0x3da81d=new _0x3d6e77(this['locale']);return _0x3da81d['set']({'label':_0x309f05,'class':_0x16e669||'','isVisible':!0x0,'withText':!0x0}),_0x3da81d;}}class yr extends _0x262350{['contentFieldView'];['copyButtonView'];constructor(_0x40d67a,_0x2e63aa=''){super(_0x40d67a),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x36f9fe=this['bindTemplate'];this['contentFieldView']=new $n(_0x40d67a,_0x2e63aa),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x36f9fe['if']('isVisible','ck-hidden',_0x2eb491=>!_0x2eb491)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x36f9fe['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 _0x36d948=!0x1;this['on']('change:value',(_0xb97790,_0x151a54,_0x2393fb)=>{const _0xba8982=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2393fb),this['isProcessing']&&_0xba8982&&!_0x36d948&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3ae5d7,_0x423fab,_0x314e9b)=>{_0x36d948=!0x1,_0x314e9b?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x36d948=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x36d948=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5b5b34=this['locale'],_0x361c66=new _0x3d6e77(this['locale']),_0x52d773='ck-ai-form__copy-button';return _0x361c66['set']({'label':Yn(_0x5b5b34,'Copy'),'icon':_0x5ddadb,'class':_0x52d773,'tooltip':!0x0}),_0x361c66['bind']('isVisible')['to'](this,'value',_0x16b606=>!!_0x16b606),_0x361c66['bind']('isEnabled')['to'](this,'isProcessing',_0x2cb4f=>!_0x2cb4f),_0x361c66['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x361c66['icon']=_0xb9bffe,_0x361c66['class']=_0x52d773+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x361c66['icon']=_0x5ddadb,_0x361c66['class']=_0x52d773;},0x3e8);}),_0x361c66;}['_copyHTMLToClipboard'](_0x5bd018){const {window:_0x3e1301,document:_0x5a6246}=_0x43815f;if(_0x3e1301['ClipboardItem']){const {Blob:_0x2cd868,ClipboardItem:_0x5a8e9e}=_0x3e1301,_0x45a813=[new _0x5a8e9e({'text/html':new _0x2cd868([_0x5bd018['innerHTML']],{'type':'text/html'}),'text/plain':new _0x2cd868([_0x5bd018['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x45a813);}else{const _0x4726a1=_0x5a6246['createElement']('div');_0x4726a1['style']['position']='absolute',_0x4726a1['style']['left']='-9999px',_0x4726a1['innerHTML']='<span>[</span>'+_0x5bd018['innerHTML']+'<span>]</span>',_0x5a6246['body']['appendChild'](_0x4726a1);const _0x37623e=_0x5a6246['createRange']();_0x37623e['setStartAfter'](_0x4726a1['firstElementChild']),_0x37623e['setEndBefore'](_0x4726a1['lastElementChild']);const _0x5abb5e=_0x3e1301['getSelection']();_0x5abb5e['removeAllRanges'](),_0x5abb5e['addRange'](_0x37623e),_0x5a6246['execCommand']('copy'),_0x4726a1['remove']();}}}class $n extends _0x262350{constructor(_0x348024,_0x44bde8=''){super(_0x348024),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x44bde8,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2a9ce9){this['element']['innerHTML']=_0x2a9ce9;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x21222d=new _0x262350(),_0x501b25=this['locale'],_0x4eec8b=new _0x449591();return _0x4eec8b['isVisible']=!0x0,_0x21222d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x4eec8b,{'text':Yn(_0x501b25,'AI\x20is\x20writing...')}]}),_0x21222d['render'](),_0x21222d;}}class gr extends _0x262350{constructor(_0x2e8202,_0x5f5db6=''){super(_0x2e8202);const _0x305fa3=new _0x3a2ec3(),_0x36d5bf=this['bindTemplate'];this['set']('text',_0x5f5db6),_0x305fa3['content']=_0x39489b,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x305fa3,{'text':_0x36d5bf['to']('text')}]});}}class Er extends _0x207cdb{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2d84d2,_0x5862c9){super(_0x2d84d2,_0x5862c9),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',(_0x50cfc7,_0x737cdb)=>{_0x50cfc7['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x737cdb());});}['_createSubmitButton'](){const _0x35682f=new _0x3d6e77(this['locale']),_0x583977=this['locale'];return _0x35682f['set']({'icon':_0x15a18a,'label':Yn(_0x583977,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x35682f['on']('execute',()=>{this['submit']();}),_0x35682f['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x340e05,_0x4da644)=>!_0x340e05&&_0x4da644),_0x35682f;}['_createShowHistoryButton'](){const _0x51d0f4=new _0x3d6e77(this['locale']),_0x34ef65=this['resultsView'],_0xed48a7=this['locale'];_0x51d0f4['set']({'label':Yn(_0xed48a7,'History'),'withText':!0x1,'icon':Ht,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x51d0f4['bind']('isOn')['to'](_0x34ef65,'isVisible'),_0x51d0f4['bind']('isEnabled')['to'](this,'isEnabled'),_0x51d0f4['on']('execute',()=>{_0x34ef65['isVisible']=!_0x34ef65['isVisible'],_0x34ef65['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x499e19=()=>{_0x43815f['window']['requestAnimationFrame'](()=>{if(_0x15f5a3(this['element'])){const _0x12fa7a=new _0x3863bd(this['queryView']['fieldView']['element']),_0x3b922a=_0x12fa7a['width'],_0x524b5f='rtl'===_0xed48a7['uiLanguageDirection']?'left':'right';_0x12fa7a['excludeScrollbarsAndBorders'](),_0x51d0f4['element']['style'][_0x524b5f]=_0x3b922a-_0x12fa7a['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x499e19),this['on']('render',_0x499e19),_0x51d0f4;}['submit'](){const _0x33b1d0=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x33b1d0);}['focus'](_0xa7edf7){-0x1===_0xa7edf7?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class vr extends _0x4a993d{['historyGroupView'];['clearHistoryButton'];constructor(_0x17e1d6){super(_0x17e1d6),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x9a3abe(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Yn(_0x17e1d6,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2a48dc=0x0;for(const _0x55aa31 of this['items'])_0x2a48dc+=_0x55aa31['items']['length'];return{'resultsCount':_0x2a48dc,'totalItemsCount':_0x2a48dc};}['_createClearHistoryButton'](){const _0x351f5d=this['locale'],_0x1b3a82=new _0x3d6e77(this['locale']);return _0x1b3a82['set']({'label':'('+Yn(_0x351f5d,'Clear')+')','withText':!0x0}),_0x1b3a82['on']('execute',()=>this['fire']('clearHistory')),_0x1b3a82;}}class Ar extends _0x321758{constructor(_0x566288){super();const _0x4fbbf5=new _0x9b3e62(),_0x230fef=new _0x3d6e77(this['locale'],_0x4fbbf5);this['children']['add'](_0x230fef),_0x230fef['set']({'label':_0x566288['prompt'],'withText':!0x0}),_0x230fef['on']('execute',()=>{this['fire']('execute',{'value':_0x57a797(_0x566288['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Pr extends _0x3addd2{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x659ef3,_0x21d493)=>{const _0x50870b=fo(_0x21d493['prompt']);for(const _0x439a16 of this)if(_0x439a16!=_0x21d493&&fo(_0x439a16['prompt'])===_0x50870b){this['remove'](_0x439a16);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x5daf15=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x5daf15));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x1e0eff=>_0x1e0eff)));}}function fo(_0x2d49f7){return _0x2d49f7['toLowerCase']()['trim']();}class ri extends _0x262350{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1fe1a7,_0x582413,_0x4d2eb0=''){super(_0x1fe1a7),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',ci['REPLACE']),this['_promptHistory']=new Pr(),this['errorView']=new gr(_0x1fe1a7),this['contentArea']=new yr(_0x1fe1a7,_0x4d2eb0),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 ts(),this['keystrokes']=new _0x25a17d(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new $t({'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 _0x37dd39=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x582413],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x37dd39['if']('isError','ck-hidden',_0x135d2b=>!_0x135d2b)]},'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'](_0x2c3339=0x1){-0x1===_0x2c3339?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 _0x45ed88=this['locale'],_0x2ab91b=new Er(_0x45ed88,{'queryView':{'label':Yn(_0x45ed88,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x3708a3,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Yn(_0x45ed88,'Empty\x20history'),'secondary':Yn(_0x45ed88,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x2ab91b['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x281340,_0x50fcbf)=>_0x281340&&!_0x50fcbf),this['listenTo'](_0x2ab91b,'submit',(_0xcf4c3b,_0x44cbe0)=>{this['prompt']=_0x44cbe0;const _0x33a43a=_0xb7774e(_0x44cbe0);this['fire']('submitPrompt',_0x33a43a),_0x44cbe0['trim']()&&this['_promptHistory']['add']({'prompt':_0x33a43a},0x0);},{'priority':'high'}),_0x2ab91b;}['_createHistoryView'](){const _0x539492=new vr(this['locale']);return _0x539492['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ar),_0x539492['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x539492;}['_createToolbar'](){const _0x169b95=new wr(this['locale']);return _0x169b95['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2882b0,_0x3ce410,_0x19b197)=>_0x2882b0&&!_0x3ce410&&!!_0x19b197),_0x169b95['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x169b95['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x39387f,_0x68eee0,_0x2143b6)=>_0x39387f&&!_0x68eee0&&!!_0x2143b6),_0x169b95['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x169b95['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x44db8e,_0x2f05cb)=>_0x44db8e&&!_0x2f05cb),_0x169b95['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x169b95['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x169b95['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x169b95;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x446ea0=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Yn(_0x446ea0,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2758a3){const _0x3dbb38=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2758a3||Yn(_0x3dbb38,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const J=globalThis['DataTransfer'];class G extends _0x24349a{['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[_0xd64c30,F,ni,_0xb21972];}constructor(_0x4455a1){super(_0x4455a1),_0x4455a1['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x4455a1['config']['define']('ai.assistant.contentAreaCssClass',''),_0x4455a1['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x4455a1['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x2b9ecb}=this;this['_aiAdapter']=_0x2b9ecb['plugins']['get'](ni),this['_dialog']=_0x2b9ecb['plugins']['get'](_0xb21972),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x9c1445=new ai(_0x2b9ecb,Array['from'](this['_commandDefinitions']['values']()));_0x2b9ecb['commands']['add']('showAIAssistant',_0x9c1445),_0x2b9ecb['ui']['componentFactory']['add']('aiCommands',_0x4a18fb=>{const _0xc2e4b7=_0x33079d(_0x4a18fb);return _0xc2e4b7['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0xc2e4b7['buttonView']['set']({'label':Yn(_0x4a18fb,'AI\x20Commands'),'icon':_0x3499d0,'tooltip':!0x0}),_0xc2e4b7['on']('execute',_0x3b1920=>this['_onExecute'](_0x3b1920['source']['id'])),_0x410c32(_0xc2e4b7,_0x2b9ecb['ui']['view']['body'],function(_0x4ba869){const _0x5c0b81=z(_0x4ba869['config']['get']('ai.assistant.commands'),_0x4ba869['locale']),_0x41ee1b=hi(_0x4ba869,_0x5c0b81)['filter'](_0x1ffbe6=>_0x1ffbe6['commands']['length']);if(0x1===_0x41ee1b['length'])return hi(_0x4ba869,_0x41ee1b[0x0]['commands'])['map'](_0x3d34ea=>({'id':_0x3d34ea['id'],'label':_0x3d34ea['label']}));return _0x41ee1b['map'](_0x3e40cc=>{const {groupId:_0x5b53c5,groupLabel:_0x13f9bf,commands:_0x33ea5f}=_0x3e40cc,_0x3bac88=hi(_0x4ba869,_0x33ea5f)['map'](_0x1cc7e4=>({'id':_0x1cc7e4['id'],'label':_0x1cc7e4['label']}));return{'id':_0x5b53c5,'menu':_0x13f9bf||_0x5b53c5,'children':_0x3bac88};});}(_0x2b9ecb),{'ariaLabel':Yn(_0x4a18fb,'AI\x20Commands')}),_0xc2e4b7['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x9c1445['on']('change:enabledCommandsIds',_0x908ac9),_0xc2e4b7['menuView']['once']('render',_0x908ac9),_0xc2e4b7;function _0x908ac9(){_0xc2e4b7['isEnabled']=_0x9c1445['enabledCommandsIds']['length']>0x0;for(const _0x4ad323 of _0xc2e4b7['menuView']['buttons'])_0x4ad323['isEnabled']=_0x9c1445['enabledCommandsIds']['includes'](_0x4ad323['id']);}}),_0x2b9ecb['ui']['componentFactory']['add']('menuBar:aiCommands',_0x97053e=>{const _0xc6ad6f=new _0x3cd2d0(_0x97053e);_0xc6ad6f['buttonView']['set']({'label':Yn(_0x97053e,'AI\x20Commands'),'icon':_0x3499d0}),_0xc6ad6f['bind']('isEnabled')['to'](_0x9c1445,'enabledCommandsIds',_0x35224a=>_0x35224a['length']>0x0);const _0x4b6651=z(_0x2b9ecb['config']['get']('ai.assistant.commands'),_0x97053e);return this['_populateMenuBarMenu'](_0x9c1445,_0xc6ad6f,_0x4b6651,_0x52198b=>this['_onExecute'](_0x52198b)),_0xc6ad6f;}),_0x2b9ecb['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x23a690=this['_createAIAssistantUIButton'](_0x3d6e77);return _0x23a690['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x23a690;}),_0x2b9ecb['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x3dcd1c=this['_createAIAssistantUIButton'](_0x470b70);return _0x3dcd1c['set']({'role':'menuitemcheckbox'}),_0x3dcd1c;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x86d309=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1be274;for(const _0x54d2b in _0x86d309){const _0x2e004e=_0x54d2b,_0x495f58=_0x86d309[_0x2e004e];if('aiLicenseKeyValid'==_0x495f58||'aiLicenseKeyInvalid'==_0x495f58||'aiLicenseKeyExpired'==_0x495f58||'aiLicenseKeyDomainLimit'==_0x495f58||'aiLicenseKeyNotAllowed'==_0x495f58||'aiLicenseKeyEvaluationLimit'==_0x495f58||'aiLicenseKeyTrialLimit'==_0x495f58||'aiLicenseKeyUsageLimit'==_0x495f58){delete _0x86d309[_0x2e004e],_0x1be274=_0x495f58,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x1be274&&_0x86d309['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x1be274&&_0x86d309['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x1be274&&_0x86d309['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x1be274&&_0x86d309['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x1be274&&_0x86d309['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x1be274&&_0x86d309['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x1be274&&_0x86d309['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x25fef8='',_0xd07006='',_0x661910='custom'){const _0x3cb9bb=this['editor'],_0x5962d3=_0x3cb9bb['editing']['view'],_0x21f15c=_0x3cb9bb['plugins']['get'](F),_0x10f986=_0x3cb9bb['plugins']['get'](_0xd64c30);_0x21f15c['showFakeVisualSelection']();const _0x57ca7e=new J(),_0x3a9bfb=new ClipboardEvent('copy',{'clipboardData':_0x57ca7e}),_0x4f65ec=new _0x3eafaf(_0x57ca7e),_0x5e18a4=new _0x16627d(_0x5962d3,_0x3a9bfb,{'dataTransfer':_0x4f65ec});_0x10f986['_forceMarkersCopy']('comment',()=>{_0x5962d3['document']['fire']('copy',_0x5e18a4);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new oi(_0x3cb9bb,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x228314=_0x4f65ec['getData']('text/html');const _0x7c7dd7=_0x3cb9bb['model']['document']['selection'],_0xcd642a=Array['from'](_0x7c7dd7['getRanges']());0x1===_0xcd642a['length']&&_0xcd642a[0x0]['isFlat']&&!_0x7c7dd7['getSelectedElement']()&&''!==_0x228314['replace'](/&nbsp;/g,'')['trim']()&&(_0x228314='<p>'+_0x228314+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x661910,'query':_0x25fef8,'htmlContent':_0x228314,'label':_0xd07006,'mainActionLabel':ci[_0x3cb9bb['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x4a15cf,'title':Yn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x3c6257['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x21f15c['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x45829e=new Map(),_0x4a10a3=z(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x94b362 of _0x4a10a3)for(const _0x4aaf5b of _0x94b362['commands'])_0x45829e['set'](_0x4aaf5b['id'],{..._0x4aaf5b,'groupId':_0x94b362['groupId'],'groupLabel':_0x94b362['groupLabel']||_0x94b362['groupId']});return _0x45829e;}['_createAIAssistantUIButton'](_0x2a5e44){const _0x5279f0=this['editor'],_0x3bb7f8=_0x5279f0['commands']['get']('showAIAssistant'),_0x5dee7a=new _0x2a5e44(_0x5279f0['locale']);return _0x5dee7a['set']({'label':Yn(_0x5279f0['locale'],'AI\x20Assistant'),'icon':_0x4a15cf,'isToggleable':!0x0}),_0x5dee7a['bind']('isEnabled')['to'](_0x3bb7f8),_0x5dee7a['bind']('isOn')['to'](this['_dialog'],'id',_0x1be2c1=>'aiAssistant'===_0x1be2c1),this['listenTo'](_0x5dee7a,'execute',()=>{_0x5dee7a['isOn']?this['hideUI']():_0x3bb7f8['execute']();}),_0x5dee7a;}['_initView'](){const _0x366ca3=this['editor']['plugins']['get'](F);this['_formView']=new ri(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.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',()=>{_0x366ca3['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x366ca3['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x1886e1,ui:{ariaLiveAnnouncer:_0x1b0f0b}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x393ec4,_0x255558,_0x1fbb6f)=>{const _0x2d7fea=this['_aiAssistantController']['currentContext'];_0x1fbb6f?_0x1b0f0b['announce'](Yn(_0x1886e1,'AI\x20is\x20writing')):_0x2d7fea&&_0x1b0f0b['announce'](Yn(_0x1886e1,'Generated\x20content:\x20%0',_0x2d7fea),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x362c56,_0xb67b5b,_0xe4ccec)=>{if(_0xe4ccec){const _0x23334f=this['_formView']['errorView']['text'];_0x1b0f0b['announce'](Yn(_0x1886e1,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x23334f));}});}['_onExecute'](_0xa9cb30){const _0x43db25=this['_commandDefinitions']['get'](_0xa9cb30),_0x4941b5=this['editor'],_0x23c209=_0x4941b5['model']['document']['selection'],_0x2501f0=_0x4941b5['commands']['get']('showAIAssistant'),_0x4e154e=_0x4941b5['plugins']['get'](F),_0x47f143=''+(_0x43db25['groupId']!==ei?_0x43db25['groupLabel']+':\x20':'')+_0x43db25['label'];if(!0x1!==_0x43db25['requiresContent']&&_0x23c209['isCollapsed']){const _0x259f00=_0x111a74(_0x23c209['getSelectedBlocks']())||_0x4941b5['model']['schema']['getLimitElement'](_0x23c209);_0x4941b5['model']['change'](_0x5dce3a=>{_0x5dce3a['setSelection'](_0x259f00,'in');});}_0x4e154e['showFakeVisualSelection'](),_0x2501f0['execute'](_0x43db25['prompt'],_0x47f143,'command:'+_0xa9cb30);}['_populateMenuBarMenu'](_0x567a83,_0x1c810c,_0x593524,_0x595e33){const _0x1205c8=this['editor'],_0x37cb93=_0x1205c8['locale'],_0x115b36=new ti(_0x37cb93),_0x584e2f=hi(_0x1205c8,_0x593524)['filter'](_0x16c63a=>_0x16c63a['commands']['length']);0x1===_0x584e2f['length']?this['_getMenuBarGroupButtons']({'command':_0x567a83,'commands':_0x584e2f[0x0]['commands'],'parentMenuView':_0x1c810c,'onExecute':_0x595e33})['forEach'](_0x36bd3e=>_0x115b36['items']['add'](_0x36bd3e)):_0x584e2f['forEach'](({groupId:_0x32ed7b,groupLabel:_0x439f50,commands:_0x1b9d8d})=>{const _0x2adee9=new _0x426725(_0x37cb93,_0x1c810c),_0x287662=new _0x3cd2d0(_0x37cb93),_0x4a3a4b=new ti(_0x37cb93),_0x4ef75a=this['_getMenuBarGroupButtons']({'command':_0x567a83,'commands':_0x1b9d8d,'parentMenuView':_0x287662,'onExecute':_0x595e33});_0x287662['buttonView']['set']({'label':_0x439f50||_0x32ed7b}),_0x287662['delegate']('execute')['to'](_0x1c810c),_0x4a3a4b['items']['addMany'](_0x4ef75a),_0x287662['panelView']['children']['add'](_0x4a3a4b),_0x2adee9['children']['add'](_0x287662),_0x115b36['items']['add'](_0x2adee9);}),_0x1c810c['panelView']['children']['add'](_0x115b36);}['_getMenuBarGroupButtons']({command:_0x3d5834,commands:_0x2db10f,parentMenuView:_0x295aaa,onExecute:_0x1a2a5f}){const _0x4bd5f6=this['editor'],_0x3a317c=_0x4bd5f6['locale'];return hi(_0x4bd5f6,_0x2db10f)['map'](_0x4d0831=>{const _0x5a100c=new _0x426725(_0x3a317c,_0x295aaa),_0x308b62=new _0x470b70(_0x3a317c);return _0x308b62['set']({'label':_0x4d0831['label']}),_0x308b62['delegate']('execute')['to'](_0x295aaa),_0x308b62['on']('execute',()=>_0x1a2a5f(_0x4d0831['id'])),_0x308b62['bind']('isEnabled')['to'](_0x3d5834,'enabledCommandsIds',_0x4de53a=>_0x4de53a['includes'](_0x4d0831['id'])),_0x5a100c['children']['add'](_0x308b62),_0x5a100c;});}}function li(_0x3572e4,_0x37b63c){return void 0x0!==_0x3572e4['order']&&void 0x0===_0x37b63c['order']?0x1:void 0x0===_0x3572e4['order']&&void 0x0!==_0x37b63c['order']?-0x1:void 0x0!==_0x3572e4['order']&&void 0x0!==_0x37b63c['order']?_0x3572e4['order']-_0x37b63c['order']:0x0;}function hi(_0xd27144,_0x59c6e6){_0x59c6e6['sort'](li);const _0x734302={},_0x4892e6=[];for(const _0x1a2fa4 of _0x59c6e6)if(void 0x0!==_0x1a2fa4['order']){if(_0x1a2fa4['order']in _0x734302)throw new _0xb61eac('ai-commands-config-order-collision',_0xd27144,{'conflictingDefinitions':[_0x1a2fa4,_0x734302[_0x1a2fa4['order']]]});_0x734302[_0x1a2fa4['order']]=_0x1a2fa4,_0x4892e6['splice'](_0x1a2fa4['order'],0x0,_0x1a2fa4);}else _0x4892e6['push'](_0x1a2fa4);return _0x4892e6;}class qn extends _0x24349a{static get['requires'](){return[G,F];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5e9372){super(_0x5e9372);const _0x1a5c8e=_0x5e9372['config'],_0x483212=_0x5e9372['locale'];_0x1a5c8e['define']('ai.assistant.preserveComments',!0x0),_0x1a5c8e['define']('ai.assistant.commands',Qn(_0x483212)),_0x1a5c8e['define']('ai.assistant.extraCommandGroups',[]),_0x1a5c8e['define']('ai.assistant.removeCommands',[]);let _0x237d0d=z(_0x1a5c8e['get']('ai.assistant.commands'),_0x483212);const _0x4086e5=_0x1a5c8e['get']('ai.assistant.extraCommandGroups'),_0x12b773=_0x1a5c8e['get']('ai.assistant.removeCommands');_0x4086e5['forEach'](_0x1c1e98=>{const _0x10896f=_0x237d0d['find'](_0x3b3aa9=>_0x3b3aa9['groupId']===_0x1c1e98['groupId']);_0x10896f?_0x10896f['commands']=_0x10896f['commands']['concat'](_0x1c1e98['commands']):_0x237d0d['push'](_0x1c1e98);}),_0x237d0d=_0x237d0d['filter'](_0x232202=>!_0x12b773['includes'](_0x232202['groupId'])),_0x237d0d['forEach'](_0x161f2e=>{_0x161f2e['commands']=_0x161f2e['commands']['filter'](_0xc8aaa6=>!_0x12b773['includes'](_0xc8aaa6['id']));}),_0x1a5c8e['set']('ai.assistant.commands',_0x237d0d);}}function Qn(_0x242c7f){return[{'groupId':'editOrReview','groupLabel':Yn(_0x242c7f,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Yn(_0x242c7f,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Yn(_0x242c7f,'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':Yn(_0x242c7f,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Yn(_0x242c7f,'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':Yn(_0x242c7f,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Yn(_0x242c7f,'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':Yn(_0x242c7f,'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':Yn(_0x242c7f,'Change\x20tone'),'commands':[{'id':'professional','label':Yn(_0x242c7f,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Yn(_0x242c7f,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Yn(_0x242c7f,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Yn(_0x242c7f,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Yn(_0x242c7f,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Yn(_0x242c7f,'Change\x20style'),'commands':[{'id':'business','label':Yn(_0x242c7f,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Yn(_0x242c7f,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Yn(_0x242c7f,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Yn(_0x242c7f,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Yn(_0x242c7f,'Translate'),'commands':[{'id':'translateEnglish','label':Yn(_0x242c7f,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Yn(_0x242c7f,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Yn(_0x242c7f,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Yn(_0x242c7f,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Yn(_0x242c7f,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Yn(_0x242c7f,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Yn(_0x242c7f,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Yn(_0x242c7f,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ue extends _0x24349a{['abortController'];static get['requires'](){return[ni];}constructor(_0x2e82fc){super(_0x2e82fc),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](ni)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x191722){return this['sendRequest'](_0x191722)['catch'](_0x16d013=>{if(_0x16d013 instanceof tr)return Promise['reject'](_0x16d013);if('AbortError'==_0x16d013['name'])return Promise['resolve']();throw console['error'](_0x16d013),new _0xb61eac('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x2a9a0f,_0x17fee3){const _0x4bc746=this['editor']['locale'],_0x3c9ee7={'Content-Type':'application/json'};if('object'==typeof _0x2a9a0f)Object['assign'](_0x3c9ee7,_0x2a9a0f);else{if(_0x2a9a0f)try{const _0x94c529=await _0x2a9a0f(_0x17fee3);Object['assign'](_0x3c9ee7,_0x94c529);}catch{return Promise['reject'](new tr(Yn(_0x4bc746,'AI_ERROR_GET_HEADERS')));}}return _0x3c9ee7;}async['_prepareRequestParameters'](_0x19df3e,_0x502b13){const _0xbecd88=this['editor']['locale'];if('object'==typeof _0x19df3e)return _0x19df3e;try{return await _0x19df3e(_0x502b13);}catch{return Promise['reject'](new tr(Yn(_0xbecd88,'AI_ERROR_GET_PARAMETERS')));}}}class Xn extends ue{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0xfe0c8e){super(_0xfe0c8e),_0xfe0c8e['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0xfe0c8e['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0xfe0c8e['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0xfe0c8e['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0xfe0c8e['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0xfe0c8e['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0xbf6e82,context:_0x1351d7,onData:_0xe45fd5,actionId:_0x358efa}){const _0x3ce91f=this['editor']['locale'],_0x470ff7=await this['prepareMessages'](_0xbf6e82,_0x1351d7,_0x358efa),_0x381291=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x358efa),_0x306565=await this['_prepareRequestParameters'](this['_requestParameters'],_0x358efa),_0x3617b3={'messages':_0x470ff7,..._0x306565},_0x5715fa={'method':'POST','headers':_0x381291,'body':JSON['stringify'](_0x3617b3),'signal':this['abortController']['signal']},_0x15a3eb=await fetch(this['_apiUrl'],_0x5715fa);if(_0x15a3eb['ok'])return _0x306565['stream']?await this['_readStreamableResponse'](_0x15a3eb,_0xe45fd5):await this['_readStaticResponse'](_0x15a3eb,_0xe45fd5),Promise['resolve']();{const _0x52fa49=await _0x15a3eb['text']();return _0x52fa49['includes']('context_length_exceeded')?Promise['reject'](new tr(Yn(_0x3ce91f,'AI_ERROR_CONTEXT_LENGTH'))):_0x52fa49['includes']('Moderation')?Promise['reject'](new tr(Yn(_0x3ce91f,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x52fa49));}}async['prepareMessages'](_0x8ad18a,_0x469474,_0x3fe970){let _0x208980,_0x37c040;return _0x469474?(_0x208980='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.',_0x37c040='Instruction:\x0a'+_0x8ad18a+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x469474):(_0x208980='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.',_0x37c040=_0x8ad18a),[{'role':'system','content':_0x208980},{'role':'user','content':_0x37c040}];}async['_readStreamableResponse'](_0x5dc044,_0x392440){const _0x3de85a=_0x5dc044['body']['getReader'](),_0x374fa4=new TextDecoder();let _0x5148a8='',_0x54e098='',_0x16c89b='',_0x213116=!0x1;for(;!_0x213116;){const {done:_0x3192c8,value:_0x222de2}=await _0x3de85a['read'](),_0x12b566=_0x5148a8+_0x374fa4['decode'](_0x222de2);let _0x2774f6='';_0x213116=_0x3192c8;try{_0x2774f6=this['_cleanUpData'](_0x12b566),_0x5148a8='';}catch{_0x5148a8=_0x12b566;continue;}_0x54e098+=_0x2774f6,!_0x213116&&this['_isBufferIncomplete'](_0x54e098)||_0x54e098&&(_0x16c89b+=_0x54e098,_0x54e098='',_0x392440(_0x16c89b));}return Promise['resolve']();}async['_readStaticResponse'](_0xfb0a1a,_0x471afb){return _0x471afb((await _0xfb0a1a['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x43f712){const _0x3f918e=_0x43f712['split']('<')['length']!==_0x43f712['split']('>')['length'],_0x2b4cab=_0x43f712['length']<0x1e;return _0x3f918e&&_0x2b4cab;}['_cleanUpData'](_0x1072fb){return _0x1072fb['split'](/\n(?![^{]*\})/g)['map'](_0x245a61=>_0x245a61['replace']('data:\x20',''))['filter'](_0x2de92a=>_0x2de92a&&_0x2de92a['length']>0x0&&'[DONE]'!==_0x2de92a)['map'](_0x1d7674=>{const {choices:_0x250729}=JSON['parse'](_0x1d7674);if(_0x250729[0x0]?.['delta']?.['content'])return _0x250729[0x0]['delta']['content'];})['filter'](_0x567408=>_0x567408)['join']('');}}class zn extends ue{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0xb8a958){super(_0xb8a958),_0xb8a958['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0xb8a958['config']['define']('ai.assistant.adapter.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']=_0xb8a958['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0xb8a958['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0xb8a958['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0xb8a958['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x429632,context:_0x2cf17b,onData:_0x2f1951,actionId:_0x3173ab}){const {model:_0xd730ea,stream:_0x3006a8,..._0xdd9a26}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3173ab),_0x43b04d={'prompt':await this['preparePrompt'](_0x429632,_0x2cf17b,_0xd730ea,_0x3173ab),..._0xdd9a26};this['_apiUrl']?await this['_processProxyRequest'](_0x43b04d,_0xd730ea,_0x3006a8,_0x2f1951,_0x3173ab):await this['_processAWSRequest'](_0x43b04d,_0xd730ea,_0x3006a8,_0x2f1951);}async['preparePrompt'](_0x117b75,_0x115de8,_0x43d5f4,_0x4a5ed7){let _0xf573ba,_0x26cac3;return _0x115de8?(_0xf573ba='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.',_0x26cac3='Instruction:\x0a'+_0x117b75+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x115de8):(_0xf573ba='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.',_0x26cac3=_0x117b75),'meta.llama'==this['getModelFamily'](_0x43d5f4)?'<<SYS>>\x0a'+_0xf573ba+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x26cac3+'\x0a[/INST]':'Human:\x0a'+_0xf573ba+'\x0a'+_0x26cac3+'\x0a\x0aAssistant:';}['getModelFamily'](_0xd3339a){if(/^anthropic\.claude/['test'](_0xd3339a))return'anthropic.claude';if(/^ai21\.j2/['test'](_0xd3339a))return'ai21.j2';if(/^cohere\.command/['test'](_0xd3339a))return'cohere.command';if(/^meta\.llama/['test'](_0xd3339a))return'meta.llama';throw new tr(Yn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0xd3339a));}async['_processProxyRequest'](_0x4dbcd6,_0x294349,_0x54ab0c,_0x3be5a2,_0x3920f1){const _0x13df74={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3920f1),'body':JSON['stringify']({..._0x4dbcd6,'model':_0x294349,'stream':_0x54ab0c}),'signal':this['abortController']['signal']},_0x597525=await fetch(this['_apiUrl'],_0x13df74);_0x54ab0c?await this['_readStreamableResponse'](_0x597525,_0x294349,_0x3be5a2):await this['_readStaticResponse'](_0x597525,_0x294349,_0x3be5a2);}async['_processAWSRequest'](_0x43d837,_0x581d91,_0x209d6f,_0x36970e){const _0x329d33=new _0x495225(this['_bedrockClientConfig']),_0x972821={'body':JSON['stringify'](_0x43d837),'contentType':'application/json','accept':'application/json','modelId':_0x581d91};let _0xeede0b;if(_0x209d6f){const _0x11dbc0=new _0x48bd50(_0x972821);_0xeede0b=await _0x329d33['send'](_0x11dbc0,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0xeede0b,_0x581d91,_0x36970e);}else{const _0x1e612e=new _0x4283cb(_0x972821);_0xeede0b=await _0x329d33['send'](_0x1e612e,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0xeede0b,_0x581d91,_0x36970e);}}async['_readAsyncIterableResponse'](_0x322922,_0x2b3045,_0x1c340e){const _0x733bac=_0x322922['body'],_0x272bea=new TextDecoder('utf-8');let _0x3ffff7='';for await(const _0x282fed of _0x733bac)if(_0x282fed['chunk']){const _0x2e4d0d=_0x272bea['decode'](_0x282fed['chunk']['bytes']),_0x601d4d=JSON['parse'](_0x2e4d0d);_0x3ffff7+=this['_getGeneratedText'](_0x601d4d,_0x2b3045),_0x1c340e(_0x3ffff7);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4472d8,_0x511491,_0x174031){const _0x33f3c2=_0x4472d8['body'],_0x43e611=new TextDecoder('utf-8'),_0x33f333=_0x33f3c2['getReader']();let _0x5757ce='',_0x18da92='',_0x463085=!0x1;for(;!_0x463085;){const {done:_0x587f11,value:_0x585209}=await _0x33f333['read']();if(_0x463085=_0x587f11,_0x463085)break;const _0xf2fe57=(_0x5757ce+_0x43e611['decode'](_0x585209))['split']('\x0a')['map'](_0x2b999e=>{try{return _0x5757ce='',JSON['parse'](_0x2b999e);}catch{return _0x5757ce=_0x2b999e,null;}})['filter'](_0xf222de=>null!==_0xf222de);_0xf2fe57['length']&&(_0x18da92+=_0xf2fe57['map'](_0x19a464=>this['_getGeneratedText'](_0x19a464,_0x511491))['join'](''),_0x174031(_0x18da92));}return Promise['resolve']();}async['_readStaticResponse'](_0x52d5c3,_0x42f085,_0xcda53a){let _0x5d68f3;return _0x5d68f3=_0x52d5c3 instanceof Response?await _0x52d5c3['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x52d5c3['body'])),(_0xcda53a(this['_getGeneratedText'](_0x5d68f3,_0x42f085)),Promise['resolve']());}['_getGeneratedText'](_0xbdf35e,_0x2a0eaf){switch(this['getModelFamily'](_0x2a0eaf)){case'anthropic.claude':return _0xbdf35e['completion'];case'ai21.j2':return _0xbdf35e['completions'][0x0]['data']['text'];case'cohere.command':return _0xbdf35e['generations'][0x0]['text'];case'meta.llama':return _0xbdf35e['generation'];}}}class ia extends _0x3d6e77{constructor(_0x1400b,_0x5359a7={}){super(_0x1400b),this['isToggleable']=!0x0,this['set']('side',_0x5359a7['side']||'top');const _0x59ed59=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x1238ba(_0x5359a7['class']||[]),_0x59ed59['to']('side',_0x3c5c24=>'ck-tab-button_'+_0x3c5c24),_0x59ed59['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x262350{['children'];constructor(_0x1ab27e,_0x49ea6f={}){super(_0x1ab27e);const _0x123ae4=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x1238ba(_0x49ea6f['class']||[]),_0x123ae4['to']('class'),_0x123ae4['if']('isVisible','ck-hidden',_0x2ff4bb=>!_0x2ff4bb)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x262350{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x187977,_0x19e90b={}){super(_0x187977),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x19e90b['side']||'top'),this['set']('isMaximized',!0x1);const _0x1f8bf3=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x1238ba(_0x19e90b['class']||[]),_0x1f8bf3['to']('side',_0x6e7380=>'ck-tabs_'+_0x6e7380),_0x1f8bf3['to']('class'),_0x1f8bf3['to']('isMaximized',_0x4ab609=>_0x4ab609?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x1f8bf3['to']('side',_0xb38977=>'ck-tabs__buttons-container_'+_0xb38977)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x1f8bf3['to']('side',_0x7a8ff3=>'ck-tabs__panels-container_'+_0x7a8ff3)]},'children':this['panelViews']},..._0x1238ba(_0x19e90b['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x56a3d8){const _0x406bdd=this['_tabs']['get'](_0x56a3d8);return _0x406bdd||null;}['addTab'](_0x2a96da){const _0x3cd04f=this['_setupButton']({'id':_0x2a96da['id'],'label':_0x2a96da['buttonLabel'],'icon':_0x2a96da['buttonIcon'],'order':_0x2a96da['order']}),_0xd94f19=new ea(this['locale']);return _0xd94f19['render'](),_0x2a96da['content']&&_0xd94f19['children']['add'](_0x2a96da['content']),this['panelViews']['add'](_0xd94f19),this['_tabs']['set'](_0x2a96da['id'],{'button':_0x3cd04f,'panel':_0xd94f19,'order':void 0x0!==_0x2a96da['order']?_0x2a96da['order']:null}),this['fire']('addTab:'+_0x2a96da['id'],{'id':_0x2a96da['id'],'button':_0x3cd04f,'panel':_0xd94f19}),null===this['activeTab']?this['activateTab'](_0x2a96da['id']):this['_hidePanel'](_0x2a96da['id']),{'button':_0x3cd04f,'panel':_0xd94f19};}['activateTab'](_0x4cc0bd){if(null!==_0x4cc0bd&&!this['getTab'](_0x4cc0bd))throw new _0xb61eac('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4cc0bd});this['activeTab']!==_0x4cc0bd&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x4cc0bd,_0x4cc0bd&&this['_showPanel'](_0x4cc0bd),this['fire']('activateTab:'+_0x4cc0bd,_0x4cc0bd));}['showTab'](_0x20b758){if(!this['getTab'](_0x20b758))throw new _0xb61eac('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x20b758});this['_showPanel'](_0x20b758),this['_showButton'](_0x20b758),this['fire']('show:'+_0x20b758,_0x20b758);}['hideTab'](_0x45cc37){if(!this['getTab'](_0x45cc37))throw new _0xb61eac('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x45cc37});const _0x332f7a=this['activeTab'];this['_hidePanel'](_0x45cc37),this['_hideButton'](_0x45cc37);const _0x5203a2=this['getTabIds']();_0x332f7a===_0x45cc37&&_0x5203a2['length']>0x1&&this['activateTab'](_0x5203a2['find'](_0x1f4ad6=>_0x1f4ad6!==_0x45cc37)),this['fire']('hide:'+_0x45cc37,_0x45cc37);}['_getPanel'](_0x1996fa){const _0x8f1547=this['_tabs']['get'](_0x1996fa);return _0x8f1547?_0x8f1547['panel']:null;}['_showPanel'](_0x446e7b){null!==this['activeTab']&&this['activeTab']!==_0x446e7b||this['_getPanel'](_0x446e7b)['show']();}['_hidePanel'](_0x99e766){const _0xe1c96c=this['_getPanel'](_0x99e766);_0xe1c96c['isVisible']&&(this['activeTab']===_0x99e766&&(this['activeTab']=null),_0xe1c96c['hide']());}['_getButton'](_0x3ebddc){const _0x494abe=this['_tabs']['get'](_0x3ebddc);return _0x494abe?_0x494abe['button']:null;}['_showButton'](_0x346c7e){this['_getButton'](_0x346c7e)['show']();}['_hideButton'](_0x545d31){this['_getButton'](_0x545d31)['hide']();}['_setupButton'](_0x11c328){const _0x4bee64=new ia(this['locale'],{'side':this['side']}),_0x3e4a8b=this['buttonViews'];if(_0x4bee64['set']({'label':_0x11c328['label'],'icon':_0x11c328['icon'],'tooltip':!0x0,'withText':!0x0}),_0x4bee64['bind']('isOn')['to'](this,'activeTab',_0x22bdb9=>_0x22bdb9===_0x11c328['id']),_0x4bee64['bind']('side')['to'](this,'side'),_0x11c328['order']){const _0x815407=[...this['_tabs']]['reduce']((_0x40f85d,_0x28601f)=>{const _0x3cef6f=_0x28601f[0x0],{order:_0x16b703}=_0x28601f[0x1];return!_0x16b703||_0x16b703>_0x11c328['order']?_0x40f85d:_0x16b703>=_0x40f85d['order']?{'id':_0x3cef6f,'order':_0x16b703}:_0x40f85d;},{'id':'','order':0x0}),_0x5244ae=_0x3e4a8b['getIndex'](this['_getButton'](_0x815407['id']));_0x3e4a8b['add'](_0x4bee64,_0x5244ae+0x1);}else _0x3e4a8b['add'](_0x4bee64);return _0x4bee64['on']('execute',()=>{this['activateTab'](_0x11c328['id']);}),_0x4bee64;}}const Ti=['overlay','sidebar','custom'],yi=['left','right'];class bi extends ss{constructor(_0x1ee14a,_0x1c304b={}){super(_0x1ee14a,_0x1c304b),this['set']('type',_0x1c304b['type']||'sidebar'),this['set']('side',_0x1c304b['side']||'right'),this['set']('isVisible',_0x1c304b['visibleByDefault']??!0x0);const _0x2adf3b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x2adf3b['if']('type','ck-ai-tabs__overlay',_0x45374e=>'overlay'===_0x45374e),_0x2adf3b['if']('type','ck-ai-tabs__sidebar',_0x5282cb=>'sidebar'===_0x5282cb),_0x2adf3b['if']('isVisible','ck-hidden',_0x3ebff4=>!_0x3ebff4)]}}),this['buttonViews']['on']('add',(_0x1d08a3,_0x319f58)=>{_0x319f58['set']('withText',!0x1);});}}class at extends _0x1bcf21{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x13ba5b){super(_0x13ba5b);const _0x350ea9=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x350ea9)throw new _0xb61eac('ai-tabs-configuration-not-found');if(void 0x0!==_0x350ea9['showResizeButton']&&(this['showResizeButton']=_0x350ea9['showResizeButton']),'sidebar'!==_0x350ea9['type']&&'overlay'!==_0x350ea9['type']||_0x350ea9['side']&&(this['side']=_0x350ea9['side']),'sidebar'===_0x350ea9['type']){if(this['container']=_0x350ea9['element'],this['set']('type','sidebar'),!this['container'])throw new _0xb61eac('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x350ea9['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new bi(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x350ea9['visibleByDefault']||_0x350ea9['visibleByDefault']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['container']&&this['container']['appendChild'](this['view']['element']),this['context']instanceof st&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x2da7f9){if(_0x2da7f9&&this['type']!==_0x2da7f9){if(!Ti['includes'](_0x2da7f9))throw new _0xb61eac('ai-tabs-unsupported-ui-type');this['type']=_0x2da7f9;}}['switchSide'](_0x27ca3d){if(_0x27ca3d&&this['side']!==_0x27ca3d){if(!yi['includes'](_0x27ca3d))throw new _0xb61eac('ai-tabs-unsupported-ui-side');this['side']=_0x27ca3d;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class s extends _0x1bcf21{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4ccb4e){super(_0x4ccb4e),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl'),this['_token']=null,this['_decoder']=new TextDecoder();}['init'](){const _0x3e3f78=this['context']['plugins']['get']('CloudServices');if(!_0x3e3f78['token'])throw new _0xb61eac('ai-missing-token',this);this['_token']=_0x3e3f78['token'];}['startConversation'](_0x2dbd4c,_0x4800f1){const _0x1511f5=this['_sendApiRequest']('/conversations','POST',{'id':_0x2dbd4c,'group':_0x4800f1});return{'getConversation':async()=>(await _0x1511f5['request'])['json'](),'abortController':_0x1511f5['abortController']};}['queryAssistant']({message:_0x1e1fad,conversationId:_0x46ede6,parts:_0x4e75b1,capabilities:_0x1a137a,model:_0x180f2a,quickActionData:_0x5f486d}){const _0x55c267={..._0x5f486d&&{'quickActionData':_0x5f486d}},_0x2224ad={'prompt':_0x1e1fad,'content':_0x4e75b1,'model':_0x180f2a,..._0x1a137a&&{'capabilities':_0x1a137a},...Object['keys'](_0x55c267)['length']>0x0&&{'attributes':_0x55c267}},_0x46c1ce=this['_sendApiRequest']('/conversations/'+_0x46ede6+'/messages','POST',_0x2224ad);return{'getStream':async()=>{const _0xe6367d=(await _0x46c1ce['request'])['body'];return this['_getStreamReader'](_0xe6367d);},'abortController':_0x46c1ce['abortController']};}['executeCustomAction']({content:_0x1941d6,message:_0x9cfaef,model:_0x399831,outputFormat:_0x4bf83d}){const _0x5f0b60={'content':[{'type':'text','content':_0x1941d6}],'prompt':_0x9cfaef,'model':_0x399831,'outputFormat':_0x4bf83d},_0x441d22=this['_sendApiRequest']('/actions/custom/calls','POST',_0x5f0b60);return{'getStream':async()=>{const _0x4eb8d7=(await _0x441d22['request'])['body'];return this['_getStreamReader'](_0x4eb8d7);},'abortController':_0x441d22['abortController']};}['executeAction']({actionName:_0x5a17d9,content:_0xf3a23e,args:_0x54c107}){const _0x45a218={'content':[{'type':'text','content':_0xf3a23e}],'args':_0x54c107},_0x16773f=this['_sendApiRequest']('/actions/system/'+_0x5a17d9+'/calls','POST',_0x45a218);return{'getStream':async()=>{const _0x5326c5=(await _0x16773f['request'])['body'];return this['_getStreamReader'](_0x5326c5);},'abortController':_0x16773f['abortController']};}['uploadFile'](_0x2640eb,_0x314ff4,_0x5c69d7){const _0x38129b=new FormData();_0x38129b['append']('file',_0x314ff4,_0x314ff4['name']),_0x5c69d7&&_0x38129b['append']('attributes',JSON['stringify'](_0x5c69d7));const _0x2e2035=this['_sendApiRequest']('/conversations/'+_0x2640eb+'/files','POST',_0x38129b);return{'getId':async()=>(await _0x2e2035['request'])['json'](),'abortController':_0x2e2035['abortController']};}['fetchDocument'](_0x13facd,_0x3777b0){const _0x122f3e=this['_sendApiRequest']('/conversations/'+_0x13facd+'/documents/'+_0x3777b0,'GET');return{'getDocument':async()=>(await _0x122f3e['request'])['json'](),'abortController':_0x122f3e['abortController']};}['uploadDocument'](_0x3ede62,_0x9d2ec6,_0xfd986d){const _0x2c805b={'content':_0x9d2ec6};_0xfd986d&&(_0x2c805b['attributes']=_0xfd986d);const _0x9eaaad=this['_sendApiRequest']('/conversations/'+_0x3ede62+'/documents','POST',_0x2c805b);return{'getId':async()=>(await _0x9eaaad['request'])['json'](),'abortController':_0x9eaaad['abortController']};}['fetchConversations'](_0x2dfe7c,_0x56df72){const _0x4cb5db=new URLSearchParams();_0x4cb5db['append']('excludeEmpty','true'),_0x4cb5db['append']('limit','100'),_0x4cb5db['append']('group',_0x2dfe7c),_0x56df72&&_0x4cb5db['append']('search',_0x56df72);const _0x2a4a27=this['_sendApiRequest']('/conversations?'+_0x4cb5db['toString'](),'GET');return{'getConversations':async()=>{const _0x226159=await _0x2a4a27['request'];return(await _0x226159['json']())['items'];},'abortController':_0x2a4a27['abortController']};}['deleteConversation'](_0x51d4ba){const _0x59a431=this['_sendApiRequest']('/conversations/'+_0x51d4ba,'DELETE');return{'execute':async()=>{await _0x59a431['request'];},'abortController':_0x59a431['abortController']};}['updateConversation'](_0x18d326,_0x1e3ebc){const _0x214ca5=this['_sendApiRequest']('/conversations/'+_0x18d326,'PATCH',_0x1e3ebc);return{'getResult':async()=>(await _0x214ca5['request'],_0x1e3ebc),'abortController':_0x214ca5['abortController']};}['fetchConversation'](_0x1f3304){const _0x4bbf7a=this['_sendApiRequest']('/conversations/'+_0x1f3304,'GET');return{'getConversation':async()=>(await _0x4bbf7a['request'])['json'](),'abortController':_0x4bbf7a['abortController']};}['fetchConversationMessages'](_0x139528){const _0x2fea2f=this['_sendApiRequest']('/conversations/'+_0x139528+'/messages','GET');return{'getMessages':async()=>{const _0xf6e001=await _0x2fea2f['request'];return(await _0xf6e001['json']())['items'];},'abortController':_0x2fea2f['abortController']};}['uploadUrl'](_0x3751fa,_0x2ef361,_0x2ba4ea){const _0x2d07a9=this['_sendApiRequest']('/conversations/'+_0x3751fa+'/web-resources','POST',{'url':_0x2ef361,'attributes':_0x2ba4ea});return{'getId':async()=>(await _0x2d07a9['request'])['json'](),'abortController':_0x2d07a9['abortController']};}['getModels'](){const _0x2ed01f=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>await(await _0x2ed01f['request'])['json'](),'abortController':_0x2ed01f['abortController']};}['deleteFile'](_0x5c1396,_0x2c8a2c){const _0x5857af=this['_sendApiRequest']('/conversations/'+_0x5c1396+'/files/'+_0x2c8a2c,'DELETE');return{'execute':async()=>{await _0x5857af['request'];},'abortController':_0x5857af['abortController']};}['deleteDocument'](_0x3122d7,_0x2317cb){const _0x238ee0=this['_sendApiRequest']('/conversations/'+_0x3122d7+'/documents/'+_0x2317cb,'DELETE');return{'execute':async()=>{await _0x238ee0['request'];},'abortController':_0x238ee0['abortController']};}['deleteWebResource'](_0x3471ee,_0x46ee67){const _0x286978=this['_sendApiRequest']('/conversations/'+_0x3471ee+'/web-resources/'+_0x46ee67,'DELETE');return{'execute':async()=>{await _0x286978['request'];},'abortController':_0x286978['abortController']};}['callSystemReview']({reviewName:_0x252e27,content:_0x3d347f,args:_0x3fba96}){const _0x25dfb2=this['_sendApiRequest']('/reviews/system/'+_0x252e27+'/calls','POST',{'content':[{'type':'text','content':_0x3d347f}],'args':_0x3fba96});return{'getStream':async()=>{const _0x20639f=(await _0x25dfb2['request'])['body'];return this['_getStreamReader'](_0x20639f);},'abortController':_0x25dfb2['abortController']};}['callCustomReview']({content:_0x2be602,prompt:_0x5bc1a6,model:_0x5c27c8}){const _0x2c2721=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x2be602}],'prompt':_0x5bc1a6,'model':_0x5c27c8});return{'getStream':async()=>{const _0x397fed=(await _0x2c2721['request'])['body'];return this['_getStreamReader'](_0x397fed);},'abortController':_0x2c2721['abortController']};}['upsertAIChatRating'](_0x57dbc0,_0x39644b,_0x55375a){const _0x2dc50f=this['_sendApiRequest']('/conversations/'+_0x57dbc0+'/messages/'+_0x39644b+'/ratings','PUT',{'positiveCount':_0x55375a['positiveCount'],'totalCount':_0x55375a['totalCount'],'modificationId':_0x55375a['modificationId']});return{'execute':async()=>{await _0x2dc50f['request'];},'abortController':_0x2dc50f['abortController']};}['upsertAIActionRating'](_0x18209d,_0x12a6cc,_0x391892){const _0x577fe2=this['_sendApiRequest']('/actions/system/'+_0x18209d+'/calls/'+_0x12a6cc+'/ratings','PUT',{'positiveCount':_0x391892['positiveCount'],'totalCount':_0x391892['totalCount']});return{'execute':async()=>{await _0x577fe2['request'];},'abortController':_0x577fe2['abortController']};}['upsertCustomAIActionRating'](_0x330f7b,_0x80c440){const _0x279f1b=this['_sendApiRequest']('/actions/custom/calls/'+_0x330f7b+'/ratings','PUT',{'positiveCount':_0x80c440['positiveCount'],'totalCount':_0x80c440['totalCount']});return{'execute':async()=>{await _0x279f1b['request'];},'abortController':_0x279f1b['abortController']};}['upsertAIReviewRating'](_0x34199d,_0x3ae375,_0x511442,_0x2cc6b8){const _0x497f31=this['_sendApiRequest']('/reviews/system/'+_0x34199d+'/calls/'+_0x3ae375+'/ratings','PUT',{'positiveCount':_0x511442['positiveCount'],'totalCount':_0x511442['totalCount'],'dataId':_0x2cc6b8});return{'execute':async()=>{await _0x497f31['request'];},'abortController':_0x497f31['abortController']};}['upsertCustomAIReviewRating'](_0x89ad4d,_0x4de4f2,_0x18162b){const _0x20d8ad=this['_sendApiRequest']('/reviews/custom/calls/'+_0x89ad4d+'/ratings','PUT',{'positiveCount':_0x4de4f2['positiveCount'],'totalCount':_0x4de4f2['totalCount'],'dataId':_0x18162b});return{'execute':async()=>{await _0x20d8ad['request'];},'abortController':_0x20d8ad['abortController']};}['_sendApiRequest'](_0x2a7c9b,_0x1549dd,_0x4f84bf){const _0x354d34=new AbortController(),_0x3d323d=_0x4f84bf instanceof FormData,_0x56eeed={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x4f84bf&&!_0x3d323d&&(_0x56eeed['Content-Type']='application/json');const _0x5e7a3e={'method':_0x1549dd,'headers':_0x56eeed,'signal':_0x354d34['signal']};return _0x4f84bf&&(_0x5e7a3e['body']=_0x3d323d?_0x4f84bf:JSON['stringify'](_0x4f84bf)),{'request':fetch(''+this['_apiUrl']+_0x2a7c9b,_0x5e7a3e)['catch'](_0x17d0e4=>{this['_handleError'](_0x17d0e4);})['then'](_0x4c8e6d=>{if(!_0x4c8e6d['ok'])throw new _0xb61eac('ai-request-failed',this,{'url':this['_apiUrl'],'path':_0x2a7c9b,'method':_0x1549dd,'body':_0x4f84bf,'status':(_0x4c8e6d||{})['status'],'statusText':(_0x4c8e6d||{})['statusText']});return _0x4c8e6d;}),'abortController':_0x354d34};}async*['_getStreamReader'](_0x1bc292){const _0x35915a=[],_0x20d597=_0x1bc292['getReader'](),_0x33ff95=wt({'onError':_0xa96049=>{this['_handleError'](_0xa96049);},'onEvent':_0x3508c6=>{_0x3508c6['data']=JSON['parse'](_0x3508c6['data']),_0x35915a['push'](_0x3508c6);}});try{let _0x5f39f5=!0x1;for(;!_0x5f39f5;){const {done:_0x241ced,value:_0x414954}=await _0x20d597['read']();_0x241ced&&(_0x5f39f5=!0x0),_0x33ff95['feed'](this['_decoder']['decode'](_0x414954,{'stream':!0x0})),yield*_0x35915a,_0x35915a['length']=0x0;}}catch(_0xa5b007){this['_handleError'](_0xa5b007);}finally{_0x20d597['releaseLock'](),_0x33ff95['reset']();}}['_handleError'](_0x1dad9d){if(_0x1dad9d instanceof _0xb61eac)throw _0x1dad9d;if(_0x1dad9d instanceof Error&&'AbortError'===_0x1dad9d['name'])throw new _0xb61eac('ai-request-aborted',this,{'originalError':_0x1dad9d});throw new _0xb61eac('ai-request-failed',this,{'originalError':_0x1dad9d});}}function C(_0x217e18,_0x2e3432,_0x14fad2){const t=_0x217e18['t'];switch(_0x2e3432){case'AI_SUGGESTION_HEADER_TITLE':return t({'id':'AI_SUGGESTION_HEADER_TITLE','string':'Proposed\x20changes'});case'AI_SUGGESTION_BUTTON_SHOW_CHANGES':return t({'id':'AI_SUGGESTION_BUTTON_SHOW_CHANGES','string':'Show\x20details'});case'AI_MINI_TOOLBAR_LIKE':return t({'id':'AI_MINI_TOOLBAR_LIKE','string':'I\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_DISLIKE':return t({'id':'AI_MINI_TOOLBAR_DISLIKE','string':'I\x20don\x27t\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_COPY':return t({'id':'AI_MINI_TOOLBAR_COPY','string':'Copy\x20to\x20clipboard'});case'AI_SUGGESTION_CONTENT_PART_TITLE':return t({'id':'AI_SUGGESTION_CONTENT_PART_TITLE','string':'Change\x20%0'},_0x14fad2);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x14fad2);case'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES','string':'Unable\x20to\x20load\x20resources\x20from\x20%0.\x20Please\x20try\x20again.'},_0x14fad2);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x14fad2);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0x14fad2);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0x14fad2);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x14fad2);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0x14fad2);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x14fad2);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0x14fad2);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x14fad2);case'AI_CHAT_MODEL_SELECTOR_GROUP':return t({'id':'AI_CHAT_MODEL_SELECTOR_GROUP','string':'Models'});case'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP','string':'Select\x20a\x20model'});case'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP','string':'Start\x20a\x20new\x20conversation\x20to\x20change\x20the\x20model'});case'AI_CHAT_CAPABILITIES_YES':return t({'id':'AI_CHAT_CAPABILITIES_YES','string':'Yes'});case'AI_CHAT_CAPABILITIES_NO':return t({'id':'AI_CHAT_CAPABILITIES_NO','string':'No'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT','string':'The\x20selected\x20model\x20is\x20no\x20longer\x20available,\x20so\x20you\x20cannot\x20continue\x20this\x20conversation.\x20Please\x20'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON','string':'start\x20a\x20new\x20one.'});case'AI_CHAT_CONTEXT_SOURCES_LABEL':return t({'id':'AI_CHAT_CONTEXT_SOURCES_LABEL','string':'Sources'});case'AI_CHAT_HISTORY_HEADING':return t({'id':'AI_CHAT_HISTORY_HEADING','string':'Chat\x20History'});case'AI_CHAT_HISTORY_SEARCH_LABEL':return t({'id':'AI_CHAT_HISTORY_SEARCH_LABEL','string':'Search\x20history'});case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY','string':'No\x20chats\x20were\x20found\x20matching\x20\x22%0\x22.'},_0x14fad2);case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY','string':'Please\x20try\x20a\x20different\x20phrase\x20or\x20check\x20the\x20spelling.'});case'AI_CHAT_HISTORY_EMPTY_MESSAGE':return t({'id':'AI_CHAT_HISTORY_EMPTY_MESSAGE','string':'Your\x20chat\x20history\x20for\x20current\x20document\x20will\x20appear\x20here.'});case'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON':return t({'id':'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON','string':'Go\x20to\x20chat'});case'AI_CHAT_HISTORY_PIN_BUTTON':return t({'id':'AI_CHAT_HISTORY_PIN_BUTTON','string':'Pin'});case'AI_CHAT_HISTORY_SHOW_MORE_ITEMS':return t({'id':'AI_CHAT_HISTORY_SHOW_MORE_ITEMS','string':'Show\x20more\x20items'});case'AI_CHAT_HISTORY_EDIT_NAME':return t({'id':'AI_CHAT_HISTORY_EDIT_NAME','string':'Edit\x20name'});case'AI_CHAT_HISTORY_REMOVE':return t({'id':'AI_CHAT_HISTORY_REMOVE','string':'Remove'});case'AI_CHAT_HISTORY_REMOVE_CONFIRM':return t({'id':'AI_CHAT_HISTORY_REMOVE_CONFIRM','string':'Do\x20you\x20want\x20to\x20remove\x20this\x20chat?'});case'AI_CHAT_HISTORY_ACCEPT':return t({'id':'AI_CHAT_HISTORY_ACCEPT','string':'Accept'});case'AI_CHAT_HISTORY_CANCEL':return t({'id':'AI_CHAT_HISTORY_CANCEL','string':'Cancel'});case'AI_CHAT_HISTORY_LOADING_REMOVING':return t({'id':'AI_CHAT_HISTORY_LOADING_REMOVING','string':'Removing\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_RENAMING':return t({'id':'AI_CHAT_HISTORY_LOADING_RENAMING','string':'Renaming\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_PINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_PINNING','string':'Pinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_UNPINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_UNPINNING','string':'Unpinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_CATEGORY_PINNED':return t({'id':'AI_CHAT_HISTORY_CATEGORY_PINNED','string':'Pinned'});case'AI_CHAT_HISTORY_CATEGORY_TODAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_TODAY','string':'Today'});case'AI_CHAT_HISTORY_CATEGORY_YESTERDAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_YESTERDAY','string':'Yesterday'});case'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS','string':'Last\x2014\x20days'});case'AI_CHAT_HISTORY_CATEGORY_LATER':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LATER','string':'Later'});case'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE','string':'Failed\x20to\x20change\x20the\x20\x22%0\x22\x20chat\x20name.\x20Please\x20try\x20again\x20later.'},_0x14fad2);case'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED','string':'Failed\x20to\x20%0\x20the\x20\x22%1\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x14fad2);case'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM':return t({'id':'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM','string':'Failed\x20to\x20delete\x20the\x20\x22%0\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x14fad2);case'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS':return t({'id':'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS','string':'Failed\x20to\x20load\x20the\x20chat\x20history.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_ERROR_GENERIC':return t({'id':'AI_CHAT_HISTORY_ERROR_GENERIC','string':'Something\x20went\x20wrong.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_PIN_ACTION':return t({'id':'AI_CHAT_HISTORY_PIN_ACTION','string':'pin'});case'AI_CHAT_HISTORY_UNPIN_ACTION':return t({'id':'AI_CHAT_HISTORY_UNPIN_ACTION','string':'unpin'});case'AI_BALLOON_HEADER_TITLE':return t({'id':'AI_BALLOON_HEADER_TITLE','string':'Change\x20%0'},_0x14fad2);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_MODEL_DESCRIPTION_AUTO':return t({'id':'AI_MODEL_DESCRIPTION_AUTO','string':'Automatically\x20selects\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost.'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20-\x20faster,\x20more\x20cost-efficient'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU','string':'Cost-efficient\x20model\x20for\x20quick\x20interactions\x20with\x20improved\x20reasoning'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET','string':'Advanced\x20model\x20with\x20strong\x20reasoning\x20and\x20reliability\x20for\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET','string':'Advanced\x20model\x20with\x20improved\x20creativity,\x20reliability,\x20and\x20reasoning'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO','string':'Google\x27s\x20advanced\x20model\x20for\x20versatile\x20problem-solving\x20and\x20research'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH','string':'Lightweight\x20Gemini\x20model\x20for\x20fast,\x20cost-efficient\x20interactions'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x14fad2);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_ACTIONS_SELECTION_REMOVED_ERROR':return t({'id':'AI_ACTIONS_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});default:return _0x2e3432;}}function Cs(_0x2f1fcb,_0x47e5ac){const _0x1ed25c=new _0x3d6e77(_0x2f1fcb),_0xc87640=C(_0x2f1fcb,'AI_TABS_LABEL_MINIMIZE'),_0x171592=C(_0x2f1fcb,'AI_TABS_LABEL_MAXIMIZE');return _0x1ed25c['set']({'withText':!0x1,'icon':_0x19452d,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x1ed25c['bind']('label')['to'](_0x47e5ac,'isMaximized',_0x5cfd10=>_0x5cfd10?_0xc87640:_0x171592),_0x1ed25c['bind']('icon')['to'](_0x47e5ac,'isMaximized',_0x27d234=>_0x27d234?to:_0x19452d),_0x1ed25c['bind']('isOn')['to'](_0x47e5ac,'isMaximized'),_0x1ed25c['on']('execute',()=>{_0x47e5ac['fire']('resizeTabs');}),_0x1ed25c;}function Ye(_0x190149){return _0x31b175(_0x190149);}function ut(_0x256f36){return _0x20aeb7(_0x256f36);}function ft(_0x2b0af9,_0x166435,_0x5d9a0c){const _0x3ad229=null!==_0x166435?_0x2aa1e6=>_0x2aa1e6['attribs'][_0x2b0af9]===_0x166435:_0xfc7bf1=>Boolean(_0xfc7bf1['attribs'][_0x2b0af9]);return gt(_0x234f4a=>_0x32c662(_0x234f4a)&&_0x3ad229(_0x234f4a),_0x5d9a0c);}function Be(_0x47b694,_0x42f158,_0x2041fa){const _0x38d0ed=null!==_0x42f158?_0x26f3c2=>_0x26f3c2['attribs'][_0x47b694]===_0x42f158:_0x27eced=>Boolean(_0x27eced['attribs'][_0x47b694]);return _0x45b719(_0x89d115=>_0x32c662(_0x89d115)&&_0x38d0ed(_0x89d115),_0x2041fa);}function pt(_0x50f41f,_0x58a4e3){return _0x50f41f&&_0x32c662(_0x50f41f)?_0x50f41f['attribs'][_0x58a4e3]:null;}function Qe(_0x302c85,_0x2882f2,_0x4b500c){_0x32c662(_0x302c85)&&(null===_0x4b500c?delete _0x302c85['attribs'][_0x2882f2]:_0x302c85['attribs'][_0x2882f2]=_0x4b500c);}function ze(_0x5bf839,_0x395ea5,_0x373271){const _0x5f02ec=_0x395ea5['cloneNode'](!0x0);'beforebegin'===_0x373271?_0x56a186(_0x5bf839,_0x5f02ec):'afterbegin'===_0x373271?_0x15972e(_0x5bf839,_0x5f02ec):'beforeend'===_0x373271?_0x23b438(_0x5bf839,_0x5f02ec):'afterend'===_0x373271&&_0x44af25(_0x5bf839,_0x5f02ec);}function Ae(_0x1fe2ce){const _0x1ed5cd=[];let _0x19d655=_0x1fe2ce;for(;_0x19d655;)_0x19d655=_0x2e679f(_0x19d655),_0x19d655&&_0x1ed5cd['push'](_0x19d655);return _0x1ed5cd;}function Jn(_0x24be12){return _0x24be12['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Ze(_0x58b6d3){let _0x1bd04a=0x0;for(;_0x58b6d3['parentNode'];)_0x58b6d3=_0x58b6d3['parentNode'],_0x1bd04a++;return _0x1bd04a;}function Is(_0x2ea2c9){const _0x191a32=[];let _0x327b9f=_0x2ea2c9['nextSibling'];for(;_0x327b9f;)_0x191a32['push'](_0x327b9f),_0x327b9f=_0x327b9f['nextSibling'];_0x191a32['forEach'](_0x4a285c=>{_0x462fa1(_0x4a285c);});}class Oe extends/* #__PURE__ -- @preserve */
25
+ _0x33fb62(){['_m2html'];constructor(){super(),this['_m2html']=new _0x5bc621();}['convertMarkdownToHTML'](_0x96cd53){const _0x50c968=this['_m2html']['parse'](_0x96cd53);return this['parseAndNormalizeHTML'](_0x50c968);}['parseAndNormalizeHTML'](_0x550ec1){return this['_parseHTML'](_0x550ec1);}['_parseHTML'](_0xdb9627){const _0x6091cb=Ye('<dummy>'+_0xdb9627['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x6091cb['children']=_0x6091cb['children'][0x0]['children'],_0x6091cb;}}class Ne extends/* #__PURE__ -- @preserve */
26
+ _0x33fb62(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x30a872){super(),this['_generateUid']=_0x30a872||_0x50fe7e;}['merge'](_0x416775,_0x131d1d,_0x1c57d8){const _0x39d069=_0x416775['cloneNode'](!0x0);if(0x0===_0x131d1d['childNodes']['length']){const _0x1c1a47=[];return Be('data-id','new-element',_0x39d069)['forEach'](_0x392701=>{const _0x4375ac=this['_generateUid']();Qe(_0x392701,'data-id',_0x4375ac),_0x1c1a47['push'](_0x4375ac);}),this['_removeSpecialComments'](_0x39d069),{'parsedContent':_0x39d069,'newNodeIds':_0x1c1a47,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x1c57d8&&_0x1c57d8['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x39d069),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Be('data-id',null,_0x131d1d)['map'](_0xbe3b39=>pt(_0xbe3b39,'data-id'))['filter'](_0x483e79=>!!_0x483e79));let _0x5a840b=-0x1,_0x1ee71f=!0x1;const _0x446baf=_0x39d069['childNodes'],_0x48179e=Array['from'](_0x446baf)['filter'](_0x493f5d=>!(0x3===_0x493f5d['nodeType']&&''===ut(_0x493f5d)['trim']())),_0x557526=_0x48179e['length'];for(let _0x308137=0x0;_0x308137<_0x557526;_0x308137++){const _0x106193=_0x48179e[_0x308137],_0x4ea74c=_0x48179e[_0x308137+0x1];if(this['_isNewNode'](_0x106193)){if(-0x1===_0x5a840b&&(_0x5a840b=_0x308137),this['_markWrappedElements'](_0x106193),!this['_isNewNode'](_0x4ea74c)){const [_0x2e8d29,_0x4fda8e]=this['_findReferenceNode'](_0x106193,_0x1ee71f,_0x131d1d);if(_0x2e8d29){const _0xe676ea=Array['from'](_0x48179e)['slice'](_0x5a840b,_0x308137+0x1);this['_insertNodes'](_0x2e8d29,_0xe676ea,_0x4fda8e),_0x5a840b=-0x1;}}}else{if(this['_isExistingContentComment'](_0x106193))_0x1ee71f=!0x0;else{if(this['_isExistingNode'](_0x106193)){const _0x29c193=pt(_0x106193,'data-id');if(_0x29c193&&this['_existingDataIds']['has'](_0x29c193)){const _0x47a560=ft('data-id',_0x29c193,_0x131d1d);this['_replaceNode'](_0x47a560,_0x106193);}if(this['_touchedNodesState']['removedIds']['includes'](_0x29c193)){const _0x4d5e05=this['_touchedNodesState']['removedIds']['indexOf'](_0x29c193);this['_touchedNodesState']['removedIds']['splice'](_0x4d5e05,0x1);}}else{if(this['_isDelNode'](_0x106193)){const _0x2f81f3=pt(_0x106193,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x2f81f3)||this['_storeDeletedElementIds'](_0x106193);}}}}}for(const _0x11348e of this['_touchedNodesState']['removedIds']){const _0x367bd5=ft('data-id',_0x11348e,_0x131d1d);if(_0x367bd5){if(_0x1c57d8&&_0x1c57d8['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x11348e;const _0x2a617b=_0x1c57d8['replaceRemovedWith']['cloneNode'](!0x0);Qe(_0x2a617b,'data-id',_0x11348e),Qe(_0x2a617b,'data-removed','true'),_0x8e05b3(_0x367bd5,_0x2a617b);}else _0x462fa1(_0x367bd5);}}if(Be('data-wrapped-id',null,_0x131d1d)['forEach'](_0x2cc577=>{const _0x3c69c9=ft('data-id',pt(_0x2cc577,'data-wrapped-id'),_0x131d1d);var _0x247061,_0x277ed2;_0x3c69c9&&(_0x277ed2=_0x2cc577,_0x462fa1(_0x247061=_0x3c69c9),_0x8e05b3(_0x277ed2,_0x247061));}),Be('data-id','new-element',_0x131d1d)['forEach'](_0x3e03c6=>{const _0x18dea5=this['_getUid'](_0x3e03c6);Qe(_0x3e03c6,'data-id',_0x18dea5),this['_touchedNodesState']['newIds']['push'](_0x18dea5);}),this['_removeSpecialComments'](_0x131d1d),_0x1c57d8&&_0x1c57d8['markUnstableElements']&&this['_markUnstableElements'](_0x131d1d,_0x1c57d8['markUnstableElementsDepth']||0x0),_0x1c57d8&&_0x1c57d8['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x6963f9=ft('data-id',this['_touchedNodesState']['lastTouchedId'],_0x131d1d);for(;_0x6963f9;)Is(_0x6963f9),_0x6963f9=_0x6963f9['parentNode'];}return{'parsedContent':_0x131d1d,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x38895a,_0x4c4360,_0x1b90c5){for(const _0x2f1283 of _0x4c4360){const _0x2690af=this['_getUid'](_0x2f1283);Qe(_0x2f1283,'data-id',_0x2690af),this['_touchedNodesState']['newIds']['push'](_0x2690af),this['_touchedNodesState']['lastTouchedId']=_0x2690af;}const _0x513ead='afterbegin'===_0x1b90c5||'afterend'===_0x1b90c5?_0x4c4360['reverse']():_0x4c4360;for(const _0x15a845 of _0x513ead)ze(_0x38895a,_0x15a845,_0x1b90c5);}['_replaceNode'](_0x3af975,_0x50da7a){if(!_0x3af975)return;if(_0x1ecb28=_0x50da7a,Jn(ut(_0x3af975))===Jn(ut(_0x1ecb28)))return;var _0x1ecb28;const _0x4d4500=this['_getUid'](_0x3af975);Qe(_0x50da7a,'data-id',_0x4d4500),this['_touchedNodesState']['modifiedIds']['push'](_0x4d4500),this['_touchedNodesState']['lastTouchedId']=_0x4d4500,_0x8e05b3(_0x3af975,_0x50da7a['cloneNode'](!0x0));}['_findReferenceNode'](_0x611213,_0x446709,_0x2d1762){const _0x2047d4=this['_findPrevElementWithDataId'](_0x611213,!0x1);if(_0x2047d4){const _0xd0b066=this['_getNodeDataId'](_0x2047d4),_0x5b1f82=ft('data-id',_0xd0b066,_0x2d1762);if(_0x5b1f82)return[_0x5b1f82,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0xd0b066);}const _0x8a3e41=this['_findNextElementWithDataId'](_0x611213,!0x1);if(_0x8a3e41){const _0x30ddc1=this['_getNodeDataId'](_0x8a3e41),_0x1d15d4=ft('data-id',_0x30ddc1,_0x2d1762);if(_0x1d15d4)return[_0x1d15d4,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x30ddc1);}return _0x446709?_0x611213['nextSibling']?this['_findFallbackReferenceNode'](_0x611213,_0x2d1762):[_0x2d1762['childNodes'][_0x2d1762['childNodes']['length']-0x1],'afterend']:[_0x2d1762['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x27505e,_0x33900f){const _0x50029b=[],_0xb72cdc=this['_findPrevElementWithDataId'](_0x27505e,!0x0);if(_0xb72cdc){const _0x4c1572=ft('data-id',this['_getNodeDataId'](_0xb72cdc),_0x33900f);_0x4c1572&&_0x50029b['push']([_0x4c1572,'afterend']);}const _0x28b8a5=this['_findNextElementWithDataId'](_0x27505e,!0x0);if(_0x28b8a5){const _0x31a877=ft('data-id',this['_getNodeDataId'](_0x28b8a5),_0x33900f);_0x31a877&&_0x50029b['push']([_0x31a877,'beforebegin']);}if(_0x50029b['length']>0x1)return Ze(_0x50029b[0x0][0x0])<=Ze(_0x50029b[0x1][0x0])?_0x50029b[0x0]:_0x50029b[0x1];return 0x1===_0x50029b['length']?_0x50029b[0x0]:[_0x33900f['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x3b2f04,_0x112ff8){let _0x2a1e9b=_0x3b2f04['nextSibling'],_0xd31bbf=null,_0x213746=!0x1;for(;_0x2a1e9b;){if(_0x524bb7(_0x2a1e9b)){if(this['_isDelNode'](_0x2a1e9b)&&(_0xd31bbf=_0x2a1e9b),this['_isExistingContentComment'](_0x2a1e9b)&&_0x112ff8&&!_0x213746){_0x213746=!0x0,_0x2a1e9b=_0x2a1e9b['nextSibling'];continue;}break;}const _0x9ccc1a=pt(_0x2a1e9b,'data-id');if(_0x9ccc1a&&'new-element'!==_0x9ccc1a&&this['_existingDataIds']['has'](_0x9ccc1a)){_0xd31bbf=_0x2a1e9b;break;}_0x2a1e9b=_0x2a1e9b['nextSibling'];}return _0xd31bbf;}['_findPrevElementWithDataId'](_0x29f1c5,_0x539624){let _0x3a4690=_0x29f1c5['previousSibling'],_0x3f64e0=null,_0x33d9a1=!0x1;for(;_0x3a4690;){if(_0x524bb7(_0x3a4690)){if(this['_isDelNode'](_0x3a4690)&&(_0x3f64e0=_0x3a4690),this['_isExistingContentComment'](_0x3a4690)&&_0x539624&&!_0x33d9a1){_0x33d9a1=!0x0,_0x3a4690=_0x3a4690['previousSibling'];continue;}break;}const _0x1b66ce=pt(_0x3a4690,'data-id');if(_0x1b66ce&&'new-element'!==_0x1b66ce&&this['_existingDataIds']['has'](_0x1b66ce)){_0x3f64e0=_0x3a4690;break;}_0x3a4690=_0x3a4690['previousSibling'];}return _0x3f64e0;}['_markWrappedElements'](_0x113492){_0x32c662(_0x113492)&&Be('data-id',null,_0x113492)['forEach'](_0x595b49=>{this['_isExistingNode'](_0x595b49)&&!this['_hasWrappedParent'](_0x595b49)&&(Qe(_0x595b49,'data-wrapped-id',pt(_0x595b49,'data-id')),Qe(_0x595b49,'data-id',null));});}['_getNodeDataId'](_0x4a6dfb){if(!_0x4a6dfb)return null;if(_0x32c662(_0x4a6dfb))return pt(_0x4a6dfb,'data-id');if(_0x524bb7(_0x4a6dfb)){const _0x150b4f=ut(_0x4a6dfb)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x150b4f&&_0x150b4f[0x1])return _0x150b4f[0x1];}return null;}['_storeDeletedElementIds'](_0x1244ed){if(_0x524bb7(_0x1244ed)){const _0x5f23cd=ut(_0x1244ed)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x5f23cd&&_0x5f23cd[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x5f23cd[0x1]);}}['_getUid'](_0x4623d4){return this['_isExistingNode'](_0x4623d4)?pt(_0x4623d4,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x4118ca){(function(_0x302f7b){return _0x58d58d(_0x270b13=>_0x524bb7(_0x270b13),_0x302f7b,!0x0,0x1/0x0);}(_0x4118ca)['filter'](_0x511079=>this['_isDelNode'](_0x511079)||this['_isExistingContentComment'](_0x511079))['forEach'](_0x166ca5=>{_0x462fa1(_0x166ca5);}));}['_markLastTagElementUnstable'](_0x2d3487){const _0x23078f=_0x2d3487['childNodes'],_0x485b20=_0x23078f[_0x23078f['length']-0x1];_0x485b20&&_0x32c662(_0x485b20)&&Qe(_0x485b20,'data-unstable','true');}['_markUnstableElements'](_0x5629c0,_0x308ee7){const _0x3ebd3b=ft('data-unstable','true',_0x5629c0);if(!_0x3ebd3b)return;const _0x4ba853=Ae(_0x3ebd3b)['slice'](0x0,-0x1),_0x3d5604=_0x4ba853['length'];let _0x47c030=_0x3ebd3b;if(_0x3d5604>_0x308ee7){let _0x246cf4=_0x3d5604,_0x5eb0fb=null;for(;_0x246cf4>_0x308ee7&&_0x246cf4>=0x0;)_0x246cf4--,_0x5eb0fb=_0x4ba853[_0x246cf4];_0x5eb0fb&&(_0x47c030=_0x5eb0fb,Qe(_0x3ebd3b,'data-unstable',null),Qe(_0x5eb0fb,'data-unstable','true'));}else{if(_0x3d5604<_0x308ee7){let _0xce621a=_0x3d5604,_0x591da9=_0x3ebd3b;for(;_0xce621a<_0x308ee7;){const _0x1f01ad=_0x591da9['childNodes']['filter'](_0x1c709a=>_0x32c662(_0x1c709a));if(0x0===_0x1f01ad['length'])break;_0xce621a++,_0x591da9=_0x1f01ad[_0x1f01ad['length']-0x1];}_0x591da9&&(_0x47c030=_0x591da9,Qe(_0x3ebd3b,'data-unstable',null),Qe(_0x591da9,'data-unstable','true'));}}let _0x3087d7=_0x47c030;for(;_0x3087d7;){for(;_0x3087d7['nextSibling'];)_0x3087d7=_0x3087d7['nextSibling'],_0x32c662(_0x3087d7)&&Qe(_0x3087d7,'data-unstable','true');_0x3087d7=_0x3087d7['parentNode'];}}['_isNewNode'](_0x1289da){return Boolean('new-element'===pt(_0x1289da,'data-id'));}['_isExistingNode'](_0x19fc47){return Boolean((pt(_0x19fc47,'data-id')||'')['length']>0x0&&'new-element'!==pt(_0x19fc47,'data-id'));}['_isDelNode'](_0x58d925){return!!_0x58d925&&Boolean(_0x524bb7(_0x58d925)&&ut(_0x58d925)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x35cb90){let _0x2815ff=_0x35cb90['parentNode'];for(;_0x2815ff;){if(pt(_0x2815ff,'data-wrapped-id'))return!0x0;_0x2815ff=_0x2815ff['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x464b6a){return Boolean(_0x524bb7(_0x464b6a)&&ut(_0x464b6a)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function y({editor:_0x3a21e1,changeGroups:_0xd23232,documentContextContent:_0x4a938d,showDiff:_0xb72df3,trimUnchanged:_0x517563=!0x0}){return _0xd23232['map'](_0x127dad=>{const _0x3bfac9=new mt([]),_0x56fd9a=new mt([]);for(const _0xc530ca of _0x127dad['changes'])if(_0xb72df3&&'removed'==_0xc530ca['type']||_0x56fd9a['children']['push'](_0xc530ca['node']['cloneNode'](!0x0)),'new'!=_0xc530ca['type']&&(_0xb72df3||'removed'!=_0xc530ca['type'])){const _0x16214b=gt(_0x39dc08=>pt(_0x39dc08,'data-id')==_0xc530ca['id'],_0x4a938d,!0x0);_0x16214b&&_0x3bfac9['children']['push'](_0x16214b['cloneNode'](!0x0));}const {content:_0x122a79,hasChanges:_0xdcb6d0}=function(_0x238a02,_0x396e9f,_0x17dd46,_0x3d5dcc,_0x24edae=!0x0){const _0xe617ca=_0x238a02['plugins']['get']('DocumentCompare'),_0xb19ec2=ut(_0x396e9f),_0x90c64d=ut(_0x17dd46),_0x526b25=_0x238a02['data']['parse'](_0xb19ec2,'$root'),_0x2fd796=_0x238a02['model']['createPositionAt'](_0x526b25,0x0),_0xb8f2c9=_0xe617ca['getDiff'](_0xb19ec2,_0x90c64d,{'anchor':_0x2fd796,'markDeletions':_0x3d5dcc}),_0x30937e=_0xb8f2c9['getOperations']();if(0x0==_0x30937e['length'])return{'content':_0x396e9f['cloneNode'](!0x0),'hasChanges':!0x1};_0x3d5dcc?function(_0x18ecdb,_0x2b75b5,_0x177b4c){if(0x0==_0x18ecdb['length'])return;const _0x53aa04=_0x177b4c['plugins']['get']('DocumentCompare'),_0x6b7f33=_0x177b4c['plugins']['get']('SuggestionsConversion');_0x177b4c['model']['change'](_0x537f11=>{const _0x5b3f05=new Set();for(let _0x5ac08c=0x0;_0x5ac08c<_0x18ecdb['length'];_0x5ac08c++){const _0x462709=_0x18ecdb[_0x5ac08c];if(_0x462709['baseVersion']=null,_0x462709['isDocumentOperation']=!0x1,_0x53aa04['isMarkedRemoveOperation'](_0x462709)){const _0x388579=_0x5d26f1(_0x462709['newRange'],_0x177b4c['model']),_0x2fedb9='suggestion:deletion:'+_0x50fe7e()+':$aiSuggestion';_0x2b75b5['markers']['set'](_0x2fedb9,_0x388579);}else switch(_0x462709['type']){case'rename':{if(_0x462709['oldName']==_0x462709['newName'])break;_0x537f11['batch']['addOperation'](_0x462709),_0x177b4c['model']['applyOperation'](_0x462709);const _0xc18d62='$elementName',_0x1cc992=_0x462709['position'],_0x6f312e=_0x177b4c['model']['createRange'](_0x1cc992,_0x177b4c['model']['createPositionAt'](_0x1cc992['nodeAfter'],'end')),_0xeedd0='suggestion:attribute:'+_0xc18d62+':'+_0x50fe7e()+':$aiSuggestion';_0x2b75b5['markers']['set'](_0xeedd0,_0x6f312e);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x462709['oldValue']==_0x462709['newValue'])break;_0x537f11['batch']['addOperation'](_0x462709),_0x177b4c['model']['applyOperation'](_0x462709);const _0x5dc37e=_0x462709['key'];if(!_0x6b7f33['isRegisteredAttribute'](_0x5dc37e))break;const _0xe643e7=_0x5d26f1(_0x462709['range'],_0x177b4c['model']),_0x1ae08a='suggestion:attribute:'+_0x5dc37e+':'+_0x50fe7e()+':$aiSuggestion';_0x2b75b5['markers']['set'](_0x1ae08a,_0xe643e7);break;}case'insert':{_0x537f11['batch']['addOperation'](_0x462709),_0x177b4c['model']['applyOperation'](_0x462709);if(_0x18ecdb[_0x5ac08c+0x1]&&'move'==_0x18ecdb[_0x5ac08c+0x1]['type']){ro(_0x2b75b5,_0x462709);break;}const _0x498f5f=_0x462709['position'],_0x1b5917=_0x462709['howMany'],_0x43a918=_0x5d26f1(_0x177b4c['model']['createRange'](_0x498f5f,_0x498f5f['getShiftedBy'](_0x1b5917)),_0x177b4c['model']),_0x3c1f6e='suggestion:insertion:'+_0x50fe7e()+':$aiSuggestion';_0x2b75b5['markers']['set'](_0x3c1f6e,_0x43a918);break;}case'split':{_0x537f11['batch']['addOperation'](_0x462709),_0x177b4c['model']['applyOperation'](_0x462709);const _0x563174=_0x462709['splitPosition'],_0x5dc054=_0x462709['moveTargetPosition'],_0x3b2ef1=_0x177b4c['model']['createRange'](_0x563174,_0x5dc054),_0xe414f6='suggestion:insertion:'+_0x50fe7e()+':$aiSuggestion';_0x2b75b5['markers']['set'](_0xe414f6,_0x3b2ef1);break;}case'move':{_0x537f11['batch']['addOperation'](_0x462709),_0x177b4c['model']['applyOperation'](_0x462709),_0x18ecdb[_0x5ac08c-0x1]&&'insert'==_0x18ecdb[_0x5ac08c-0x1]['type']&&ro(_0x2b75b5,_0x462709);const _0x404898=_0x462709['getMovedRangeStart'](),_0x1ed63e=_0x462709['howMany'];for(let _0x153ab9=0x0;_0x153ab9<_0x1ed63e;_0x153ab9++){const _0x139a7b=_0x404898['getShiftedBy'](_0x153ab9)['nodeAfter'];_0x5b3f05['add'](_0x139a7b);}break;}case'remove':{const _0x51ceb7=_0x462709['sourcePosition'],_0x320a07=_0x462709['howMany'],_0x293a7e=new _0xb3c868(_0x51ceb7,_0x320a07);_0x537f11['batch']['addOperation'](_0x293a7e),_0x177b4c['model']['applyOperation'](_0x293a7e);break;}}}for(const _0x5f2c61 of _0x5b3f05){const _0x58e54e=_0x177b4c['model']['createRangeOn'](_0x5f2c61),_0xb3a747='suggestion:formatBlock:$fakeWrap:'+_0x50fe7e()+':$aiSuggestion';_0x2b75b5['markers']['set'](_0xb3a747,_0x5d26f1(_0x58e54e,_0x177b4c['model']));}});}(_0x30937e,_0x526b25,_0x238a02):_0x238a02['model']['change'](_0x25ecf9=>{for(const _0x5a3783 of _0x30937e)if('remove'==_0x5a3783['type']){const _0x387d76=_0x5a3783['sourcePosition'],_0x3857f8=_0x5a3783['howMany'],_0x5e0efa=new _0xb3c868(_0x387d76,_0x3857f8);_0x25ecf9['batch']['addOperation'](_0x5e0efa),_0x238a02['model']['applyOperation'](_0x5e0efa);}else{if('marker'==_0x5a3783['type']){const _0x42ea08=_0x5a3783['name'],_0x120e8e=_0x5a3783['newRange'];_0x526b25['markers']['set'](_0x42ea08,_0x120e8e);}else _0x5a3783['baseVersion']=null,_0x5a3783['isDocumentOperation']=!0x1,_0x25ecf9['batch']['addOperation'](_0x5a3783),_0x238a02['model']['applyOperation'](_0x5a3783);}});if(_0x24edae){const _0x427ebc=lt(_0x238a02,_0x30937e,_0x526b25);dt(_0x238a02['model'],_0x427ebc),function(_0x1052d0,_0x4d8f13){const _0x13b14e=_0x4d8f13['getFirstRange']()['start'];let _0x11ae8a=_0x4d8f13['getFirstRange']()['end'];const _0x57d6dc=_0x13b14e['root'];(_0x11ae8a['textNode']||_0x11ae8a['nodeAfter']&&_0x11ae8a['nodeAfter']['is']('$text'))&&(_0x4fa1cc(_0x11ae8a,'...'),_0x11ae8a=_0x11ae8a['getShiftedBy'](0x3)),(_0x13b14e['textNode']||_0x13b14e['nodeBefore']&&_0x13b14e['nodeBefore']['is']('$text'))&&(_0x4fa1cc(_0x13b14e,'...'),function(_0x3410af,_0x2bda74,_0x2091d1){for(let [_0x374e93,_0x589474]of _0x3410af['markers']){const _0x2c1723=_0x589474['_getTransformedByInsertion'](_0x2bda74,_0x2091d1,!0x1);_0x589474=_0x2c1723[0x0],_0x3410af['markers']['set'](_0x374e93,_0x589474);}}(_0x57d6dc,_0x13b14e,0x3),_0x13b14e['parent']==_0x11ae8a['parent']&&(_0x11ae8a=_0x11ae8a['getShiftedBy'](0x3)));const _0x1418fb=_0x1052d0['createRange'](_0x1052d0['createPositionAt'](_0x57d6dc,0x0),_0x13b14e),_0x41d635=_0x1052d0['createRange'](_0x11ae8a,_0x1052d0['createPositionAt'](_0x57d6dc,'end')),_0x23ee8b=[..._0x1418fb['getMinimalFlatRanges'](),..._0x41d635['getMinimalFlatRanges']()];_0x23ee8b['reverse']();for(const _0x5be219 of _0x23ee8b)_0x4e3c48(_0x5be219),Zn(_0x57d6dc,_0x5be219);}(_0x238a02['model'],_0x427ebc);}const _0x55dc50=_0x238a02['data']['stringify'](_0x526b25,{'showSuggestionHighlights':!0x0});return{'content':Ye(_0x55dc50),'hasChanges':!0x0};}(_0x3a21e1,_0x3bfac9,_0x56fd9a,_0xb72df3,_0x517563);return{'type':_0x127dad['changes'][0x0]['type'],'index':_0x127dad['index'],'content':_0x122a79,'hasChanges':_0xdcb6d0};});}function ro(_0x38e8c4,_0x44d7cd){for(const [_0x2ece21,_0x1e4f26]of _0x38e8c4['markers']){const _0x421dcc=_0x33fc08['_createFromRanges'](_0x1e4f26['getTransformedByOperation'](_0x44d7cd));_0x38e8c4['markers']['set'](_0x2ece21,_0x421dcc);}}function lt(_0x8c8cfe,_0x57fe61,_0x5cd0e1){const _0x48a709=_0x8c8cfe['plugins']['get']('DocumentCompare');let _0x41d651=_0x8c8cfe['model']['createPositionAt'](_0x5cd0e1,Number['POSITIVE_INFINITY']),_0x3b5c9d=_0x8c8cfe['model']['createPositionAt'](_0x5cd0e1,0x0);for(const _0x2918bb of _0x57fe61){let _0x3c13e9,_0x4c7064;if(_0x48a709['isMarkedRemoveOperation'](_0x2918bb))_0x3c13e9=_0x2918bb['newRange']['start'],_0x4c7064=_0x2918bb['newRange']['end'];else switch(_0x41d651=_0x41d651['getTransformedByOperation'](_0x2918bb),_0x3b5c9d=_0x3b5c9d['getTransformedByOperation'](_0x2918bb),_0x2918bb['type']){case'rename':_0x3c13e9=_0x2918bb['position'],_0x4c7064=_0x3c13e9['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x3c13e9=_0x2918bb['range']['start'],_0x4c7064=_0x2918bb['range']['end'];break;case'insert':_0x3c13e9=_0x2918bb['position'],_0x4c7064=_0x3c13e9['getShiftedBy'](_0x2918bb['howMany']);break;case'split':_0x3c13e9=_0x2918bb['splitPosition'],_0x4c7064=_0x2918bb['moveTargetPosition'];break;case'merge':{const _0x35444f=_0x2918bb['targetPosition']['path']['slice'](0x0,-0x1);_0x3c13e9=_0x8c8cfe['model']['createPositionFromPath'](_0x5cd0e1,_0x35444f),_0x4c7064=_0x3c13e9['getShiftedBy'](0x1);break;}case'remove':{const _0x31d1a7=_0x2918bb['howMany'],_0x418ac1=_0x2918bb['sourcePosition']['_getTransformedByInsertion'](_0x2918bb['targetPosition'],_0x31d1a7),_0x49c458=_0x2918bb['getMovedRangeStart']();'remove'==_0x2918bb['type']?(_0x3c13e9=_0x418ac1,_0x4c7064=_0x418ac1):(_0x3c13e9=_0x49c458,_0x4c7064=_0x49c458['getShiftedBy'](_0x31d1a7));break;}}_0x3c13e9&&_0x3c13e9['isBefore'](_0x41d651)&&(_0x41d651=_0x3c13e9['clone'](),_0x41d651['stickiness']='toNone'),_0x4c7064&&_0x4c7064['isAfter'](_0x3b5c9d)&&(_0x3b5c9d=_0x4c7064['clone'](),_0x3b5c9d['stickiness']='toNone');}return _0x8c8cfe['model']['createSelection'](_0x8c8cfe['model']['createRange'](_0x41d651,_0x3b5c9d));}function dt(_0x3bb50f,_0x1eac05){so(_0x3bb50f,_0x1eac05,'forward');const _0x1e09a1=_0x1eac05['getFirstRange']();_0x1eac05['setTo']([]),_0x1eac05['setTo'](_0x1e09a1,{'backward':!0x0}),so(_0x3bb50f,_0x1eac05,'backward');}function so(_0x497c45,_0x40d32f,_0x2295a0){let _0xecc66b=0x14;for(;_0xecc66b;){_0x497c45['modifySelection'](_0x40d32f,{'unit':'word','direction':_0x2295a0}),_0xecc66b--;const _0x1a813a=_0x40d32f['focus']['forward'==_0x2295a0?'nodeBefore':'nodeAfter'];if(_0x1a813a&&_0x1a813a['is']('element')&&_0x497c45['schema']['isBlock'](_0x1a813a)&&_0x497c45['schema']['isObject'](_0x1a813a))break;}}function Zn(_0x597f86,_0x2b972a){for(const [_0x5f3b67,_0x56bdc4]of _0x597f86['markers']){const _0x90db7e=_0x56bdc4['_getTransformedByDeletion'](_0x2b972a['start'],_0x2b972a['end']['offset']-_0x2b972a['start']['offset']);null!=_0x90db7e?_0x597f86['markers']['set'](_0x5f3b67,_0x90db7e):_0x597f86['markers']['delete'](_0x5f3b67);}}const Ur=['modification-delta','text-delta','web-search','reasoning'],Wr=['conversation-title'];class de extends _0x33fb62(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new mt([]);['parsedMergedContent']=new mt([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x357e31,content:_0x5ae585='',isDone:_0x165a77=!0x1,interactionId:_0x3beda7,areActionsDisabled:_0x565934,documentContextContent:_0x258290,editor:_0x375d3,id:_0x2965d4}){super(),this['id']=_0x2965d4||_0x50fe7e(),this['interactionId']=_0x3beda7,this['type']=_0x357e31,this['areActionsDisabled']=!!_0x565934,this['editor']=_0x375d3,this['aiResponseParser']=new Oe(),this['aiResponseApplier']=new Ne(),this['documentContextContent']=Ye(_0x258290||''),this['set']('isDone',_0x165a77),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x5ae585);}['appendContent'](_0x2b5c07){this['set']('content',this['content']+_0x2b5c07);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x47f3c3,_0x2a72e5){this['changeGroups'][_0x47f3c3]['state']=_0x2a72e5,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x47f3c3,'state':_0x2a72e5});}['getContentParts']({showDiff:_0x5332ae,groupIndex:_0x455517}){if(!this['editor'])throw new _0xb61eac('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x2b2b65=this['_getCachedContentParts'](_0x5332ae,_0x455517);if(_0x2b2b65)return _0x2b2b65;let _0x2bcbbf=[];if(void 0x0===_0x455517)_0x2bcbbf=this['changeGroups'];else{const _0x1ce6fe=this['changeGroups']['find'](({index:_0x130077})=>_0x130077===_0x455517);if(!_0x1ce6fe)throw new _0xb61eac('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x455517});_0x2bcbbf=[_0x1ce6fe];}const _0x23724d=y({'editor':this['editor'],'showDiff':_0x5332ae,'changeGroups':_0x2bcbbf,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x5332ae,_0x23724d),_0x23724d;}['_getCachedContentParts'](_0x54728b,_0x4aa8fd){const _0x5f54de=_0x54728b?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x5f54de]['length'])return null;const _0x241c7b=this['cachedSuggestionContentParts'][_0x5f54de];if(void 0x0===_0x4aa8fd)return _0x28cce4(_0x241c7b);{const _0x3568e8=_0x241c7b['find'](({index:_0xd843b1})=>_0xd843b1===_0x4aa8fd);if(_0x3568e8)return[_0x28cce4(_0x3568e8)];}return null;}['_setCachedContentParts'](_0x2d5ff8,_0x3a26c0){const _0x36e79a=_0x2d5ff8?'withDiff':'withoutDiff';_0x3a26c0['forEach'](_0x3fbe94=>{const _0x1c6f2d=this['cachedSuggestionContentParts'][_0x36e79a],_0x1b5146=_0x1c6f2d['find'](({index:_0x57690c})=>_0x57690c===_0x3fbe94['index']);if(_0x1b5146){const _0x88247e=_0x1c6f2d['indexOf'](_0x1b5146);_0x1c6f2d['splice'](_0x88247e,0x1,_0x3fbe94);}else _0x1c6f2d['push'](_0x3fbe94);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x1be53e=this['changeGroups'];this['updateChangeGroups']();const _0xa4d8cd=this['_getDifferentChangeGroups'](_0x1be53e,this['changeGroups']);(_0xa4d8cd['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0xa4d8cd),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x47d598,_0x4d3591){const _0x4f6004=[];for(const _0xf901fc of _0x4d3591){const _0x304261=_0x47d598[_0xf901fc['index']];_0x304261?_0x304261['changes']['length']!==_0xf901fc['changes']['length']?_0x4f6004['push'](_0xf901fc):_0x304261['changes']['forEach']((_0x1fc185,_0x1822a1)=>{const _0x552865=_0xf901fc['changes'][_0x1822a1];_0x1fc185['id']!==_0x552865['id']&&_0x4f6004['push'](_0xf901fc);}):_0x4f6004['push'](_0xf901fc);}return _0x4f6004;}['updateChangeGroups'](){const _0x4c9ab4=new _0x2708d9('p',{},[new _0x2708d9('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x54e177(C(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x4ae8d1=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x4c9ab4,'cutAfterLastChange':!this['isDone']});if(!_0x4ae8d1['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x4ae8d1['parsedContent'];let _0xfbd9a7=[];if(_0x45b719(_0xc54088=>{const _0x2dd23e=pt(_0xc54088,'data-id');if(!_0x2dd23e||!_0x3d9f56(_0x2dd23e))return!0x1;const _0x4b7ff4=[_0xc54088,...Ae(_0xc54088)]['at'](-0x2);if(_0xc54088!=_0x4b7ff4){const _0x3986e5=pt(_0x4b7ff4,'data-id');_0x3d9f56(_0x3986e5)||(_0xfbd9a7['push']({'node':_0x4b7ff4,'id':_0x3986e5,'type':'modified'}),_0x4ae8d1['modifiedNodeIds']['push'](_0x3986e5));}else _0x4ae8d1['modifiedNodeIds']['includes'](_0x2dd23e)?_0xfbd9a7['push']({'node':_0xc54088,'type':'modified','id':_0x2dd23e}):_0x4ae8d1['newNodeIds']['includes'](_0x2dd23e)?_0xfbd9a7['push']({'node':_0xc54088,'type':'new','id':_0x2dd23e,'anchorId':pt(_0xc54088['previousSibling'],'data-id')}):_0xfbd9a7['push']({'node':_0xc54088,'type':'removed','id':_0x2dd23e});return!0x0;},this['parsedMergedContent']),_0xfbd9a7=_0xfbd9a7['filter'](({node:_0x54de16})=>[...Ae(_0x54de16),_0x54de16]['every'](_0x1ae8b8=>!pt(_0x1ae8b8,'data-unstable'))),0x0==_0xfbd9a7['length'])return;const _0x4418db=[[_0xfbd9a7[0x0]]];for(let _0x10663b=0x1;_0x10663b<_0xfbd9a7['length'];_0x10663b++){const _0x36128c=_0x4418db[_0x4418db['length']-0x1],_0x2e971f=_0x36128c[_0x36128c['length']-0x1];_0xfbd9a7[_0x10663b]['node']['previousSibling']==_0x2e971f['node']&&'modified'!=_0xfbd9a7[_0x10663b]['type']&&'modified'!=_0x2e971f['type']?_0x36128c['push'](_0xfbd9a7[_0x10663b]):_0x4418db['push']([_0xfbd9a7[_0x10663b]]);}for(const _0xcc4a68 of _0x4418db){const _0x5005c3=_0xcc4a68[0x0],_0x53777e=_0xcc4a68[_0xcc4a68['length']-0x1],_0x3dedd4=_0x582a4(_0x5005c3['node']['previousSibling']);_0x3dedd4&&_0xcc4a68['unshift'](_0x3dedd4);const _0x48d43b=_0x582a4(_0x53777e['node']['nextSibling']);_0x48d43b&&_0xcc4a68['push'](_0x48d43b);}function _0x3d9f56(_0x2ed743){return _0x4ae8d1['modifiedNodeIds']['includes'](_0x2ed743)||_0x4ae8d1['newNodeIds']['includes'](_0x2ed743)||_0x4ae8d1['removedNodeIds']['includes'](_0x2ed743);}function _0x582a4(_0x14e5a3){if(_0x14e5a3&&pt(_0x14e5a3,'data-id')&&!pt(_0x14e5a3,'data-unstable')){const _0x43940a=pt(_0x14e5a3,'data-id');if(!_0x3d9f56(_0x43940a))return{'node':_0x14e5a3,'type':'context','id':_0x43940a};}return null;}this['changeGroups']=_0x4418db['map']((_0x2ba195,_0x3e579b)=>({'changes':_0x2ba195,'state':'pending','index':_0x3e579b}));}}function $i(_0x10c185){return Object['values'](Ur)['includes'](_0x10c185);}function Zi(_0x45189e){return Wr['includes'](_0x45189e);}function Ee(_0x5e9987){return'conversation-title'===_0x5e9987;}function Fe(_0x47e2ad){return'source'===_0x47e2ad;}const Vt=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class Jt extends _0x2ebfa6(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x187d54,editor:_0x3366ff}){super(),this['id']=_0x50fe7e(),this['connector']=_0x187d54,this['isStopped']=!0x0,this['editor']=_0x3366ff;}async['start'](){let _0x43e6d7;const _0xa82371=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x143668=await this['currentRequest']['getStream']();for await(const _0x56ae36 of _0x143668){if(this['isStopped'])return;if('error'===_0x56ae36['event'])return void this['fire']('error',{'error':new _0xb61eac('ai-chat-interaction-error',this)});if('message-metadata'!==_0x56ae36['event']){if('action-metadata'!==_0x56ae36['event']){if(Ee(_0x56ae36['event'])&&this['setConversationTitle'](_0x56ae36['data']['conversationTitle'],!0x0),Fe(_0x56ae36['event']))_0xa82371['push'](_0x56ae36['data']['source']);else{if($i(_0x56ae36['event'])){if(_0x56ae36['event']!==_0x43e6d7){if(_0x43e6d7=_0x56ae36['event'],'web-search'===_0x56ae36['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x56ae36['event']){this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));continue;}this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this)),this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this)),this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x56ae36['event'],'interactionId':this['id'],'id':_0x56ae36['data']?.['id']}),_0xa82371['length']>0x0&&'modification-delta'===_0x56ae36['event']&&(this['currentReply']['sources']=_0xa82371['splice'](0x0));}_0x56ae36['data']['textDelta']&&this['currentReply']['appendContent'](_0x56ae36['data']['textDelta']);}else Zi(_0x56ae36['event'])||_0x2398b2('ai-interaction-invalid-event-type',{'chunk':_0x56ae36});}}else this['actionCallId']=_0x56ae36['data']['callId'];}else this['messageId']=_0x56ae36['data']['messageId'];}}finally{this['isStopped']||(_0xa82371['length']>0x0&&(this['currentReply']['sources']=_0xa82371['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0xa6f4a4){return this['replies']['find'](_0x283737=>_0x283737['id']===_0xa6f4a4);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x14835b=>_0x14835b['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x344250){const _0x51bc77=new de({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x344250});return this['replies']['push'](_0x51bc77),_0x51bc77['delegate'](...Vt)['to'](this),this['fire']('replyCreated',_0x51bc77),_0x51bc77;}['setConversationTitle'](_0x5c06dc,_0x146c77=!0x1){this['fire']('setConversationTitle',_0x5c06dc,_0x146c77);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Xt=function(_0xbb7925){return _0xbb7925['FILE']='file',_0xbb7925['DOCUMENT']='document',_0xbb7925['URL']='web-resource',_0xbb7925['TEXT']='text',_0xbb7925['SELECTION']='selection',_0xbb7925;}({}),Ie=function(_0x135fab){return _0x135fab['TEXT']='text',_0x135fab['MARKDOWN']='markdown',_0x135fab['HTML']='html',_0x135fab;}({});const xi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Ci extends _0x33fb62(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x34d70a,config:_0xaf2348,ownerId:_0x58a130}){super(),this['_connector']=_0x34d70a,this['_config']=_0xaf2348,this['_ownerId']=_0x58a130;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x2f7660){const _0x54e1fa=await this['_createContextItemFromContent'](_0x2f7660);return this['_addToConversationContextItem'](_0x54e1fa),'current-document'===_0x54e1fa['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x54e1fa;}async['_createContextItemFromContent'](_0x152502){if(_0x152502['type']===Xt['DOCUMENT']){const _0x303fbe=await this['_connector']['fetchDocument'](this['_ownerId'],_0x152502['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x152502['type'],'content':_0x303fbe['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x303fbe['attributes']?.['version'],'sessionId':_0x303fbe['attributes']?.['sessionId']};}return{'id':_0x152502['id'],'uiId':_0x152502['id'],'label':_0x152502['attributes']?.['label']||_0x152502['name']||_0x152502['url']||_0x152502['id'],'type':_0x152502['type'],..._0x152502?.['attributes']?.['resourceId']?{'resourceId':_0x152502['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x2ffdfc){const _0x27d654=this['_pendingContextItems']['get'](_0x2ffdfc);_0x27d654?.['isReadOnly']||this['_removeContextItem'](_0x2ffdfc);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x10720f of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x10720f['uiId']);const _0x4f5e00=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x4f5e00&&this['_addContextItem']({..._0x4f5e00,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x4ad228){for(const _0x5c53b0 of _0x4ad228['values']())this['_addToConversationContextItem'](_0x5c53b0);this['clearPendingContextItems'](),this['fire']('contextSent',{'contextItems':Array['from'](this['getSentContextItems']()['values']())});}['isCurrentDocumentInContext'](){return this['_pendingContextItems']['has']('current-document');}['isSelectionInContext'](){return this['_pendingContextItems']['has']('selection');}['isCurrentDocumentInConversation'](){return this['_conversationContextItems']['has']('current-document');}static['mapContextItemsToRequestData'](_0x5d027b){return Array['from'](_0x5d027b['values']())['map'](_0x932f48=>this['_mapContextItemToRequestData'](_0x932f48))['filter'](_0x52ef76=>null!==_0x52ef76);}async['addFilesToContext'](_0x5547f5,_0x4d2fa8,_0x240d04=Xt['FILE']){const _0x1eefb7='files-'+_0x50fe7e();this['_startUploadOperation'](_0x1eefb7);try{await Promise['all'](_0x5547f5['map'](async _0x2b6be0=>{const _0x9da8cb='file-'+_0x50fe7e(),_0x586404=_0xb7774e(_0x2b6be0['name']);try{this['_addContextItem']({'type':_0x240d04,'label':_0x4d2fa8?.['label']||_0x586404,'uiId':_0x9da8cb,'resourceId':_0x4d2fa8?.['resourceId']},!0x0);const _0xd4b26a=this['_connector']['uploadFile'](this['_ownerId'],_0x2b6be0,_0x4d2fa8);this['_ongoingUploads']['set'](_0x9da8cb,_0xd4b26a['abortController']);const {id:_0x33d48d}=await _0xd4b26a['getId']();this['_ongoingUploads']['delete'](_0x9da8cb),this['_finishContextItemLoading']({'type':_0x240d04,'id':_0x33d48d,'label':_0x4d2fa8?.['label']||_0x586404,'uiId':_0x9da8cb,'resourceId':_0x4d2fa8?.['resourceId']},!0x1);}catch(_0x305dc4){this['_ongoingUploads']['delete'](_0x9da8cb);if(!_0x305dc4['message']['startsWith']('ai-request-aborted')){const _0x26f084=new _0xb61eac('ai-chat-file-upload-failed',null,{'fileName':_0x586404});_0x26f084['stack']=_0x305dc4['stack'],this['fire']('error',{'error':_0x26f084,'fileName':_0x586404});}this['_removeContextItem'](_0x9da8cb);}}));}finally{this['_finishUploadOperation'](_0x1eefb7);}}['addCurrentDocumentToContext'](_0x5af215){if(this['isCurrentDocumentInContext']())return;const _0x5bd381={'type':Xt['DOCUMENT'],'uiId':'current-document','label':_0x5af215,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x5bd381);}async['updateCurrentDocument'](_0x1b91b0,_0x506783,_0x21350f,_0x5215fa){const _0x3aa598=this['_pendingContextItems']['get']('current-document');if(_0x3aa598&&_0x1b91b0){_0x3aa598['selection']=_0x5215fa?_0x5215fa['map'](_0x27ce5f=>({'start':_0x27ce5f['start'],'end':_0x27ce5f['end']})):[];try{if(_0x3aa598['version']===_0x506783)return;const {id:_0x2461af}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x1b91b0,{'version':_0x506783,'sessionId':_0x21350f})['getId']();_0x3aa598['id']=_0x2461af,_0x3aa598['content']=_0x1b91b0,_0x3aa598['version']=_0x506783,_0x3aa598['sessionId']=_0x21350f;}catch(_0x50d7ea){const _0x1fbf79=new _0xb61eac('ai-chat-document-upload-failed',null);_0x1fbf79['stack']=_0x50d7ea['stack'],this['fire']('error',{'error':_0x1fbf79});}}}['addSelectionToContext'](_0x23d1a4){this['_addContextItem']({'type':Xt['SELECTION'],'label':_0x23d1a4,'uiId':'selection','content':_0x23d1a4});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x13704b,_0x4949ec){const _0x3a9adf='url-'+_0x50fe7e();this['_startUploadOperation'](_0x3a9adf);const _0x2bc949='url-'+_0x50fe7e();try{this['_addContextItem']({'type':Xt['URL'],'label':_0x4949ec?.['label']||_0x13704b,'uiId':_0x2bc949,'resourceId':_0x4949ec?.['resourceId']},!0x0);const _0x157ce1=this['_connector']['uploadUrl'](this['_ownerId'],_0x13704b,_0x4949ec);this['_ongoingUploads']['set'](_0x2bc949,_0x157ce1['abortController']);const {id:_0x146b72}=await _0x157ce1['getId']();this['_ongoingUploads']['delete'](_0x2bc949),this['_finishContextItemLoading']({'type':Xt['URL'],'id':_0x146b72,'label':_0x4949ec?.['label']||_0x13704b,'uiId':_0x2bc949,'resourceId':_0x4949ec?.['resourceId']},!0x1);}catch(_0x5210c1){this['_ongoingUploads']['delete'](_0x2bc949),(_0x5210c1['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0xb61eac('ai-chat-url-upload-failed',this,{'url':_0x13704b,'originalError':_0x5210c1}),'url':_0x13704b}),this['_removeContextItem'](_0x2bc949));}finally{this['_finishUploadOperation'](_0x3a9adf);}}async['loadSourceResources'](_0x36f235,_0x44de9d,_0x232030){const _0x3aa22f=this['_addContextOptionsState']['sources']['find'](_0x1ad86c=>_0x1ad86c['id']===_0x36f235);if(!_0x3aa22f)return this['fire']('error',{'error':new _0xb61eac('ai-chat-source-not-found',this,{'sourceId':_0x36f235}),'sourceId':_0x36f235}),[];try{const _0x3fd1c2=(await _0x3aa22f['getResources'](_0x44de9d))['map'](_0x5a89f7=>{const _0x5d0b5c=this['_isResourceInContext'](_0x5a89f7['id']);return{..._0x5a89f7,'isInContext':_0x5d0b5c};});return _0x3aa22f['resources']=_0x3fd1c2,this['fire']('sourceResourcesLoaded',{'sourceId':_0x36f235,'source':_0x3aa22f,'resources':_0x3fd1c2,'uid':_0x232030}),_0x3fd1c2;}catch(_0x211357){return this['fire']('error',{'error':new _0xb61eac('ai-chat-source-resources-load-failed',this,{'sourceId':_0x36f235,'originalError':_0x211357}),'sourceId':_0x36f235,'sourceLabel':_0x3aa22f['label']}),[];}}async['addResourceToContext'](_0x9d9834,_0x1ff328){if(this['_isResourceInContext'](_0x1ff328['id']))return;let _0x31450f=_0x1ff328['data'];if(!_0x31450f&&_0x9d9834['getData'])try{_0x31450f=await _0x9d9834['getData'](_0x1ff328['id']);}catch(_0x46b9ba){return void this['fire']('error',{'error':new _0xb61eac('ai-chat-resource-load-failed',this,{'resourceId':_0x1ff328['id'],'sourceId':_0x9d9834['id'],'originalError':_0x46b9ba}),'resourceId':_0x1ff328['id'],'sourceId':_0x9d9834['id']});}if(_0x31450f)switch(_0x1ff328['type']){case Xt['URL']:if('string'!=typeof _0x31450f)return void this['fire']('error',{'error':new _0xb61eac('ai-chat-context-invalid-data',this,{'resourceId':_0x1ff328['id'],'sourceId':_0x9d9834['id'],'expectedType':'string','actualType':typeof _0x31450f}),'resourceId':_0x1ff328['id'],'sourceId':_0x9d9834['id']});await this['addUrlToContext'](_0x31450f,{'label':_0x1ff328['label'],'resourceId':_0x1ff328['id']});break;case Xt['FILE']:if(!(_0x31450f instanceof File))return void this['fire']('error',{'error':new _0xb61eac('ai-chat-context-invalid-data',this,{'resourceId':_0x1ff328['id'],'sourceId':_0x9d9834['id'],'expectedType':'File','actualType':typeof _0x31450f}),'resourceId':_0x1ff328['id'],'sourceId':_0x9d9834['id']});await this['addFilesToContext']([_0x31450f],{'label':_0x1ff328['label'],'resourceId':_0x1ff328['id']});break;case Xt['TEXT']:if('object'!=typeof _0x31450f||!('content'in _0x31450f)||!('type'in _0x31450f))return void this['fire']('error',{'error':new _0xb61eac('ai-chat-context-invalid-data',this,{'resourceId':_0x1ff328['id'],'sourceId':_0x9d9834['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x31450f}),'resourceId':_0x1ff328['id'],'sourceId':_0x9d9834['id']});_0x31450f=Ci['_convertTextResourceToFile'](_0x31450f,_0x1ff328['label']),await this['addFilesToContext']([_0x31450f],{'label':_0x1ff328['label'],'resourceId':_0x1ff328['id']},Xt['TEXT']);break;default:this['fire']('error',{'error':new _0xb61eac('ai-chat-context-unsupported-type',this,{'resourceId':_0x1ff328['id'],'sourceId':_0x9d9834['id'],'resourceType':_0x1ff328['type']}),'resourceId':_0x1ff328['id'],'sourceId':_0x9d9834['id']});}else this['fire']('error',{'error':new _0xb61eac('ai-chat-resource-no-data',this,{'resourceId':_0x1ff328['id'],'sourceId':_0x9d9834['id']}),'resourceId':_0x1ff328['id'],'sourceId':_0x9d9834['id']});}static['_convertTextResourceToFile'](_0x4e5c5a,_0x5f0322){switch(_0x4e5c5a['type']){case Ie['MARKDOWN']:return new File([_0x4e5c5a['content']],_0x5f0322,{'type':'text/markdown'});case Ie['HTML']:return new File([_0x4e5c5a['content']],_0x5f0322,{'type':'text/html'});default:return new File([_0x4e5c5a['content']],_0x5f0322,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x212c57){switch(_0x212c57['type']){case Xt['FILE']:return{'type':Xt['FILE'],'id':_0x212c57['id']};case Xt['URL']:return{'type':Xt['URL'],'id':_0x212c57['id']};case Xt['DOCUMENT']:return{'type':Xt['DOCUMENT'],'id':_0x212c57['id'],..._0x212c57['selection']?.['length']&&{'selection':_0x212c57['selection']}};case Xt['TEXT']:return{'type':Xt['FILE'],'id':_0x212c57['id']};default:return null;}}['_addContextItem'](_0x57f1d2,_0x3833e8=!0x1){if(this['_pendingContextItems']['set'](_0x57f1d2['uiId'],_0x57f1d2),_0x57f1d2['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x57f1d2,'isLoading':_0x3833e8}),'current-document'===_0x57f1d2['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x57f1d2['resourceId']){const _0x48f344=this['_findSourceIdsByResourceId'](_0x57f1d2['resourceId']);_0x48f344&&_0x48f344['forEach'](_0x4ae6eb=>{this['_updateResourceInContextState'](_0x4ae6eb,_0x57f1d2['resourceId'],!0x0);});}}['_removeContextItem'](_0x2f27c3){const _0x37b92b=this['_pendingContextItems']['get'](_0x2f27c3),_0x3711af=this['_ongoingUploads']['get'](_0x2f27c3);if(_0x3711af&&(_0x3711af['abort'](),this['_ongoingUploads']['delete'](_0x2f27c3)),_0x37b92b?.['resourceId']){const _0x4888e8=this['_findSourceIdsByResourceId'](_0x37b92b['resourceId']);_0x4888e8&&_0x4888e8['forEach'](_0x16bf18=>{this['_updateResourceInContextState'](_0x16bf18,_0x37b92b['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x2f27c3),this['fire']('contextItemRemoved',{'uiId':_0x2f27c3,'type':_0x37b92b?.['type']}),'current-document'===_0x2f27c3&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x2528cc,_0x2c25cf){if(this['_pendingContextItems']['has'](_0x2528cc['uiId'])&&(this['_pendingContextItems']['set'](_0x2528cc['uiId'],_0x2528cc),this['fire']('contextItemLoadingEnded',{'contextItem':_0x2528cc,'isLoading':_0x2c25cf}),_0x2528cc['resourceId'])){const _0x3a57ad=this['_findSourceIdsByResourceId'](_0x2528cc['resourceId']);_0x3a57ad&&_0x3a57ad['forEach'](_0x48db1a=>{this['_updateResourceInContextState'](_0x48db1a,_0x2528cc['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x1550da){this['_conversationContextItems']['set'](_0x1550da['uiId'],_0x1550da);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x5a512d=>({..._0x5a512d,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x1e2f6a=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x1e2f6a,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x198337){for(const _0x148cba of this['_pendingContextItems']['values']())if(_0x148cba['resourceId']===_0x198337)return!0x0;for(const _0x19926d of this['_conversationContextItems']['values']())if(_0x19926d['resourceId']===_0x198337)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x13243d){const _0xcb8b62=[];for(const _0x25ff4b of this['_addContextOptionsState']['sources']){_0x25ff4b['resources']['find'](_0x3ea8e5=>_0x3ea8e5['id']===_0x13243d)&&_0xcb8b62['push'](_0x25ff4b['id']);}return 0x0===_0xcb8b62['length']?null:_0xcb8b62;}['_updateResourceInContextState'](_0x34fd91,_0x19a001,_0x55c374){const _0x31f02b=this['_addContextOptionsState']['sources']['find'](_0x3ff1e3=>_0x3ff1e3['id']===_0x34fd91);if(!_0x31f02b)return;const _0x5bc75a=_0x31f02b['resources']['find'](_0x46e1b2=>_0x46e1b2['id']===_0x19a001);_0x5bc75a&&(_0x5bc75a['isInContext']=_0x55c374,this['fire']('resourceStateChanged',{'sourceId':_0x34fd91,'resourceId':_0x19a001,'isInContext':_0x55c374}));}['_startUploadOperation'](_0x142499){this['_ongoingUploadOperations']['set'](_0x142499,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x10f7c7){this['_ongoingUploadOperations']['delete'](_0x10f7c7),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Mi=['capabilitiesUpdated'];class Di extends _0x2ebfa6(){['_isWebSearchEnabled'];['_isReasoningEnabled'];constructor(){super(),this['_isWebSearchEnabled']=!0x1,this['_isReasoningEnabled']=!0x1;}['init'](){this['reset']();}['reset'](){this['setWebSearch'](!0x1),this['setReasoning'](!0x1);}['getCapabilitiesConfig'](){return{'isWebSearchEnabled':this['_isWebSearchEnabled'],'isReasoningEnabled':this['_isReasoningEnabled']};}static['getCapabilitiesRequestData'](_0x373664){const _0x5776b6={};return _0x373664&&_0x373664['isWebSearchEnabled']&&(_0x5776b6['webSearch']={}),_0x373664&&_0x373664['isReasoningEnabled']&&(_0x5776b6['reasoning']={}),_0x5776b6;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x194c38){_0x194c38!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x194c38,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x31282f){_0x31282f!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x31282f,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Si extends Jt{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x584f76){super(_0x584f76),this['conversationId']=_0x584f76['conversationId'],this['contextItems']=_0x584f76['contextItems'],this['capabilities']=_0x584f76['capabilities'],this['userMessage']=_0x584f76['userMessage'],this['model']=_0x584f76['model'],this['quickActionData']=_0x584f76['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Ci['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Di['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class nt extends _0x2ebfa6(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x2262ff){super(),this['options']=_0x2262ff,this['connector']=_0x2262ff['connector'],this['chatModels']=_0x2262ff['chatModels'],this['id']=_0x2262ff['conversationId'];}async['init'](_0x232e8c){try{this['chatContext']=new Ci({'connector':this['connector'],'config':_0x232e8c,'ownerId':this['id']}),this['chatContext']['delegate'](...xi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Di(),this['chatCapabilities']['delegate'](...Mi)['to'](this),this['chatCapabilities']['init']();const _0x18651e=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x18651e});const _0x1c7975=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x1c7975&&await this['setModel'](_0x1c7975);}catch(_0x59ab1a){const _0x338904=new _0xb61eac('ai-chat-conversation-init-failed',null,{'message':_0x59ab1a['message']});_0x338904['stack']=_0x59ab1a['stack'],this['fire']('error',{'error':_0x338904});}}async['start'](){if(this['isStarted'])throw new _0xb61eac('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0xb61eac('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x2c168e}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x2c168e,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x588c51){const _0x21d44b=new _0xb61eac('ai-chat-conversation-start-failed',null,{'message':_0x588c51['message']});_0x21d44b['stack']=_0x588c51['stack'],this['fire']('error',{'error':_0x21d44b});}}async['load'](_0x23e32c,_0x2cca58){try{const _0x11aac6=await this['connector']['fetchConversation'](_0x23e32c)['getConversation'](),_0x8eec2=await this['connector']['fetchConversationMessages'](_0x23e32c)['getMessages'](),_0x25f942=_0x8eec2[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x11aac6['id'],'title'in _0x11aac6?this['fire']('setConversationTitle',_0x11aac6['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x37b77=(await this['chatModels']['getAll']())['find'](_0x29c2ee=>_0x29c2ee['id']['toLowerCase']()===_0x25f942['toLowerCase']());return this['selectedModel']=_0x37b77,this['fire']('modelSelected',{'selectedModel':_0x37b77,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x8eec2,_0x2cca58,_0x25f942),this['currentInteraction']=void 0x0,this;}catch(_0x1c1e92){const _0x2f2fd6=new _0xb61eac('ai-chat-conversation-init-from-id-failed',null,{'message':_0x1c1e92['message'],'conversationId':_0x23e32c});throw _0x2f2fd6['stack']=_0x1c1e92['stack'],this['fire']('error',{'error':_0x2f2fd6}),_0x2f2fd6;}}async['_processMessagesToInteractions'](_0x2624c6,_0x4db5cf,_0x1c951f){let _0x4ba141;for(const _0x1e455c of _0x2624c6)if('user'===_0x1e455c['role']){const _0xeb818b=await this['_extractContextItems'](_0x1e455c),_0x319ae4={'isReasoningEnabled':Object['hasOwn'](_0x1e455c['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x1e455c['capabilities'],'webSearch')};_0x4ba141=this['createInteraction']({'userMessage':_0x1e455c['prompt'],'contextItems':_0xeb818b,'capabilities':_0x319ae4,'modelId':_0x1c951f,'quickActionData':_0x1e455c['attributes']?.['quickActionData']}),this['currentInteraction']=_0x4ba141,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x1e455c['role']&&_0x4ba141)for(const _0x2cec49 of _0x1e455c['content']){const _0x19090f='text'===_0x2cec49['type']?'text-delta':'modification-delta',_0x5bebda=_0x4ba141['getDocumentContext']()?.['sessionId']!==_0x4db5cf;_0x4ba141['currentReply']=_0x4ba141['createReply']({'type':_0x19090f,'isDone':!0x0,'interactionId':_0x4ba141['id'],'areActionsDisabled':_0x5bebda}),_0x4ba141['currentReply']['appendContent'](_0x2cec49['content']);}}}async['_extractContextItems'](_0x3fb201){const _0x355f8c=new Map();if(!_0x3fb201['content'])return _0x355f8c;for(const _0x5ff5a6 of _0x3fb201['content']){const _0x548702=await this['chatContext']['populateFromMessage'](_0x5ff5a6);_0x548702&&_0x355f8c['set'](_0x548702['id'],_0x548702);}return _0x355f8c;}async['handleUserInteraction']({userMessage:_0x416d42,quickActionData:_0xe4c16d}){if(!this['isStarted'])throw new _0xb61eac('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0xb61eac('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x4e4026=this['chatContext']['getPendingContextItems'](),_0x270df6=this['chatCapabilities']['getCapabilitiesConfig'](),_0x3f6332=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x416d42,'contextItems':_0x4e4026,'capabilities':_0x270df6,'modelId':_0x3f6332,'quickActionData':_0xe4c16d}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x19a702){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x19a702});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x5862e8,contextItems:_0xd9e2c2,capabilities:_0x20b1f3,modelId:_0x16bcfc,quickActionData:_0x4140ef}){const _0x3ce954=new Si({'userMessage':_0x5862e8,'contextItems':_0xd9e2c2,'capabilities':_0x20b1f3,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x16bcfc,'quickActionData':_0x4140ef});return _0x3ce954['delegate'](...Vt)['to'](this),this['interactions']['push'](_0x3ce954),this['fire']('interactionCreated',_0x3ce954),_0x3ce954;}['getInteraction'](_0x2e2628){return this['interactions']['find'](_0x159af3=>_0x159af3['id']===_0x2e2628);}['removeInteraction'](_0x13c248){const _0x594d8b=this['getInteraction'](_0x13c248);_0x594d8b&&(_0x594d8b['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x594d8b),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x16f033){this['chatContext']['addCurrentDocumentToContext'](_0x16f033);}async['updateCurrentDocumentInContext']({content:_0x5b745f,version:_0x3bc806,sessionId:_0x3468a3,selections:_0x3501e1}){await this['chatContext']['updateCurrentDocument'](_0x5b745f,_0x3bc806,_0x3468a3,_0x3501e1);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x5c48d9){this['chatContext']['addSelectionToContext'](_0x5c48d9);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x20e1ee){this['chatContext']['addFilesToContext'](_0x20e1ee);}['addUrlToContext'](_0x3faa63){this['chatContext']['addUrlToContext'](_0x3faa63);}['addResourceToContext'](_0x3211a0,_0x1ccfeb){this['chatContext']['addResourceToContext'](_0x3211a0,_0x1ccfeb);}['loadSourceResources'](_0x34c042,_0xe83423,_0x43478f){return this['chatContext']['loadSourceResources'](_0x34c042,_0xe83423,_0x43478f);}['removeFromContext'](_0x33b731){this['chatContext']['removeFromContext'](_0x33b731);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x243d63){_0x243d63?!0x1===await this['chatModels']['isAvailable'](_0x243d63)&&(_0x2398b2('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x243d63}),_0x243d63=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x2398b2('ai-chat-conversation-set-model-null',{'conversation':this}),_0x243d63=(await this['chatModels']['getAvailableModels']())[0x0]),_0x243d63['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x243d63,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x243d63}));}}function P(_0x4ae184){if(_0x4ae184 instanceof st)return _0x4ae184;if(_0x4ae184?.['editors']&&_0x4ae184['editors']['get'](0x0))return _0x4ae184['editors']['length']>0x1&&console['warn']('AIChat:\x20Multiple\x20editor\x20instances\x20detected.\x20Only\x20the\x20first\x20editor\x20instance\x20will\x20be\x20used\x20for\x20AI\x20operations.\x20This\x20configuration\x20is\x20not\x20fully\x20supported\x20and\x20may\x20lead\x20to\x20unexpected\x20behavior.'),_0x4ae184['editors']['get'](0x0);throw new _0xb61eac('ai-get-editor-from-context-no-editor');}const rt='ai-selection';class c extends _0x1bcf21{['_displayedFakeSelectionId']=null;['_displayedFakeSelectionLocked']=!0x1;['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x32d9a8=P(this['context']),_0x7d1878=_0x32d9a8['plugins']['has']('RealTimeCollaborationClient')&&_0x32d9a8['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x7d1878||_0x50fe7e();}return this['_sessionId'];}['getDocumentData'](){const _0x37fd29=P(this['context']),_0x2204af=_0x37fd29['model'],_0x56a92e=_0x37fd29['data']['toView'](_0x2204af['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x1994ee=new kt(_0x37fd29['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x56a92e,_0x1994ee);let _0x4ce3e2=_0x37fd29['data']['processor']['toData'](_0x56a92e);const _0x2a7470=this['_getMarkersInDocumentOrder'](),_0x1d3097=[];for(const _0x66e112 of _0x2a7470){const _0xdb27a8='<'+_0x66e112['name']+':start></'+_0x66e112['name']+':start>',_0x14ce3e=_0x4ce3e2['indexOf'](_0xdb27a8);_0x4ce3e2=_0x4ce3e2['substring'](0x0,_0x14ce3e)+_0x4ce3e2['substring'](_0x14ce3e+_0xdb27a8['length']);const _0x59e6ce='<'+_0x66e112['name']+':end></'+_0x66e112['name']+':end>',_0x419099=_0x4ce3e2['indexOf'](_0x59e6ce);_0x4ce3e2=_0x4ce3e2['substring'](0x0,_0x419099)+_0x4ce3e2['substring'](_0x419099+_0x59e6ce['length']),_0x1d3097['push']({'markerName':_0x66e112['name'],'start':_0x14ce3e,'end':_0x419099,'htmlFragment':_0x4ce3e2['substring'](_0x14ce3e,_0x419099)});}return{'content':_0x4ce3e2,'version':_0x37fd29['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x1d3097};}async['afterInit'](){this['context']instanceof st?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0xd48a0,_0x43f5a4)=>{_0x43f5a4['on']('ready',()=>{this['_integrateEditor'](_0x43f5a4);});});}['_integrateEditor'](_0x1e997d){_0x1e997d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':rt,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x1e997d['conversion']['for']('dataDowncast')['markerToElement']({'model':rt,'view':(_0x1dbe67,{writer:_0x530200,options:_0x18735a})=>_0x18735a['convertAiChatSelectionMarker']?_0x530200['createUIElement'](_0x1dbe67['markerName']+':'+(_0x1dbe67['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x5854f8,_0x2d9e0e,_0x49d6ad=!0x1,_0x4bb251=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x4bb251)return!0x1;const _0x45c818=P(this['context'])['model'];return _0x45c818['change'](_0x1a9c56=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x2d9e0e,this['_displayedFakeSelectionLocked']=_0x49d6ad;let _0x174a73=0x0;for(let _0x50bc73 of _0x5854f8){const _0x20fb28=rt+':'+_0x174a73;if(_0x50bc73['start']['isAtEnd']){const _0xa982df=_0x50bc73['start']['getLastMatchingPosition'](({item:_0x17c860})=>!_0x45c818['schema']['isContent'](_0x17c860),{'boundaries':_0x50bc73});_0x50bc73=_0x1a9c56['createRange'](_0xa982df,_0x50bc73['end']);}_0x1a9c56['addMarker'](_0x20fb28,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x50bc73}),_0x174a73++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x22a0e5){if(this['_displayedFakeSelectionId']!=_0x22a0e5)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x5b113a=P(this['context']),_0x5ab165=_0x5b113a['model']['markers']['getMarkersGroup'](rt);return _0x5b113a['model']['change'](_0x52a437=>{for(const _0x419e81 of _0x5ab165)_0x52a437['removeMarker'](_0x419e81);}),!0x0;}['modelToViewWithIds'](_0x20fb8a){const _0x1639a8=P(this['context']),_0x4e8d83=_0x1639a8['data']['toView'](_0x20fb8a),_0x276f4c=new kt(_0x1639a8['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x4e8d83,_0x276f4c),_0x4e8d83;}['_setDataIdsOnChildren'](_0x1a4913,_0x1388c2){let _0x112df6=!0x1;const _0x36807e=new Set();for(const _0x2560b7 of _0x1a4913['getChildren']()){const _0x3e8854=_0x2560b7['is']('emptyElement')||_0x2560b7['is']('containerElement');if(!_0x2560b7['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x2560b7,_0x1388c2)||_0x3e8854)&&(_0x1388c2['setAttribute']('data-id',this['_nextDataId'](_0x36807e),_0x2560b7),_0x112df6=!0x0);}return _0x112df6;}['_nextDataId'](_0xf01cc7){let _0x1f956c;do{_0x1f956c='';for(let _0x41507d=0x0;_0x41507d<0x4;_0x41507d++)_0x1f956c+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0xf01cc7['has'](_0x1f956c));return _0xf01cc7['add'](_0x1f956c),_0x1f956c;}['getSelectionText'](){const {model:_0x518e87}=P(this['context']),_0x2c2c82=_0x518e87['document']['selection'],_0x5ed533=_0x518e87['getSelectedContent'](_0x2c2c82),_0x318ae4=[],_0x37d97f=_0x518e87['createRangeIn'](_0x5ed533)['getWalker']();for(const {item:_0x34237e}of _0x37d97f)_0x34237e['is']('$textProxy')?_0x318ae4['push'](_0x34237e['data']):_0x34237e['is']('element')&&_0x318ae4['length']>0x0&&'\x20'!==_0x318ae4[_0x318ae4['length']-0x1]&&_0x318ae4['push']('\x20');return'\x22'+_0x318ae4['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0xa86a14=P(this['context'])['model'];return Array['from'](_0xa86a14['markers']['getMarkersGroup'](rt))['sort']((_0x45c54f,_0x290afa)=>_0x45c54f['getStart']()['isBefore'](_0x290afa['getStart']())?-0x1:_0x45c54f['getStart']()['isAfter'](_0x290afa['getStart']())?0x1:0x0);}}const k=['applySuggestion','insertSuggestion','showChangeInText'];class nh extends _0x262350{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0x2ceda3,_0xca73be){super(_0x2ceda3),this['_dropdownOriginalConfig']=_0xca73be||[...k],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x160ba4=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x948671({'label':Hn('applySuggestion',_0x2ceda3,this['_partsCount']),'icon':_0xb9bffe,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x948671({'label':Hn('showChangeInText',_0x2ceda3,this['_partsCount']),'icon':_0x47de8d,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x948671({'label':Hn('insertSuggestion',_0x2ceda3,this['_partsCount']),'icon':_0x199daf,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x2ceda3),this['children']=this['createCollection'](),this['actionsButton']&&this['children']['add'](this['actionsButton']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x160ba4['if']('isVisible','ck-hidden',_0x5237d4=>!_0x5237d4)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x28844e=>'applySuggestion'!==_0x28844e):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0x2ceda3);});}['_updateDropdownActions'](_0x194009){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x194009),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x49398a){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0x55be19=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x49398a):this['_createActionsDropdown'](_0x49398a),_0x56d327=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0x55be19['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x49398a,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x49398a,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0x56d327});for(const _0x2844ca of this['_dropdownCurrentConfig'])_0x55be19['on'](_0x2844ca,()=>{this['fire'](_0x2844ca);});return this['_firstRender']=!0x1,_0x55be19;}['_createActionsButton'](_0x5b0639){const _0x9cc3f2=new _0x3d6e77(_0x5b0639);return _0x9cc3f2['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x9cc3f2['on']('execute',()=>{_0x9cc3f2['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x9cc3f2;}['_createActionsDropdown'](_0x2ed5e0){const _0x4b4a45=new Gn(_0x2ed5e0,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x4386a3=>{switch(_0x4386a3){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x4b4a45['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x2ed5e0,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x2ed5e0,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x4b4a45['bind']('isEnabled')['to'](this),_0x4b4a45;}['updateLabels'](_0x3f989d){const _0x292dc8=this['locale'];this['_partsCount']=_0x3f989d||this['_partsCount'],this['actionsButton']['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x292dc8,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x292dc8,this['_partsCount'])}),this['applySuggestionModel']['label']=Hn('applySuggestion',_0x292dc8,this['_partsCount']),this['showChangeInTextModel']['label']=Hn('showChangeInText',_0x292dc8,this['_partsCount']),this['insertSuggestionModel']['label']=Hn('insertSuggestion',_0x292dc8,this['_partsCount']);}}class Gn extends _0xd26e7b{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x4c526a,_0xfe2f22){super(_0x4c526a),this['balloonPanelView']=new _0x51cd8c(this['locale']),this['bodyCollection']=new qt(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0xfe2f22['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',C(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0x515628=_0xfe2f22['listItemModels'][0x0]['actionName'];this['fire'](_0x515628),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?yn:Pn]}),this['listView']['focus']());}),_0x3bd809({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x50369d){const _0x5075ef=this['locale'],_0x52918a=new _0x4a993d(_0x5075ef);for(const _0x47ce89 of _0x50369d){const _0x5f5ccc=new _0x321758(_0x5075ef),_0x50a288=new _0x299f96(_0x5075ef);_0x50a288['bind'](...Object['keys'](_0x47ce89))['to'](_0x47ce89),_0x50a288['delegate']('execute')['to'](_0x52918a),_0x5f5ccc['children']['add'](_0x50a288),_0x52918a['items']['add'](_0x5f5ccc);}return _0x52918a['items']['delegate']('execute')['to'](this),_0x52918a['on']('execute',_0x4c811c=>{const _0x4d829a=_0x4c811c['source'];this['fire'](_0x4d829a['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x52918a;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x25a17d(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x23a7ad,_0x44dcf)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x44dcf();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function yn(_0x4f4187){return{'top':_0x4f4187['bottom'],'left':_0x4f4187['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function Pn(_0xef555d,_0x3ebeb8){return{'top':_0xef555d['bottom'],'left':_0xef555d['left']-(_0x3ebeb8['width']-_0xef555d['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Hn(_0x17ac1b,_0x4bffe9,_0x409704){switch(_0x17ac1b){case'applySuggestion':return C(_0x4bffe9,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x409704);case'showChangeInText':return C(_0x4bffe9,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x409704);case'insertSuggestion':return C(_0x4bffe9,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x409704);}}function Ln(_0x3bde53,_0x45096c,_0x4ef610){switch(_0x3bde53){case'applySuggestion':return C(_0x45096c,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x4ef610);case'showChangeInText':return C(_0x45096c,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x4ef610);case'insertSuggestion':return C(_0x45096c,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x4ef610);}}class ki extends _0x2ebfa6(){['_connector'];['_availableModels'];['_defaultModelId'];['_modelList']=[];constructor({connector:_0xc20024,availableModels:_0x545b7c,defaultModelId:_0x1d8331}){super(),this['_connector']=_0xc20024,this['_availableModels']=_0x545b7c,this['_defaultModelId']=_0x1d8331;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x1628a0=this['_connector']['getModels'](),_0x24b0f4=await _0x1628a0['list']();this['_modelList']=_0x24b0f4['items'];}catch(_0x348c84){throw new _0xb61eac('ai-models-unable-to-retrieve',null,{'error':_0x348c84});}return[...this['_modelList']];}async['getAvailableModels'](){const _0x2efafd=await this['getAll']();return this['_filterModels'](_0x2efafd,this['_availableModels']);}async['getModel'](_0x2440ba){const _0x6fde14=await this['getAll']();if(!_0x6fde14['length'])return null;if(_0x2440ba){const _0x135d08=this['_getModelById'](_0x6fde14,_0x2440ba);if(_0x135d08)return _0x135d08;_0x2398b2('ai-chat-model-id-unrecognized',{'modelId':_0x2440ba,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x879afc=await this['getAvailableModels']();if(!_0x879afc['length'])return null;if(this['_defaultModelId']){const _0x1f2e31=this['_getModelById'](_0x879afc,this['_defaultModelId']);if(_0x1f2e31)return _0x1f2e31;_0x2398b2('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x879afc[0x0]['id']});}return _0x879afc[0x0];}async['isAvailable'](_0x23e18f){return(await this['getAvailableModels']())['some'](_0x4ce926=>_0x4ce926['name']===_0x23e18f['name']&&_0x4ce926['provider']===_0x23e18f['provider']);}['_filterModels'](_0x18713a,_0x65069){let _0x3e540c;if(_0x65069){_0x3e540c=[];const _0x54a8a9='string'==typeof _0x65069?[_0x65069['toLocaleLowerCase']()]:_0x65069['map'](_0x197e9b=>_0x197e9b['toLocaleLowerCase']());for(const _0x2657b4 of _0x54a8a9)for(const _0x18827e of _0x18713a)(_0x18827e['id']['toLocaleLowerCase']()===_0x2657b4||_0x18827e['name']['toLocaleLowerCase']()===_0x2657b4||Me(_0x18827e)&&'auto'===_0x2657b4||_0x18827e['provider']['toLocaleLowerCase']()===_0x2657b4||_0x18827e['id']['toLocaleLowerCase']()['startsWith'](_0x2657b4))&&_0x3e540c['push'](_0x18827e);}else _0x3e540c=_0x18713a;return _0x3e540c;}['_getModelById'](_0x38528f,_0x20bcbf){return _0x38528f['find'](_0x4d2470=>Me(_0x4d2470)&&'auto'===_0x20bcbf?_0x4d2470:_0x4d2470['id']===_0x20bcbf)||null;}static['getLocalized'](_0x258f38,_0x275c47){return _0x275c47['map'](_0x46062f=>{if(Me(_0x46062f))_0x46062f['name']=C(_0x258f38,'AI_MODEL_NAME_AUTO'),_0x46062f['description']=C(_0x258f38,'AI_MODEL_DESCRIPTION_AUTO');else C(_0x258f38,'AI_MODEL_DESCRIPTION_'+_0x46062f['id']['toUpperCase']())['startsWith']('AI_MODEL_DESCRIPTION_')||(_0x46062f['description']=C(_0x258f38,'AI_MODEL_DESCRIPTION_'+_0x46062f['id']['toUpperCase']()));return _0x46062f;});}}function Me(_0x3cd09f){return _0x3cd09f['id']['startsWith']('agent');}class ht extends ki{async['getAll'](){return(await super['getAll']())['sort']((_0x47c58d,_0x23512f)=>{const _0x45f8aa=Object['values'](_0x47c58d['capabilities'])['filter'](_0x5d9419=>_0x5d9419['enabled'])['length'];return Object['values'](_0x23512f['capabilities'])['filter'](_0x50aa46=>_0x50aa46['enabled'])['length']-_0x45f8aa;});}}function v({editor:_0x3d2b11,interaction:_0x2536b2,reply:_0x9b6eed,groups:_0x1e942a,transform:_0xf4b06d,documentCompare:_0xb980ab,documentCompareOptions:_0x55a112}){const _0x2e67e1=_0x2536b2['getDocumentContext']();if(!_0x2e67e1)return[];const _0x5e29e3=_0x2e67e1['content'],_0xcd9073=_0x2e67e1['version'],_0x54bd34=_0x9b6eed['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x13c380}of _0x1e942a){const _0x5bd284=_0x13c380['filter'](_0x25980e=>'new'!=_0x25980e['type'])['map'](_0x277642=>ft('data-id',_0x277642['id'],_0x54bd34)),_0x35f72f=_0x13c380['filter'](_0x10d1d9=>'removed'!=_0x10d1d9['type'])['map'](_0x4c035d=>_0x4c035d['node']['cloneNode'](!0x0));let _0xe915b5=null;if(_0x5bd284['length']){_0xe915b5=_0x5bd284[0x0]['previousSibling'];for(let _0x5ec4e7=0x0;_0x5ec4e7<_0x5bd284['length'];_0x5ec4e7++)_0x462fa1(_0x5bd284[_0x5ec4e7]);}if(_0x35f72f['length']){_0xe915b5||(_0x13c380[0x0]['anchorId']?_0xe915b5=ft('data-id',_0x13c380[0x0]['anchorId'],_0x54bd34):(_0xe915b5=_0x35f72f['shift'](),_0x15972e(_0x54bd34,_0xe915b5)));for(let _0x49f68f=0x0;_0x49f68f<_0x35f72f['length'];_0x49f68f++)_0x44af25(_0xe915b5,_0x35f72f[_0x49f68f]),_0xe915b5=_0x35f72f[_0x49f68f];}}const _0x21856e=ut(_0x54bd34),_0x230262=_0xb980ab['getDiff'](_0x5e29e3,_0x21856e,_0x55a112)['getOperations']();if(_0xf4b06d){const _0x5cc3b8=_0x3d2b11['model']['document']['history']['getOperations'](_0xcd9073),_0x578888={'document':_0x3d2b11['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x226818(_0x230262,_0x5cc3b8,_0x578888)['operationsA'];}return _0x230262;}function b(_0x1e5c78,_0x45fd16){if('marker'!=_0x45fd16['type'])return;const _0x5cc939=_0x1e5c78['model']['markers']['get'](_0x45fd16['name']);_0x5cc939&&(_0x45fd16['oldRange']=_0x5cc939['getRange']());}class Vr extends _0x427ffd{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0xf0df70,_0x4a086c={},_0xce7f28){super(_0xf0df70),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x4a086c};const _0x111ee4=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x111ee4?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](_0xce7f28),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['_setupRatingButtons'](){this['likeButton']=new _0x3d6e77(this['locale']),this['likeButton']['set']({'icon':_0x5c6ba3,'label':C(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x548916=>!_0x548916),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x3d6e77(this['locale']),this['dislikeButton']['set']({'icon':_0x3816ea,'label':C(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3a4e7f=>!_0x3a4e7f),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x3d6e77(this['locale']),this['copyButton']['set']({'icon':_0x287257,'label':C(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5e637f=>!_0x5e637f);const _0x1a6cde=new _0x3a2ec3();_0x1a6cde['set']({'content':_0x223d65}),_0x1a6cde['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied',setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button';},0x7d0);}),this['copyButton']['children']['add'](_0x1a6cde);}['_setupShowChangesButton'](_0x42c89a){this['showChangesButton']=new _0x3d6e77(this['locale']),this['showChangesButton']['set']({'icon':_0xd2a692,'label':C(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0x42c89a}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5769c9=>!_0x5769c9),this['showChangesButton']['on']('execute',()=>{const _0x346399=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x346399,'icon':_0x346399?_0x58b84a:_0xd2a692}),this['fire']('toggleShowChanges',_0x346399);});}}class Lr extends _0x262350{['showChangesToggleView'];constructor(_0x4fea63,_0x29a96c){super(_0x4fea63),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Yr(_0x4fea63),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':C(_0x4fea63,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x29a96c['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x61c5f0=>_0x61c5f0?_0x1300c4:_0x3e637d),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x106431=new _0x3a2ec3();_0x106431['content']=_0x2a33e9,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x29a96c['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x106431,{'tag':'span','children':[C(_0x4fea63,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Yr extends _0x3d6e77{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x33928e){this['options']={'delay':_0x33928e['delay']??0x14,'textNodeStyle':_0x33928e['textNodeStyle'],'onStreamUpdate':_0x33928e['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x332118,targetElement:_0x236336,abortSignal:_0x481d16}){this['isStreaming']&&this['stop'](),_0x481d16?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x16a7a4(_0x332118,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x2398b2('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x3ad35e=0x0;_0x3ad35e<this['currentIndex'];_0x3ad35e++)this['nodesList'][_0x3ad35e]['shouldBeStreamed']=!0x0;let _0x1c7a5c=0x0;for(let _0x305cb0=this['currentIndex'];_0x305cb0<this['nodesList']['length'];_0x305cb0++){const _0x24c2d4=Date['now'](),_0x51c20b=this['nodesList'][_0x305cb0],_0x436325=_0x24c2d4-_0x1c7a5c;_0x51c20b['shouldBeStreamed']=!0x0;let _0xc9565a=_0x51c20b['parent'];for(;_0xc9565a;)_0xc9565a['shouldBeStreamed']=!0x0,_0xc9565a=_0xc9565a['parent'];if(_0x436325<this['options']['delay'])try{const {promise:_0x35024e,abortController:_0x7bc25c}=pr(this['options']['delay']-_0x436325);this['timeoutAbortController']=_0x7bc25c,await _0x35024e;}catch(_0x226527){return;}_0x20dcf6(_0x236336,'<'+_0x236336['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x236336['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x305cb0,_0x1c7a5c=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x9ce9a3}){Array['from'](_0x9ce9a3['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x1c8626=>{_0x1c8626['replaceWith'](_0x1c8626['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x236fae){let _0x220ad0='';if(function(_0x5e1a0b){return _0x2f796e(_0x5e1a0b);}(_0x236fae)){for(const _0x294ac7 of _0x236fae['children'])_0x220ad0+=this['renderNode'](_0x294ac7);}else{if(dr(_0x236fae)){if(!_0x236fae['shouldBeStreamed'])return'';const _0x56c433=_0x236fae,_0x3aee71=Object['entries'](_0x56c433['attribs'])['map'](([_0x505260,_0x75745e])=>_0x505260+'=\x22'+_0x75745e+'\x22')['join']('\x20');_0x220ad0+='<'+_0x56c433['tagName']+(_0x3aee71?'\x20'+_0x3aee71:'')+'>';for(const _0x30b174 of _0x36fc4e(_0x56c433))_0x220ad0+=this['renderNode'](_0x30b174);_0x220ad0+='</'+_0x56c433['tagName']+'>';}else{if(!ar(_0x236fae))return'';if(!_0x236fae['shouldBeStreamed'])return'';!function(_0x5e6c94){if(!_0x5e6c94['parent']||!dr(_0x5e6c94['parent']))return!0x1;if(!cr['includes'](_0x5e6c94['parent']['tagName']))return!0x1;return!_0x1cfcc2(_0x5e6c94)['match'](/^\s*[<>]\s*$/);}(_0x236fae)?_0x220ad0+=_0x20aeb7(_0x236fae):_0x220ad0+=_0x20aeb7(new _0x2708d9('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x236fae]));}}return _0x220ad0;}['getParsedDocumentNodeList'](){const _0x4d5332=[];return function(_0x346ed9,_0xa4c217){const _0x396bb4=_0x26d02a=>{if(_0xa4c217(_0x26d02a),_0x26d02a instanceof _0x1f43c2)for(let _0x309450=0x0;_0x309450<_0x26d02a['children']['length'];_0x309450++){const _0x538aa9=_0x26d02a['children'][_0x309450];_0x396bb4(_0x538aa9);}};for(let _0x3ee8d2=0x0;_0x3ee8d2<_0x346ed9['children']['length'];_0x3ee8d2++)_0x396bb4(_0x346ed9['children'][_0x3ee8d2]);}(this['document'],_0x5a9f0d=>{if(ar(_0x5a9f0d)){const _0x8be305=this['splitTextNodeIntoWordNodes'](_0x5a9f0d);_0x8be305['length']&&_0x4d5332['push'](..._0x8be305);}_0x5a9f0d['isWordSplitSource']||_0x5a9f0d['isWordSplitResult']||_0x4d5332['push'](_0x5a9f0d);}),_0x4d5332;}['splitTextNodeIntoWordNodes'](_0xebdf86){if(_0xebdf86['isWordSplitSource']||_0xebdf86['isWordSplitResult'])return[];const _0x28303a=_0x1cfcc2(_0xebdf86)['match'](/(?:\s*\S+\s*)/g),_0x52eb94=[];if(_0x28303a&&_0x28303a['length']>0x1){for(const _0x4f06d7 of _0x28303a){const _0x3dc4bd=new _0x54e177(_0x4f06d7);_0x3dc4bd['isWordSplitResult']=!0x0,_0x56a186(_0xebdf86,_0x3dc4bd),_0x52eb94['push'](_0x3dc4bd);}_0xebdf86['isWordSplitSource']=!0x0,_0x462fa1(_0xebdf86);}return _0x52eb94;}}const cr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ar(_0x453f6c){return _0x44d02d(_0x453f6c);}function dr(_0x196332){return _0x32c662(_0x196332);}function pr(_0x10ecaf){const _0x5bdffe=new AbortController();return{'promise':new Promise((_0x1b9584,_0x45e1b5)=>{const _0x46b2c2=setTimeout(_0x1b9584,_0x10ecaf);_0x5bdffe['signal']['addEventListener']('abort',()=>{clearTimeout(_0x46b2c2),_0x45e1b5();});}),'abortController':_0x5bdffe};}const Te=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends _0x262350{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x5e8ef3,{part:_0x2eb505,uiIndex:_0x5b15df,areActionsDisabled:_0x252ea7,availableActions:_0x129345}){super(_0x5e8ef3),this['set']('partDefinition',_0x2eb505),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x4bcf59=>'pending'==_0x4bcf59&&!_0x252ea7),this['children']=this['createCollection'](),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Un(_0x5e8ef3,{'part':_0x2eb505,'uiIndex':_0x5b15df,'availableActions':_0x129345}),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Te)['to'](this);const _0x43010c=this['bindTemplate'];this['contentView']=new _0x262350(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x43010c['to']('state',_0x593262=>'ck-ai-suggestion__body__content-part_'+_0x593262),_0x43010c['to']('isEnabled',_0x3781e7=>_0x3781e7?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x43010c['if']('isVisible','ck-hidden',_0x32956d=>!_0x32956d)]},'children':this['children'],'on':{'mouseenter':_0x43010c['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x2eb505['index']});}),'mouseleave':_0x43010c['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x2eb505['index']});})}});}async['updateContent']({part:_0x40a9dc,renderingStrategy:_0x3a56cb,showUnchangedParts:_0x1d3c71=!0x1,abortSignal:_0x16c1f2}){this['partDefinition']=_0x40a9dc,this['isVisible']=this['partDefinition']['hasChanges']||_0x1d3c71,this['isVisible']&&('streaming'===_0x3a56cb?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x16c1f2}):this['contentView']['element']['innerHTML']=ut(this['partDefinition']['content']));}['toggleHeader'](_0x5f095b){_0x5f095b?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Un extends _0x262350{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0x43d192,{part:_0x33907f,uiIndex:_0x1b52ff,availableActions:_0x5b1dc8}){super(_0x43d192),this['set']('partDefinition',_0x33907f),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x196e27=new _0x3a2ec3();_0x196e27['content']=_0x4d2f65,_0x196e27['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x379f8c=[];if(_0x5b1dc8['includes']('showChangeInText')){const _0x26a804=new _0x3d6e77(_0x43d192);_0x26a804['set']({'label':C(_0x43d192,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x47de8d}),_0x26a804['bind']('isEnabled')['to'](this),_0x26a804['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x33907f['index']});}),_0x379f8c['push'](_0x26a804);}if(_0x5b1dc8['includes']('insertSuggestion')){const _0x2c9205=new _0x3d6e77(_0x43d192);_0x2c9205['set']({'label':C(_0x43d192,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x199daf}),_0x2c9205['bind']('isEnabled')['to'](this),_0x2c9205['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x33907f['index']});}),_0x379f8c['push'](_0x2c9205);}const _0x62333d=new _0x3d6e77(_0x43d192);_0x62333d['set']({'label':C(_0x43d192,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x3d606e}),_0x62333d['bind']('isEnabled')['to'](this),_0x62333d['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x33907f['index']});}),_0x379f8c['push'](_0x62333d),this['_toolbarView']=new _0x427ffd(_0x43d192),this['_toolbarView']['items']['addMany'](_0x379f8c),this['_iconStateAccepted']=new _0x3a2ec3(),this['_iconStateAccepted']['content']=_0x51e75b,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':C(_0x43d192,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x3a2ec3(),this['_iconStateRejected']['content']=_0x175e95,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':C(_0x43d192,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x3a2ec3(),this['_iconStateOutdated']['content']=_0x175e95,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':C(_0x43d192,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x570ba3=new _0x262350(_0x43d192);_0x570ba3['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[C(_0x43d192,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x1b52ff['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x196e27,_0x570ba3,this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x4d2972,_0xc9c021,_0x27c62b,_0x2cb3ae)=>{switch(_0x2cb3ae){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);break;case'outdated':this['children']['remove'](this['_iconStateOutdated']);}switch(_0x27c62b){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);break;case'outdated':this['children']['add'](this['_iconStateOutdated']);}});}}class _ extends _0x2ebfa6(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x103d7e){const _0x324fd5=this['createTask'](_0x103d7e);return this['queue']['push'](_0x324fd5),this['_processQueue'](),_0x324fd5['completePromise'];}['abort'](){this['isProcessing']&&(this['_abortController']['abort'](),this['_abortController']=void 0x0,this['queue']=[],this['fire']('_queueEmpty'),this['isProcessing']=!0x1);}get['queueEmptyPromise'](){return this['queue']['length']||this['isProcessing']?new Promise(_0x119704=>{this['once']('_queueEmpty',()=>{_0x119704();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x45e3fa=this['queue']['shift']();try{await _0x45e3fa['callback'](this['_abortController']['signal']),_0x45e3fa['resolve']();}catch(_0x1eb6b0){_0x45e3fa['reject'](_0x1eb6b0);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x4bb45d){let _0x232173,_0x264534;const _0x54219b=new Promise((_0x2f0afc,_0x3c1ffb)=>{_0x232173=_0x2f0afc,_0x264534=_0x3c1ffb;});return{'callback':_0x4bb45d,'resolve':_0x232173,'reject':_0x264534,'completePromise':_0x54219b};}}class jr extends _0x262350{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x1b599d){super();const _0xd2d2d3=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x1b599d,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0xd2d2d3['if']('isDone','ck-ai-chat__feed__item_done'),_0xd2d2d3['if']('isVisible','ck-hidden',_0x235837=>!_0x235837),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){this['htmlStreamer']['cleanUpAnimations']({'targetElement':this['element']}),this['element']['querySelectorAll']('[data-id]')['forEach'](_0x4d73bd=>{_0x4d73bd['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x33b55f,_0x553d95,_0xb29ae0){await this['htmlStreamer']['stream']({'document':_0x33b55f,'targetElement':_0x553d95,'abortSignal':_0xb29ae0});}}class _e extends jr{constructor(_0x228033){super(_0x228033),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0x228033['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x4716e7){this['element']['innerHTML']=_0x4716e7;}}class Dr extends _0x262350{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x3e5f0f,_0x30638a){super(_0x3e5f0f);const {areActionsDisabled:_0x1749b6,showUnchangedParts:_0xfc9413,availableActions:_0x386c70}=_0x30638a;this['_areActionsDisabled']=_0x1749b6,this['_showUnchangedParts']=_0xfc9413,this['_availableActions']=_0x386c70,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new _(),this['_emptyPartsWarningView']=new _e({'id':'empty-parts-warning','initialContent':C(_0x3e5f0f,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x23bd77,renderingStrategy:_0x375bad,abortSignal:_0x1fba0c}){this['_children']['length']?_0x23bd77['forEach'](_0x48840e=>{const _0x2e0732=this['_cachedContentParts']['findIndex'](_0xb824a8=>_0xb824a8['index']==_0x48840e['index']);-0x1===_0x2e0732?this['_cachedContentParts']['push'](_0x48840e):this['_cachedContentParts'][_0x2e0732]=_0x48840e;}):this['_cachedContentParts']=_0x23bd77;for(const _0x5e6b27 of _0x23bd77['filter'](_0x3da01c=>_0x3da01c['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x5bba5b=>{let _0x1c66c8=this['getPartView'](_0x5e6b27['index']);_0x1c66c8||(_0x1c66c8=new na(this['locale'],{'part':_0x5e6b27,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x1c66c8['delegate'](...Te)['to'](this),this['_children']['add'](_0x1c66c8),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x1c66c8['toggleHeader'](this['_children']['length']>0x1),await _0x1c66c8['updateContent']({'part':_0x5e6b27,'renderingStrategy':_0x375bad,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x5bba5b});});return _0x1fba0c?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x55b2ea,_0x32ad40){const _0x5064a6=this['getPartView'](_0x55b2ea);_0x5064a6&&(_0x5064a6['state']=_0x32ad40),this['hasPendingParts']='pending'==_0x32ad40||Array['from'](this['_children'])['some'](_0x445763=>'pending'==_0x445763['state']);}['getPartView'](_0x6dd44c){return this['_children']['find'](_0x36d085=>_0x36d085['partDefinition']['index']==_0x6dd44c)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x1ff0b9=!this['_cachedContentParts']['find'](({hasChanges:_0x4cee50})=>_0x4cee50),_0x43c16b=!!this['_cachedContentParts']['find'](({hasChanges:_0xee1dde})=>!_0xee1dde);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x43c16b,_0x1ff0b9?this['_emptyPartsWarningView']['setContent'](C(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](C(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x2a2966=>_0x2a2966['partDefinition']['hasChanges']);}}class Le extends _0x449591{constructor(_0x1838b9=void 0x0){super();const _0x1cb36c=_0x1838b9?'ck-ai-spinner_'+_0x1838b9:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x1cb36c]}});}}class e extends _0x262350{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];constructor(_0x46db71,_0x2eae04){super(_0x46db71);const {showDiff:_0x59f5a9,areActionsDisabled:_0x24327c,miniToolbarConfig:_0x11d594,hideHeader:_0x2e286e,showLoader:_0x2ff26d,showUnchangedParts:_0x5027c1,availableActions:_0xe8390e}=_0x2eae04;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x2ff26d),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x2e286e||(this['headerView']=new Lr(_0x46db71,{'showDiff':_0x59f5a9}),this['headerView']['on']('toggleShowChanges',(_0x51e265,_0x4c9c79)=>{this['areChangesVisible']=_0x4c9c79['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x4c9c79['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Dr(_0x46db71,{'areActionsDisabled':_0x24327c,'showUnchangedParts':!!_0x5027c1,'availableActions':_0xe8390e}),this['bodyView']['delegate'](...Te)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Vr(_0x46db71,_0x11d594,_0x59f5a9),this['miniToolbarView']['delegate'](...Te)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x1502da,_0x4f927e)=>{this['areChangesVisible']=_0x4f927e,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x4f927e});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new Sr(this['locale']),this['children']['add'](this['sourcesView']),_0x2ff26d&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['errorView']=this['_createErrorView'](),this['children']['add'](this['errorView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x33cea2){await this['bodyView']['updateContentParts'](_0x33cea2);}['updateSources'](_0x446521){this['sourcesView']['children']['addMany'](_0x446521['map'](_0x4e1eab=>new Fr(this['locale'],_0x4e1eab))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0xca37d9){if(this['errorView']){const _0x3dec39=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x3dec39&&(_0x3dec39['textContent']=_0xca37d9),this['isErrorVisible']=!0x0;}}['hideError'](){this['errorView']&&(this['isErrorVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x0),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x1);}['clearErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x1),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x0);}['addNavigationItem'](_0x345172){this['miniToolbarView']['items']['add'](_0x345172);}['removeNavigationItem'](_0x465eca){this['miniToolbarView']['items']['remove'](_0x465eca);}['_createLoaderView'](){const _0x4aac25=new _0x262350(this['locale']),_0x528de7=new Le('small');_0x528de7['isVisible']=!0x0;const _0x293b3c=new _0x262350(this['locale']);return _0x293b3c['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[C(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x4aac25['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0xd3a987=>!_0xd3a987)]},'children':[_0x528de7,_0x293b3c]}),_0x4aac25;}['_createErrorView'](){const _0x43f916=new _0x262350(this['locale']),_0xfd802d=new _0x262350(this['locale']);return _0xfd802d['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[C(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x43f916['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x5c6edd=>!_0x5c6edd)]},'children':[_0xfd802d]}),_0x43f916;}}class Sr extends _0x262350{['children'];constructor(_0x2570d6){super(_0x2570d6),this['children']=this['createCollection'](),this['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources',this['bindTemplate']['if']('isVisible','ck-hidden',_0x11f8e8=>!_0x11f8e8)]},'children':this['children']});const _0x1d6f57=new _0x262350(this['locale']),_0x3e4790=new _0x3a2ec3();_0x3e4790['content']=_0x533bf1,_0x1d6f57['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x3e4790,{'tag':'span','children':[{'text':C(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x1d6f57);}}class Fr extends _0x3d6e77{constructor(_0xffa7f,_0x18b3ad){super(_0xffa7f),this['set']({'label':_0x18b3ad['title'],'tooltip':_0x18b3ad['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x1cc566=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x1cc566['to'](()=>{window['open'](_0x18b3ad['url'],'_blank');})}}),_0x18b3ad['favicon']){const _0x24e077=new _0x262350(_0xffa7f);_0x24e077['setTemplate']({'tag':'img','attributes':{'src':_0x18b3ad['favicon']||_0x533bf1,'alt':_0x18b3ad['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x24e077);}else this['set']('icon',_0x533bf1);}}class es extends _0x427ffd{constructor(_0x4c3757,_0x5ba1f7=!0x0,_0x59bde4=!0x0){super(_0x4c3757),this['set']('isLoading',!0x1),_0x5ba1f7&&(this['applyButton']=this['_createButton'](C(_0x4c3757,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3b0d13=>!_0x3b0d13),this['items']['add'](this['applyButton'])),_0x59bde4&&(this['suggestButton']=this['_createButton'](C(_0x4c3757,'AI_BALLOON_SUGGEST_BUTTON'),_0x5ba1f7?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x4a8f46=>!_0x4a8f46),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x16b6ac,_0x5d4237){const _0x42b66b=new _0x3d6e77(this['locale']);return _0x42b66b['set']({'label':_0x16b6ac,'class':_0x5d4237||'','isVisible':!0x0,'withText':!0x0}),_0x42b66b;}}class os extends _0x262350{constructor(_0x5cd47a){super(_0x5cd47a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':C(_0x5cd47a,'AI_DISCLAIMER_TEXT')}]}]});}}const O=['applySuggestion','insertSuggestion','showNext','showPrevious'];class R extends _0x262350{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];constructor(_0x14245a,_0x207a10,_0x188d38,_0x3f74a7){super(_0x14245a),this['_availableActions']=_0x188d38,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x3f74a7),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new ts(),this['keystrokes']=new _0x25a17d(),this['_focusables']=this['createCollection'](),this['focusCycler']=new $t({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x2f454a(),this['_addContentView'](_0x207a10['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x207a10['showApplyButton'],_0x207a10['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_dialogContent']['remove'](this['toolbar']),this['_addToolbar'](_0x207a10['showApplyButton'],_0x207a10['showSuggestButton']);});}['render'](){super['render']();for(const _0x560142 of this['_focusables'])this['focusTracker']['add'](_0x560142['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x156d15){-0x1===_0x156d15?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x1c989f){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x1c989f,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0x19b67a){this['showError'](_0x19b67a);}['showBlockingError'](_0x2f3133){this['showError'](_0x2f3133),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x52676e){const _0x22e4d7=this['_createNextButtonView'](),_0x4b1cb0=this['_createPreviousButtonView']();_0x52676e['view']['headerView']['children']['add'](_0x22e4d7,0x2),_0x52676e['view']['headerView']['children']['add'](_0x4b1cb0,0x0),this['_focusables']['addMany']([_0x22e4d7,_0x4b1cb0]),this['focusTracker']['add'](_0x22e4d7['element']),this['focusTracker']['add'](_0x4b1cb0['element']);}['_addContentView'](_0x39386d){this['_mainView']=_0x39386d,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0x45258e){const _0x11f6de=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0x45258e,this['_dialogContent']['add'](this['_mainView'],_0x11f6de),this['hideError']();}['_addDisclaimerView'](){this['disclaimerView']=new os(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x3b5c99=!0x0,_0x1322df=!0x0){_0x3b5c99=_0x3b5c99&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x1322df=_0x1322df&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new es(this['locale'],_0x3b5c99,_0x1322df),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x4b4bd7=new _0x3d6e77(this['locale']);return _0x4b4bd7['set']({'icon':_0x3f932b,'tooltip':C(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x4b4bd7['on']('execute',()=>{this['fire']('showNext');}),_0x4b4bd7;}['_createPreviousButtonView'](){const _0x20b933=new _0x3d6e77(this['locale']);return _0x20b933['set']({'icon':_0x488fbf,'tooltip':C(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x20b933['on']('execute',()=>{this['fire']('showPrevious');}),_0x20b933;}['_createErrorView'](){const _0x3118d6=new _0x262350(this['locale']),_0x523707=new _0x262350(this['locale']);return _0x523707['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0x3118d6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x18aad0=>!_0x18aad0)]},'children':[_0x523707]}),_0x3118d6;}}const x=0xa;class w extends _0x1bcf21{static get['requires'](){return[s,c];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['_isUpdatingMarkers']=!0x1;['_pendingRenderCallback']=null;['open'](_0xb97eed){const _0x4d74d8=P(this['context']);if(this['_config']=_0xb97eed,this['isOpen'])return void this['_updateBalloon'](_0xb97eed);const _0x5cfba5=this['context']['config']['get']('ai.availableReplyActions')||[...k],_0x40cadd=_0x4d74d8?.['commands']['get']('trackChanges'),_0x3e3f55=_0x40cadd?.['value'];this['balloonView']=new R(_0x4d74d8['locale'],_0xb97eed,_0x5cfba5,!!_0x3e3f55),this['balloonView']['delegate'](...O)['to'](this),_0x40cadd&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x40cadd,'value'),this['_showDialog'](_0xb97eed);}['close'](){P(this['context'])['plugins']['get']('Dialog')['hide']();}['_updateBalloon'](_0x2e053c){const _0x3b0d99=P(this['context']),_0x47d408=_0x3b0d99['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x3b0d99['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x47d408['view']?.['headerView']&&(_0x47d408['view']['headerView']['label']=_0x2e053c['title'],_0x47d408['view']['headerView']['iconView']&&_0x2e053c['icon']&&(_0x47d408['view']['headerView']['iconView']['content']=_0x2e053c['icon'])),this['balloonView']['updateContent'](_0x2e053c['mainView']),this['_setupVisualSelection'](_0x2e053c['ranges'],_0x2e053c['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x47d408['view']&&_0x47d408['view']['updatePosition']();},_0x3b0d99['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0x5b5572,_0x3994c1){this['context']['plugins']['get'](c)['showFakeVisualSelection'](_0x5b5572,'ai-balloon-'+_0x3994c1,!0x0,!0x0);}['_showDialog'](_0x170a52){const _0x3d7b94=P(this['context']);this['_setupVisualSelection'](_0x170a52['ranges'],_0x170a52['index']);const _0x159dcc=this['_getSelectionElements']();_0x159dcc&&_0x159dcc[0x0]&&_0x568df9({'target':_0x159dcc[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0x3d7b94['plugins']['get']('Dialog')['show']({'title':_0x170a52['title'],'icon':_0x170a52['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x170a52['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x1e3449=>{_0x170a52['showRotator']&&this['balloonView']['setupRotator'](_0x1e3449),this['_setupMarkerRemovalListener'](),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+this['_config']['index']),this['_cleanupMarkerRemovalListener'](),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x575347,_0x23bc6d){if(!_0x23bc6d)return null;const _0x516abc=this['_getSelectionElements']();if(!_0x516abc||0x0===_0x516abc['length'])return{'left':Math['round'](_0x23bc6d['left']+_0x23bc6d['width']/0x2-_0x575347['width']/0x2),'top':Math['round'](_0x23bc6d['top']+_0x23bc6d['height']/0x2-_0x575347['height']/0x2)};const _0x158752=Math['round'](_0x23bc6d['left']+_0x23bc6d['width']/0x2-_0x575347['width']/0x2),_0xa1aabf=new _0x3863bd(_0x516abc[0x0]),_0x2967c0=new _0x3863bd(_0x516abc[_0x516abc['length']-0x1]),_0x412d62=_0x575347['height'],_0x90d9b5=this['_config']['showRotator']?0x8:0x0;return{'left':_0x158752,'top':this['_calculateOptimalTopPosition'](_0xa1aabf,_0x2967c0,_0x412d62,_0x90d9b5,_0x23bc6d)};}['_calculateOptimalTopPosition'](_0x125bb1,_0x15b1e0,_0x64023c,_0x14a1ce=0x0,_0x58f816){const _0x5908de=_0x64023c+_0x14a1ce,_0x55d4e1=new _0x3863bd(_0x43815f['window']),_0x69a36=[_0x125bb1['getVisible'](),_0x15b1e0['getVisible']()]['filter'](_0x578710=>_0x578710),_0x28198b=_0x3863bd['getBoundingRect'](_0x69a36);if(!_0x28198b)return Math['round'](_0x58f816['top']+_0x58f816['height']/0x2);const _0x825060=_0x55d4e1['getIntersection'](_0x28198b);if(!_0x825060)return Math['round'](_0x58f816['top']+_0x58f816['height']/0x2);const _0x1d3641=_0x58f816['getVisible'](),_0x4fd7a0=_0x1d3641&&_0x28198b['height']>_0x1d3641['height'],_0x2b47bf=_0x825060['top'],_0x565c6d=_0x825060['bottom'];if(_0x4fd7a0){const _0x496011=(_0x1d3641||_0x55d4e1)['height']/0x2-_0x5908de/0x2,_0x33de39=_0x2b47bf-x-_0x58f816['top'],_0x51f7cf=_0x58f816['bottom']-_0x565c6d-x;return _0x33de39>=_0x5908de?Math['max'](x,_0x2b47bf-_0x5908de-x):_0x51f7cf>=_0x5908de?_0x565c6d+x:Math['max'](x,_0x496011);}const _0x54e60b=_0x2b47bf-_0x5908de,_0x17027d=_0x58f816['bottom']-_0x565c6d-x,_0x29f926=_0x2b47bf-x-_0x58f816['top'];let _0x3b8262;if(_0x17027d>=_0x5908de)_0x3b8262=_0x565c6d+x;else{if(_0x29f926>=_0x5908de)_0x3b8262=_0x54e60b-x;else _0x3b8262=_0x2b47bf+_0x28198b['height']/0x2-_0x5908de/0x2;}return _0x3b8262;}['_setupMarkerRemovalListener'](){const _0x235375=P(this['context']);this['listenTo'](_0x235375['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x1af984,data:{newRange:_0x4657dd}}of _0x235375['model']['document']['differ']['getChangedMarkers']())if(_0x1af984['startsWith']('ai-selection:')&&(_0x4657dd&&(_0x4657dd['start']['isEqual'](_0x4657dd['end'])||'$graveyard'==_0x4657dd['root']['rootName'])||null==_0x4657dd)){const _0x2a004f=C(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x2a004f),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x546c11=P(this['context']);this['stopListening'](_0x546c11['model']['document']);}['_getSelectionElements'](){const _0x349abe=P(this['context']);return _0x1b6680(_0x349abe['editing'],[..._0x349abe['model']['markers']['getMarkersGroup']('ai-selection'),..._0x349abe['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class tt extends _0x1bcf21{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[s,w,_0x11fc7b];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new ht({'connector':this['_aiConnector'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId')});const _0x59d735=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x3ff4fe,_0x4fec28)=>{this['_handleUIUserMessage']({'userMessage':_0x4fec28});}),this['listenTo'](_0x59d735,'resizedTabs',(_0x54a7fe,_0x2c3847)=>{this['_setIsMaximized'](_0x2c3847);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x59d735['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x1e2aae,_0x1639ce)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x1639ce));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x24939d,_0x290a78)=>{this['activeConversation']?.['addUrlToContext'](_0x290a78);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x2610b6,_0x36811e)=>{this['activeConversation']?.['addResourceToContext'](_0x36811e['source'],_0x36811e['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x1fb0bf,_0x5c56d1)=>{this['_removeFromContext'](_0x5c56d1);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x3fddb4,_0x359971)=>{this['activeConversation']?.['loadSourceResources'](_0x359971['sourceId'],_0x359971['query'],_0x359971['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0xac5416,_0x3181d8)=>{this['activeConversation']?.['setModel'](_0x3181d8);}),this['listenTo'](this['_aiChatUi'],'like',(_0x21ef77,{replyId:_0x1d7cf6})=>{console['log']('Liked\x20response',_0x1d7cf6);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x10068c,{replyId:_0x2eaf45})=>{console['log']('Disliked\x20response',_0x2eaf45);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x418923,_0x5d6f8e)=>{this['context']['plugins']['get'](w)['close'](),this['_insertSuggestion'](_0x5d6f8e);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x177ce8,{replyId:_0x51d5a3,partIndex:_0x5995e6})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x51d5a3,_0x5995e6);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x5e8a7c,{replyId:_0x4f0ea3,partIndex:_0x4cc5d4})=>{const _0x4758b0=this['_getDocumentRangeForReplyChanges'](_0x4f0ea3,_0x4cc5d4);_0x4758b0&&'$graveyard'!=_0x4758b0['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x4758b0['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x2f7442,_0x6afa91)=>{this['context']['plugins']['get'](w)['close'](),this['_applySuggestion'](_0x6afa91);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x35d086,{replyId:_0x3c1b84,showDiff:_0x32528e})=>{const {reply:_0x8baa3b}=this['getInteractionAndReplyById'](_0x3c1b84),_0x2eaee7=_0x8baa3b['getContentParts']({'showDiff':_0x32528e});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x8baa3b['id'],'parts':_0x2eaee7,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x561605,{replyId:_0x260805,partIndex:_0x1e55bc})=>{this['_previewedChangeGroup']?.['replyId']==_0x260805&&this['_previewedChangeGroup']?.['partIndex']==_0x1e55bc&&this['context']['plugins']['get'](w)['close']();const {reply:_0x5e471b}=this['getInteractionAndReplyById'](_0x260805);_0x5e471b['setChangeGroupState'](_0x1e55bc,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof st?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x144c51,_0x329ef5)=>{_0x329ef5['on']('ready',()=>{this['_integrateEditor'](_0x329ef5);});}),await this['_startConversationSafely']();}['_insertSuggestion'](_0xdab57){const _0x1db86f=P(this['context']);if(!_0x1db86f['plugins']['has']('TrackChanges'))throw new _0xb61eac('ai-no-track-changes',null);const _0x442f29=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x26d704,interaction:_0x54810f}=this['getInteractionAndReplyById'](_0xdab57['replyId']),_0x28a07d=this['_getDocumentRangeForReplyChanges'](_0xdab57['replyId'],_0xdab57['partIndex']),_0x863051=void 0x0!==_0xdab57['partIndex']?[_0x26d704['changeGroups'][_0xdab57['partIndex']]]:_0x26d704['changeGroups']['filter'](_0x580a8f=>'pending'==_0x580a8f['state']),_0x4a218f=_0x863051['map'](_0x16c811=>_0x26d704['changeGroups']['indexOf'](_0x16c811));if(!_0x28a07d||'$graveyard'==_0x28a07d['range']['root']['rootName'])return void _0x4a218f['forEach'](_0x182527=>_0x26d704['setChangeGroupState'](_0x182527,'outdated'));_0x4a218f['forEach'](_0x41744c=>_0x26d704['setChangeGroupState'](_0x41744c,'accepted'));const _0x284682=v({'editor':_0x1db86f,'reply':_0x26d704,'interaction':_0x54810f,'groups':_0x863051,'transform':!0x0,'documentCompare':_0x442f29,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x488fac;_0x28a07d&&this['_scrollToSuggestionRange'](_0x28a07d['range']),_0x1db86f['model']['change'](_0x145a33=>{_0x488fac=_0x145a33['batch'],_0x1db86f['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x284682),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x488fac,{'interactionId':_0x54810f['id'],'replyId':_0x26d704['id'],'indexes':_0x4a218f['slice']()}),this['_updateRatings'](_0x26d704);}['_applySuggestion'](_0x58cda9){const _0x34be5a=P(this['context']),_0x29c10f=this['context']['plugins']['get'](_0x11fc7b),{reply:_0x10ca75,interaction:_0x42182d}=this['getInteractionAndReplyById'](_0x58cda9['replyId']),_0x424ff4=this['_getDocumentRangeForReplyChanges'](_0x58cda9['replyId'],_0x58cda9['partIndex']),_0x28d4eb=void 0x0!==_0x58cda9['partIndex']?[_0x10ca75['changeGroups'][_0x58cda9['partIndex']]]:_0x10ca75['changeGroups']['filter'](_0x599144=>'pending'==_0x599144['state']),_0x1698eb=_0x28d4eb['map'](_0xdc6f16=>_0x10ca75['changeGroups']['indexOf'](_0xdc6f16));if(!_0x424ff4||'$graveyard'==_0x424ff4['range']['root']['rootName'])return void _0x1698eb['forEach'](_0x1f1080=>_0x10ca75['setChangeGroupState'](_0x1f1080,'outdated'));_0x1698eb['forEach'](_0x43eced=>_0x10ca75['setChangeGroupState'](_0x43eced,'accepted'));const _0xfac64=v({'editor':_0x34be5a,'reply':_0x10ca75,'interaction':_0x42182d,'groups':_0x28d4eb,'transform':!0x0,'documentCompare':_0x29c10f,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x4f19af;_0x424ff4&&this['_scrollToSuggestionRange'](_0x424ff4['range']),_0x34be5a['model']['change'](_0x37613b=>{_0x4f19af=_0x37613b['batch'];for(const _0x320e7e of _0xfac64)_0x320e7e['baseVersion']=_0x34be5a['model']['document']['version'],b(_0x34be5a,_0x320e7e),_0x37613b['batch']['addOperation'](_0x320e7e),_0x34be5a['model']['applyOperation'](_0x320e7e);}),this['_batchToChanges']['set'](_0x4f19af,{'interactionId':_0x42182d['id'],'replyId':_0x10ca75['id'],'indexes':_0x1698eb['slice']()}),this['_updateRatings'](_0x10ca75);}['_openBalloonFor'](_0x13a637,_0x723331){const _0x11041c=P(this['context']),_0xe73406=this['_getDocumentRangeForReplyChanges'](_0x13a637,_0x723331),_0x84d466=this['context']['plugins']['get'](w);if(!_0xe73406)return void _0x84d466['close']();const {range:_0x1f62f8,currentIndex:_0x2885b0}=_0xe73406;if('$graveyard'==_0x1f62f8['root']['rootName']){const {reply:_0x3e9e89}=this['getInteractionAndReplyById'](_0x13a637);return _0x3e9e89['setChangeGroupState'](_0x2885b0,'outdated'),void _0x84d466['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x13a637&&this['_previewedChangeGroup']?.['partIndex']==_0x2885b0)return;this['stopListening'](_0x84d466),this['_previewedChangeGroup']={'replyId':_0x13a637,'partIndex':_0x2885b0};let _0x1274c9=_0x11041c['config']['get']('ai.availableReplyActions')||[...k];_0x11041c['plugins']['has']('TrackChanges')||(_0x1274c9=_0x1274c9['filter'](_0x2972fe=>'insertSuggestion'!=_0x2972fe));const _0x57e0c4=new e(_0x11041c['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x1274c9});this['stopListening'](_0x57e0c4);const {reply:_0x12620c}=this['getInteractionAndReplyById'](_0x13a637),_0x3844ed=_0x12620c['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x5c158e=>_0x5c158e['hasChanges']),_0xe3d0a6=_0x3844ed['findIndex'](_0x30c23a=>_0x30c23a['index']==_0x2885b0);if(-0x1==_0xe3d0a6)return;const _0x47ab01=_0x3844ed[_0xe3d0a6],_0x4b11fd=_0x3844ed['at']((_0xe3d0a6-0x1)%_0x3844ed['length'])?.['index'],_0x5a6990=_0x3844ed['at']((_0xe3d0a6+0x1)%_0x3844ed['length'])?.['index'];_0x57e0c4['updateContent']({'parts':[_0x47ab01],'renderingStrategy':'static'});const _0x414e4a=_0x2885b0!==_0x4b11fd;this['_scrollToSuggestionRange'](_0x1f62f8,!0x0),_0x84d466['open']({'index':_0x2885b0,'title':C(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0xe3d0a6+0x1)['toString']()),'icon':Ct,'mainView':_0x57e0c4,'showRotator':_0x414e4a,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':[_0x1f62f8]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x13a637,_0x2885b0),this['listenTo'](_0x57e0c4,'toggleSuggestionDisplayMode',(_0x12fae4,{showDiff:_0x3c6917})=>{this['_balloonShowDiff']=_0x3c6917;const {reply:_0x10de10}=this['getInteractionAndReplyById'](_0x13a637),_0x26b11d=_0x10de10['getContentParts']({'showDiff':_0x3c6917,'groupIndex':_0x2885b0});_0x57e0c4['updateContent']({'parts':_0x26b11d,'renderingStrategy':'static'});}),this['listenTo'](_0x84d466,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x13a637,'partIndex':_0x2885b0}),_0x414e4a?this['_openBalloonFor'](_0x13a637,_0x5a6990):_0x84d466['close']();}),this['listenTo'](_0x84d466,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x13a637,'partIndex':_0x2885b0}),_0x414e4a?this['_openBalloonFor'](_0x13a637,_0x5a6990):_0x84d466['close']();}),_0x414e4a&&(this['listenTo'](_0x84d466,'showNext',()=>{this['_openBalloonFor'](_0x13a637,_0x5a6990);}),this['listenTo'](_0x84d466,'showPrevious',()=>{this['_openBalloonFor'](_0x13a637,_0x4b11fd);})),this['listenTo'](_0x84d466,'dialogClosed',()=>{this['stopListening'](_0x84d466),this['stopListening'](_0x57e0c4),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x3316e6,_0x10cdcc){const _0x1e0716=P(this['context']),{reply:_0x810db6,interaction:_0x27a5bf}=this['getInteractionAndReplyById'](_0x3316e6),_0xc72d2a=_0x810db6['changeGroups']['filter'](_0x13b397=>'pending'==_0x13b397['state']),_0x398d41=_0xc72d2a['map'](_0x581228=>_0x810db6['changeGroups']['indexOf'](_0x581228));void 0x0===_0x10cdcc&&(_0x10cdcc=_0x398d41[0x0]);const _0x5d5f1a=_0x398d41['indexOf'](_0x10cdcc);if(-0x1==_0x5d5f1a)return null;const _0x2b0480=_0xc72d2a[_0x5d5f1a],_0x3bd183=new mt([]),_0x5119f5=new mt([]);for(const _0x3ee13b of _0x2b0480['changes'])if('removed'!=_0x3ee13b['type']&&_0x5119f5['children']['push'](_0x3ee13b['node']['cloneNode'](!0x0)),'new'!=_0x3ee13b['type']){const _0x407ab3=gt(_0x27e018=>pt(_0x27e018,'data-id')==_0x3ee13b['id'],_0x810db6['documentContextContent'],!0x0);_0x3bd183['children']['push'](_0x407ab3['cloneNode'](!0x0));}if(0x0==_0x3bd183['children']['length']){if(_0x2b0480['changes'][0x0]['anchorId']){const _0x379653=ft('data-id',_0x2b0480['changes'][0x0]['anchorId'],_0x810db6['documentContextContent']);_0x3bd183['children']['unshift'](_0x379653['cloneNode'](!0x0)),_0x5119f5['children']['unshift'](_0x379653['cloneNode'](!0x0)),_0x379653['nextSibling']&&(_0x3bd183['children']['push'](_0x379653['nextSibling']['cloneNode'](!0x0)),_0x5119f5['children']['push'](_0x379653['nextSibling']['cloneNode'](!0x0)));}else{const _0xc17fd8=_0x810db6['documentContextContent']['children'][0x0];if(!_0xc17fd8)return null;_0x3bd183['children']['push'](_0xc17fd8['cloneNode'](!0x0)),_0x5119f5['children']['push'](_0xc17fd8['cloneNode'](!0x0));}}const _0x342232=_0x27a5bf['getDocumentContext'](),_0x445806=_0x1e0716['data']['parse'](_0x342232['content']),_0x542835=ut(_0x3bd183),_0x35c56a=_0x1e0716['data']['parse'](_0x542835),_0x48033a=_0x1e0716['data']['parse'](_0x542835),_0x2182b8=_0x1e0716['model']['createPositionAt'](_0x35c56a,0x0),_0x3fd6d7=ut(_0x5119f5),_0x3d253f={'anchor':_0x2182b8,'markDeletions':!0x1},_0x5c3829=_0x1e0716['plugins']['get'](_0x11fc7b)['getDiff'](_0x542835,_0x3fd6d7,_0x3d253f)['getOperations']();if(!_0x5c3829['length'])return null;_0x1e0716['model']['change'](_0x56aadc=>{for(const _0x4de178 of _0x5c3829)if('remove'==_0x4de178['type']){const _0x120a43=_0x4de178['sourcePosition'],_0x485d62=_0x4de178['howMany'],_0x37a1fb=new _0xb3c868(_0x120a43,_0x485d62);_0x56aadc['batch']['addOperation'](_0x37a1fb),_0x1e0716['model']['applyOperation'](_0x37a1fb);}else'marker'!==_0x4de178['type']&&(_0x4de178['baseVersion']=null,_0x4de178['isDocumentOperation']=!0x1,_0x56aadc['batch']['addOperation'](_0x4de178),_0x1e0716['model']['applyOperation'](_0x4de178));});const _0x3c8cc6=lt(_0x1e0716,_0x5c3829,_0x35c56a);dt(_0x1e0716['model'],_0x3c8cc6);const _0x23d49d=_0x3c8cc6['getFirstRange']()['start']['path']['slice'](),_0x52c8a3=_0x3c8cc6['getFirstRange']()['end']['path']['slice'](),_0x50d5a7=[];let _0x14a248=_0x35c56a,_0x25f14b=_0x48033a;for(let _0x449506=0x0;_0x449506<_0x52c8a3['length'];_0x449506++){const _0xf149b2=_0x14a248['maxOffset']-_0x52c8a3[_0x449506];_0x50d5a7[_0x449506]=_0x25f14b['maxOffset']-_0xf149b2,_0x14a248=_0x14a248['getChildAtOffset'](_0x52c8a3[_0x449506]),_0x25f14b=_0x25f14b['getChildAtOffset'](_0x50d5a7[_0x449506]);}const _0x3e3ac2=_0x1e0716['model']['createRange'](_0x1e0716['model']['createPositionFromPath'](_0x48033a,_0x23d49d),_0x1e0716['model']['createPositionFromPath'](_0x48033a,_0x50d5a7)),_0x26eaaf=_0x48033a['getChild'](0x0)['getAttribute'](ct),_0x38f86c=Array['from'](_0x445806['getChildren']())['find'](_0x199159=>_0x199159['getAttribute'](ct)==_0x26eaaf)['getPath'](),_0x20d4a5=_0x3e3ac2['start']['path']['slice'](),_0x913c50=_0x3e3ac2['end']['path']['slice']();_0x20d4a5[0x0]=_0x38f86c[0x0]+_0x20d4a5[0x0],_0x913c50[0x0]=_0x38f86c[0x0]+_0x913c50[0x0];let _0x1d447d=_0x1e0716['model']['createRange'](_0x1e0716['model']['createPositionFromPath'](_0x1e0716['model']['document']['getRoot'](),_0x20d4a5),_0x1e0716['model']['createPositionFromPath'](_0x1e0716['model']['document']['getRoot'](),_0x913c50));const _0x4e7123=_0x1e0716['model']['document']['history']['getOperations'](_0x342232['version']);for(const _0x4b277b of _0x4e7123)_0x1d447d=_0x33fc08['_createFromRanges'](_0x1d447d['getTransformedByOperation'](_0x4b277b));return{'range':_0x1d447d,'currentIndex':_0x10cdcc};}['_integrateEditor'](_0xc99e58){if(!_0xc99e58['plugins']['has']('Undo'))return;const _0xc351a3=_0xc99e58['commands']['get']('undo'),_0x4d9266=_0xc99e58['commands']['get']('redo');this['listenTo'](_0xc351a3,'revert',(_0x157b59,_0x2ae047,_0x4e02cc)=>{const _0x3a89c0=this['_batchToChanges']['get'](_0x2ae047);if(!_0x3a89c0)return;const _0x258318=this['activeConversation']['getInteraction'](_0x3a89c0['interactionId'])['getReply'](_0x3a89c0['replyId']);_0x3a89c0['indexes']['forEach'](_0x3ae555=>_0x258318['setChangeGroupState'](_0x3ae555,'pending')),this['_batchToChanges']['delete'](_0x2ae047),this['_batchToChanges']['set'](_0x4e02cc,_0x3a89c0);}),this['listenTo'](_0x4d9266,'revert',(_0x1817c7,_0x3cc864,_0xc8e396)=>{const _0x3ab34b=this['_batchToChanges']['get'](_0x3cc864);if(!_0x3ab34b)return;const _0xebd88f=this['activeConversation']['getInteraction'](_0x3ab34b['interactionId'])['getReply'](_0x3ab34b['replyId']);_0x3ab34b['indexes']['forEach'](_0x3b0ec9=>_0xebd88f['setChangeGroupState'](_0x3b0ec9,'accepted')),this['_batchToChanges']['delete'](_0x3cc864),this['_batchToChanges']['set'](_0xc8e396,_0x3ab34b);});}async['loadConversation'](_0xf366b5){this['context']['plugins']['get'](w)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x144516=this['context']['plugins']['get'](at);this['updateConversationTitle']('\x20'),_0x144516['view']['activateTab']('chat'),await this['_startConversationSafely'](_0xf366b5);const {sessionId:_0x1cb25d}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0xf366b5,_0x1cb25d),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x5cdf92){console['error']('Failed\x20to\x20load\x20conversation',_0x5cdf92);}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x1fe94a){this['activeConversation']['id']===_0x1fe94a&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x130f20=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x130f20),this['activeConversation']?.['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x2f55aa,quickActionData:_0x1df1b3}){await this['_handleUIUserMessage']({'userMessage':_0x2f55aa,'quickActionData':_0x1df1b3});}['getGroupId'](){const _0x5549d3=this['context']['config']['get']('collaboration.channelId');if(!_0x5549d3)throw new _0xb61eac('ai-chat-missing-channel-id',this);return _0x5549d3;}async['_startConversationSafely'](_0x24e623){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x24e623);}catch(_0x365e74){ot('ai-chat-conversation-start-failed',_0x365e74),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x5463b0){const _0x1b22eb=this['context']['plugins']['get'](w);let _0x19b5a;_0x1b22eb['isOpen']&&_0x1b22eb['close'](),_0x5463b0||!this['activeConversation']?_0x19b5a=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x19b5a=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x10d353=this['getGroupId'](),_0x1182a0=_0x5463b0||_0x50fe7e();this['activeConversation']=new nt({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x19b5a,'conversationId':_0x1182a0,'group':_0x10d353,'getEditor':()=>P(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x3ae7be,_0x426064)=>{this['_aiChatUi']['createConversation'](_0x426064),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x5463b0||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x51e011,_0x132e24)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x132e24['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x54e4d8,_0x1643e8)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x1643e8);}),this['activeConversation']['on']('webSearchStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('webSearchFinished',(_0x27ab06,_0x3a778d)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3a778d,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x30b7ad,_0x1b2d8e)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1b2d8e,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x4d1212,_0x1df368)=>{this['_aiChatUi']['removeFeedInteraction'](_0x1df368['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x55779e,_0x2c5d6d,_0x32b9f7)=>{this['updateConversationTitle'](_0x2c5d6d,_0x32b9f7);}),this['activeConversation']['on']('replyCreated',(_0x1ae2bd,_0x5efaae)=>{'text-delta'===_0x5efaae['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x5efaae):this['_aiChatUi']['addFeedItemAISuggestion'](_0x5efaae);}),this['activeConversation']['on']('replyContentUpdated',async(_0x29a88c,_0x5740a4)=>{await this['_updateReplyContent']({'reply':_0x5740a4});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x16e9be,{reply:_0x131ce5,index:_0xbec542,state:_0x2d8db5})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x131ce5['id'],'index':_0xbec542,'state':_0x2d8db5});}),this['activeConversation']['on']('contextItemAdded',(_0x15afbb,_0x39613f)=>{if(this['_aiChatUi']['addContextItem'](_0x39613f['contextItem'],_0x39613f['isLoading']),'selection'===_0x39613f['contextItem']['type']){const _0x361a7e=[...P(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x361a7e,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0xcbe415,_0x5c1a56)=>{this['_aiChatUi']['removeContextItem'](_0x5c1a56['uiId']),'current-document'==_0x5c1a56['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x5c1a56['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x5bae46,_0x2d07c6)=>{this['_aiChatUi']['setContextItemLoading'](_0x2d07c6['contextItem']['uiId'],_0x2d07c6['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x2eb87d,_0x10943e)=>{this['_aiChatUi']['setConversationContext'](_0x10943e['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x4850a9,_0x3fdf2c)=>{this['_aiChatUi']['setAddContextOptions'](_0x3fdf2c['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x5d523d,_0x3d1d3b)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x3d1d3b['sourceId'],_0x3d1d3b['source'],_0x3d1d3b['resources'],_0x3d1d3b['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x4cfb98,_0x3ee958)=>{this['_aiChatUi']['updateResourceState'](_0x3ee958['sourceId'],_0x3ee958['resourceId'],_0x3ee958['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x2e6d7e,_0x3cc551)=>{this['_aiChatUi']['updateCapabilities'](_0x3cc551);}),this['activeConversation']['on']('modelSelected',(_0x168107,_0x8fb587)=>{this['_aiChatUi']['setSelectedModel'](_0x8fb587['selectedModel'],_0x8fb587['isDisabled']);}),this['activeConversation']['on']('error',(_0x3bb9cd,{error:_0x52dfe0,interactionId:_0x307f15,fileName:_0x19bd47,url:_0x33c540,sourceId:_0xdb9e76,sourceLabel:_0x58bcfe})=>{const _0x5c8322=_0x307f15?_0x307f15+':'+_0x50fe7e():_0x50fe7e();_0x52dfe0['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':C(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x5c8322}):_0x52dfe0['message']['startsWith']('ai-chat-conversation-init-failed')||_0x52dfe0['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x5c8322}),this['_logError'](_0x52dfe0)):_0x52dfe0['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x19bd47),'id':_0x5c8322}):_0x52dfe0['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x33c540),'id':_0x5c8322}):_0x52dfe0['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x5c8322}):_0x52dfe0['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x5c8322}):_0x52dfe0['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0xdb9e76&&this['_aiChatUi']['closeSourceResourceBalloon'](_0xdb9e76),this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x58bcfe||'source'),'id':_0x5c8322}),this['_logError'](_0x52dfe0)):_0x52dfe0['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x5c8322}),this['_logError'](_0x52dfe0)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x5c8322}),this['_logError'](_0x52dfe0));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x5463b0||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x578e3d,quickActionData:_0x465d6b}){if(!this['activeConversation'])throw new _0xb61eac('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x578e3d,'quickActionData':_0x465d6b}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x563c2d=P(this['context'])['model'],_0x1ef23f=Array['from'](_0x563c2d['markers']['getMarkersGroup'](rt));_0x563c2d['change'](_0x4a878f=>{_0x1ef23f['forEach'](_0x46d76b=>_0x4a878f['removeMarker'](_0x46d76b));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x4ce31c){this['_aiChatUi']['setIsMaximized'](_0x4ce31c);}['_logError'](_0x5cbaa5){ot(_0x5cbaa5['message']);}['_removeFromContext'](_0x2a0b80){this['activeConversation']?.['removeFromContext'](_0x2a0b80);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x4c0dff){const [_0x3d6290,_0xa0f1f]=_0x4c0dff['split'](':'),_0x14b2d8=this['activeConversation']['getInteraction'](_0x3d6290),_0x51bf21=_0x14b2d8['getReply'](_0xa0f1f);return{'interaction':_0x14b2d8,'reply':_0x51bf21};}['_scrollToSuggestionRange'](_0x11b6f2,_0x339827=!0x1){const _0x8387e8=P(this['context']),_0x24757b={'target':_0x8387e8['editing']['view']['domConverter']['viewRangeToDom'](_0x8387e8['editing']['mapper']['toViewRange'](_0x11b6f2)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x339827};_0x339827&&(_0x24757b['alignToTop']=!0x0),_0x568df9(_0x24757b);}['updateConversationTitle'](_0x341db5,_0xc4908a=!0x1){this['_aiChatUi']['setConversationTitle'](_0x341db5||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0xc4908a);}async['_updateReplyContent']({reply:_0xd8484c,renderingStrategy:_0x42e8b8}){const {id:_0x527bd1,isDone:_0x3dc308,type:_0x37ee5b,parsedContent:_0x1bca81}=_0xd8484c;if('modification-delta'===_0x37ee5b){const _0x422913=_0xd8484c['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x527bd1,'parts':_0x422913,'renderingStrategy':_0x42e8b8,'isDone':_0x3dc308});}else'text-delta'===_0x37ee5b&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x527bd1,'parsedContent':_0x1bca81,'renderingStrategy':_0x42e8b8,'isDone':_0x3dc308});_0x3dc308&&_0xd8484c['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x527bd1,_0xd8484c['sources']);}async['_stopLastInteraction'](){const _0xba1e6=this['activeConversation']?.['lastInteraction'];_0xba1e6&&(_0xba1e6['stop'](),this['_aiChatUi']['stopInteraction'](_0xba1e6));}async['_flushLastInteractionUI'](){const _0x18a6db=this['activeConversation']?.['lastInteraction'];if(_0x18a6db){for await(const _0x4fa1db of _0x18a6db['replies'])await this['_updateReplyContent']({'reply':_0x4fa1db,'renderingStrategy':'static'});}}['_updateRatings'](_0x382e65){const _0x4ac82f={'positiveCount':_0x382e65['changeGroups']['filter'](_0x335517=>'accepted'===_0x335517['state'])['length'],'totalCount':_0x382e65['changeGroups']['length'],'modificationId':_0x382e65['id']},_0x582962=this['activeConversation']['getInteraction'](_0x382e65['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x582962,_0x4ac82f);}}const St=[...Te,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ge extends jr{['containerView'];['actionsView'];constructor(_0x10b6de,_0x5ed3c1){super(_0x5ed3c1),this['set']('isTrackChangesOn',!0x1),this['containerView']=new e(_0x10b6de,{'showDiff':_0x5ed3c1['showDiff'],'areActionsDisabled':_0x5ed3c1['areActionsDisabled'],'availableActions':_0x5ed3c1['availableActions']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x69fa60,_0x3763be)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x3763be['showDiff']});}),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0xc5f135,{index:_0x35ae99})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x35ae99});}),this['containerView']['on']('insertSuggestion',(_0x1ece3d,{index:_0x1fe3b8})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1fe3b8});}),this['containerView']['on']('rejectSuggestion',(_0x1f5704,{index:_0x37465c})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x37465c});}),this['containerView']['on']('mouseOverSuggestion',(_0x321fd7,{index:_0x36530b})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x36530b});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x44015b,{index:_0x244509})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x244509});}),this['actionsView']=new nh(_0x10b6de,this['options']['availableActions']),this['actionsView']['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn'),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0x5ed3c1['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x572676){await this['containerView']['updateContent'](_0x572676),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x24a66e,_0x2142a8){this['containerView']['bodyView']['updatePartState'](_0x24a66e,_0x2142a8);}['updateSources'](_0x25fc45){this['containerView']['updateSources'](_0x25fc45);}['getPartView'](_0x57d6c7){return this['containerView']['bodyView']['getPartView'](_0x57d6c7);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class ke extends jr{['replyContainer'];constructor(_0x17d75b,_0x231b20){super(_0x231b20),this['locale']=_0x17d75b,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x262350(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':Ye(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x2c6dbe,renderingStrategy:_0x2d9e23,abortSignal:_0x13ce03}){'streaming'===_0x2d9e23?await this['streamIntoElement'](_0x2c6dbe,this['replyContainer']['element'],_0x13ce03):this['replyContainer']['element']['innerHTML']=_0x20aeb7(_0x2c6dbe);}['updateSources'](_0x151ed4){const _0x4aff09=new Sr(this['locale']);_0x4aff09['children']['addMany'](_0x151ed4['map'](_0x35f021=>new Fr(this['locale'],_0x35f021))),_0x4aff09['isVisible']=!0x0,this['children']['add'](_0x4aff09);}}const xn={'file':_0x3f89c6,'document':_0x2adc4e,'web-resource':_0x39c37d,'text':_0x3f89c6,'selection':_0x4147de},$r='ck-ai-chat-context-chip',Qr='ck-ai-chat-context-chip_wide',Jr='ck-ai-chat-context-chip_document',Zr='ck-ai-chat-context-chip__label',ra='ck-ai-chat-context-chip__type-icon',oa='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class bo extends _0x3d6e77{constructor(_0x1a2f02,_0x93ca9,_0x2ea5c8,_0x5db651,_0x3405a7=!0x1){super(_0x1a2f02),this['_isAnimationOnEnterEnabled']=_0x5db651,this['_initializeProperties'](_0x93ca9,_0x2ea5c8,_0x3405a7),this['_setupTemplate']();}['render'](){super['render'](),this['_isAnimationOnEnterEnabled']&&this['element']&&(this['element']['classList']['add']('ck-ai-chat-context-chip_new-chip'),this['_handleAnimationEndOnce'](this['element'],()=>{this['element']&&this['element']['classList']['remove']('ck-ai-chat-context-chip_new-chip');}));}['disableAnimationOnEnter'](){this['_isAnimationOnEnterEnabled']=!0x1,this['element']&&this['element']['classList']['remove']('ck-ai-chat-context-chip_new-chip');}['_initializeProperties'](_0x12e41e,_0x3622ff,_0x369028){this['set']('label',_0x12e41e['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x12e41e['type']),this['set']('id',_0x12e41e['uiId']),this['set']('readonly',_0x3622ff),this['set']('isLoading',_0x369028);}['_setupTemplate'](){const _0x36f2cd=this['_createIconView'](),_0x249de8=this['_createRemoveButton'](),_0x1f0c73=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x1f0c73),'children':this['_createTemplateChildren'](_0x36f2cd,_0x249de8,_0x1f0c73)});}['_createTemplateAttributes'](_0x1c6fcc){return{'class':[$r,_0x1c6fcc['if']('itemType',Jr,_0x50cc5c=>'document'==_0x50cc5c),_0x1c6fcc['if']('itemType',Qr,_0x5ac083=>'selection'==_0x5ac083)],'data-cke-tooltip-text':_0x1c6fcc['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':oa};}['_createTemplateChildren'](_0x1f5e53,_0xc09148,_0x19e75b){const _0x231ee7=this['_createLabelElement'](_0x19e75b),_0x4b3ae1=this['_createLoaderIcon']();return this['readonly']?[_0x1f5e53,_0x231ee7]:[_0x1f5e53,_0x4b3ae1,_0x231ee7,_0xc09148];}['_createLabelElement'](_0x48567f){return{'tag':'span','attributes':{'class':Zr},'children':[{'text':_0x48567f['to']('label')}]};}['_createRemoveButton'](){const _0x53d1e0=new _0x3d6e77(this['locale']);return _0x53d1e0['set']({'label':C(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x3843a6}),this['_setupRemoveButtonEvent'](_0x53d1e0),_0x53d1e0;}['_setupRemoveButtonEvent'](_0xaffe6e){_0xaffe6e['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x41ef0c=this['bindTemplate'],_0x5e464d=new _0x3a2ec3();return _0x5e464d['content']=xn[this['itemType']],_0x5e464d['extendTemplate']({'attributes':{'class':[ra,_0x41ef0c['if']('isLoading','ck-hidden',_0x3749f9=>_0x3749f9)]}}),_0x5e464d;}['_handleAnimationEndOnce'](_0x47b9e9,_0x1d397c){if(!_0x47b9e9)return;const _0x5c092d=()=>{_0x1d397c(),_0x47b9e9['removeEventListener']('animationend',_0x5c092d),_0x47b9e9['removeEventListener']('webkitAnimationEnd',_0x5c092d);};_0x47b9e9['addEventListener']('animationend',_0x5c092d),_0x47b9e9['addEventListener']('webkitAnimationEnd',_0x5c092d);}['_createLoaderIcon'](){const _0x4e977d=new Le('small');return _0x4e977d['bind']('isVisible')['to'](this,'isLoading',_0x27c1a4=>_0x27c1a4),_0x4e977d;}}function In(_0x2ff76b){if(!_0x2ff76b)return _0x2ff76b;if(_0x2ff76b['length']<=0x78)return _0x2ff76b;const _0x567239=_0x2ff76b['slice'](0x0,0x78),_0x1863bc=_0x567239['lastIndexOf']('\x20');return(_0x1863bc>0x0?_0x567239['slice'](0x0,_0x1863bc):_0x567239)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Ao{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x33bdea,_0xf56bb0,_0x5afa3e,_0x3bbb00,_0x2035be){this['_locale']=_0x33bdea,this['_visibleChips']=_0xf56bb0,this['_config']={...hn,..._0x5afa3e,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x5afa3e['cssClasses']}},this['_overflowChips']=new _0x3addd2(),this['_bodyCollection']=_0x3bbb00,this['_parentView']=_0x2035be||null;}['setContainerElement'](_0x2879b7){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x2879b7,this['_setupVisibilityObserver']();}get['showMoreButtonView'](){return this['_showMoreButtonView'];}get['overflowChips'](){return this['_overflowChips'];}['reorganizeChips'](){requestAnimationFrame(()=>{this['_checkAndHandleOverflow']();});}['showBalloonPanel'](){this['_showMoreButtonView']&&this['_showMoreBalloonPanelView']&&(this['_updateBalloonContent'](),this['_showMoreButtonView']['isOn']=!0x0,this['_showMoreBalloonPanelView']['show'](),this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':document['querySelector']('.ck-ai-chat')}));}['hideBalloonPanel'](){this['_showMoreButtonView']&&this['_showMoreBalloonPanelView']&&(this['_showMoreButtonView']['isOn']=!0x1,this['_showMoreBalloonPanelView']['hide']());}['clear'](){this['_overflowChips']['clear'](),this['hideBalloonPanel'](),this['_updateShowMoreButtonVisibility'](),this['_showMoreButtonView']&&(this['_showMoreButtonView']['label']=''),this['_showMoreBalloonPanelView']&&this['_showMoreBalloonPanelView']['content']['clear']();}['destroy'](){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_showMoreButtonView']&&(this['_showMoreButtonView']['destroy'](),this['_showMoreButtonView']=null),this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['destroy'](),this['_showMoreBalloonPanelView']=null);}['_checkAndHandleOverflow'](){if(!this['_containerElement'])return;if(!this['_isContainerVisible']())return void(this['_pendingCalculation']=!0x0);this['_pendingCalculation']=!0x1;const _0x18cb9e=[...this['_visibleChips'],...this['_overflowChips']],_0x57f1df=this['_createCalculationContainer'](),_0x3311fb=this['_calculateOverflowInContainer'](_0x57f1df,_0x18cb9e),_0x5f009b=_0x57f1df['_ancestorsToRestore'];_0x5f009b&&this['_restoreAncestorVisibility'](_0x5f009b),_0x57f1df['remove'](),this['_applyOverflowResults'](_0x18cb9e,_0x3311fb);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x3bd809({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x9d3ec6=new _0x3d6e77(this['_locale']);_0x9d3ec6['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x466ba0=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x466ba0['push'](this['_config']['cssClasses']['controlsButton']),_0x9d3ec6['extendTemplate']({'attributes':{'class':_0x466ba0}}),_0x9d3ec6;}['_createShowMoreBalloonPanelView'](){const _0x4e32ac=new _0x51cd8c(this['_locale']);return _0x4e32ac['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x4e32ac),_0x4e32ac;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x1a9672=>{_0x1a9672['disableAnimationOnEnter']();});const _0x3d1fdb=new _0x262350(this['_locale']);_0x3d1fdb['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x3d1fdb);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x1e7794=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x1e7794?'':'none');}['_repinBalloonPanel'](){this['_showMoreButtonView']?.['isOn']&&this['_showMoreBalloonPanelView']?.['isVisible']&&this['_showMoreButtonView']['element']&&this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':document['querySelector']('.ck-ai-chat')});}['_findTargetContainer'](_0x44540d){const _0x3b17d3=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x3d8202=this['_containerElement']?.['classList'];if(_0x3d8202){const _0xfd2636=_0x3d8202[0x0]||'',_0x2df7a7=_0x44540d['querySelector']('.'+_0xfd2636),_0x5b4140=_0x44540d['querySelector'](_0x3b17d3);return _0x2df7a7||_0x5b4140||_0x44540d;}return _0x44540d['querySelector'](_0x3b17d3)||_0x44540d;}['_calculateContainerWidth'](){const _0x3a2ae6=this['_parentView']?.['element']||this['_containerElement'];if(!_0x3a2ae6)return an;const _0x4c9681=window['getComputedStyle'](_0x3a2ae6)['width'];if('auto'===_0x4c9681||'0px'===_0x4c9681||!_0x4c9681){const _0xd58883=_0x3a2ae6['parentElement'];if(_0xd58883){const _0x4e003b=window['getComputedStyle'](_0xd58883);return'auto'!==_0x4e003b['width']?_0x4e003b['width']:an;}return an;}return _0x4c9681;}['_applyCalculationStyles'](_0xe3edab,_0x245870){this['_config']['cssClasses']['calculationContainer']&&_0xe3edab['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0xe3edab['style']['width']=_0x245870,_0xe3edab['style']['position']='absolute',_0xe3edab['style']['top']='-9999px',_0xe3edab['style']['left']='-9999px',_0xe3edab['style']['opacity']='0',_0xe3edab['style']['pointerEvents']='none',_0xe3edab['style']['zIndex']='-1',_0xe3edab['style']['visibility']='visible\x20!important',_0xe3edab['style']['display']='block\x20!important',_0xe3edab['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0xdd1a50){_0xdd1a50['forEach'](({element:_0x904bc2,originalDisplay:_0x9fab8d,originalVisibility:_0x5b7baa})=>{_0x904bc2['style']['display']=_0x9fab8d,_0x904bc2['style']['visibility']=_0x5b7baa;});}['_makeAncestorsVisible'](_0x483eb3){const _0x2f9d4c=[];let _0x33ac34=_0x483eb3;for(;_0x33ac34&&_0x33ac34!==document['body'];){const _0x72071f=window['getComputedStyle'](_0x33ac34);'none'!==_0x72071f['display']&&'hidden'!==_0x72071f['visibility']||(_0x2f9d4c['push']({'element':_0x33ac34,'originalDisplay':_0x33ac34['style']['display'],'originalVisibility':_0x33ac34['style']['visibility']}),_0x33ac34['style']['display']='block',_0x33ac34['style']['visibility']='visible'),_0x33ac34=_0x33ac34['parentElement'];}return _0x2f9d4c;}['_createContainerElements'](){let _0x162b8a,_0x20e444;return this['_parentView']?.['element']?(_0x162b8a=this['_parentView']['element']['cloneNode'](!0x0),_0x20e444=this['_findTargetContainer'](_0x162b8a)):(_0x162b8a=document['createElement']('div'),_0x20e444=_0x162b8a),{'calculationContainer':_0x162b8a,'targetContainer':_0x20e444};}['_createCalculationContainer'](){const {calculationContainer:_0x2bca80,targetContainer:_0x3f8777}=this['_createContainerElements'](),_0x2ac7c0=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x2bca80,_0x2ac7c0);const _0xfa4176=this['_parentView']?.['element']||this['_containerElement'],_0x30cfca=_0xfa4176?.['parentElement'];_0x30cfca?_0x30cfca['appendChild'](_0x2bca80):document['body']['appendChild'](_0x2bca80),_0x2bca80['_targetContainer']=_0x3f8777;const _0x197f00=this['_makeAncestorsVisible'](_0x30cfca||null);return _0x2bca80['offsetWidth'],_0x2bca80['_ancestorsToRestore']=_0x197f00,_0x2bca80;}['_calculateOverflowInContainer'](_0x73231e,_0x53df08){const _0x5b7eff=_0x73231e['_targetContainer']||_0x73231e,_0x1ed868=[],{rowCount:_0x10a2f6}=this['_renderChipsAndCountRows'](_0x5b7eff,_0x53df08);if(_0x10a2f6<=this['_config']['maxVisibleRows'])return _0x1ed868;const _0x43a4ae=_0x53df08['slice']();for(;_0x43a4ae['length']>0x0;){if(this['_testButtonFit'](_0x73231e,_0x5b7eff,_0x43a4ae)){const _0x36ee37=_0x53df08['filter'](_0x51e167=>!_0x43a4ae['includes'](_0x51e167));_0x1ed868['push'](..._0x36ee37);break;}if(!_0x43a4ae['pop']())break;}return _0x1ed868;}['_renderChipsAndCountRows'](_0x28c36d,_0x285620){_0x28c36d['innerHTML']='',_0x285620['forEach'](_0x293d74=>{if(_0x293d74['element']){const _0x1cc040=_0x293d74['element']['cloneNode'](!0x0);_0x28c36d['appendChild'](_0x1cc040);}}),_0x28c36d['offsetWidth'];const _0x2be81c=_0x28c36d['children'],_0x887f6a=[];return Array['from'](_0x2be81c)['forEach'](_0x996d5f=>{const _0x3e3bb1=_0x996d5f['getBoundingClientRect']()['top'];_0x887f6a['some'](_0x555121=>Math['abs'](_0x555121-_0x3e3bb1)<this['_config']['rowDetectionTolerance'])||_0x887f6a['push'](_0x3e3bb1);}),{'rowCount':_0x887f6a['length']};}['_createMockButton'](){const _0x1727ef=document['createElement']('button');return _0x1727ef['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x1727ef['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x1727ef['textContent']='+\x201',_0x1727ef;}['_testButtonFit'](_0x3ff41a,_0x25b0ca,_0x12a433){this['_renderChipsAndCountRows'](_0x25b0ca,_0x12a433);const _0x4f19ad=this['_createMockButton']();_0x3ff41a['appendChild'](_0x4f19ad),_0x3ff41a['offsetWidth'];const _0x2a520f=[..._0x25b0ca['children'],_0x4f19ad],_0x141302=[];_0x2a520f['forEach'](_0x32bc43=>{const _0x4eb0ed=_0x32bc43['getBoundingClientRect']()['top'];_0x141302['some'](_0x4fc680=>Math['abs'](_0x4fc680-_0x4eb0ed)<this['_config']['rowDetectionTolerance'])||_0x141302['push'](_0x4eb0ed);});const _0x5d87a3=_0x141302['length'];return _0x4f19ad['remove'](),_0x5d87a3<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x53f88b,_0x14ab86){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x53f88b['forEach'](_0x4a84=>{_0x14ab86['includes'](_0x4a84)?this['_overflowChips']['add'](_0x4a84):this['_visibleChips']['add'](_0x4a84);});}['_updateOverflowUI'](_0x13b519){if(_0x13b519>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x13b519>0x0&&this['_showMoreButtonView']){const _0x208e2a=''+this['_config']['showMoreLabelPrefix']+(_0x13b519<0x63?_0x13b519:'99');this['_showMoreButtonView']['label']=_0x208e2a;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x4ce7ec,_0x21b714){this['_distributeChips'](_0x4ce7ec,_0x21b714),this['_updateOverflowUI'](_0x21b714['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x16f6bf=>{_0x16f6bf[0x0]['isIntersecting']&&this['_pendingCalculation']&&requestAnimationFrame(()=>{this['_checkAndHandleOverflow']();});},{'threshold':0.01,'rootMargin':'50px'}),this['_intersectionObserver']['observe'](this['_containerElement']));}['_isContainerVisible'](){if(!this['_containerElement'])return!0x1;if(!this['_containerElement']['isConnected'])return!0x1;const _0x35e0c7=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x35e0c7['width']||0x0===_0x35e0c7['height'])return!0x1;const _0x2fc0a1=window['innerHeight']||document['documentElement']['clientHeight'],_0x338eb8=window['innerWidth']||document['documentElement']['clientWidth'],_0x49e557=0xc8;return _0x35e0c7['bottom']>=-0xc8&&_0x35e0c7['top']<=_0x2fc0a1+_0x49e557&&_0x35e0c7['right']>=-0xc8&&_0x35e0c7['left']<=_0x338eb8+_0x49e557;}}const ca='ck-ai-chat__feed__context-chips',la='ck-ai-chat-context-chips-wrapper',da='ck-ai-chat-context-chips-wrapper-balloon',ua='ck-ai-chat-controls-button',_a='ck-ai-chat-controls_context_show-more-button',Ia='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0x262350{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x3bb9ee,_0x135dbe,_0x3557ef){super(_0x3bb9ee),this['_bodyCollection']=_0x3557ef,this['_createContextChips'](_0x135dbe);const _0xc2cb8a={'cssClasses':{'showMoreButton':_a,'showMoreBalloon':Ia,'overflowContainer':da,'controlsButton':ua}};this['_overflowManager']=new Ao(_0x3bb9ee,this['_contextChips'],_0xc2cb8a,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[ca,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':la},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x1b3bbc=this['element']['querySelector']('.'+la);_0x1b3bbc&&(this['_overflowManager']['setContainerElement'](_0x1b3bbc),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x397b47){for(const _0x5a5fd4 of _0x397b47){const _0x56e3bb=new bo(this['locale'],_0x5a5fd4,!0x0,!0x1);this['_contextChips']['add'](_0x56e3bb);}}}class ve extends jr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x335868,_0x2e6ffa,_0x47d393){super(_0x2e6ffa),this['_locale']=_0x335868,this['_bodyCollection']=_0x47d393,this['_createContextChipsView'](),this['_createMessageContentView'](),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__user-message']}});}['_createContextChipsView'](){this['options']['contextItems']&&this['options']['contextItems']['length']>0x0&&(this['_contextChipsView']=new ah(this['_locale'],this['options']['contextItems']['filter'](_0x2047a6=>!_0x2047a6['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x262350(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Et extends jr{['capabilities'];constructor(_0x1a5c4d,_0xaaf70b){super(_0xaaf70b);const {isWebSearchEnabled:_0xcfee33,isReasoningEnabled:_0x1b728f}=_0xaaf70b['capabilities'],_0xa6fac6=[];let _0x3047d7='';_0xcfee33&&_0x1b728f?(_0x3047d7=C(_0x1a5c4d,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0xa6fac6['push'](aa(_0x533bf1)),_0xa6fac6['push'](aa(_0x255204))):_0xcfee33?(_0x3047d7=C(_0x1a5c4d,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0xa6fac6['push'](aa(_0x533bf1))):_0x1b728f&&(_0x3047d7=C(_0x1a5c4d,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0xa6fac6['push'](aa(_0x255204))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x3047d7?'':'ck-hidden']}});const _0x48b8b8=new _0x262350();_0x48b8b8['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0xa6fac6,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x3047d7]}]}),this['children']['add'](_0x48b8b8),this['capabilities']=_0xaaf70b['capabilities'];}}function aa(_0x454544){const _0x3589a4=new _0x3a2ec3();return _0x3589a4['content']=_0x454544,_0x3589a4;}const ws=['wheel','touchstart','pointerdown','keydown'],fs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class be{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x94a2e4){this['element']=_0x94a2e4,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x58cdfd of ws){const _0x4e5afb='keydown'!==_0x58cdfd;this['element']['addEventListener'](_0x58cdfd,this['_onUserEvent']['bind'](this),{'passive':_0x4e5afb,'signal':this['abortController']['signal']});}}['start'](){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}['stop'](){requestAnimationFrame(()=>{this['_stop']();});}['destroy'](){this['_stop'](),this['abortController']['abort']();}['_stop'](){null!==this['animationFrameId']&&(cancelAnimationFrame(this['animationFrameId']),this['animationFrameId']=null),this['isRunning']&&(this['isRunning']=!0x1),this['isUserPaused']=!0x1;}['_onUserEvent'](_0xa2543c){if(this['isRunning']){if('keydown'===_0xa2543c['type']){const _0x48ecec=_0xa2543c['key'];if(!fs['includes'](_0x48ecec))return;}_0xa2543c instanceof WheelEvent?_0xa2543c['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x2b8381,scrollHeight:_0x433440,clientHeight:_0x5dbebe}=this['element'];return _0x433440-_0x2b8381-_0x5dbebe<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class je extends _0x262350{constructor(_0x513101,_0x371e0f){super(_0x513101),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x371e0f)});}['_createSkeletonItems'](_0x5d3366){const _0x37e64e=['ck','ck-ai-skeleton__item'];return _0x5d3366['map'](_0x3f1112=>{let _0x5dbafe='';switch(_0x3f1112['attributes']['align']){case'right':_0x5dbafe='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x5dbafe='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x5dbafe='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x3f1112['tag'],'attributes':{'class':[..._0x37e64e,_0x3f1112['attributes']['class']?_0x3f1112['attributes']['class']:''],'style':'width:\x20'+_0x3f1112['attributes']['width']+';\x20height:\x20'+_0x3f1112['attributes']['height']+';'+_0x5dbafe}};});}}const Ce={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':ta(0x5,'100%','44px','right'),'aiChatResources':ta(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function ta(_0x4f3e01,_0x43f4d2,_0x1eae47,_0x186b44){return new Array(_0x4f3e01)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x43f4d2,'height':_0x1eae47,'align':_0x186b44}}));}class ji extends _0x262350{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x9e863a,_0x31d29d){super(_0x9e863a),this['_bodyCollection']=_0x31d29d,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...St)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new be(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x250830,_0xf27606){let _0x1432dd;'ai-reply'===_0x250830?_0x1432dd=new ke(this['locale'],_0xf27606):'ai-suggestion-reply'===_0x250830?(_0x1432dd=new ge(this['locale'],_0xf27606),_0x1432dd['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0x1432dd='user-message'===_0x250830?new ve(this['locale'],_0xf27606,this['_bodyCollection']):'interaction-header'===_0x250830?new Et(this['locale'],_0xf27606):new _e(_0xf27606),this['children']['add'](_0x1432dd);}async['updateReplyItem']({id:_0x232ca7,parsedContent:_0x3caf85,renderingStrategy:_0x578656,abortSignal:_0x163d21}){const _0x5b4fda=this['getItemById'](_0x232ca7);if(!(_0x5b4fda instanceof ke))throw new _0xb61eac('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x5b4fda,'id':_0x232ca7,'parsedContent':_0x3caf85});await _0x5b4fda['updateContent']({'parsedContent':_0x3caf85,'renderingStrategy':_0x578656,'abortSignal':_0x163d21});}async['updateWebSources'](_0x2146b5,_0x4f002f){const _0x2251f8=this['getItemById'](_0x2146b5);if(_0x2251f8 instanceof ge)_0x2251f8['updateSources'](_0x4f002f);else{if(!(_0x2251f8 instanceof ke))throw new _0xb61eac('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x2251f8,'id':_0x2146b5,'sources':_0x4f002f});_0x2251f8['updateSources'](_0x4f002f);}}async['updateSuggestionItem']({id:_0x454d2c,parts:_0x185992,renderingStrategy:_0xf71a3d,abortSignal:_0x1c78e4}){const _0x3b3410=this['getItemById'](_0x454d2c);if(!(_0x3b3410 instanceof ge))throw new _0xb61eac('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x3b3410,'id':_0x454d2c,'parts':_0x185992});await _0x3b3410['updateContent']({'parts':_0x185992,'renderingStrategy':_0xf71a3d,'abortSignal':_0x1c78e4});}['updateSuggestionPartState']({id:_0x1a15b6,index:_0xe11be8,state:_0x2d58ca}){const _0x4c34f0=this['getItemById'](_0x1a15b6);if(!(_0x4c34f0 instanceof ge))throw new _0xb61eac('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x1a15b6});_0x4c34f0['updatePartState'](_0xe11be8,_0x2d58ca);}['markItemAsDone'](_0x804262){this['getItemById'](_0x804262)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x400cc7=>_0x400cc7['options']['id']);}['removeItem'](_0x2c3289){this['children']['remove'](this['getItemById'](_0x2c3289));}['scrollToSuggestion'](_0xce17ef,_0x32a18e){const _0x41fc47=this['getItemById'](_0xce17ef);if(!(_0x41fc47 instanceof ge))return void _0x2398b2('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0xce17ef,'partIndex':_0x32a18e});const _0x3dc1fd=_0x41fc47['getPartView'](_0x32a18e);_0x3dc1fd?_0x568df9({'target':_0x3dc1fd['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x2398b2('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0xce17ef,'partIndex':_0x32a18e});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x45b2ec=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x45b2ec,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x409cbb=new je(this['locale'],Ce['aiFeed']);return _0x409cbb['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x547ccb=>!_0x547ccb)]}}),_0x409cbb;}['_createFeedItems'](){const _0x1accfc=new _0x262350(this['locale']);return _0x1accfc['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x1accfc;}['_createFeedLoader'](){const _0x2b9f79=new _0x262350(this['locale']);return _0x2b9f79['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0xf1ca3b=>!_0xf1ca3b)]},'children':this['_createLoaderChildren']()}),_0x2b9f79;}['_createLoaderChildren'](){const _0x35ffaa=new Le();return _0x35ffaa['isVisible']=!0x0,[_0x35ffaa,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x48cd3f){const _0x22bb4c=this['children']['find'](_0x23976d=>_0x23976d['options']['id']['includes'](_0x48cd3f));if(!_0x22bb4c)throw new _0xb61eac('ai-chat-feed-view-item-not-found',this,{'id':_0x48cd3f});return _0x22bb4c;}['setLoadingMessage'](_0x53a930){this['set']('loadingMessage',_0x53a930);}['toggleLoadingSkeleton'](_0x3fce54){this['set']('isLoadingSkeletonVisible',_0x3fce54);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Ir extends _0x4a993d{['filter'](){let _0x2dcd27=0x0;for(const _0x1cce00 of this['items'])_0x2dcd27+=_0x1cce00['items']['length'];return{'resultsCount':_0x2dcd27,'totalItemsCount':_0x2dcd27};}}class ds extends _0x207cdb{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x325178,_0x4acf3b){super(_0x325178,{'queryView':{'label':'','creator':_0x3708a3,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Ir(_0x325178),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x4acf3b,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ds['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ds['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x312c74,_0x4b848a)=>!_0x312c74&&!_0x4b848a),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x35c341,_0xe34084)=>{this['isUploadInProgress']||this['isEmpty']||_0x35c341['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xe34084());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x583126=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x583126)return this['queryView']['errorText']=C(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x4adc56=_0xb7774e(_0x583126);this['fire']('sendUserMessage',_0x4adc56),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x4f3991){this['queryView']['fieldView']['set']('placeholder',_0x4f3991);}['_createSubmitButton'](){const _0x4a7932=new _0x3d6e77(this['locale']);return _0x4a7932['set']({'icon':_0x15a18a,'label':C(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x4a7932['on']('execute',()=>{this['submit']();}),_0x4a7932;}['setIsUploadInProgress'](_0x557aea){this['isUploadInProgress']=_0x557aea;}['_setUpAddContextButtonPositioning'](){const _0x27a690=this['locale'],_0x1fbb9e=()=>{_0x43815f['window']['requestAnimationFrame'](()=>{if(_0x15f5a3(this['element'])){const _0x5c64e8=new _0x3863bd(this['queryView']['fieldView']['element']),_0x4709f1=new _0x3863bd(this['_addContextButtonView']['element']),_0x37f11f=_0x5c64e8['width'],_0x38d756='rtl'===_0x27a690['uiLanguageDirection']?'right':'left';_0x5c64e8['excludeScrollbarsAndBorders']();const _0x169f82=_0x37f11f-_0x5c64e8['width']+0x1;this['_addContextButtonView']['element']['style'][_0x38d756]='calc('+(_0x37f11f-_0x4709f1['width']-_0x169f82)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x1fbb9e),this['on']('render',()=>{_0x1fbb9e(),this['_queryViewResizeObserver']=new _0x56775d(this['queryView']['fieldView']['element'],()=>{_0x1fbb9e();});});}}const Aa='ck-ai-chat__prompt-capabilities',ga='ck-ai-chat-controls-button',Ea='ck-ai-chat-controls-button--commands',ma='ck-ai-chat-controls__model-selection',pa='ck-ai-chat-controls__model-selection__item-name',Ta='ck-ai-chat-controls__model-selection__item-description',Ca='ck-ai-chat-controls__model-selection__item-capabilities',wa='n';class ps extends _0x262350{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x480b6b){super(_0x480b6b),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelSelectorVisible',_0x5c05be=>_0x5c05be),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x4d59ef=>_0x4d59ef?this['_modelSelectionDropdown']['buttonView']['label']:C(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x59d682=>_0x59d682),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x36b7c8=>_0x36b7c8),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x1c6b02=>!_0x1c6b02),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x57855c=>C(this['locale'],_0x57855c?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x5485e1=>_0x5485e1),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x1e5e1c=>!_0x1e5e1c),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x1338ac=>C(this['locale'],_0x1338ac?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Aa]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x3addd2(),_0x162dc1(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x39d7be,_0x524171){if(this['set']('modelSelectorVisible',!(_0x524171&&_0x39d7be['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x39d7be?.['length']){const _0x254859=ki['getLocalized'](this['locale'],_0x39d7be);for(const _0x18149b of _0x254859){const _0x1817d2=new _0x948671({'label':_0x18149b['name'],'withText':!0x0,'role':'menuitemradio','id':_0x18149b['id'],'model':_0x18149b});_0x1817d2['bind']('isOn')['to'](this,'activeModelId',_0x9e600c=>_0x9e600c===_0x18149b['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1817d2,'labelView':new fa(this['locale'],_0x18149b)});}}}['setWebSearch'](_0x495a7c){this['set']('webSearchActive',_0x495a7c);}['setReasoning'](_0x3dafde){this['set']('reasoningActive',_0x3dafde);}['setModel'](_0x54e760){if(!_0x54e760)return;this['activeModelId']=_0x54e760['id'],this['activeModelName']=_0x54e760['name']||_0x54e760['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x54e760['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x54e760['name']);const _0x103b58=_0x54e760['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x103b58),this['_webSearchButton']['set']('isVisible',_0x103b58);const _0x11f4eb=_0x54e760['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x11f4eb),this['_reasoningButton']['set']('isVisible',_0x11f4eb);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x27a3e7){this['set']('modelSelectorEnabled',!0x1),_0x27a3e7&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x32b943=new _0x3d6e77();return _0x32b943['set']({'label':C(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x533bf1,'class':ga,'isToggleable':!0x0,'tooltipPosition':wa}),_0x32b943['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x32b943;}['_createReasoningButton'](){const _0x43b5c1=new _0x3d6e77();return _0x43b5c1['set']({'label':C(this['locale'],'AI_CHAT_REASONING'),'icon':_0x255204,'class':ga,'isToggleable':!0x0,'tooltipPosition':wa}),_0x43b5c1['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x43b5c1;}['_createCommandsButton'](){const _0x1054b8=new _0x3d6e77();return _0x1054b8['set']({'label':C(this['locale'],'AI_CHAT_COMMANDS'),'icon':Ct,'withText':!0x0,'class':ga,'isToggleable':!0x0,'tooltip':C(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':wa}),_0x1054b8['extendTemplate']({'attributes':{'class':[Ea]}}),_0x1054b8['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x1054b8;}['_createModelSelectionDropdown'](){const _0x213cb2=_0x33079d(this['locale']);return _0x213cb2['set']({'panelPosition':'ne','class':[ma]}),_0x213cb2['buttonView']['set']({'label':C(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':wa}),this['listenTo'](_0x213cb2,'execute',_0x285f33=>{this['fire']('selectModel',_0x285f33['source']['model']);}),_0x213cb2;}['_createModelNameView'](){const _0x30a1d4=new Ko(this['locale']);return _0x30a1d4['bind']('text')['to'](this,'activeModelName',_0x3d8d1a=>_0x3d8d1a??''),_0x30a1d4['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x3c2e1f,_0x37e237)=>!_0x3c2e1f&&!_0x37e237?.['toLowerCase']()['startsWith']('agent')),_0x30a1d4;}}let fa=class extends _0x9b3e62{constructor(_0x1fd116,_0x562b97){super();const _0x2f5d78=this['bindTemplate'],_0x561fa2=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x2f5d78['to']('style'),'id':_0x2f5d78['to']('id')},'children':[{'tag':'div','attributes':{'class':[pa]},'children':[{'text':_0x2f5d78['to']('text')}]},{'tag':'div','attributes':{'class':[Ta]},'children':[{'tag':'span','children':[{'text':_0x562b97['description']}]}]},{'tag':'div','attributes':{'class':[Ca]},'children':_0x561fa2}]}),_0x561fa2['addMany'](this['_getCapabilityParts'](_0x1fd116,_0x533bf1,'AI_CHAT_SEARCH_WEB',_0x562b97['capabilities']['webSearch']?.['enabled']??!0x1)),_0x561fa2['addMany'](this['_getCapabilityParts'](_0x1fd116,_0x255204,'AI_CHAT_REASONING',_0x562b97['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0xb68956,_0x18cc23,_0x480c56,_0x4a3cb7){const _0x38ca02=new _0x3a2ec3();_0x38ca02['content']=_0x18cc23;const _0x81acc4=new _0x262350(_0xb68956);_0x81acc4['setTemplate']({'tag':'span','children':[{'text':C(_0xb68956,_0x480c56)+':\x20'}]});const _0x3809ac=new _0x262350(_0xb68956);return _0x3809ac['setTemplate']({'tag':'span','children':[{'text':C(_0xb68956,_0x4a3cb7?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x38ca02,_0x81acc4,_0x3809ac];}};class Ko extends _0x262350{constructor(_0x1690a1){super(_0x1690a1),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x3afce6=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x3afce6['if']('isVisible','ck-hidden',_0x32672d=>!_0x32672d)]},'children':[{'text':_0x3afce6['to']('text')}]});}}const Sa='ck-ai-chat-context-controls__url-form',Oa='ck-ai-chat-context-controls__url-input-section';class To extends _0x262350{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x2231c2){super(_0x2231c2),this['focusTracker']=new ts(),this['keystrokes']=new _0x25a17d(),this['backButton']=this['_createBackButton'](),this['urlInputField']=this['_createUrlInputField'](),this['confirmButton']=this['_createConfirmButton'](),this['_focusables']=this['createCollection']([this['backButton'],this['urlInputField'],this['confirmButton']]),this['focusCycler']=new $t({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x33494a=>{this['focusTracker']['add'](_0x33494a['element']),this['keystrokes']['listenTo'](_0x33494a['element']);}),_0x49a30d({'view':this}),this['focus']();}['destroy'](){super['destroy'](),this['focusTracker']['destroy'](),this['keystrokes']['destroy']();}['focus'](){this['urlInputField']['focus']();}['getValue'](){return this['urlInputField']['fieldView']['element']?.['value']?.['trim']()||'';}['clear'](){this['urlInputField']['fieldView']['element']['value']='',this['urlInputField']['errorText']=null,this['confirmButton']['isEnabled']=!0x1;}['setError'](_0x5f1269){this['urlInputField']['errorText']=_0x5f1269,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x301fb7=new _0x3d6e77(this['locale']);return _0x301fb7['set']({'icon':_0x488fbf,'tooltip':C(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x301fb7;}['_createUrlInputField'](){const _0x5625e2=new _0x5d33a3(this['locale'],th);return _0x5625e2['set']({'label':C(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x5625e2['fieldView']['set']({'placeholder':C(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x5625e2;}['_createConfirmButton'](){const _0x104d00=new _0x3d6e77(this['locale']);return _0x104d00['set']({'icon':_0x223d65,'tooltip':C(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x104d00;}['_setupTemplate'](){const _0x46ee4c=new _0x20ce21(this['locale'],{'label':C(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x46ee4c['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Sa,'tabindex':'-1'},'children':[_0x46ee4c,{'tag':'div','attributes':{'class':Oa},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0x4d6c0b=>{_0x4d6c0b['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x412762,_0x3cde33)=>{this['clear'](),this['fire']('cancel'),_0x3cde33();});}['_handleSubmit'](){const _0x13ea0b=this['getValue']()['trim']();_0x13ea0b?this['_isValidUrl'](_0x13ea0b)?(this['clearError'](),this['fire']('submitUrl',_0x13ea0b)):this['setError'](C(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](C(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x10b99c=this['getValue']()['trim'](),_0x306474=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x10b99c['length']>0x0&&!_0x306474;}['_isValidUrl'](_0x570d2d){try{return!!new URL(_0x570d2d);}catch{return!0x1;}}}const Ra='ck-ai-chat-resources__item',ba='ck-ai-chat-resources__item--in-context',Na='ck-ai-chat-resources__item-title',ka='ck-ai-chat-resources__item__icon';class tc extends _0x321758{['resource'];['_titleView'];['_iconView'];constructor(_0xbe4d4a,_0x3db5d0){super(_0xbe4d4a),this['resource']=_0x3db5d0,this['set']('isInContext',!!_0x3db5d0['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x154286){if(_0x154286['isInContext'])return _0x223d65;switch(_0x154286['type']){case Xt['DOCUMENT']:return _0x2adc4e;case Xt['URL']:return _0x39c37d;case Xt['FILE']:case Xt['TEXT']:return _0x3f89c6;default:return _0x301d1a;}}['highlightText'](_0x56cc41){if(!_0x56cc41||''===_0x56cc41['trim']())return void this['_titleView']['highlightText'](null);const _0x4b2a08=new RegExp(_0x58ed47(_0x56cc41),'gi');this['_titleView']['highlightText'](_0x4b2a08);}['updateResourceState'](_0x1b52c8){this['resource']['isInContext']=_0x1b52c8,this['isInContext']=_0x1b52c8,this['_updateIcon']();}['_createTitleView'](){const _0x3aa0a0=new _0x4063f0();return _0x3aa0a0['text']=this['resource']['label'],_0x3aa0a0['extendTemplate']({'tag':'span','attributes':{'class':[Na]}}),_0x3aa0a0;}['_createIconView'](){const _0xba1ad4=new _0x3a2ec3();return _0xba1ad4['content']=this['getResourceIcon'](this['resource']),_0xba1ad4;}['_setupTemplate'](){const _0x26ce62=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Ra,_0x26ce62['if']('isVisible','ck-hidden',_0x9df8fd=>!_0x9df8fd),_0x26ce62['if']('isInContext',ba)]},'children':[{'tag':'div','attributes':{'class':[ka]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x26ce62['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const ya='ck-ai-chat-resources__list';class Rr extends _0x4a993d{['_source'];constructor(_0x17c7df,_0x18dacd){super(_0x17c7df),this['_source']=_0x18dacd,this['extendTemplate']({'attributes':{'class':[ya]}});}['setResources'](_0x553e62,_0x3985c8){this['items']['clear']();let _0x32c910=_0x553e62;if(this['_source']['useDefaultFiltering']&&_0x3985c8&&''!==_0x3985c8['trim']()){const _0x4dadd1=new RegExp(_0x3985c8['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x32c910=_0x553e62['filter'](_0x4b2772=>_0x4dadd1['test'](_0x4b2772['label']));}for(const _0x12ce18 of _0x32c910){const _0x439dc3=new tc(this['locale'],_0x12ce18);_0x439dc3['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x12ce18);}),this['items']['add'](_0x439dc3);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x3985c8);}['highlightText'](_0x46050f){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0xeeff27=>{_0xeeff27['highlightText'](_0x46050f);});}['updateResourceState'](_0x48b4b6,_0x45ab81){for(const _0xaae941 of this['items']){const _0x81d739=_0xaae941;_0x81d739['resource']['id']===_0x48b4b6&&_0x81d739['updateResourceState'](_0x45ab81);}}['_handleResourceSelection'](_0x2d62bf,_0x4683b1){this['fire']('addResourceToContext',{'source':_0x2d62bf,'resource':_0x4683b1});}}class qr extends _0x5d33a3{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x4e8ef1){const t=_0x4e8ef1['t'],_0x57aeb4={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':C(_0x4e8ef1,'AI_CHAT_SEARCH_RESOURCES')};super(_0x4e8ef1,_0x57aeb4['creator']),this['label']=_0x57aeb4['label'],this['_viewConfig']=_0x57aeb4,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x4e8ef1,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x44d9e7){this['fire']('search',_0x44d9e7);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x3a2ec3(),this['iconView']['content']=_0x37f845,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x15b1f1,t){this['resetButtonView']=new _0x3d6e77(_0x15b1f1),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x417878,'class':'ck-search__reset','isVisible':!0x1,'tooltip':!0x0}),this['resetButtonView']['on']('execute',()=>{this['reset'](),this['focus'](),this['fire']('reset');}),this['resetButtonView']['bind']('isVisible')['to'](this['fieldView'],'isEmpty',_0x13ec0a=>!_0x13ec0a),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class Or extends _0x262350{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x37551e,_0x3706d1){super(_0x37551e),this['_source']=_0x3706d1['source'],this['_searchInputVisibleFrom']=_0x3706d1['searchInputVisibleFrom']??0x7,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView'](),this['_searchSection']=this['_createSearchSection'](),this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x2f454a([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new qr(this['locale']);}['_createSearchSection'](){const _0x536bc3=new _0x262350(this['locale']);return _0x536bc3['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x2548b2,_0x4dbf86)=>{this['loadResources'](_0x4dbf86),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x4dbf86);}),_0x536bc3;}['_createResourcesListView'](){const _0x2b39c8=new Rr(this['locale'],this['_source']);return _0x2b39c8['delegate']('addResourceToContext')['to'](this),_0x2b39c8['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x2b39c8;}['_createSkeletonView'](){const _0x77a9ab=new je(this['locale'],Ce['aiChatResources']);return _0x77a9ab['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x5d8573=>!_0x5d8573)]}}),_0x77a9ab;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x2a09ce){const _0x419e11=_0x50fe7e();this['_latestLoadResourcesUid']=_0x419e11,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x2a09ce,'uid':_0x419e11}),this['isLoading']=!0x0;}['setResources'](_0x51b6a5,_0x1a8ce4){if(_0x1a8ce4&&_0x1a8ce4!==this['_latestLoadResourcesUid'])return;const _0x1039bc=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x51b6a5,_0x1039bc),_0x51b6a5['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x16078c,_0xfa2eed){this['_resourcesListView']['updateResourceState'](_0x16078c,_0xfa2eed);}}const va='ck-ai-chat-context-controls__source-balloon-panel',xa='ck-button-icon\x20ck-button-back',La='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class ko{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x43d7a8,_0x1146c8,_0x336cc0){this['_locale']=_0x43d7a8,this['_bodyCollection']=_0x1146c8,this['_config']=_0x336cc0;}['showSourceResourcesBalloon'](_0x40a98e){let _0x27957a=this['_sourceResourceBalloons']['get'](_0x40a98e['id']);_0x27957a||(_0x27957a=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x40a98e['id'],_0x27957a),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x27957a)),this['_addSourceResourceContent'](_0x27957a,_0x40a98e),_0x27957a['show']();const _0x54dfe7=this['_config']['getTargetElement']();_0x54dfe7&&_0x27957a['pin']({'target':_0x54dfe7,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x27b3f4,_0x34bb42,_0x5646d4){const _0x4dc42e=this['_sourceResourceBalloons']['get'](_0x27b3f4);if(!_0x4dc42e)return;const _0x169072=this['_getResourcesViewFromBalloon'](_0x4dc42e);_0x169072&&(_0x169072['setResources'](_0x34bb42,_0x5646d4),_0x169072['once']('change:isLoading',()=>{_0x4dc42e['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x16dc07){const _0x31f6fb=this['_sourceResourceBalloons']['get'](_0x16dc07);_0x31f6fb&&requestAnimationFrame(()=>{_0x31f6fb['hide'](),this['_sourceResourceBalloons']['delete'](_0x16dc07),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x4182af of this['_sourceResourceBalloons']['values']())if(_0x4182af['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x39c4d0,_0xca236,_0x21880c){const _0x168033=this['_sourceResourceBalloons']['get'](_0x39c4d0);if(!_0x168033||!_0x168033['isVisible'])return;const _0x1cb3d1=this['_config']['getTargetElement']();if(!_0x1cb3d1)return;_0x168033['pin']({'target':_0x1cb3d1,'limiter':this['_config']['getLimiterElement']()});const _0x3d304e=this['_getResourcesViewFromBalloon'](_0x168033);_0x3d304e&&_0x3d304e['updateResourceState'](_0xca236,_0x21880c);}['destroy'](){for(const _0x9bc4f9 of this['_sourceResourceBalloons']['values']())_0x9bc4f9['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x167617=new _0x51cd8c(this['_locale']);return _0x167617['extendTemplate']({'attributes':{'class':va}}),this['_bodyCollection']['add'](_0x167617),_0x167617;}['_addSourceResourceContent'](_0x328833,_0x5ad368){_0x328833['content']['clear']();const _0x122a39=this['_createBalloonHeader'](_0x328833,_0x5ad368);_0x328833['content']['add'](_0x122a39);const _0xb81244=this['_createBalloonResourcesView'](_0x5ad368);_0x328833['content']['add'](_0xb81244);}['_createBalloonHeader'](_0x5ce175,_0x259179){const _0x3e95a0=this['_createBackButton'](_0x5ce175),_0x33dde6=new _0x20ce21(this['_locale'],{'label':_0x259179['label'],'class':La});return _0x33dde6['children']['add'](_0x3e95a0,0x0),_0x33dde6;}['_createBackButton'](_0x36581d){const _0x489d91=new _0x3d6e77(this['_locale']);return _0x489d91['set']({'icon':_0x488fbf,'tooltip':C(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':xa}),_0x489d91['on']('execute',()=>{_0x36581d['hide'](),this['_config']['onBackToContext']();}),_0x489d91;}['_createBalloonResourcesView'](_0x5d656c){const _0x4553f6=new Or(this['_locale'],{'source':_0x5d656c,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x4553f6['on']('loadSourceResources',(_0x447984,_0x4f94fc)=>{this['_config']['onLoadSourceResources'](_0x4f94fc);}),_0x4553f6['on']('addResourceToContext',(_0x24d0f1,_0x5badb2)=>{this['_config']['onResourceSelected'](_0x5badb2['source'],_0x5badb2['resource']),this['closeSourceResourceBalloon'](_0x5d656c['id']);}),_0x4553f6;}['_getResourcesViewFromBalloon'](_0x37b0b6){const _0x24bc85=_0x37b0b6['content']['get'](0x1);return _0x24bc85 instanceof Or?_0x24bc85:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x19b765){_0x3bd809({'emitter':_0x19b765,'contextElements':[_0x19b765['element']],'callback':()=>{_0x19b765['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x19b765['isVisible']});}}const ms=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],Eo='ck-ai-chat-context-controls',vo='ck-ai-chat-context-controls__pending-contexts',Vo='ck-ai-chat-context-controls__add-context-balloon-panel',Io='ck-ai-chat-context-controls__add-context-button',Po='ck-ai-chat-context-controls__url-balloon-panel',Ro='ck-ai-chat-context-controls__balloon-button',Uo='ck-ai-chat-context-controls__balloon-button-source',Lo='ck-ai-chat-controls-button',No='ck-ai-chat-context-chips-wrapper-balloon',Oo='ck-ai-chat-controls_context_show-more-button',Mo='ck-ai-chat-context-controls__show-more-balloon-panel',Ho='ck-ai-chat',jo=[_0x51cd8c['defaultPositions']['northArrowSouthWest'],_0x51cd8c['defaultPositions']['northArrowSouth'],_0x51cd8c['defaultPositions']['northArrowSouthEast'],_0x51cd8c['defaultPositions']['southArrowNorthWest'],_0x51cd8c['defaultPositions']['southArrowNorth'],_0x51cd8c['defaultPositions']['southArrowNorthEast']];class us extends _0x262350{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x5342f1,_0x259a42){super(_0x5342f1),this['bodyCollection']=_0x259a42['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x5342f1),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x5342f1),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x5342f1),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x5342f1,_0x259a42);const _0x1fb7e6={'cssClasses':{'showMoreButton':Oo,'showMoreBalloon':Mo,'overflowContainer':No,'controlsButton':Lo}};this['_overflowManager']=new Ao(_0x5342f1,this['_currentContextsChips'],_0x1fb7e6,this['bodyCollection'],this),this['_addContextBalloonConfig']={'buttonView':this['addContextButtonView'],'balloonView':this['_addContextBalloonPanelView'],'hideMethod':this['hideAddContextBalloonPanel']['bind'](this),'showMethod':this['showAddContextBalloonPanel']['bind'](this)},this['_setupTemplate'](),this['_bindEventHandlers']();}['render'](){super['render'](),this['_setupAllBalloonClickOutsideHandlers'](),this['_overflowManager']['setContainerElement'](this['element']),this['_overflowManager']['reorganizeChips']();}['destroy'](){super['destroy'](),this['_overflowManager']['destroy'](),this['_resourcesBalloonView']['destroy']();}['addContextItem'](_0x220be5,_0x4c77b4){const _0x1782e4=this['_createContextButton'](_0x220be5,'current',!0x0,_0x4c77b4);this['_addContextToCollection'](_0x1782e4,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x2a056e){this['_removeContextFromCollection'](_0x2a056e,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x2a056e,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x185c56,_0x4a48a0){let _0x1c94ef=this['_currentContextsChips']['find'](_0x3c7adc=>_0x3c7adc['id']===_0x185c56);_0x1c94ef||(_0x1c94ef=this['_overflowManager']['overflowChips']['find'](_0x5586dc=>_0x5586dc['id']===_0x185c56)),_0x1c94ef&&(_0x1c94ef['isLoading']=_0x4a48a0);}['setConversationContext'](_0x122ec5){this['_conversationContextsChips']['clear']();for(const _0x3674e3 of _0x122ec5){const _0x483e0a=this['_createContextButton'](_0x3674e3,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x483e0a,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x45270b,_0x14148a,_0x4adfc0){this['_resourcesBalloonView']['updateResourceState'](_0x45270b,_0x14148a,_0x4adfc0);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['_showSourceResourcesBalloon'](_0x521fea){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x521fea),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x379a90,_0x2c83ca,_0xe94918,_0x2b7633){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x379a90,_0xe94918,_0x2b7633);}['closeSourceResourceBalloon'](_0x13b1d2){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x13b1d2),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0xfeb70c){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0xfeb70c),this['_setAddContextButtonEnabled'](_0xfeb70c);}['_setAddContextButtonEnabled'](_0x2ff01d){const _0x4f5f74=!_0x2ff01d['document']['isHidden']&&_0x2ff01d['document']['enabled'],_0x3f12f9=_0x2ff01d['urls']['enabled'],_0x13b4ac=_0x2ff01d['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x4f5f74||_0x3f12f9||_0x13b4ac;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Eo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':vo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x3f1a78){const _0x1f55c7=new _0x3d6e77(_0x3f1a78);return _0x1f55c7['set']({'label':C(_0x3f1a78,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Lo+'\x20'+Io,'icon':_0x5a3b98,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x1f55c7;}['_createAddContextBalloonPanelView'](_0x3c03be){return this['_createBaseBalloonPanel'](_0x3c03be,Vo);}['_createUrlBalloonPanelView'](_0x4296e3){const _0x4752f1=this['_createBaseBalloonPanel'](_0x4296e3,Po);return this['_addUrlContent'](_0x4752f1,_0x4296e3),_0x4752f1;}['_createResourcesBalloonView'](_0x5481f8,_0x21e4be){const _0x4b9b54={'searchInputVisibleFrom':_0x21e4be['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});},'onResourceSelected':(_0x208458,_0x18ad9b)=>{this['fire']('addResourceToContext',{'source':_0x208458,'resource':_0x18ad9b});},'onLoadSourceResources':_0x1f511e=>{this['fire']('loadSourceResources',_0x1f511e);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new ko(_0x5481f8,_0x21e4be['bodyCollection'],_0x4b9b54);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Ho)||document['body'];}['_createBaseBalloonPanel'](_0x467db5,_0x213cc5){const _0xb41757=new _0x51cd8c(_0x467db5);return _0xb41757['extendTemplate']({'attributes':{'class':_0x213cc5}}),this['bodyCollection']['add'](_0xb41757),_0xb41757;}['_setBalloonPanelContent'](_0x429235,_0x2735c0,_0x1ab1af){if(_0x429235['content']['clear'](),!_0x1ab1af['document']['isHidden']&&_0x1ab1af['document']['enabled']){const _0x3fa0e7=this['_createBalloonButton'](_0x2735c0,{'label':C(_0x2735c0,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x2adc4e});_0x3fa0e7['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x429235['content']['add'](_0x3fa0e7);}if(_0x1ab1af['urls']['enabled']){const _0x599f34=this['_createBalloonButton'](_0x2735c0,{'label':C(_0x2735c0,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x39c37d});_0x599f34['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}),this['_urlInputView']['focus']();}),_0x429235['content']['add'](_0x599f34);}if(_0x1ab1af['files']['enabled']){const _0x1bfa19=new _0x28699f(_0x2735c0);_0x1bfa19['set']({'label':C(_0x2735c0,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x31c9bb,'withText':!0x0,'tooltip':!0x0,'class':Ro,'allowMultipleFiles':!0x0}),_0x1bfa19['on']('done',(_0x4782c4,_0x398d0e)=>{this['fire']('addFileToContext',_0x398d0e),this['hideAddContextBalloonPanel']();}),_0x1bfa19['tooltip']=!0x0,_0x429235['content']['add'](_0x1bfa19);}for(const _0x1d5257 of _0x1ab1af['sources']){const _0x104200=this['_createBalloonButton'](_0x2735c0,{'label':_0x1d5257['label'],'icon':_0x1d5257['icon']||_0x301d1a,'type':'source'});_0x429235['content']['add'](_0x104200),_0x104200['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x1d5257);});}}['_addUrlContent'](_0x1f5ea9,_0xb5253a){this['_urlInputView']=new To(_0xb5253a),this['_urlInputView']['on']('submitUrl',(_0x39de41,_0x15e264)=>{this['_handleUrlSubmit'](_0x15e264);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});}),_0x1f5ea9['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x261898,_0x461889){const _0x38ecad='source'===_0x461889['type']?new Da(_0x261898):new _0x3d6e77(_0x261898);return _0x38ecad['set']({'label':_0x461889['label'],'icon':_0x461889['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Ro}),_0x38ecad;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x3bd809({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x1df2e0){const _0x421bac=this['_addContextBalloonConfig'];_0x421bac['buttonView']['isOn']=_0x1df2e0,_0x1df2e0?_0x421bac['balloonView']['show']():_0x421bac['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x1e7c18,buttonView:_0x5ca39e,hideMethod:_0x503346}=this['_addContextBalloonConfig'];_0x3bd809({'emitter':_0x1e7c18,'contextElements':[_0x1e7c18['element'],_0x5ca39e['element']],'callback':()=>{_0x503346();},'activator':()=>_0x5ca39e['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x126a47,_0x490670,_0x295f9f=!0x1,_0x2cf2b5=!0x1){const _0x3a89f2='conversation'===_0x490670||!0x0===_0x126a47['isReadOnly'],_0x1a1110=new bo(this['locale'],_0x126a47,_0x3a89f2,_0x295f9f,_0x2cf2b5);return _0x3a89f2||_0x1a1110['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x1a1110['id']);}),_0x1a1110;}['_addContextToCollection'](_0x44655e,_0xead2a9){_0xead2a9['add'](_0x44655e,0x0);}['_removeContextFromCollection'](_0x101df1,_0x35093c){const _0xe6554a=_0x35093c['find'](_0x503409=>_0x503409['id']===_0x101df1);_0xe6554a&&_0x35093c['remove'](_0xe6554a);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}));}['_handleUrlSubmit'](_0x5179f7){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x5179f7);}}class Da extends _0x3d6e77{['arrowView'];constructor(_0x5d6b6b){super(_0x5d6b6b),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Uo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x23f0d0=new _0x3a2ec3();return _0x23f0d0['content']=_0x4a36c6,_0x23f0d0['extendTemplate']({'attributes':{'class':Uo+'__arrow'}}),_0x23f0d0;}}class bs extends _0x262350{['_cancelButtonView'];['_loaderView'];constructor(_0x1f3f8a){super(_0x1f3f8a),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_loaderView']=this['_createLoaderView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-loader-wrapper','ck-reset_all']},'children':[this['_loaderView'],this['_cancelButtonView']]});}['_createCancelButtonView'](){const _0x29b053=new _0x3d6e77(this['locale']);return _0x29b053['set']({'label':C(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x4eb42b}),_0x29b053['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x29b053;}['_createLoaderView'](){const _0x3398b4=new _0x262350(this['locale']);return _0x3398b4['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':C(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x3398b4;}}class Bi extends _0x262350{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x114d97,_0x2936ef){super(_0x114d97),this['_contextPanelView']=this['_createContextPanelView'](_0x114d97,{'bodyCollection':_0x2936ef['bodyCollection'],'searchInputVisibleFrom':_0x2936ef['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x114d97),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x114d97),this['_loaderView']=this['_createLoaderView'](_0x114d97),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x114d97),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...ms)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0xffb1c5=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0xffb1c5['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0xffb1c5['if']('isLoading','ck-hidden',_0x307eca=>_0x307eca||!this['isModelAvailable']),_0xffb1c5['if']('isModelAvailable','ck-hidden',_0x55c8aa=>!_0x55c8aa||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0xffb1c5['if']('isLoading','ck-hidden',_0x530d9b=>!_0x530d9b)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0xffb1c5['if']('isModelAvailable','ck-hidden',_0x5372b2=>_0x5372b2)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x3bd809({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x1347c9,_0x1837d8){return new us(_0x1347c9,_0x1837d8);}['_createPromptInputView'](_0x12dc10){return new ds(_0x12dc10,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x1b5098){return new ps(_0x1b5098);}['_createLoaderView'](_0x337d3b){return new bs(_0x337d3b);}['_createModelUnavailableMessageView'](_0x4553d5){const _0x2148bd=new gs(_0x4553d5);return _0x2148bd['delegate']('startConversation')['to'](this),_0x2148bd;}['_handlePromptInputFocus'](_0x988a5c,_0x3e4c12,_0x390815){_0x390815?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x134c36,_0x5d8292){this['_contextPanelView']['addContextItem'](_0x134c36,_0x5d8292);}['removeContextItem'](_0x5de7ea){this['_contextPanelView']['removeContextItem'](_0x5de7ea);}['setContextItemLoading'](_0x3f3a76,_0xc3bd8b){this['_contextPanelView']['setContextItemLoading'](_0x3f3a76,_0xc3bd8b);}['setIsUploadInProgress'](_0x1158a6){this['_promptInputView']['setIsUploadInProgress'](_0x1158a6);}['setConversationContext'](_0x2a7329){this['_contextPanelView']['setConversationContext'](_0x2a7329);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x1cf205,_0x10ebf1,_0x2ae18d){this['_contextPanelView']['updateResourceState'](_0x1cf205,_0x10ebf1,_0x2ae18d);}['setWebSearch'](_0x502830){this['_promptCapabilitiesView']['setWebSearch'](_0x502830);}['setReasoning'](_0x31948d){this['_promptCapabilitiesView']['setReasoning'](_0x31948d);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x279105){this['_contextPanelView']['setAddContextOptions'](_0x279105);}['setInputPlaceholder'](_0x309046){this['_promptInputView']['setPlaceholderText'](_0x309046);}['setModelList'](_0x5cedfa,_0x38bbd3){this['_displayedModels']=_0x5cedfa,this['_promptCapabilitiesView']['setModelList'](_0x5cedfa,_0x38bbd3);}['setModel'](_0x5c81df){(_0x5c81df?this['_displayedModels']['find'](_0x113ee3=>_0x113ee3['id']===_0x5c81df['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x5c81df)):_0x5c81df?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x44be71){this['_promptCapabilitiesView']['disableModelSelector'](_0x44be71);}['populateSourceResourceBalloon'](_0x3f374c,_0x2d0847,_0x1e23a1,_0x5ef415){this['_contextPanelView']['populateSourceResourceBalloon'](_0x3f374c,_0x2d0847,_0x1e23a1,_0x5ef415);}['closeSourceResourceBalloon'](_0x58bfac){this['_contextPanelView']['closeSourceResourceBalloon'](_0x58bfac);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class gs extends _0x262350{constructor(_0x40b783){super(_0x40b783);const _0x181902=new _0x3d6e77(_0x40b783);_0x181902['set']({'label':C(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x181902['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':C(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x181902]}]});}}class Fi extends _0x20ce21{['conversationStartButton'];['resizeButton'];constructor(_0x551a0e,_0xe6eadd){super(_0x551a0e,{'label':C(_0x551a0e,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_t}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x551a0e),this['children']['add'](this['conversationStartButton']),_0xe6eadd&&(this['resizeButton']=Cs(_0x551a0e,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x4fde7f){const _0x2c82cd=new _0x3d6e77(_0x4fde7f);return _0x2c82cd['set']({'label':C(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x25c434,'class':'ck-ai-chat__start-conversation'}),_0x2c82cd['on']('execute',()=>{this['fire']('startConversation');}),_0x2c82cd;}}class Vi extends _0x262350{constructor(_0x5e85d8){super(_0x5e85d8),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':C(_0x5e85d8,'AI_DISCLAIMER_TEXT')}]}]});}}class At extends _0x262350{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x1e047a,_0x324685){super(_0x1e047a),this['_bodyCollection']=new qt(_0x1e047a),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Fi(_0x1e047a,_0x324685['showResizeButton']),this['chatHeader']['delegate'](...St)['to'](this),this['chatFeed']=new ji(_0x1e047a,this['_bodyCollection']),this['chatFeed']['delegate'](...St)['to'](this),this['chatControls']=new Bi(_0x1e047a,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x324685['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...St)['to'](this),this['chatDisclaimer']=new Vi(_0x1e047a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x1e047a['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x554136,_0x4028c4,_0x29c39d,_0x5e488b){this['chatControls']['populateSourceResourceBalloon'](_0x554136,_0x4028c4,_0x29c39d,_0x5e488b);}['closeSourceResourceBalloon'](_0x554d2e){this['chatControls']['closeSourceResourceBalloon'](_0x554d2e);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class et extends _0x1bcf21{static get['requires'](){return[at];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x23c151){super(_0x23c151);const _0x45f2b0=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new _(),this['_view']=new At(this['context']['locale'],{'showResizeButton':_0x45f2b0['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...St)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x4bb8fb,{showDiff:_0xc0fd5e})=>{this['showDiff']=_0xc0fd5e;}),_0x45f2b0['view']['addTab']({'id':'chat','buttonLabel':C(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_t,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x5709fe=>_0x5709fe),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x1f6f73=>_0x1f6f73),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x19be74){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x19be74['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':C(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x59adf1,staticMessage:_0x65f6f3}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x59adf1,'initialContent':'<p>'+_0x65f6f3+'</p>'});}['addFeedItemUserMessage'](_0x4c4bd8){const _0xa114de=_0x4c4bd8['quickActionData']?.['displayedPrompt']||_0x4c4bd8['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x4c4bd8['contextItems']['values']()),'initialContent':'<p>'+_0xa114de+'</p>','id':_0x4c4bd8['id']});}['addFeedItemError']({errorMessage:_0x2a1557,id:_0x96458e}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x2a1557+'</p>','id':_0x96458e});}['addFeedItemAIReply'](_0x142900){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x142900['interactionId']+':'+_0x142900['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x49bac1){const _0x24fac4=P(this['context']);let _0x4fbda2=_0x24fac4['config']['get']('ai.availableReplyActions')||[...k];if(_0x24fac4['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x30e68d=_0x24fac4['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x30e68d,'value');}}else _0x4fbda2=_0x4fbda2['filter'](_0x4f79b9=>'insertSuggestion'!=_0x4f79b9);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x49bac1['interactionId']+':'+_0x49bac1['id'],'areActionsDisabled':_0x49bac1['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x4fbda2}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x836f06,_0x218a9b){const _0x92f112=this['_view']['chatFeed']['children']['last'];if(_0x92f112 instanceof Et)return this['_view']['chatFeed']['children']['remove'](_0x92f112),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x836f06['id'],'capabilities':{'isWebSearchEnabled':_0x92f112['capabilities']['isWebSearchEnabled']||_0x218a9b['isWebSearchEnabled'],'isReasoningEnabled':_0x92f112['capabilities']['isReasoningEnabled']||_0x218a9b['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x836f06['id'],'capabilities':_0x218a9b});}['updateFeedInteractionHeader'](_0x553306){const _0x10e3d1=this['_view']['chatFeed']['children']['find'](_0x16e697=>_0x16e697['options']['id']==_0x553306['id']&&_0x16e697 instanceof Et);_0x10e3d1&&_0x10e3d1['set']('isVisible',_0x553306['isVisible']);}async['updateFeedItemAIReplyContent'](_0x143db0){const _0x52c44a=_0x143db0['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x36c5a4=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x143db0,'abortSignal':_0x36c5a4,'renderingStrategy':_0x52c44a}),_0x143db0['isDone']&&this['markFeedItemAsDone'](_0x143db0['id']);});}['updateFeedItemAIReplySources'](_0x358b52,_0x3d5bdb){this['_view']['chatFeed']['updateWebSources'](_0x358b52,_0x3d5bdb);}async['updateFeedItemAIReplySuggestionContent'](_0x433a7c){const _0x4c032a=_0x433a7c['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0xa7352b=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x433a7c,'abortSignal':_0xa7352b,'renderingStrategy':_0x4c032a}),_0x433a7c['isDone']&&this['markFeedItemAsDone'](_0x433a7c['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x3b3b46){this['_view']['chatFeed']['updateSuggestionPartState'](_0x3b3b46);}['markFeedItemAsDone'](_0x34e94c){this['_view']['chatFeed']['markItemAsDone'](_0x34e94c);}['removeFeedInteraction'](_0x57091b){this['_view']['chatFeed']['getItemIds']()['filter'](_0x4eb8ad=>_0x4eb8ad['startsWith'](_0x57091b))['forEach'](_0x3eaf67=>this['_view']['chatFeed']['removeItem'](_0x3eaf67));}['startInteraction'](){this['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1}),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x580b5d){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x4be115=>_0x4be115['startsWith'](_0x580b5d['id']))['forEach'](_0x151942=>this['markFeedItemAsDone'](_0x151942)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x4da22a,_0x3a037e){this['_view']['chatControls']['addContextItem'](_0x4da22a,_0x3a037e);}['removeContextItem'](_0x285422){this['_view']['chatControls']['removeContextItem'](_0x285422);}['setContextItemLoading'](_0x49e37e,_0x132225){this['_view']['chatControls']['setContextItemLoading'](_0x49e37e,_0x132225);}['setIsUploadInProgress'](_0x11b9c4){this['_view']['chatControls']['setIsUploadInProgress'](_0x11b9c4);}['setConversationContext'](_0x5e4c3d){this['_view']['chatControls']['setConversationContext'](_0x5e4c3d);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x18ee61,_0x517528,_0x5170eb){this['_view']['chatControls']['updateResourceState'](_0x18ee61,_0x517528,_0x5170eb);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x43bced){this['_view']['chatControls']['setAddContextOptions'](_0x43bced);}['updateCapabilities'](_0x21d54d){this['_view']['chatControls']['setWebSearch'](_0x21d54d['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x21d54d['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x21d54d));}['setSelectedModel'](_0x5e840b,_0x43788c){this['_view']['chatControls']['setModel'](_0x5e840b),_0x43788c&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x5e4d38){this['feedItemRenderingStrategy']=_0x5e4d38;}['toggleLoadingSkeleton'](_0x5c4467){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x5c4467);}['resetConversationTitle'](){this['setConversationTitle'](C(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x398c7e,_0x13746e=!0x1){if(_0x13746e&&!It()&&_0x398c7e['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x398c7e);this['_view']['chatHeader']['label']=_0x398c7e;}['setLoadingMessage'](_0x2962b1){const _0x6e202c=this['_getLoadingMessage'](_0x2962b1);this['_view']['chatFeed']['setLoadingMessage'](_0x6e202c);}['_animateConversationTitle'](_0x38e772){let _0x2ff044=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x38e772[_0x2ff044],_0x2ff044++,_0x2ff044===_0x38e772['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x1d62b3){this['_view']['chatHeader']['isMaximized']=_0x1d62b3;}['_getLoadingMessage'](_0x2480ec){return _0x2480ec?_0x2480ec['isWebSearchEnabled']&&_0x2480ec['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x2480ec['isWebSearchEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x2480ec['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x55416f){return _0x55416f?_0x55416f['isWebSearchEnabled']&&_0x55416f['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x55416f['isWebSearchEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x55416f['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x1baede,_0x234ff8,_0x543b2c,_0x2b66dd){this['_view']['populateSourceResourceBalloon'](_0x1baede,_0x234ff8,_0x543b2c,_0x2b66dd);}['closeSourceResourceBalloon'](_0x34e1c1){this['_view']['closeSourceResourceBalloon'](_0x34e1c1);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0xd1fd96,_0x7ecf98){this['_view']['chatFeed']['scrollToSuggestion'](_0xd1fd96,_0x7ecf98);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Ji extends _0x4a993d{['sections'];constructor(_0x178a27,_0x203a66){super(_0x178a27),this['sections']=_0x203a66,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x4f7eb2){let _0x29c6a5=0x0,_0x3682d3=0x0;for(const _0x47f0e6 of this['sections']){const {resultsCount:_0x50b77d,totalItemsCount:_0x35c003}=_0x47f0e6['filter'](_0x4f7eb2);_0x29c6a5+=_0x50b77d,_0x3682d3+=_0x35c003;}return{'resultsCount':_0x29c6a5,'totalItemsCount':_0x3682d3};}}class Ki extends _0x321758{['title'];['itemsViews'];['_itemsListView'];constructor(_0x54066d,{title:_0xf083fe,items:_0x542ee6}){super(_0x54066d);const _0x1dd20b=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0xf083fe,this['itemsViews']=_0x542ee6;const _0x498600=new _0x262350(_0x54066d);_0x498600['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x4a993d(_0x54066d),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x1dd20b['if']('isVisible','ck-hidden',_0x56324b=>!_0x56324b)]},'children':[_0x498600,this['_itemsListView']]});}['filter'](_0x5c4694){const _0x158419=this['itemsViews']['length'];let _0x11f31c=0x0;for(const _0x2d13a3 of this['itemsViews']){if(_0x5c4694){const _0x28c993=_0x2d13a3['isMatching'](_0x5c4694);_0x2d13a3['isVisible']=!!_0x28c993,_0x2d13a3['highlightText'](_0x5c4694);}else _0x2d13a3['isVisible']=!0x0,_0x2d13a3['highlightText'](null);_0x2d13a3['isVisible']&&_0x11f31c++;}return this['isVisible']=_0x11f31c>0x0,{'resultsCount':_0x11f31c,'totalItemsCount':_0x158419};}['getItem'](_0x5d4704){return this['itemsViews']['find'](_0x1fd455=>_0x1fd455['id']===_0x5d4704);}['removeItem'](_0x14a0d9){const _0x122d2a=this['itemsViews']['indexOf'](_0x14a0d9);-0x1!==_0x122d2a&&(this['itemsViews']['splice'](_0x122d2a,0x1),this['_itemsListView']['items']['remove'](_0x14a0d9));}}class Qi extends/* #__PURE__ -- @preserve */
27
+ _0x4b3894(_0x321758){['id'];static ['LOADING_LABELS']={'remove':'AI_CHAT_HISTORY_LOADING_REMOVING','rename':'AI_CHAT_HISTORY_LOADING_RENAMING','pin':'AI_CHAT_HISTORY_LOADING_PINNING','unpin':'AI_CHAT_HISTORY_LOADING_UNPINNING'};['actions'];['mainContent'];['_titleView'];constructor(_0x50780c,_0x2e4128){super(_0x50780c);const _0xb66f1e=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x2e4128['pinned']),this['set']('loadingState',null),this['id']=_0x2e4128['id'];const {title:_0x25a252,createdAt:_0x483a39,active:_0x1d7973=!0x1}=_0x2e4128;this['_titleView']=new _0x4063f0(),this['_titleView']['text']=_0x25a252,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x59914d=this['_createCheckView'](),_0x1aeae8=this['_createPinButtonView'](_0x50780c),_0x4a2c22=this['_createMenuDropdownView'](),_0x149fad=this['_createEditInputView'](_0x50780c,_0x25a252),_0x440e73=this['_createAcceptEditButtonView'](_0x50780c,_0x149fad),_0x3592dc=this['_createCancelEditButtonView'](_0x50780c,_0x149fad);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x1aeae8),this['actions']['add'](_0x4a2c22),this['on']('change:isEdit',(_0x8ab47e,_0x94b466,_0x421d34)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x421d34?(this['actions']['add'](_0x440e73),this['actions']['add'](_0x3592dc),this['mainContent']['add'](_0x149fad),_0x149fad['element']['focus']()):(this['actions']['add'](_0x1aeae8),this['actions']['add'](_0x4a2c22),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x1d7973?'ck-ai-chat-history__item--active':'',_0xb66f1e['if']('isVisible','ck-hidden',_0x2359a9=>!_0x2359a9),_0xb66f1e['if']('isEdit','ck-ai-chat-history__item--edit')],'role':'listitem'},'children':[{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-check-container']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-check',_0xb66f1e['if']('loadingState','ck-hidden',_0xb20a18=>!!_0xb20a18)]},'children':_0x1d7973?[_0x59914d]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0xb66f1e['if']('loadingState','ck-hidden',_0xcdfb62=>!_0xcdfb62)]},'children':[this['_createSpinnerView']()]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-row']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-content']},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-title',_0xb66f1e['if']('loadingState','ck-hidden',_0xe869fb=>!!_0xe869fb)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0xb66f1e['if']('loadingState','ck-hidden',_0x2838b8=>!_0x2838b8)]},'children':[{'text':_0xb66f1e['to']('loadingState',_0x5a06d9=>_0x5a06d9?C(this['locale'],Qi['LOADING_LABELS'][_0x5a06d9]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x483a39]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-actions']},'children':this['actions']}]}]}),this['on']('click',()=>{this['isEdit']||this['fire']('selectConversation',{'id':this['id']});});}['updateTitle'](_0x4ffbd6){this['_titleView']['text']=_0xb7774e(_0x4ffbd6);}['updateLoadingState'](_0x3c405d,_0x3df2db){this['set']('loadingState',_0x3df2db?_0x3c405d:null);}['_createCheckView'](){const _0x77aed6=new _0x3a2ec3();return _0x77aed6['set']({'content':_0xb9bffe}),_0x77aed6;}['_createPinButtonView'](_0x2efb9c){const _0x1d0447=new _0x3d6e77(_0x2efb9c);return _0x1d0447['set']({'label':C(_0x2efb9c,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x1215aa,'withText':!0x1,'tooltip':!0x0}),_0x1d0447['bind']('isOn')['to'](this,'pinned'),_0x1d0447['on']('execute',()=>{const _0x142811=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x142811});}),_0x1d0447;}['_createMenuDropdownView'](){const _0x4345c9=_0x33079d(this['locale'],_0x1d9ea1),_0x33e335=_0x4345c9['panelView']['children'];_0x4345c9['buttonView']['set']({'label':C(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x2c2132}),_0x4345c9['panelPosition']='sw';const _0x170bce=new _0x3d6e77(this['locale']);_0x170bce['label']=C(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x170bce['withText']=!0x0,_0x170bce['on']('execute',()=>{this['isEdit']=!0x0;});const _0x3d17cf=new _0x3d6e77(this['locale']);_0x3d17cf['label']=C(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x3d17cf['withText']=!0x0,_0x3d17cf['on']('execute',()=>{this['showConfirm'](C(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x385e2f=new _0x4a993d(this['locale']),_0x9c971f=new _0x321758(this['locale']);_0x9c971f['children']['add'](_0x170bce);const _0x57625e=new _0x321758(this['locale']);return _0x57625e['children']['add'](_0x3d17cf),_0x385e2f['items']['addMany']([_0x9c971f,_0x57625e]),_0x33e335['add'](_0x385e2f),_0x4345c9;}['_createEditInputView'](_0x4c20a8,_0x55505a){const _0x21bc30=new _0x3e9226(_0x4c20a8),_0x341ce6=_0x21bc30['bindTemplate'];return _0x21bc30['value']=_0x55505a,_0x21bc30['extendTemplate']({'on':{'keydown':_0x341ce6['to'](_0x445465=>{'Enter'==_0x445465['key']&&this['_commitEditInputValue'](_0x21bc30);})}}),_0x21bc30;}['_createAcceptEditButtonView'](_0x3fa59d,_0x5885e5){const _0x179a90=new _0x3d6e77(_0x3fa59d);return _0x179a90['set']({'icon':_0xb9bffe,'withText':!0x1,'tooltip':C(_0x3fa59d,'AI_CHAT_HISTORY_ACCEPT')}),_0x179a90['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x179a90['on']('execute',()=>{this['_commitEditInputValue'](_0x5885e5);}),_0x179a90;}['_commitEditInputValue'](_0x589916){const _0x2bc1b6=_0x589916['element']['value']||'';this['_titleView']['text']=_0x2bc1b6,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x2bc1b6});}['_createCancelEditButtonView'](_0xa8614f,_0x5bfec9){const _0x40e5e6=new _0x3d6e77(_0xa8614f);return _0x40e5e6['set']({'icon':_0x417878,'withText':!0x1,'tooltip':C(_0xa8614f,'AI_CHAT_HISTORY_CANCEL')}),_0x40e5e6['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x40e5e6['on']('execute',()=>{this['isEdit']=!0x1,_0x5bfec9['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x40e5e6;}['_createSpinnerView'](){const _0x329ebf=new Le('tiny');return _0x329ebf['isVisible']=!0x0,_0x329ebf;}['isMatching'](_0x3dda2d){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x3dda2d)?{'title':!0x0}:null;}['highlightText'](_0x292742){this['_titleView']['highlightText'](_0x292742);}}class vt extends _0x262350{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x5e6808,_0xffbd12){super(_0x5e6808),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x3a9128=new _0x20ce21(_0x5e6808,{'label':C(_0x5e6808,'AI_CHAT_HISTORY_HEADING'),'icon':Ht,'class':'ck-ai-header\x20ck-ai-header_history'});_0xffbd12&&(this['resizeButton']=Cs(_0x5e6808,this),_0x3a9128['children']['add'](this['resizeButton'])),this['sectionsView']=new Ji(_0x5e6808,[]),this['sectionsView']['delegate'](...Xi)['to'](this),this['errorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['on']('change:isLoading',()=>this['_updateViewVisibility']()),this['on']('change:hasItems',()=>this['_updateViewVisibility']()),this['on']('change:errorMessage',()=>this['_updateViewVisibility']()),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat-history','ck-rounded-corners'],'dir':'ltr'},'children':[_0x3a9128,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['errorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems']&&!this['errorMessage'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'];}['_createSearchView'](){const _0x44e359=new _0x4a200b(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':C(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x1b6c67=>C(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x1b6c67),'secondary':C(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x44e359['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x44e359['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x52c2ae=>!_0x52c2ae)]}}),_0x44e359;}['_createSkeletonView'](){const _0x9c9804=new je(this['locale'],Ce['aiHistory']);return _0x9c9804['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x305f3b=>!_0x305f3b)]}}),_0x9c9804;}['_createErrorView'](){const _0x3b9a49=new _0x262350(this['locale']),_0x3d9db0=new _0x3d6e77(this['locale']);return _0x3d9db0['set']({'withText':!0x1,'icon':_0x417878,'class':'ck-ai-chat-error__dismiss-button'}),_0x3d9db0['bind']('isVisible')['to'](this,'hasItems',_0xa61a67=>!!_0xa61a67),_0x3d9db0['on']('execute',()=>{this['errorMessage']='';}),_0x3b9a49['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x3b1631=>!_0x3b1631)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x3d9db0]}),_0x3b9a49;}['_createEmptyStateView'](){const _0x20f4dd=new _0x3d6e77(this['locale']);_0x20f4dd['set']({'label':C(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x25c434,'class':'ck-ai-chat__start-conversation'}),_0x20f4dd['on']('execute',()=>{this['fire']('openChat');});const _0x2023c0=new _0x262350(this['locale']);return _0x2023c0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x56ed7a=>!_0x56ed7a)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[C(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x20f4dd]}),_0x2023c0;}['_createListItemViews'](_0x214b41,_0x3dee9a){const _0x2821b3=[];for(const _0x471b9 of _0x214b41){const _0x575612=new Qi(_0x3dee9a,_0x471b9);_0x575612['delegate'](...Xi)['to'](this),_0x2821b3['push'](_0x575612);}return _0x2821b3;}['updateHistoryItemsWithCategories'](_0x58ea90){const _0x75010=this['locale']||'en',_0x1f69c0=[];for(const _0x5a7a3e of _0x58ea90){const _0x52140d=this['_createListItemViews'](_0x5a7a3e['items'],_0x75010);_0x1f69c0['push'](new Ki(_0x75010,{'title':_0x5a7a3e['title'],'items':_0x52140d}));}this['sectionsView']['sections']=_0x1f69c0,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x1f69c0),this['hasItems']=_0x58ea90['some'](_0x4ceb05=>_0x4ceb05['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x5d173b){for(const _0xa92e4c of this['sectionsView']['sections']){const _0x5c26ec=_0xa92e4c['getItem'](_0x5d173b);if(_0x5c26ec){if(_0xa92e4c['removeItem'](_0x5c26ec),0x0===_0xa92e4c['itemsViews']['length']){const _0x4c3d69=this['sectionsView']['sections']['indexOf'](_0xa92e4c);-0x1!==_0x4c3d69&&(this['sectionsView']['sections']['splice'](_0x4c3d69,0x1),this['sectionsView']['items']['remove'](_0xa92e4c));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x304d4d,_0x297e16){for(const _0x16068e of this['sectionsView']['sections']){const _0x1b0145=_0x16068e['getItem'](_0x304d4d);if(_0x1b0145){_0x1b0145['updateTitle'](_0x297e16);break;}}}['updateItemLoadingState'](_0x160946,_0x2039f9,_0x3381c8){for(const _0x539944 of this['sectionsView']['sections']){const _0x40999c=_0x539944['getItem'](_0x160946);if(_0x40999c){_0x40999c['updateLoadingState'](_0x2039f9,_0x3381c8);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x538ba6=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x538ba6);}}}const Xi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class jt extends _0x1bcf21{static get['requires'](){return[at];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x282d95){super(_0x282d95);const _0x48018d=this['context']['plugins']['get']('AITabs');this['_historyView']=new vt(this['context']['locale'],_0x48018d['showResizeButton']),this['_historyView']['delegate'](...Xi)['to'](this),_0x48018d['view']['addTab']({'id':'history','buttonLabel':C(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x384d59){this['_historyView']['removeHistoryItem'](_0x384d59);}['updateItems'](_0x46a778){this['_historyView']['updateHistoryItemsWithCategories'](_0x46a778);}['updateItemTitle'](_0x53eb96,_0x26d39d){this['_historyView']['updateItemTitle'](_0x53eb96,_0x26d39d);}['updateItemLoadingState'](_0x36a567,_0x49bf7e,_0x1c05ec){this['_historyView']['updateItemLoadingState'](_0x36a567,_0x49bf7e,_0x1c05ec);}['setLoadingSkeleton'](_0x69472d){this['_historyView']['isLoading']=_0x69472d;}['showError'](_0x313cee){this['_historyView']['errorMessage']=_0x313cee;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x169cec){this['_historyView']['isMaximized']=_0x169cec;}}class De extends _0x33fb62(){['id'];['createdAt'];constructor({id:_0x33d19b,title:_0x376a7f,createdAt:_0x2e32e1,updatedAt:_0x208f2a,pinned:_0x110865}){super(),this['id']=_0x33d19b,this['createdAt']=new Date(_0x2e32e1),this['set']('title',_0x376a7f),this['set']('updatedAt',_0x208f2a?new Date(_0x208f2a):null),this['set']('pinned',_0x110865||!0x1);}['updateTitle'](_0x4848e0){this['set']('title',_0xb7774e(_0x4848e0)),this['updatedAt']=new Date();}['updatePinned'](_0x1fdd76){this['set']('pinned',_0x1fdd76),this['updatedAt']=new Date();}}class Tt extends _0x2ebfa6(){['items']=[];['connector'];['group'];constructor({connector:_0x35b118,group:_0x3fb609}){super(),this['connector']=_0x35b118,this['group']=_0x3fb609;}async['init'](){try{const _0x591708=this['connector']['fetchConversations'](this['group']),_0x4764e0=await _0x591708['getConversations']();this['loadItems'](_0x4764e0);}catch(_0x411870){this['fire']('error',{'error':_0x411870,'operation':'init'});}}['addItem'](_0x44d63f){this['items']['push'](_0x44d63f);}async['removeItem'](_0x3a77d3){const _0x4f1678=this['items']['findIndex'](_0x349860=>_0x349860['id']===_0x3a77d3);if(-0x1===_0x4f1678)return!0x1;try{return await this['connector']['deleteConversation'](_0x3a77d3)['execute'](),this['items']['splice'](_0x4f1678,0x1),this['fire']('itemRemoved',{'itemId':_0x3a77d3}),!0x0;}catch(_0x309a71){return this['fire']('error',{'error':_0x309a71,'operation':'removeItem','itemId':_0x3a77d3}),!0x1;}}['getItem'](_0x47dcab){return this['items']['find'](_0x5c8429=>_0x5c8429['id']===_0x47dcab);}async['updateItemTitle'](_0x3407f6,_0xf68c06){const _0x470012=this['getItem'](_0x3407f6);if(!_0x470012)return!0x1;try{return await this['connector']['updateConversation'](_0x3407f6,{'title':_0xf68c06})['getResult'](),_0x470012['updateTitle'](_0xf68c06),this['fire']('itemUpdated',{'itemId':_0x3407f6,'updates':{'title':_0xf68c06}}),!0x0;}catch(_0x259954){return this['fire']('error',{'error':_0x259954,'operation':'updateItemTitle','itemId':_0x3407f6}),!0x1;}}async['updateItemPinned'](_0x58b4be,_0xff2d7b){const _0x2fab46=this['getItem'](_0x58b4be);if(!_0x2fab46)return!0x1;try{return await this['connector']['updateConversation'](_0x58b4be,{'pinned':_0xff2d7b})['getResult'](),_0x2fab46['updatePinned'](_0xff2d7b),this['fire']('itemUpdated',{'itemId':_0x58b4be,'updates':{'pinned':_0xff2d7b}}),!0x0;}catch(_0x49376f){return this['fire']('error',{'error':_0x49376f,'operation':'updateItemPinned','itemId':_0x58b4be}),!0x1;}}['loadItems'](_0x5a6376){try{this['items']=[],_0x5a6376['map'](_0x1ff431=>{this['addItem'](new De(_0x1ff431));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x1a346c){this['fire']('error',{'error':_0x1a346c,'operation':'loadItems'});}}['getItems'](_0x391574={}){const _0x1f6d38=void 0x0!==_0x391574['pinned']&&_0x391574['pinned'],_0x5ac1c7=_0x391574['from']?new Date(_0x391574['from']['getFullYear'](),_0x391574['from']['getMonth'](),_0x391574['from']['getDate']()):null,_0x3658ef=_0x391574['to']?new Date(_0x391574['to']['getFullYear'](),_0x391574['to']['getMonth'](),_0x391574['to']['getDate']()):null;return this['items']['filter'](_0x18dace=>{if(_0x18dace['pinned']!==_0x1f6d38)return!0x1;if(_0x3658ef){const _0x3a04af=new Date(_0x18dace['createdAt']['getFullYear'](),_0x18dace['createdAt']['getMonth'](),_0x18dace['createdAt']['getDate']());return _0x5ac1c7?_0x5ac1c7['getTime']()===_0x3658ef['getTime']()?_0x3a04af['getTime']()===_0x5ac1c7['getTime']():_0x3a04af<_0x3658ef&&_0x3a04af>=_0x5ac1c7:_0x3a04af<_0x3658ef;}return!0x0;});}}class yt extends _0x1bcf21{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[s,tt,jt,at];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](s),this['_aiChatHistoryUi']=this['context']['plugins']['get'](jt),this['_aiChatController']=this['context']['plugins']['get'](tt);const _0x29b4c9=this['context']['plugins']['get'](at),_0x38babd=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x38babd}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x551939,_0x66a686)=>{this['_setItemLoading'](_0x66a686['id'],'remove'),this['_handleRemove'](_0x66a686['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x3721f1,_0x348b86)=>{this['_setItemLoading'](_0x348b86['id'],'rename'),this['_handleEditTitle'](_0x348b86['id'],_0x348b86['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x55453f,_0x2b9079)=>{void 0x0!==_0x2b9079['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x2b9079['itemId'],_0x2b9079['updates']['title']),void 0x0!==_0x2b9079['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x2b9079['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x2e5ad6,_0x463380)=>{this['_aiChatController']['handleRemovedConversation'](_0x463380['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x463380['itemId']),this['_clearItemLoading'](_0x463380['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x59a30e,_0x261d11)=>{this['_handleHistoryErrorUI'](_0x261d11['error'],_0x261d11['operation'],_0x261d11['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x264613,_0x38fd2e)=>{this['_handleSelectConversation'](_0x38fd2e['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x48dd94,_0x55badd)=>{const _0x9da90a=_0x55badd['pinned']?'pin':'unpin';this['_setItemLoading'](_0x55badd['id'],_0x9da90a),this['_handleTogglePin'](_0x55badd['id'],_0x55badd['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x29b4c9['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x29b4c9['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x29b4c9,'resizedTabs',(_0x13ce43,_0x56c0ac)=>{this['_setIsMaximized'](_0x56c0ac);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x29b4c9['resize']();});}async['_handleEditTitle'](_0x158fc2,_0x2df908){await this['history']['updateItemTitle'](_0x158fc2,_0x2df908);}async['_handleTogglePin'](_0x5807dc,_0xb3260a){await this['history']['updateItemPinned'](_0x5807dc,_0xb3260a);}async['_handleRemove'](_0x45199f){await this['history']['removeItem'](_0x45199f);}async['_handleSelectConversation'](_0x2e1715){await this['_aiChatController']['loadConversation'](_0x2e1715);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x5edd7a=this['_aiChatController']['activeConversation']?.['id'],_0x31d9a1=this['_getCategorizedItems']()['map'](_0x4fa5ed=>({'title':_0x4fa5ed['title'],'items':_0x4fa5ed['items']['map'](_0x1bcda0=>({'id':_0x1bcda0['id'],'title':_0x1bcda0['title']||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x1bcda0['createdAt'])['toLocaleDateString'](),'active':_0x1bcda0['id']===_0x5edd7a,'pinned':_0x1bcda0['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x31d9a1);}['_setItemLoading'](_0x2f4527,_0x58ad0e){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2f4527,_0x58ad0e,!0x0);}['_clearItemLoading'](_0x2e0cfa){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2e0cfa,null,!0x1);}['_handleHistoryErrorUI'](_0xccfac6,_0x56289b,_0xdd728c){const _0x1a5547=this['_generateErrorMessage'](_0x56289b,_0xdd728c);this['_aiChatHistoryUi']['showError'](_0x1a5547),_0xdd728c&&this['_clearItemLoading'](_0xdd728c),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x2d8175,_0x4df326){const _0x382f60=_0x4df326?this['history']['getItem'](_0x4df326):null,_0x1fe756=_0x382f60?.['title']||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x2d8175){case'updateItemTitle':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x1fe756);case'updateItemPinned':{const _0x49f64a=C(this['context']['locale'],_0x382f60?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x49f64a,_0x1fe756]);}case'removeItem':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x1fe756);case'init':case'loadItems':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x26bb62=new Date(),_0x4384e5=new Date(_0x26bb62['getFullYear'](),_0x26bb62['getMonth'](),_0x26bb62['getDate']()),_0x4d3e0c=new Date(_0x4384e5);_0x4d3e0c['setDate'](_0x4d3e0c['getDate']()-0x1);const _0x2dbf11=new Date(_0x4384e5);_0x2dbf11['setDate'](_0x2dbf11['getDate']()-0xe);const _0x3ef8ea=this['history']['getItems']({'pinned':!0x0}),_0x46544d=this['history']['getItems']({'from':_0x4384e5,'to':_0x4384e5}),_0x20801a=this['history']['getItems']({'from':_0x4d3e0c,'to':_0x4d3e0c}),_0x4ccfe0=this['history']['getItems']({'from':_0x2dbf11,'to':_0x4d3e0c}),_0x1384e3=this['history']['getItems']({'to':_0x2dbf11}),_0x3f2190=[];return _0x3ef8ea['length']>0x0&&_0x3f2190['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x3ef8ea}),_0x46544d['length']>0x0&&_0x3f2190['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x46544d}),_0x20801a['length']>0x0&&_0x3f2190['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x20801a}),_0x4ccfe0['length']>0x0&&_0x3f2190['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x4ccfe0}),_0x1384e3['length']>0x0&&_0x3f2190['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x1384e3}),_0x3f2190;}['_setIsMaximized'](_0x79cac2){this['_aiChatHistoryUi']['setIsMaximized'](_0x79cac2);}}class it extends _0x1bcf21{static get['requires'](){return[yt,jt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Pa extends _0x1bcf21{static get['requires'](){return[tt,c,et,it];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5d8e8a){super(_0x5d8e8a),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](tt)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](tt)['startConversation']();}async['sendMessage']({message:_0xffd220,quickActionData:_0x40a9bb}){await this['context']['plugins']['get'](tt)['sendMessage']({'message':_0xffd220,'quickActionData':_0x40a9bb});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](tt)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](tt)['focusPromptInput']();}}class co extends Nt{constructor(_0x4e6fb1){super(_0x4e6fb1);const _0x2d1e91=_0x4e6fb1['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x2d1e91,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0xd9fee1=this['editor']['plugins']['get']('AITabs')['view'];_0xd9fee1['isVisible']=!_0xd9fee1['isVisible'];}}class bt extends _0x24349a{static get['requires'](){return[at];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2bf6ed=this['editor'];_0x2bf6ed['commands']['add']('toggleAi',new co(_0x2bf6ed)),_0x2bf6ed['ui']['componentFactory']['add']('toggleAi',()=>{const _0x318bdc=this['_createAIUIButton'](_0x3d6e77);return _0x318bdc['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x318bdc;}),_0x2bf6ed['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x2df6f1=this['_createAIUIButton'](_0x470b70);return _0x2df6f1['set']({'role':'menuitemcheckbox'}),_0x2df6f1;});}['_createAIUIButton'](_0x32dc0f){const _0x5e670a=this['editor'],_0x1eefc5=_0x5e670a['commands']['get']('toggleAi'),_0x1e0596=new _0x32dc0f(_0x5e670a['locale']);return _0x1e0596['set']({'label':C(_0x5e670a['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x208fd0,'isToggleable':!0x0}),_0x1e0596['bind']('isEnabled')['to'](_0x1eefc5),_0x1e0596['bind']('isOn')['to'](_0x1eefc5,'value',_0x39fc26=>!!_0x39fc26),this['listenTo'](_0x1e0596,'execute',()=>{_0x1eefc5['execute']();}),_0x1e0596;}}class Ha extends _0x24349a{static get['requires'](){return[bt,Pt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Gt(_0x1d8e17,_0xb38bd6,_0x598a78=!0x1,_0x362ee6=!0x0,_0xcc15d5=!0x0){return()=>{const _0x3c9de6=_0x1d8e17['locale'],_0x18c0b3=new _0x3d6e77(_0x3c9de6),_0x52e0d7=_0x18c0b3['bindTemplate'];_0xcc15d5&&_0x18c0b3['extendTemplate']({'on':{'mouseenter':_0x52e0d7['to'](()=>{_0x18c0b3['focus']();})}});const _0x23ada6=_0xb38bd6['icon']??_0xb38bd6['parent']?.['icon'];return _0x18c0b3['set']({'label':_0xb38bd6['displayedPrompt'],'withText':_0x598a78,'role':'menuitem','icon':_0x362ee6?_0x23ada6??_0x3133c5:void 0x0,'tooltip':!_0x598a78,'class':'ck-ai-quick-actions-button'}),_0x18c0b3['on']('execute',()=>{_0x1d8e17['editing']['view']['focus'](),_0x1d8e17['commands']['execute']('aiQuickAction',_0xb38bd6);}),_0x18c0b3;};}const Ls='menu',Ns='menuitem';class ao extends _0x262350{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x3bf656,_0x39f768,_0x4ec2e2,_0x25f69e){const _0x481230=_0x3bf656['locale'];super(_0x481230),this['_bodyCollection']=_0x25f69e;const _0x15e445=this['_createListItems'](_0x3bf656,_0x39f768,_0x4ec2e2);this['optionsListView']=new _0x4a993d(_0x481230),this['optionsListView']['role']=Ls,this['optionsListView']['items']['addMany'](_0x15e445),this['focusTracker']=new ts(),this['keystrokes']=new _0x25a17d(),this['_focusables']=_0x15e445,this['focusCycler']=new $t({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x481230['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0x20b1b3,_0x2b1a1a,_0x20a84a){const _0x587730=new _0x2f454a();return _0x2b1a1a['forEach'](_0x382744=>{'actions'in _0x382744?_0x587730['add'](this['_createActionGroupButton'](_0x20b1b3,_0x382744,_0x20a84a)):_0x587730['add'](this['_createActionButton'](_0x20b1b3,_0x382744));}),_0x587730;}['_createActionButton'](_0x314460,_0x27f65a){const _0x451709=new _0x321758(this['locale']),_0x54ce8b=Gt(_0x314460,_0x27f65a,!0x0,void 0x0!==_0x27f65a['icon'])();return _0x451709['children']['add'](_0x54ce8b),_0x451709;}['_createActionGroupButton'](_0x24a3ce,_0x4a841f,_0x41c9b1){const _0x414af0=new _0x321758(this['locale']),_0x2f9eee=new _0x270dfe(this['locale']),_0x2e7492=_0x2f9eee['bindTemplate'],_0x4d6026='rtl'===_0x41c9b1['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x45342a=this['_createGroupActionsList'](_0x24a3ce,_0x4a841f['actions'],_0x41c9b1);_0x2f9eee['set']({'label':_0x4a841f['label'],'withText':!0x0,'role':Ns,'icon':_0x4a841f['icon']??_0x3133c5}),_0x2f9eee['extendTemplate']({'on':{'mouseenter':_0x2e7492['to'](()=>{_0x2f9eee['focus']();})}});const _0x15bb8f=new _0x51cd8c(this['locale']);return _0x15bb8f['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x2e7492['to'](_0x5021f0=>{_0x5021f0['key']==_0x4d6026&&(_0x2f9eee['focus'](),this['_hideNestedPanel'](_0x15bb8f));})}}),_0x2f9eee['bind']('isOn')['to'](_0x15bb8f,'isVisible'),this['_bodyCollection']['add'](_0x15bb8f),_0x15bb8f['content']['add'](_0x45342a),this['_setupGroupMenuBehavior'](_0x2f9eee,_0x15bb8f),_0x414af0['children']['add'](_0x2f9eee),_0x414af0;}['_createGroupActionsList'](_0x2d6a6,_0x286e49,_0x16e2fc){const _0x163d4f=new _0x4a993d(this['locale']);return _0x163d4f['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x286e49['forEach'](_0x5f2e22=>{const _0x11a8bd=new _0x321758(this['locale']),_0x4acd11=Gt(_0x2d6a6,_0x5f2e22,!0x0,!0x1)();_0x11a8bd['children']['add'](_0x4acd11),_0x16e2fc['focusTracker']['add'](_0x4acd11),_0x163d4f['items']['add'](_0x11a8bd);}),_0x163d4f;}['_setupGroupMenuBehavior'](_0x2d79ac,_0x3d88ae){const _0x15b1a3=_0x2d79ac['bindTemplate'],_0x4cc1b8='rtl'===_0x2d79ac['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x2d79ac['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x15b1a3['to'](()=>{this['_showNestedPanel'](_0x3d88ae,_0x2d79ac);}),'mouseleave':_0x15b1a3['to'](_0x4dd0e3=>{const _0x519735=_0x4dd0e3['relatedTarget'];this['_isMovingToNestedMenu'](_0x519735,_0x3d88ae)||this['_hideNestedPanel'](_0x3d88ae);}),'keydown':_0x15b1a3['to'](_0x544fe0=>{_0x544fe0['key']==_0x4cc1b8&&(this['_showNestedPanel'](_0x3d88ae,_0x2d79ac),_0x3d88ae['content']['get'](0x0)['focus']());})}}),_0x3d88ae['on']('render',()=>{_0x3d88ae['element']?.['addEventListener']('mouseleave',_0xe29f50=>{const _0x50bf1d=_0xe29f50['relatedTarget'];_0x2d79ac['element']?.['contains'](_0x50bf1d)||this['_isMovingToNestedMenu'](_0x50bf1d,_0x3d88ae)||this['_hideNestedPanel'](_0x3d88ae);});});}['_showNestedPanel'](_0x1091fa,_0x150340){this['_openNestedPanels']['forEach'](_0x1c446a=>{_0x1c446a!==_0x1091fa&&_0x1c446a['isVisible']&&_0x1c446a['hide']();}),_0x1091fa['show'](),_0x1091fa['pin']({'positions':[_0x6092f6['eastSouth']],'target':_0x150340['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x1091fa);}['_hideNestedPanel'](_0x4161ad){_0x4161ad['hide'](),this['_openNestedPanels']['delete'](_0x4161ad);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x3b6253=>_0x3b6253['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x9bb174,_0x210758){if(!_0x9bb174)return!0x1;if(_0x210758['element']?.['contains'](_0x9bb174))return!0x0;const _0x1aa4eb=_0x9bb174;return _0x1aa4eb['closest']&&(null!==_0x1aa4eb['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x1aa4eb['closest']('.ck-ai-quick-actions-group-list')||null!==_0x1aa4eb['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function Yt(_0x16eda4,_0x4db7fc,_0x4071a5,_0x56d561){return()=>{const _0x27df62=_0x16eda4['locale'],_0x58707c=_0x33079d(_0x27df62);_0x58707c['buttonView']['set']({'icon':_0x4071a5['icon']??_0x3133c5,'label':_0x4071a5['label'],'tooltip':!0x0}),_0x58707c['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x3928f8=new ao(_0x16eda4,_0x4db7fc,_0x58707c,_0x56d561);return _0x58707c['panelView']['children']['add'](_0x3928f8),_0x58707c;};}const Ft='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Wt='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Bt='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form.-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var Ot=function(_0x3bcda9){return _0x3bcda9['CHAT']='CHAT',_0x3bcda9['ACTION']='ACTION',_0x3bcda9['REVIEW']='REVIEW',_0x3bcda9;}({}),Ma=function(_0x1cca84){return _0x1cca84['CHAT']='AIChat',_0x1cca84['ACTION']='AIActions',_0x1cca84['REVIEW']='AIReviewMode',_0x1cca84;}({});class ui extends _0x24349a{static get['requires'](){return[zt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x58fb78){return function(_0x2bfdde){const _0x577292=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x2bfdde['uiLanguage']),_0x2c57f6=_0x577292||'English',_0x1e2ac3=[{'id':'ask-ai','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Ut},{'id':'chat-commands','label':C(_0x2bfdde,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Ut,'actions':[{'id':'explain','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ft['replace']('%0',_0x2c57f6),'type':'CHAT'},{'id':'summarize','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Wt['replace']('%0',_0x2c57f6),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Bt['replace']('%0',_0x2c57f6),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Mt},{'id':'continue','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Kt},{'id':'fix-grammar','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Rt},{'id':'adjust-length','label':C(_0x2bfdde,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Qt,'actions':[{'id':'make-shorter','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':C(_0x2bfdde,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':xt,'actions':[{'id':'make-tone-casual','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':C(_0x2bfdde,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Dt,'actions':[{'id':'translate-to-english','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':C(_0x2bfdde,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':C(_0x2bfdde,'AI_QUICK_ACTIONS_OTHER'),'icon':Lt,'actions':[]}];return _0x1e2ac3;}(_0x58fb78);}['_getDefaultAndCustomActions'](){const _0x1726fa=ui['getDefaultQuickActions'](this['editor']['locale']),_0x1f2d66=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x582e82=>({..._0x582e82,'icon':void 0x0}));return _0x1726fa['find'](_0x558666=>'other'===_0x558666['id'])['actions']['push'](..._0x1f2d66),_0x1726fa;}['_initializeQuickActionsComponentsAndCommands'](){const _0x33d66b=new qt(this['editor']['locale']);_0x33d66b['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x33d66b),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x33d66b);}['_initializeQuickActionsDropdown'](_0x207b3e){this['editor']['ui']['componentFactory']['add']('aiQuickActions',Yt(this['editor'],this['_quickActionsDefinition'],{'icon':_0x3133c5,'label':C(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x207b3e));}['_prepareQuickActionsDefinition'](_0x462d3d){this['_quickActionsDefinition']=_0x462d3d['map'](_0x901a29=>{if('actions'in _0x901a29){const _0x4205a0=_0x901a29;return{..._0x4205a0,'actions':_0x4205a0['actions']['map'](_0x1946f1=>{const {actions:_0x163363,..._0x9da856}=_0x4205a0;return{..._0x1946f1,'parent':_0x9da856};})['filter'](_0x21637d=>this['_shouldIncludeAction'](_0x21637d))};}return _0x901a29;})['filter'](_0x16f4ac=>'actions'in _0x16f4ac?_0x16f4ac['actions']['length']>0x0:this['_shouldIncludeAction'](_0x16f4ac));}['_shouldIncludeAction'](_0x118bbc){const _0x385c69=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ma[_0x118bbc['type']])&&!_0x385c69['includes'](_0x118bbc['id']);}['_initializeQuickActionsComponents'](_0x1deb56){this['_quickActionsDefinition']['forEach'](_0xf1d83f=>{if('actions'in _0xf1d83f){const _0xaad909=Yt(this['editor'],_0xf1d83f['actions'],_0xf1d83f,_0x1deb56);this['editor']['ui']['componentFactory']['add'](_0xf1d83f['id'],_0xaad909),_0xf1d83f['actions']['forEach'](_0x5e0ec5=>{const _0x92ce6c=Gt(this['editor'],_0x5e0ec5);this['editor']['ui']['componentFactory']['add'](_0x5e0ec5['id'],_0x92ce6c);});}else{const _0x2fb92b=Gt(this['editor'],_0xf1d83f,!0x1,!0x0,!0x1);this['editor']['ui']['componentFactory']['add'](_0xf1d83f['id'],_0x2fb92b);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x566afd=>{const _0x41b8d1=new _0x3cd2d0(_0x566afd),_0x2f2e24=C(_0x566afd,'AI_QUICK_ACTIONS_HEADING');_0x41b8d1['buttonView']['set']({'label':_0x2f2e24,'icon':_0x3133c5});const _0x5e0a16=new ti(_0x566afd);_0x5e0a16['set']({'ariaLabel':_0x2f2e24,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x2c8950=>{if('actions'in _0x2c8950){const _0x481db6=_0x2c8950,_0x22eac3=new _0x426725(_0x566afd,_0x41b8d1),_0x197dc8=new _0x3cd2d0(_0x566afd),_0x4a2fe8=new ti(_0x566afd);_0x197dc8['buttonView']['set']({'label':_0x481db6['label'],'icon':_0x481db6['icon']}),_0x481db6['actions']['forEach'](_0x5e84fb=>{const _0x1c378c=new _0x426725(_0x566afd,_0x197dc8),_0x4a6f2a=new _0x470b70(_0x566afd);_0x4a6f2a['set']({'label':_0x5e84fb['displayedPrompt'],'icon':_0x5e84fb['icon'],'role':'menuitem'}),_0x4a6f2a['on']('execute',()=>{this['_executeQuickAction'](_0x5e84fb);}),_0x4a6f2a['delegate']('execute')['to'](_0x197dc8),_0x1c378c['children']['add'](_0x4a6f2a),_0x4a2fe8['items']['add'](_0x1c378c);}),_0x197dc8['panelView']['children']['add'](_0x4a2fe8),_0x22eac3['children']['add'](_0x197dc8),_0x5e0a16['items']['add'](_0x22eac3);}else{const _0x3101a2=_0x2c8950,_0x426b0d=new _0x426725(_0x566afd,_0x41b8d1),_0x568e36=new _0x470b70(_0x566afd);_0x568e36['set']({'label':_0x3101a2['displayedPrompt'],'icon':_0x3101a2['icon'],'role':'menuitem'}),_0x568e36['on']('execute',()=>{this['_executeQuickAction'](_0x3101a2);}),_0x568e36['delegate']('execute')['to'](_0x41b8d1),_0x426b0d['children']['add'](_0x568e36),_0x5e0a16['items']['add'](_0x426b0d);}});const _0x5d324a=Object['values'](Ma)['some'](_0x19f39d=>this['editor']['plugins']['has'](_0x19f39d));return _0x41b8d1['set']({'isEnabled':_0x5d324a}),_0x41b8d1['panelView']['children']['add'](_0x5e0a16),_0x41b8d1;});}['_executeQuickAction'](_0x5537b6){const _0xf21df9=this['editor'];_0xf21df9['editing']['view']['focus'](),_0xf21df9['commands']['execute']('aiQuickAction',_0x5537b6);const _0x28fe80=_0xf21df9['ui']['view']['menuBarView'];_0x28fe80&&_0x28fe80['close']&&_0x28fe80['close']();}}class Ai extends Nt{['execute'](_0x324bc0){switch(this['_expandSelectionIfCollapsed'](),_0x324bc0['type']){case Ot['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x23388d=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0xb61eac('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x23388d});}this['_handleAIChatAction'](_0x324bc0);break;case Ot['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x208252=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0xb61eac('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x208252});}this['_handleAIActionsAction'](_0x324bc0);break;case Ot['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x451f32=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0xb61eac('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x451f32});}this['_handleAIReviewAction'](_0x324bc0);}}async['_handleAIChatAction'](_0x2e6af7){const _0x567165=this['editor']['plugins']['get']('AIChat'),_0x3c4e68=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x2e6af7['id'])_0x3c4e68['removeSelectionFromChatContext'](),await _0x567165['addSelectionToChatContext'](),_0x567165['focusPromptInput']();else await _0x567165['startConversation'](),_0x3c4e68['removeSelectionFromChatContext'](),await _0x567165['addSelectionToChatContext'](),_0x567165['focusPromptInput'](),await _0x567165['sendMessage']({'message':_0x2e6af7['prompt']||_0x2e6af7['displayedPrompt'],'quickActionData':{'id':_0x2e6af7['id'],'displayedPrompt':_0x2e6af7['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x3e1917=this['editor'],_0x148d6e=_0x3e1917['model']['document']['selection'];if(!_0x148d6e['isCollapsed'])return;const _0x37db33=_0x111a74(_0x148d6e['getSelectedBlocks']())||_0x3e1917['model']['schema']['getLimitElement'](_0x148d6e);_0x3e1917['model']['change'](_0x4f642b=>{_0x4f642b['setSelection'](_0x37db33,'in');});}['_handleAIActionsActionLabel'](_0x346a8a){return _0x346a8a['parent']?.['label']&&'other'!==_0x346a8a['parent']?.['id']?_0x346a8a['parent']['label']+':\x20'+_0x346a8a['displayedPrompt']:_0x346a8a['displayedPrompt'];}async['_handleAIActionsAction'](_0x361985){const _0x4bb2e2=this['editor']['plugins']['get']('AIActions'),_0x386f53=_0x361985['prompt']?{'userMessage':_0x361985['prompt'],'model':_0x361985['model']}:{'actionName':_0x361985['actionName']||_0x361985['id'],'args':_0x361985['args']},_0x4db49e=this['_handleAIActionsActionLabel'](_0x361985);await _0x4bb2e2['executeAction'](_0x386f53,_0x4db49e,_0x361985['icon']);}async['_handleAIReviewAction'](_0x1b1789){console['log']('handleAIReviewAction',_0x1b1789);}}class gi extends _0x24349a{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3855b9=this['editor'],_0x3a6855=new Ai(this['editor']);if(_0x3855b9['commands']['add']('aiQuickAction',_0x3a6855),_0x3855b9['plugins']['has']('AIChat')){const _0x49b06b=this['editor']['plugins']['get']('AIChat');_0x3855b9['model']['document']['selection']['on']('change:range',(_0x221bbf,_0x2e0e07)=>{_0x2e0e07['directChange']&&_0x49b06b['removeSelectionFromChatContext']();});}}}class Zt extends de{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x2b90ed=this['documentContextContent']['children']['map'](_0x396fe5=>({'node':_0x396fe5,'id':pt(_0x396fe5,'data-id')})),_0x88a607=this['parsedMergedContent']['children']['map'](_0x257fc4=>({'node':_0x257fc4,'id':pt(_0x257fc4,'data-id')||_0x50fe7e()})),_0x9ff137=_0x235f0d(_0x2b90ed,_0x88a607,{'comparator':(_0x6c139b,_0x1ac706)=>_0x6c139b['id']==_0x1ac706['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x9ff137['length']&&_0x9ff137[_0x9ff137['length']-0x1]['removed'];)_0x9ff137['pop']();}const _0x1bbc48=_0x9ff137['map'](_0x4eca98=>{const _0x135722=_0x4eca98['added']?'new':_0x4eca98['removed']?'removed':'modified';return{'node':_0x4eca98['value'][0x0]['node'],'type':_0x135722,'id':_0x4eca98['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x1bbc48,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x26e6b2,_0x1d7366){return _0x1d7366;}}class l extends Jt{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x41202b){super(_0x41202b),this['content']=_0x41202b['content'],this['version']=_0x41202b['version'],this['actionName']=_0x41202b['actionName'],this['args']=_0x41202b['args'],this['userMessage']=_0x41202b['userMessage'],this['model']=_0x41202b['model'];}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':Xt['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x2f0d61){const _0x46368b=new Zt({'editor':this['editor'],'documentContextContent':this['content'],..._0x2f0d61});return this['replies']['push'](_0x46368b),_0x46368b['delegate'](...Vt)['to'](this),this['fire']('replyCreated',_0x46368b),_0x46368b;}}class pi extends _0x24349a{static get['requires'](){return[s,_0xb21972,c,w,_0x11fc7b];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x2f454a();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x593a73){super(_0x593a73),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new _(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x37eaf1,_0x3558e8,_0x3e886c){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x3c9679,anchorData:_0x58a175}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x37eaf1,_0x3c9679,_0x58a175,_0x3558e8,_0x3e886c);}}const {modelFragment:_0x34a0fa,anchorData:_0x285def}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x37eaf1,_0x34a0fa,_0x285def,_0x3558e8,_0x3e886c);}['_getExecuteDataRegular'](){const _0x8992af=this['editor']['model']['document']['selection'];if(_0x8992af['isCollapsed']){const _0x4db592=_0x111a74(_0x8992af['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x8992af);this['editor']['model']['change'](_0x37a84a=>{_0x37a84a['setSelection'](_0x4db592,'in');});}const _0x368ef=_0x8992af['getFirstRange'](),_0x5e4b05=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x8992af),_0x368ef['start'],_0x368ef['end']),_0x3620ed=_0x8992af['getFirstRange']()['start'],_0x51dddb=new Map();let _0x5dd7a6=_0x5e4b05;for(let _0x16e7de=0x0;_0x16e7de<_0x3620ed['path']['length'];_0x16e7de++)_0x51dddb['set'](_0x5dd7a6,_0x3620ed['path'][_0x16e7de]),_0x5dd7a6=_0x5dd7a6['getChild'](0x0);return{'modelFragment':_0x5e4b05,'anchorData':_0x51dddb};}['_getExecuteDataInTable'](){const _0x5ba84c=this['editor']['model']['document']['selection'],_0x575793=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x43daa6=_0x5ba84c['getFirstRange']()['start']['parent']['parent'],_0x396073=this['_wrapWithCommonAncestors'](_0x575793,this['editor']['model']['createPositionBefore'](_0x43daa6),this['editor']['model']['createPositionAfter'](_0x43daa6)),_0x38a3cc=_0x5ba84c['getFirstRange']()['start'],_0x285d33=new Map();let _0x2ef11c=_0x396073;for(let _0x370f20=0x0;_0x370f20<_0x38a3cc['path']['length'];_0x370f20++)if(_0x285d33['set'](_0x2ef11c,_0x38a3cc['path'][_0x370f20]),_0x370f20<_0x38a3cc['path']['length']-0x1)_0x2ef11c=_0x2ef11c['getChild'](0x0);else{let _0x4c5f18=_0x2ef11c['nextSibling'];for(;_0x4c5f18;)_0x285d33['set'](_0x4c5f18,_0x38a3cc['path'][_0x370f20]),_0x4c5f18=_0x4c5f18['nextSibling'];}return{'modelFragment':_0x396073,'anchorData':_0x285d33};}['_executeAction'](_0x4eca3f,_0x4c0b41,_0x23ebf2,_0x415482,_0x1c453a){const _0x18c0ae=this['editor']['plugins']['get'](c),_0x3ef455=this['editor']['plugins']['get'](w),_0x2ed24e=this['editor']['model']['document']['selection'],_0x3262ea=_0x18c0ae['modelToViewWithIds'](_0x4c0b41),_0x5ef4ab=this['editor']['data']['processor']['toData'](_0x3262ea),_0xc3dfdc=this['editor']['model']['document']['version'],_0x4c567c=[..._0x2ed24e['getRanges']()];let _0x85f20d=this['editor']['config']['get']('ai.availableReplyActions')||[...k];this['editor']['plugins']['has']('TrackChanges')||(_0x85f20d=_0x85f20d['filter'](_0x4c8fbc=>'insertSuggestion'!=_0x4c8fbc));const _0x4d64de=new e(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x85f20d});return _0x3ef455['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x415482,'icon':_0x1c453a||_0x3133c5,'mainView':_0x4d64de,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':_0x4c567c}),this['_setLoadingState'](_0x4d64de,_0x3ef455),this['listenTo'](_0x3ef455,'applySuggestion',()=>{this['_applyChanges'](_0x4c0b41,_0x23ebf2,!0x1);}),this['listenTo'](_0x3ef455,'insertSuggestion',()=>{this['_applyChanges'](_0x4c0b41,_0x23ebf2,!0x0);}),this['listenTo'](_0x3ef455,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x3ef455,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0xa31967=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x1dda60=_0xa31967['changeGroups'][0x0];_0x1dda60&&'pending'===_0x1dda60['state']&&_0xa31967['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x3ef455);}),this['_createInteraction'](_0x5ef4ab,_0xc3dfdc,_0x4d64de,_0x3ef455,_0x4eca3f);}['_wrapWithCommonAncestors'](_0x2ecb6e,_0x37d999,_0x4cc441){const _0x767133=this['editor']['model']['createRange'](_0x37d999,_0x4cc441)['getCommonAncestor'](),_0x40d9d2=_0x767133['is']('documentFragment')?[]:_0x767133['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x40d9d2['length']){const _0x2c2aa4=_0x40d9d2['map'](_0x3b0d05=>_0x3b0d05['_clone'](!0x1));for(let _0x56ff04=0x1;_0x56ff04<_0x2c2aa4['length'];_0x56ff04++)_0x2c2aa4[_0x56ff04-0x1]['_appendChild'](_0x2c2aa4[_0x56ff04]);return _0x2c2aa4[_0x2c2aa4['length']-0x1]['_appendChild'](_0x2ecb6e),new _0x3c80b2(_0x2c2aa4[0x0]);}return _0x2ecb6e;}async['_createInteraction'](_0x45f665,_0x3e606f,_0x3958d5,_0x2c2e33,_0x448048){const _0x166405=this['editor'];this['_interactionParams']={'action':_0x448048,'content':_0x45f665,'version':_0x3e606f,'mainView':_0x3958d5,'aiBalloon':_0x2c2e33};const _0x471f19=new l({'connector':this['_aiConnector'],'editor':_0x166405,'content':_0x45f665,'version':_0x3e606f,..._0x448048});this['_interactions']['push'](_0x471f19),_0x3958d5['hideError']();const _0x28ccf9=(_0x296813,_0x2f5705,_0x5e6ec6=!0x1,_0xed3fad='streaming')=>this['_promiseQueue']['enqueue'](async _0x4a2c5e=>{try{const _0x4d2e28=y({'editor':_0x166405,'changeGroups':_0x296813['changeGroups'],'documentContextContent':_0x296813['documentContextContent'],'showDiff':_0x5e6ec6,'trimUnchanged':!0x1});await _0x2f5705['updateContent']({'parts':_0x4d2e28,'renderingStrategy':_0xed3fad,'abortSignal':_0x4a2c5e});}catch(_0x10f9cc){if(this['_isAbortError'](_0x10f9cc))return;throw _0x10f9cc;}});this['_interaction']['on']('replyCreated',(_0x5e0c6b,_0x2b3824)=>{_0x3958d5['hideLoader'](),_0x28ccf9(_0x2b3824,_0x3958d5)['catch'](_0x496279=>{this['_isAbortError'](_0x496279)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x496279),this['_setErrorState'](_0x471f19,_0x3958d5));});}),this['_interaction']['on']('replyContentUpdated',(_0x4a3617,_0x26df05)=>{_0x28ccf9(_0x26df05,_0x3958d5)['catch'](_0x425218=>{this['_isAbortError'](_0x425218)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x425218),this['_setErrorState'](_0x471f19,_0x3958d5));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x3958d5,_0x2c2e33),this['_updateNavigationUI']();}catch(_0x2db8b0){this['_isAbortError'](_0x2db8b0)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x2db8b0),this['_setErrorState'](_0x471f19,_0x3958d5));}}),this['listenTo'](_0x3958d5,'toggleSuggestionDisplayMode',(_0x47bc24,{showDiff:_0x229737})=>{this['_balloonShowDiff']=_0x229737;const _0x1e2d9f=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x1e2d9f&&_0x28ccf9(_0x1e2d9f,_0x3958d5,_0x229737,'static')['catch'](_0x27c2dc=>{this['_isAbortError'](_0x27c2dc)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x27c2dc),this['_setErrorState'](_0x471f19,_0x3958d5));});}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x41483e,{reply:_0x14c13b})=>{const _0x27f1d4={'positiveCount':_0x14c13b['changeGroups']['filter'](_0x364a52=>'accepted'===_0x364a52['state'])['length'],'totalCount':_0x14c13b['changeGroups']['length']},_0x1dadf0=this['_interaction']['actionCallId'],_0x4f3feb=this['_interaction']['actionName'];_0x4f3feb?this['_aiConnector']['upsertAIActionRating'](_0x4f3feb,_0x1dadf0,_0x27f1d4):this['_aiConnector']['upsertCustomAIActionRating'](_0x1dadf0,_0x27f1d4);}),this['_setLoadingState'](_0x3958d5,_0x2c2e33);try{const _0x327b23=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x327b23;}catch(_0x3032d6){if(this['_isAbortError'](_0x3032d6))return;_0x3958d5['hideLoader'](),this['_setErrorState'](_0x471f19,_0x3958d5);}}['_applyChanges'](_0xc96ab7,_0x56a61e,_0x97e2d5){const _0x410c0e=this['editor'];if(_0x97e2d5&&!_0x410c0e['plugins']['has']('TrackChanges'))throw new _0xb61eac('ai-no-track-changes',null);const _0x50bfc3=this['editor']['plugins']['get'](_0x11fc7b),_0x2c065e=this['_interaction'],_0x5f02e6=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x101443=_0x5f02e6['changeGroups'];_0x5f02e6['setChangeGroupState'](0x0,'accepted');let _0x10c88b=v({'editor':_0x410c0e,'reply':_0x5f02e6,'interaction':_0x2c065e,'groups':_0x101443,'transform':!0x1,'documentCompare':_0x50bfc3,'documentCompareOptions':{'anchor':_0x410c0e['model']['createPositionAt'](_0xc96ab7,0x0),'markDeletions':_0x97e2d5}});_0x10c88b=this['_filterOperationsOutsideRange'](_0x10c88b,_0x56a61e);for(const _0x2572d7 of _0x10c88b)this['_anchorOperation'](_0x56a61e,_0x2572d7,_0x410c0e['model']['document']['getRoot']());const _0x1f2020=_0x2c065e['getDocumentContext']()['version'],_0x49749c=_0x410c0e['model']['document']['history']['getOperations'](_0x1f2020),_0x2da49a={'document':_0x410c0e['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x1d994f=_0x226818(_0x10c88b,_0x49749c,_0x2da49a)['operationsA'];_0x410c0e['model']['change'](_0x48caa5=>{if(_0x48caa5['setSelection'](_0x410c0e['model']['document']['selection']['focus']),_0x97e2d5)_0x410c0e['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x1d994f);else{for(const _0x40264b of _0x1d994f)_0x40264b['baseVersion']=_0x410c0e['model']['document']['version'],b(_0x410c0e,_0x40264b),_0x48caa5['batch']['addOperation'](_0x40264b),_0x410c0e['model']['applyOperation'](_0x40264b);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x2acb55,_0x133f30){return _0x2acb55['filter'](_0x585d56=>{if('rename'==_0x585d56['type']){const _0x5d562f=_0x585d56['position']['nodeAfter'];return!_0x133f30['has'](_0x5d562f);}if(_0x585d56['type']['indexOf']('Attribute')>-0x1){const _0x56f1f4=_0x585d56['range']['start']['nodeAfter'];return!_0x133f30['has'](_0x56f1f4);}return!0x0;});}['_anchorOperation'](_0x595531,_0x531a14,_0x479b2f){const _0xce0b58=_0x531a14['clone']();for(const _0xe57fe5 in _0x531a14){const _0x5befaa=_0x531a14[_0xe57fe5];_0x5befaa instanceof _0x33fc08?_0x531a14[_0xe57fe5]=new _0x33fc08(_0x43d908(_0x5befaa['start']),_0x43d908(_0x5befaa['end'])):_0x5befaa instanceof _0xf3918b&&(_0x531a14[_0xe57fe5]=_0x43d908(_0x5befaa));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0xce0b58['type'])){if(_0xce0b58['isDocumentOperation']=!0x1,_0xce0b58['baseVersion']=null,'remove'==_0xce0b58['type']){const _0x53d4d7=_0xce0b58['sourcePosition'],_0x16c6c8=_0xce0b58['howMany'];new _0xb3c868(_0x53d4d7,_0x16c6c8)['_execute']();}else _0xce0b58['_execute']();}function _0x43d908(_0x22501a){if('$graveyard'==_0x22501a['root']['rootName'])return _0x22501a;const _0x2e40a3=[];let _0x1beb77=_0x22501a['root'];for(let _0x587bb4=0x0;_0x587bb4<_0x22501a['path']['length'];_0x587bb4++){const _0xc52fb2=_0x595531['get'](_0x1beb77)||0x0;_0x2e40a3[_0x587bb4]=_0x22501a['path'][_0x587bb4]+_0xc52fb2,_0x1beb77=_0x1beb77['getChildAtOffset'](_0x22501a['path'][_0x587bb4]);}return new _0xf3918b(_0x479b2f,_0x2e40a3,_0x22501a['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x1d5521,content:_0x4c82f6,version:_0x1f382b,mainView:_0xbb35d3,aiBalloon:_0x13e11b}=this['_interactionParams'];_0xbb35d3['areChangesVisible']=!0x1,_0xbb35d3['hideError'](),this['_clearErrorState'](_0xbb35d3,_0x13e11b);const _0x1d9b91=_0xbb35d3;_0x1d9b91['miniToolbarView']&&_0x1d9b91['miniToolbarView']['showChangesButton']&&_0x1d9b91['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':_0xd2a692}),this['_clearSuggestionContent'](_0xbb35d3),_0xbb35d3['showLoader'](),this['_updateNavigationUI'](),this['_createInteraction'](_0x4c82f6,_0x1f382b,_0xbb35d3,_0x13e11b,_0x1d5521)['catch'](_0x3005ad=>{this['_isAbortError'](_0x3005ad)||console['error']('Error\x20refreshing\x20interaction:',_0x3005ad);});}['_clearSuggestionContent'](_0x51d133){const _0x2fee76=_0x51d133['bodyView']['_children'];for(;_0x2fee76['length']>0x0;)_0x2fee76['remove'](_0x2fee76['first']);_0x51d133['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x39dbb8){return!!_0x39dbb8['message']&&_0x39dbb8['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_updateNavigationUI']();}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1;}['_setupCustomViews'](){const _0x58b2e9=new _0x3d6e77(this['editor']['locale']),_0x410b18=new _0x3d6e77(this['editor']['locale']),_0x273eba=new _0x262350(this['editor']['locale']),_0x5aa7af=new _0x3d6e77(this['editor']['locale']);_0x58b2e9['set']({'icon':_0x218209,'label':C(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x410b18['set']({'icon':_0x488fbf,'tooltip':C(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x273eba['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x5aa7af['set']({'icon':_0x3f932b,'tooltip':C(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x58b2e9['bind']('isEnabled')['to'](this,'isBusy',_0x48658e=>!_0x48658e),_0x58b2e9['on']('execute',()=>{this['_refreshInteraction']();}),_0x410b18['bind']('isEnabled')['to'](this,'isBusy',_0x5c6d07=>!_0x5c6d07),_0x410b18['on']('execute',()=>{this['_navigateToPrevious']();}),_0x5aa7af['bind']('isEnabled')['to'](this,'isBusy',_0x1113a3=>!_0x1113a3),_0x5aa7af['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0x410b18,this['_navigationCounter']=_0x273eba,this['_navigationNextButton']=_0x5aa7af,this['_customViews']['add'](_0x58b2e9);}['_navigateToPrevious'](){const _0x469ead=this['_interactions']['length'];this['_currentInteractionIndex']<_0x469ead-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x2786f6){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x2786f6;const {mainView:_0xc21e9d}=this['_interactionParams'],_0x40674b=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x40674b)return;if(_0x40674b['hasError'])return this['_setErrorState'](_0x40674b,_0xc21e9d),void this['_updateNavigationUI']();if(!_0x40674b['replies']['length'])return;_0xc21e9d['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0xc21e9d,this['_interactionParams']['aiBalloon']);const _0x582f48=_0x40674b['replies'][_0x40674b['replies']['length']-0x1];if(_0x582f48){const _0x57e11c=this['editor'];this['_clearSuggestionContent'](_0xc21e9d);try{const _0x22e89b=y({'editor':_0x57e11c,'changeGroups':_0x582f48['changeGroups'],'documentContextContent':_0x582f48['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0xc21e9d),await new Promise(_0x1767e7=>setTimeout(_0x1767e7,0x32)),await _0xc21e9d['updateContent']({'parts':_0x22e89b,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x2e1c31){this['_isAbortError'](_0x2e1c31)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x2e1c31);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x592ca2=this['_interactions']['length'],_0x393642=_0x592ca2>0x1,_0x555d35=this['_interactionParams']?.['mainView'];if(_0x393642){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x555d35?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x555d35?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x555d35?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x4e8895=_0x592ca2-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x4e8895+'/'+_0x592ca2),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x592ca2-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x555d35?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x555d35?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x555d35?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x131bc6,_0x55cc1e){_0x131bc6['setLoading'](),_0x55cc1e['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x43e894,_0x83f33b){const _0x5a38f3=C(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0x83f33b['showError'](_0x5a38f3),_0x43e894['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0x83f33b['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0x1e9284,_0x5935d9){_0x1e9284['clearErrorState'](),_0x5935d9['balloonView']['toolbar']&&(_0x5935d9['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x5cf91a,_0x2b3ced){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x5cf91a['clearLoading'](),_0x2b3ced['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0x5021d2=>{'isEnabled'in _0x5021d2&&(_0x5021d2['isEnabled']=!0x1);});}}class Ua extends _0x24349a{static get['requires'](){return[ui,gi,pi];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xf4190a){super(_0xf4190a),_0xf4190a['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class xs{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x2e5670,title:_0x3325dc,description:_0x5cc919,isParameterized:_0x36e628,useArgs:_0x2ef03b,options:_0x30c30b}){this['id']=_0x2e5670,this['title']=_0x3325dc,this['description']=_0x5cc919,this['isParameterized']=_0x36e628,this['useArgs']=_0x2ef03b,this['options']=_0x30c30b;}}class kr extends xs{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x2976b3){this['_models']=_0x2976b3;}}class wi extends _0x33fb62(){['_checks'];constructor(_0x5ecb9b){super(),this['_checks']=this['_mapCheckDefinitions'](_0x5ecb9b);}get['checks'](){return this['_checks'];}['getCheckById'](_0x38e5e0){return this['checks']['find'](_0x3f093f=>_0x3f093f['id']===_0x38e5e0);}['_mapCheckDefinitions'](_0x14739c){return _0x14739c['map'](_0x7a5fad=>'custom'===_0x7a5fad['id']?new kr(_0x7a5fad):new xs(_0x7a5fad));}}class Rs extends _0x2ebfa6(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x336a9b,contentNew:_0xb5af3e,contentInitial:_0x4e25ff,documentVersion:_0x56f706}){super(),this['id']=_0x336a9b,this['contentNew']=_0xb5af3e,this['contentInitial']=_0x4e25ff,this['documentVersion']=_0x56f706;}}class js extends _0x33fb62(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x5cd0b7,_0x49f39a,_0x55f433){super(),this['id']=_0x5cd0b7,this['parent']=_0x55f433,this['_data']=_0x49f39a,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class Ts extends _0x33fb62(){['id']=_0x50fe7e();['callId'];['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x498940,_0x32eb37,_0x51958c,_0x163798,_0x1c5b02){super(),this['_documentData']=_0x498940,this['_sourceCheck']=_0x32eb37,this['_aiConnector']=_0x51958c,this['_reviewParams']=_0x163798,this['_reviewArgs']=_0x1c5b02,this['on']('change:status',(_0x3221bb,_0x556f97,_0x2e18b1)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x2e18b1,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get['documentData'](){return this['_documentData'];}get['processedResultsCount'](){return this['_results']['size'];}get['title'](){return this['_sourceCheck']['title'];}get['subTitle'](){return'';}get['reviewName'](){return this['_sourceCheck']['id'];}get['hasModifications'](){return!this['_changes']['every'](_0x5b7905=>'pending'===_0x5b7905['status']);}get['currentError'](){return this['_currentError'];}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0xa3a2a2=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x4f17df of _0xa3a2a2)'unmodified'!==_0x4f17df['data']['operation']&&('error'!==_0x4f17df['data']['operation']?'review-metadata'!==_0x4f17df['event']?this['_addReviewCheckResult'](_0x4f17df['data']['dataId'],_0x4f17df['data']['textDelta']):this['callId']=_0x4f17df['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x428740){this['_currentError']=_0x428740,_0x428740 instanceof Error&&_0x428740['message']['includes']('ai-request-aborted')?this['status']='aborted':this['status']='error-general';}finally{this['_activeRequest']=null;}}async['restart'](){this['_results']['clear'](),this['_changes']['length']=0x0,this['_currentError']=void 0x0,await this['start']();}['addResultChanges'](_0x17ca67,_0x4265bc){const _0x30a130=this['_results']['get'](_0x17ca67);if(!_0x30a130)return;const _0x396b42=[];_0x4265bc['forEach']((_0x466ce9,_0x1c3558)=>{const _0x496adc=new js(_0x30a130['id']+'-'+_0x1c3558,_0x466ce9,_0x30a130);_0x496adc['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x496adc,'status':_0x496adc['status']});}),_0x496adc['on']('change:isActivated',()=>{_0x496adc['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x496adc}):this['fire']('reviewCheckResultDeactivated',{'change':_0x496adc});}),this['_changes']['push'](_0x496adc),_0x396b42['push'](_0x496adc);}),this['fire']('reviewCheckResultReady',{'changes':_0x396b42,'result':_0x30a130,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x44708c){const _0x4bb3ba=this['_changes']['find'](_0x15a4c8=>_0x15a4c8['id']===_0x44708c);return!(!_0x4bb3ba||'pending'!==_0x4bb3ba['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x21fa73=>'pending'===_0x21fa73['status']);}['markAllChangesAsAccepted'](){for(const _0x4d7fee of this['_changes'])'pending'===_0x4d7fee['status']&&(_0x4d7fee['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x5573b7){const _0x480ddd=this['_changes']['find'](_0x1b93c3=>_0x1b93c3['id']===_0x5573b7);_0x480ddd&&'pending'===_0x480ddd['status']&&(_0x480ddd['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x3b24a4){const _0xe77acb=this['_changes']['find'](_0x1478eb=>_0x1478eb['id']===_0x3b24a4);_0xe77acb&&'pending'===_0xe77acb['status']&&(_0xe77acb['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x7b9d){const _0x4191e9=this['_changes']['find'](_0x35cfe3=>_0x35cfe3['id']===_0x7b9d);_0x4191e9&&'pending'===_0x4191e9['status']&&(_0x4191e9['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x799d1f){const _0x2169cd=this['_changes']['find'](_0x4f7cad=>_0x4f7cad['id']===_0x799d1f);_0x2169cd&&'outdated'===_0x2169cd['status']&&(_0x2169cd['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x3722f8){this['_changes']['filter'](_0x4b7127=>_0x4b7127['isActivated']&&_0x4b7127['id']!==_0x3722f8)['forEach'](_0x2cf270=>{_0x2cf270['isActivated']=!0x1;});const _0x2fa1a7=this['_changes']['find'](_0x459017=>_0x459017['id']===_0x3722f8);_0x2fa1a7&&'pending'===_0x2fa1a7['status']&&(_0x2fa1a7['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x1ce945=>_0x1ce945['isActivated'])['forEach'](_0x36af1e=>{_0x36af1e['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x6a3d26){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x4ed7e2;if(_0x6a3d26){const _0x2ee036=this['_changes']['find'](_0x86b5d2=>_0x86b5d2['id']===_0x6a3d26);if(_0x2ee036&&_0x2ee036['isRated'])return;_0x2ee036&&(_0x4ed7e2=_0x2ee036['parent']['id'],_0x2ee036['isRated']=!0x0);}const _0x5c6406={'positiveCount':this['_changes']['filter'](_0x59bab8=>'accepted'===_0x59bab8['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x5c6406,this['callId'],_0x4ed7e2);}['_addReviewCheckResult'](_0x1297d2,_0x37fe1f){const _0x83c2a0=this['_documentData']['elements']['get'](_0x1297d2);if(!_0x83c2a0)return;const _0x3b9b55=_0x83c2a0['getContent']();if(_0x3b9b55===_0x37fe1f)return;const _0x198fd5=new Rs({'id':_0x1297d2,'contentInitial':_0x3b9b55,'contentNew':_0x37fe1f,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x198fd5['id'],_0x198fd5),this['fire']('reviewCheckResultAdded',{'result':_0x198fd5,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x1d0f19=>'pending'===_0x1d0f19['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x48f0e3=>'pending'===_0x48f0e3['status'])['length']&&(this['status']='finished'));}}class vi extends Ts{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x598dcc=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x2eba04=0x0;_0x2eba04<this['_reviewParams']['length'];_0x2eba04++){if(!this['_reviewParams'][_0x2eba04]||!this['_sourceCheck']['options'][_0x2eba04])continue;const _0x1e3995=this['_sourceCheck']['options'][_0x2eba04],_0x289b21=_0x1e3995['data']?.['find'](_0x52e1ef=>_0x52e1ef['id']===this['_reviewParams'][_0x2eba04]);_0x289b21&&_0x598dcc['push'](_0x289b21['label']);}return _0x598dcc['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x27a390,_0x13feca,_0x3a6afb){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x13feca,_0x27a390,_0x3a6afb);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class fi extends Ts{['_prompt'];['_model'];constructor(_0x4ef595,_0x3af74b,_0x3a00ee,_0x455527,_0x18623f){super(_0x3a00ee,_0x455527,_0x18623f),this['_prompt']=_0x4ef595,this['_model']=_0x3af74b;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x128c0f,_0x3e5862,_0x9f88c2){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x3e5862,_0x128c0f,_0x9f88c2);}}const Ri=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]}]}];class ee extends _0x1bcf21{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[s];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0x3dcdfb=this['context']['config']['get']('ai.reviewMode.translations');if(_0x3dcdfb){for(const _0x5ed424 of Ri)'translate'===_0x5ed424['id']&&(_0x5ed424['options'][0x0]['data']=_0x3dcdfb);}const _0x4a0f5b=this['_translateReviewChecks'](Ri);this['_aiReviewCheckList']=new wi(_0x4a0f5b);const _0x1b3c76=this['_aiReviewCheckList']['checks']['find'](_0x56f362=>'custom'===_0x56f362['id']);if(_0x1b3c76){const _0x27b258=await new ki({'connector':this['_aiConnector']})['getAll']();_0x1b3c76['models']=_0x27b258['map'](_0x2acc65=>({..._0x2acc65,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0x2acc65['id']['toUpperCase'](),_0x2acc65['description'])}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x3ec839,_0x3e469d)=>{const _0x4333a1=this['_aiReviewCheckList']['getCheckById'](_0x3e469d['id']);if(_0x4333a1){this['_onDiffChange'](this['_isDiffOn']),_0x3e469d['isCustom']?this['_currentReviewCheckRun']=new fi(_0x3e469d['args']['prompt'],_0x3e469d['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x4333a1,this['_aiConnector']):this['_currentReviewCheckRun']=new vi(this['_aiReviewModeEditing']['getDocumentData'](),_0x4333a1,this['_aiConnector'],_0x3e469d['params'],_0x3e469d['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0xb2e13b,_0x4aa261)=>{'data'===_0x4aa261['status']||'loading'===_0x4aa261['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x4aa261)):'finished'===_0x4aa261['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x4aa261['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x4aa261['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x4aa261['status']?(this['_aiReviewModeUi']['showGeneralErrorView'](),this['_logError'](new _0xb61eac('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']))):'error-chunk'===_0x4aa261['status']?(this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0xb61eac('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']))):'aborted'===_0x4aa261['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0)),'ready'!==_0x4aa261['status']&&'error-chunk'!==_0x4aa261['status']&&'error-general'!==_0x4aa261['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x919432,_0x4f4151)=>{if(!this['_currentReviewCheckRun'])throw new _0xb61eac('ai-review-mode-no-current-check-run',this);const _0xadcc86=this['_aiReviewModeEditing']['diffContent'](_0x4f4151['result']['contentInitial'],_0x4f4151['result']['contentNew']);_0x4f4151['source']['addResultChanges'](_0x4f4151['result']['id'],_0xadcc86);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x39589a,_0x14f633)=>{for(const _0x37baaa of _0x14f633['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x37baaa);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x14f633['changes'],_0x14f633['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x14a348,_0x5d1e30)=>{this['_aiReviewModeUi']['updateChangeState'](_0x5d1e30['change']['id'],_0x5d1e30['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x1745fc,_0x27ee4c)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x27ee4c['change']['id']);const _0x399410=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x27ee4c['change']['id']);if(_0x399410){if('content'===this['_changeActivationSource']){const _0x5abb96=this['_aiReviewModeUi']['getChangeElement'](_0x27ee4c['change']['id']);_0x5abb96&&_0x5bd77a(_0x5abb96['closest']('.ck-ai-review-mode__check-run-result')||_0x5abb96);}else{if('panel'===this['_changeActivationSource']){const _0x9ec605={'target':_0x399410['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};_0x568df9(_0x9ec605);}}this['_aiReviewModeUi']['showChangeBalloon'](_0x27ee4c['change'],_0x399410['domElement']);}}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x5a3041){_0x5a3041 instanceof Error&&_0x5a3041['message']['includes']('ai-request-aborted')||(_0x5a3041 instanceof _0xb61eac?this['_logError'](_0x5a3041):this['_logError'](new _0xb61eac('ai-review-mode-check-run-failed',this,{'error':_0x5a3041})));}}else this['_logError'](new _0xb61eac('ai-review-mode-source-check-not-found',this,{'checkId':_0x3e469d['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x4f0645=this['_currentReviewCheckRun']['getActiveChanges']();_0x4f0645['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x4f0645['map'](_0x4f0ace=>_0x4f0ace['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x2cbd06,_0x1cc4de)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1cc4de['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x1cc4de['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x1cc4de['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x1cc4de['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x3787ca,_0x26cae5)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x26cae5['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x26cae5['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x26cae5['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x26cae5['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x47a5a9,_0x5a2930)=>{this['_isDiffOn']=_0x5a2930['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&await this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x56ad23,_0x11c037)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x11c037['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x390e41,_0x599309)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x599309['changeId']));}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0x3bbce3,_0x48921d)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x48921d['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0x7ea68,_0x5e1105)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x5e1105['changeId']);});}['_onReviewModeRunLeave'](_0x1f9f91=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x1f9f91&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x4689d0=this['_aiReviewModeEditing']['getEditor']();_0x4689d0&&_0x4689d0['editing']['view']['change'](_0x19ced3=>{const _0x3acdd6=_0x4689d0['editing']['view']['document']['getRoot']();_0x19ced3['removeClass']('ck-ai-review-mode-diff',_0x3acdd6),_0x19ced3['removeClass']('ck-ai-review-mode-highlights',_0x3acdd6);});}['_onDiffChange'](_0x28f1d4){const _0x2acc51=this['_aiReviewModeEditing']['getEditor']();_0x28f1d4?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0x2acc51&&_0x2acc51['editing']['view']['change'](_0x5cc6e2=>{const _0x3b17b5=_0x2acc51['editing']['view']['document']['getRoot']();_0x5cc6e2['removeClass']('ck-ai-review-mode-diff',_0x3b17b5),_0x5cc6e2['removeClass']('ck-ai-review-mode-highlights',_0x3b17b5),_0x5cc6e2['addClass'](_0x28f1d4?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x3b17b5);});}['_translateReviewChecks'](_0x1154bf){return _0x1154bf['map'](_0x361511=>{const _0x1dd8c8='AI_REVIEW_CHECK_'+_0x361511['id']['toUpperCase']()['replaceAll']('-','_'),_0x3a9a6b={..._0x361511,'title':this['_getTranslationWithDefault'](_0x1dd8c8+'_TITLE',_0x361511['title']),'description':this['_getTranslationWithDefault'](_0x1dd8c8+'_DESCRIPTION',_0x361511['description'])};return _0x361511['options']&&(_0x3a9a6b['options']=_0x361511['options']['map'](_0x1683ff=>({..._0x1683ff,'label':this['_getTranslationWithDefault'](_0x1dd8c8+'_OPTIONS_LABEL',_0x1683ff['label']||''),'data':_0x1683ff['data']?_0x1683ff['data']['map'](_0xac76e5=>({..._0xac76e5,'label':this['_getTranslationWithDefault'](_0x1dd8c8+'_OPTIONS_DATA_'+_0xac76e5['id']['toUpperCase'](),_0xac76e5['label'])})):void 0x0}))),_0x3a9a6b;});}['_getTranslationWithDefault'](_0x52ab00,_0xd9468d){const _0x1f50db=C(this['context']['locale'],_0x52ab00);return _0x1f50db===_0x52ab00?_0xd9468d:_0x1f50db;}['_logError'](_0x4998aa){ot(_0x4998aa['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class Mr extends _0x262350{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x53a60e,_0x2e67fe){super(_0x53a60e),this['_defaultValue']=_0x2e67fe['default']||(_0x2e67fe['data']['length']>0x0?_0x2e67fe['data'][0x0]['id']:''),this['_defaultLabel']=_0x2e67fe['data']['find'](_0x4a0b80=>_0x4a0b80['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x33079d(this['locale']);const _0x5a2532=this['_prepareListOptions'](_0x2e67fe['data']);_0x162dc1(this['_dropdownView'],_0x5a2532,{'role':'menu','ariaLabel':_0x2e67fe['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x110155=>{_0x110155['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x5bf1d7=>{this['formValue']=_0x5bf1d7['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x5bf1d7['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x45691c=[]){const _0x1c1130=new _0x3addd2();this['resetToDefault']();for(const _0x1950f0 of _0x45691c){const _0x3b0a45=new _0x948671({'label':_0x1950f0['label'],'withText':!0x0,'role':'menuitemradio','id':_0x1950f0['id'],'model':_0x1950f0});_0x3b0a45['bind']('isOn')['to'](this,'formValue',_0xbf5979=>_0xbf5979===_0x3b0a45['id']);const _0x3c2e70={'type':'button','model':_0x3b0a45};_0x1c1130['add'](_0x3c2e70);}return _0x1c1130;}}class Ys extends _0x321758{['_formItem']=null;constructor(_0x1c52c0,_0x46d7e0,_0x590abc){super(_0x1c52c0),this['argsKey']=_0x46d7e0?.['argsKey'];if('dropdown'===_0x46d7e0['formType'])this['_formItem']=new Mr(this['locale'],_0x46d7e0);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x255bec=new _0x17466f(this['locale'],{'children':[this['_formItem']],'class':[_0x590abc?'ck-form__row_with-submit':'']});_0x590abc&&_0x255bec['children']['add'](_0x590abc),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x255bec]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Hs extends _0x587f99{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x487ec0){super(_0x487ec0),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x25a17d(),this['minRows']=Hs['MIN_ROWS'],this['maxRows']=Hs['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class Zs extends _0x262350{['focusTracker']=new ts();['keystrokes']=new _0x25a17d();['focusCycler'];['_focusables']=new _0x2f454a();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x526431,_0x399daa){super(_0x526431),this['_check']=_0x399daa,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x399daa['models']&&_0x399daa['models']['length']>0x0?_0x399daa['models'][0x0]['id']:'',this['_defaultLabel']=_0x399daa['models']&&_0x399daa['models']['length']>0x0?_0x399daa['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x5d33a3(this['locale'],()=>new Hs(_0x526431)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0x3addd2(),this['_setModelList'](),_0x162dc1(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x17466f(this['locale'],{'children':[this['promptInputView']]}),new _0x17466f(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0xc6d0ed,_0x1ec5ea)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x1ec5ea()):_0x1ec5ea();}),this['focusCycler']=new $t({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x5701d3=>{this['_focusables']['add'](_0x5701d3),this['focusTracker']['add'](_0x5701d3['element']);}),this['keystrokes']['listenTo'](this['element']));}get['modelDefaultValue'](){return this['_defaultValue'];}get['modelDefaultLabel'](){return this['_defaultLabel'];}['resetToDefault'](){this['prompt']='',this['modelId']=this['modelDefaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['modelDefaultLabel'],this['resetFormValidationStatus']();}['resetFormValidationStatus'](){this['promptInputView']['errorText']='';}['_isValid'](){this['resetFormValidationStatus']();for(const _0x8e4ae7 of this['_getFormValidators']()){const _0x5d9cc7=_0x8e4ae7();if(_0x5d9cc7)return this['promptInputView']['errorText']=_0x5d9cc7,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return C(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x4b7f2b=new _0x3d6e77(this['locale']),t=this['locale']['t'];return _0x4b7f2b['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x4b7f2b['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x4b7f2b;}['_createCancelButtonView'](){const _0x52ba8e=new _0x3d6e77(this['locale']),t=this['locale']['t'];return _0x52ba8e['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x52ba8e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x35d426=>{_0x35d426['stopPropagation']();})}}),_0x52ba8e['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x52ba8e;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x3edeeb=this['_check']['models'];if(this['resetToDefault'](),_0x3edeeb?.['length']){const _0x413d4c=ki['getLocalized'](this['locale'],_0x3edeeb);for(const _0x3c38f1 of _0x413d4c){const _0x4e131f=new _0x948671({'label':_0x3c38f1['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3c38f1['id'],'model':_0x3c38f1});_0x4e131f['bind']('isOn')['to'](this,'modelId',_0x540555=>_0x540555===_0x3c38f1['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4e131f,'labelView':new Ws(this['locale'],_0x3c38f1)});}}}['_createModelSelectionDropdown'](){const _0x2e085e=_0x33079d(this['locale']);return _0x2e085e['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x2e085e['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x2e085e,'execute',_0x398ea9=>{this['modelId']=_0x398ea9['source']['model']['id'],_0x2e085e['buttonView']['label']=_0x398ea9['source']['label'];}),_0x2e085e;}['_createActionsFooterView'](){const _0x456cc1=new _0x262350(this['locale']);return _0x456cc1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x456cc1;}}class Ws extends _0x9b3e62{constructor(_0x55595a,_0x235bad){super();const _0x204ecb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x204ecb['to']('style'),'id':_0x204ecb['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x204ecb['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x235bad['description']||'']}]}]});}}class Gs extends _0x321758{['_formItemsCollection']=new _0x2f454a();['_customCheckView']=null;constructor(_0x466522,_0x21fd40,_0x9450d5){super(_0x466522),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x21fd40['isParameterized']);const _0x420a20=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x298454=>_0x298454),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x38d090=>_0x38d090)],'style':{'--ck-ai-review-check-list-item-index':_0x9450d5}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0x21fd40['title']}]},_0x420a20]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x21fd40['description']}]}]}]},..._0x21fd40['isParameterized']?[this['_createParameterizedView'](_0x21fd40)]:[],...'custom'===_0x21fd40['id']?[this['_createCustomView'](_0x21fd40)]:[]]}),this['on']('click',()=>{_0x21fd40['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x21fd40['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x3bd809({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x115d16=>{_0x115d16['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x2ba78a=new _0x3a2ec3();return _0x2ba78a['content']=_0x33c9a8,_0x2ba78a['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x2ba78a;}['_createParameterizedView'](_0x220660){const _0x457ca2=new _0x262350(),_0x2a5f2d=this['_createFormView'](_0x220660);return _0x457ca2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x78ce59=>!_0x78ce59)]},'children':[_0x2a5f2d]}),_0x457ca2;}['_createFormView'](_0x3944d3){const _0x577657=new _0x262350(),_0x44c90d=Array['isArray'](_0x3944d3['options'])?_0x3944d3['options']:[],_0x476881=new _0x3d6e77(this['locale']),t=this['locale']['t'];_0x476881['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x476881['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1d50de=>{_0x1d50de['stopPropagation']();})}}),_0x476881['on']('execute',()=>{const _0x58b30f=[],_0xf32a2b={};this['_formItemsCollection']['forEach'](_0x3e3c97=>{_0x58b30f['push'](_0x3e3c97['value']),_0x3944d3['useArgs']&&_0x3944d3['options']&&(_0xf32a2b[_0x3e3c97['argsKey']]=_0x3e3c97['value']);}),this['fire']('runReviewCheck',{'id':_0x3944d3['id'],'params':_0x58b30f['length']?_0x58b30f:void 0x0,'args':Object['keys'](_0xf32a2b)['length']?_0xf32a2b:void 0x0});});const _0x4bc6cd=_0x44c90d['length'];return _0x44c90d['forEach']((_0x3daec6,_0x3f070b)=>{const _0x4a27c7=_0x3f070b===_0x4bc6cd-0x1;this['_formItemsCollection']['add'](new Ys(this['locale'],_0x3daec6,_0x4a27c7?_0x476881:null));}),_0x577657['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x577657;}['_createCustomView'](_0x5eafda){return this['_customCheckView']=new Zs(this['locale'],_0x5eafda),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x40bd77=>!_0x40bd77)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x5739a9,_0x3ce59a,_0x31ed3d)=>{_0x31ed3d||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class $s extends _0x321758{['_checkViews'];constructor(_0x1459d0){super(_0x1459d0),this['_checkViews']=new _0x2f454a();const _0x39285c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x39285c['if']('isVisible','ck-hidden',_0x42ec07=>!_0x42ec07)]},'children':this['_checkViews']});}['setChecks'](_0x14cf6f){this['_checkViews']['clear']();for(const [_0x28d2da,_0x1ff3c4]of _0x14cf6f['entries']()){const _0x68c1ae=new Gs(this['locale'],_0x1ff3c4,_0x28d2da);_0x68c1ae['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x68c1ae);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x576fe5 of this['_checkViews'])_0x576fe5 instanceof Gs&&_0x576fe5['resetToDefault']();}}class Bs extends _0x262350{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['statusButtonView'];constructor(_0x32dce4,_0x425731){super(_0x32dce4),this['id']=_0x425731,this['set']('status','pending'),this['set']('changeId',_0x425731),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['statusButtonView']=this['_createStatusButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['statusButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('activateChange',{'id':_0x425731,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x3e9db4=new _0x262350(this['locale']);return _0x3e9db4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-content-direct-excluded','ck-ai-review-mode__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x14bb75=>!_0x14bb75)]}}),_0x3e9db4;}['_createAcceptButtonView'](){const _0x4c0bd4=new _0x3d6e77(this['locale']);return _0x4c0bd4['set']({'label':C(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x4c0bd4['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4574d3=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x4574d3['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x2fc2c3=>'pending'!==_0x2fc2c3)]}}),_0x4c0bd4;}['_createDismissButtonView'](){const _0x397f60=new _0x3d6e77(this['locale']);return _0x397f60['set']({'label':C(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x397f60['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4825ea=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x4825ea['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-result-dismiss-button',this['bindTemplate']['if']('status','ck-hidden',_0x5f260d=>'pending'!==_0x5f260d)]}}),_0x397f60;}['_createInfoButtonView'](){const _0xb29315=new _0x3d6e77(this['locale']);return _0xb29315['set']({'label':C(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x39984d,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0xb29315['bind']('isOn')['to'](this,'isInfoToggleOn',_0x332962=>_0x332962),_0xb29315['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0xb29315;}['_createStatusButtonView'](){const _0x5e34c6=new _0x3d6e77(this['locale']);return _0x5e34c6['set']({'withText':!0x0,'isEnabled':!0x1}),_0x5e34c6['bind']('label')['to'](this,'status',_0x5af2e6=>C(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_'+_0x5af2e6['toUpperCase']())),_0x5e34c6['bind']('icon')['to'](this,'status',_0x5b6636=>'ACCEPTED'===_0x5b6636['toUpperCase']()?_0xb9bffe:'REJECTED'===_0x5b6636['toUpperCase']()?_0x417878:_0x37f2d8),_0x5e34c6['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x19abb2=>'pending'===_0x19abb2)],'disabled':'disabled'}}),_0x5e34c6;}}class Js extends _0x3d6e77{constructor(_0x2cf586){super(_0x2cf586),this['set']({'label':C(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class sh extends _0x321758{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x2db1dc){super(_0x2db1dc),this['_resultViews']=new _0x2f454a(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new Vi(_0x2db1dc),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('headerSubtitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general'),this['set']('isCompleted',!0x1);const _0x2e0a51=this['_createCombinedSkeletonLoader'](),_0x2c6944=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x2c6944['if']('isVisible','ck-hidden',_0x534a89=>!_0x534a89)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x1b14aa=>_0x1b14aa)]},'children':this['_resultViews']},_0x2e0a51]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x1b35a7){const _0x14422b=new Bs(this['locale'],_0x1b35a7['id']);_0x14422b['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x14422b),_0x14422b['resultResponseView']['element']['innerHTML']=_0x1b35a7['contentDiffed'];}['hideResult'](_0x5d4fcc,_0x136077){if('pending'===_0x136077)return;const _0x58eb92=this['_resultViews']['find'](_0x4f9797=>_0x4f9797['id']===_0x5d4fcc);_0x58eb92&&(_0x58eb92['status']=_0x136077,_0x58eb92['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0x4fb49f,_0x4b27d0){if('pending'!==_0x4b27d0)return;const _0x56d1d3=this['_resultViews']['find'](_0x34071a=>_0x34071a['id']===_0x4fb49f);_0x56d1d3&&(_0x56d1d3['status']=_0x4b27d0,_0x56d1d3['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x5254a6,_0x23a15c){this['headerTitle']=_0x5254a6,this['headerSubtitle']=_0x23a15c||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}['resetErrorState'](){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}['_createSkeletonLoader'](){return new je(this['locale'],Ce['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x5a4181=new _0x262350(this['locale']),_0x433d59=[];for(let _0x69709f=0x0;_0x69709f<0x10;_0x69709f++){const _0x151d12=this['_createSkeletonLoader']();_0x151d12['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x433d59['push'](_0x151d12);}return _0x5a4181['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x29945b=>!_0x29945b)]},'children':_0x433d59}),_0x5a4181;}['_createErrorView'](){const _0x17eb30=new _0x262350(this['locale']),_0x4b2c86=new _0x3d6e77(this['locale']),t=this['locale']['t'];return _0x17eb30['delegate']('retryReview')['to'](this),_0x4b2c86['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x4b2c86['on']('execute',()=>{this['fire']('retryReview');}),_0x17eb30['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x3c3d94=>!_0x3c3d94),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x45956b=>'chunk'===_0x45956b)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-chat-error','ck-ai-chat-error_full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-chat-error_warning',_0x56768b=>'chunk'===_0x56768b)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x56b6df=>'general'!==_0x56b6df)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x169964=>'chunk'!==_0x169964)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x4b2c86]}),_0x17eb30;}['_createCancelButtonView'](){const _0x118cd1=new _0x3d6e77(this['locale']);return _0x118cd1['set']({'label':C(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x4eb42b}),_0x118cd1['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2ca0a7=>_0x2ca0a7),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3a8034=>_0x3a8034)]}}),_0x118cd1['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x118cd1;}['_createToggleDiffButtonView'](){const _0x3f1121=new _0x3d6e77(this['locale']);_0x3f1121['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x3f1121['bind']('isEnabled')['to'](this,'isError',_0xa30919=>!_0xa30919),_0x3f1121['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4bad2b=>!_0x4bad2b),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x35640a=>_0x35640a)]}});const _0x4cd113=C(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x36456c=C(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x3f1121['bind']('isOn')['to'](this,'isToggleDiffOn',_0x58fbfc=>_0x58fbfc),_0x3f1121['bind']('icon')['to'](this,'isToggleDiffOn',_0x54d88e=>_0x54d88e?_0x145e51:_0x455890),_0x3f1121['bind']('label')['to'](this,'isToggleDiffOn',_0x2de92f=>_0x2de92f?_0x4cd113:_0x36456c),_0x3f1121['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x3f1121;}['_createAcceptAllButtonView'](){const _0x34a84b=new _0x3d6e77(this['locale']);return _0x34a84b['set']({'label':C(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x34a84b['bind']('isEnabled')['to'](this,'isError',_0x3e0ef1=>!_0x3e0ef1),_0x34a84b['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3fa1fe=>!_0x3fa1fe),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x30f4d5=>_0x30f4d5)]}}),_0x34a84b['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x34a84b;}['_createExitReviewButtonView'](){const _0x20328f=new _0x3d6e77(this['locale']);return _0x20328f['set']({'label':C(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x20328f['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x16abce=>!_0x16abce),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4425ff=>_0x4425ff)]}}),_0x20328f['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x20328f;}['_createResultHeaderView'](){const _0x5b5595=new _0x262350(this['locale']),_0x3d0173=this['_createTitleView']();return _0x5b5595['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x28a4b5=>_0x28a4b5)]},'children':[_0x3d0173,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x5b5595;}['_createTitleView'](){const _0x6361ba=new _0x262350(this['locale']),_0x2195c4=new Le();return _0x2195c4['bind']('isVisible')['to'](this,'isResultReady',_0x20d240=>!_0x20d240),_0x6361ba['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x2195c4,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3a2362=>_0x3a2362)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x41ae9e=>!_0x41ae9e)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x6361ba;}['_createFinishReviewButtonView'](){const _0xbfee02=new Js(this['locale']);return _0xbfee02['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5ec2e3=>!_0x5ec2e3)]}}),_0xbfee02['delegate']('finishReview')['to'](this),_0xbfee02;}}class eh extends _0x321758{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x2cfc30){super(_0x2cfc30),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x2908e9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x2908e9['if']('isVisible','ck-hidden',_0x35a2a7=>!_0x35a2a7)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':C(_0x2cfc30,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x47940a=new Js(this['locale']);return _0x47940a['delegate']('finishReview')['to'](this),_0x47940a;}['_createResultHeaderView'](){const _0x1a8b27=new _0x262350(this['locale']);return _0x1a8b27['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x1a8b27;}}class le extends _0x262350{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x597787){super(_0x597787),this['reviewModeHeader']=new _0x20ce21(_0x597787,{'label':C(_0x597787,'AI_REVIEW_MODE'),'icon':_0x283cc3,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new $s(_0x597787),this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=new sh(_0x597787),this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=new eh(_0x597787),this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0);}['addCheckRunResult'](_0x2b7742){this['reviewCheckResultsView']['addResult'](_0x2b7742),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class we extends _0x51cd8c{['resultItemView'];constructor(_0x3338cd,_0x3d0f26){super(_0x3338cd),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['content']['add'](this['_createContentView']()),_0x3d0f26['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0xc2661a){this['resultItemView']['changeId']=_0xc2661a['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0xc2661a['contentDiffed'];}['showBalloon'](_0x2287de,_0x45b834){this['updateContent'](_0x2287de),this['show'](),this['pin']({'target':()=>this['_getBestRectPosition'](_0x45b834)});}['hideBalloon'](){this['hide'](),this['unpin']();}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange');}['_setupClickOutsideHandler'](){_0x3bd809({'emitter':this,'activator':()=>this['isVisible'],'contextElements':[this['element']],'callback':()=>{this['hideBalloon'](),this['deactivateChange']();}});}['_createContentView'](){const _0x26a6e6=new _0x262350();return this['resultItemView']=new Bs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x26a6e6['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion']},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0x26a6e6;}['_getBestRectPosition'](_0x48477e){const _0x2cf365=Array['from'](_0x48477e['getClientRects']());return _0x2cf365['find'](_0x24b9fb=>_0x24b9fb['width']>0x0)||_0x2cf365[0x0];}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ie extends _0x1bcf21{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[at];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4c842c){super(_0x4c842c),this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new le(this['context']['locale']),this['_reviewModeView']['delegate'](...ih)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new we(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x4bb6fd=this['context']['plugins']['get']('AITabs');_0x4bb6fd['view']['on']('activateTab',(_0x3373be,_0x1d8b44)=>{'reviewMode'===_0x1d8b44?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x4bb6fd['view']['addTab']({'id':'reviewMode','buttonLabel':C(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x283cc3,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x26e4c5){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x26e4c5),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x5adc00){_0x5adc00&&('error-general'!==_0x5adc00['status']?'error-chunk'!==_0x5adc00['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x497e9c){this['_reviewModeView']['addCheckRunResult'](_0x497e9c);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x271436,_0x3c0886){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x271436,_0x3c0886);}['setActiveStateInResults'](_0xff95aa){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x207fa1=>{_0x207fa1['id']===_0xff95aa&&_0x207fa1['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4b6c84=>_0x4b6c84['setItemAsInactive']());}['updateChangeState'](_0x795102,_0x526c86){'accepted'===_0x526c86||'rejected'===_0x526c86||'outdated'===_0x526c86?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x795102,_0x526c86):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x795102,_0x526c86);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x1c27e3,_0x3ca331){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x1c27e3,_0x3ca331);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x4d9298){const _0x38c2fd=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x286ab5=>_0x286ab5['id']===_0x4d9298);return _0x38c2fd?_0x38c2fd['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const me='reviewmode-';class re extends _0x1bcf21{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x11fc7b,c];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x1ae12e){super(_0x1ae12e),this['_domEmitter']=new(_0x5aa562())(),this['_eventEmitter']=new(_0x2ebfa6())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x2874ef=P(this['context']);_0x2874ef['conversion']['for']('editingDowncast')['markerToElement']({'model':me+'insert','view':(_0xa54ea0,{writer:_0x4b4427})=>{const _0x32c7f1=this['_markers']['get'](_0xa54ea0['markerName']),_0x2ca5b7={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0xa54ea0['markerName']};return _0x4b4427['createUIElement']('span',_0x2ca5b7,function(_0x1c3141){const _0x44e8f7=this['toDomElement'](_0x1c3141);return _0x44e8f7['innerHTML']=_0x32c7f1?.['text']||'',_0x44e8f7;});}}),_0x2874ef['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-only','view':_0x27b7d5=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x27b7d5['markerName']}})}),_0x2874ef['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-context','view':_0x294955=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x294955['markerName']}})}),_0x2874ef['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-text','view':_0x3c57b8=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x3c57b8['markerName']}})}),_0x2874ef['conversion']['for']('dataDowncast')['markerToElement']({'model':me+'suggestion-context','view':(_0x1be333,{writer:_0x4871dc})=>_0x4871dc['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x1be333['isOpening']?'start':'end')})}),_0x2874ef['conversion']['for']('downcast')['attributeToAttribute']({'model':ct,'view':_0x18e402}),this['_domEmitter']['listenTo'](document,'click',(_0x12b725,_0x1c2de9)=>{const _0x3b50dd=_0x1c2de9['target'],_0xfe5181=this['_findMarkerElement'](_0x3b50dd);if(!_0xfe5181)return;const _0x28816b=_0xfe5181['getAttribute']('data-marker-id'),_0x51a1f7=_0x28816b['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x28816b,'changeId':_0x51a1f7});}),_0x2874ef['model']['document']['registerPostFixer'](_0x466af3=>this['_validateMarkers'](_0x2874ef,_0x466af3)),_0x2874ef['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x2874ef));}['getDocumentData'](){const _0x5b8ace=this['context']['plugins']['get']('AIEditing'),_0x32f1ea=P(this['context']),_0x34c8b8=_0x32f1ea['model'],_0x2a06a4=new _0x3c80b2();for(const _0x1f9745 of _0x34c8b8['document']['getRoot']()['getChildren']()){const _0xb4edc5=_0x1f9745['_clone'](!0x0);_0x2a06a4['_appendChild'](_0xb4edc5);}for(const _0x220188 of _0x34c8b8['markers'])_0x2a06a4['markers']['set'](_0x220188['name'],this['_changeRangeOwnerDocument'](_0x220188['getRange']()['clone'](),_0x2a06a4));const _0x45c3de=new _0x43fa8d({'ignoreElementEnd':!0x0,'startPosition':_0x34c8b8['createPositionAt'](_0x2a06a4,0x0)}),_0x259293=new Set(),_0xf055e=new Map();for(const {item:_0x3a39f4}of _0x45c3de){if(!_0x3a39f4['is']('$textProxy'))continue;const _0xf06590=_0x3a39f4['parent'];if((!_0xf06590||!_0xf06590['is']('element','caption'))&&(_0xf06590&&_0xf06590['is']('element'))){let _0x16e8ee=_0xf06590['getAttribute'](ct);_0x16e8ee||(_0x16e8ee=_0x5b8ace['_nextDataId'](_0x259293),_0xf06590['_setAttribute'](ct,_0x16e8ee)),_0x259293['add'](_0x16e8ee);let _0x34d38b=_0xf06590;for(;_0x34d38b['parent']&&!_0x34d38b['parent']['is']('documentFragment');)_0x34d38b=_0x34d38b['parent'],_0x34d38b['hasAttribute'](ct)&&_0x34d38b['_removeAttribute'](ct);_0xf055e['set'](_0x16e8ee,{'path':_0xf06590['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x34d38b['_clone'](!0x0),_0x16e8ee,_0x32f1ea['data'])}),_0x45c3de['jumpTo'](_0x34c8b8['createPositionAfter'](_0xf06590));}}return{'content':_0x32f1ea['data']['processor']['toData'](_0x32f1ea['data']['toView'](_0x2a06a4)),'version':_0x32f1ea['model']['document']['version'],'elements':_0xf055e};}['diffContent'](_0x1dd41f,_0xdc1bdc){const _0x52903c=[],_0x2644f7=P(this['context']),_0x6deca=_0x2644f7['data']['parse'](_0x1dd41f,'$documentFragment'),_0x3d2edb=_0x2644f7['model']['createPositionAt'](_0x6deca,0x0),_0x385c03=_0x2644f7['data']['parse'](_0xdc1bdc,'$documentFragment');if(!this['_hasSameTopLevelElement'](_0x6deca,_0x385c03))return _0x52903c;const _0x5b6e99=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x1dd41f,_0xdc1bdc,{'anchor':_0x3d2edb,'markDeletions':!0x0})['getOperations']()['filter'](_0x2d9b12=>'insert'===_0x2d9b12['type']||'marker'===_0x2d9b12['type']&&_0x2d9b12['name']['startsWith']('$markedRemove')),_0x422425=this['_groupAdjacentOperations'](_0x5b6e99);let _0x130631=0x0;return _0x2644f7['model']['change'](_0x408498=>{for(let _0xcbc990=0x0;_0xcbc990<_0x422425['length'];_0xcbc990++){const _0x2cf2e9=_0x422425[_0xcbc990],_0x46821e=_0x408498['createDocumentFragment']();for(const _0xf851c4 of _0x6deca['getChildren']())_0x408498['append'](_0xf851c4['_clone'](!0x0),_0x46821e);for(const _0xe378af of _0x2cf2e9['operationsIsolated'])if('insert'===_0xe378af['type']){const _0x41e5c7=_0xe378af;_0x41e5c7['baseVersion']=null,_0x41e5c7['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x41e5c7,_0x46821e),_0x408498['batch']['addOperation'](_0xe378af),_0x2644f7['model']['applyOperation'](_0xe378af);const _0x36a89a='suggestion:insertion:id:authorId:'+_0x130631++,_0x409e74=_0x2644f7['model']['createRange'](_0x41e5c7['position'],_0x41e5c7['position']['getShiftedBy'](_0x41e5c7['howMany']));_0x46821e['markers']['set'](_0x36a89a,_0x409e74);}else{if('marker'===_0xe378af['type']&&_0xe378af['name']['startsWith']('$markedRemove')){const _0x5cfbc4=_0xe378af,_0x170dc0='suggestion:deletion:id:authorId:'+_0x130631++;this['_changeOperationOwnerDocument'](_0x5cfbc4,_0x46821e),_0x46821e['markers']['set'](_0x170dc0,_0x5cfbc4['newRange']);}}const _0x1a5b62=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x2cf2e9['operationsIsolated'][0x0]),_0x46821e),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x2cf2e9['operationsIsolated'][_0x2cf2e9['operationsIsolated']['length']-0x1]),_0x46821e));_0x46821e['markers']['set'](me+'suggestion-context',new _0x33fc08(_0x1a5b62['start'],_0x1a5b62['end'])),_0x52903c['push']({..._0x2cf2e9,'context':this['_createGetContextFn'](_0x46821e,_0x2644f7['data'],{'ellipsisBefore':_0x1a5b62['hasContentBefore'],'ellipsisAfter':_0x1a5b62['hasContentAfter']}),'content':this['_createGetContentFn'](_0x46821e,_0x2644f7['data'])});}}),_0x52903c;}['markChangePositionInEditorContent'](_0x2aa255,_0x1d6611){if(!_0x2aa255['length'])return;const _0x50231e=_0x2aa255[0x0]['parent']['id'],_0x53afaa=_0x1d6611['elements']['get'](_0x50231e);if(!_0x53afaa)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x50231e);const _0x3e7651=_0x53afaa['path'],_0x1c200a=P(this['context']),_0x5489c2=_0x1c200a['model']['document']['history']['getOperations'](_0x1d6611['version']),_0x7bdb3e=[];for(const _0x19e700 of _0x2aa255){const _0xcae8b=_0x19e700['operationsIsolated']['map'](_0x1c1170=>this['_translateOperationToEditorContent'](_0x1c1170,_0x3e7651,_0x1c200a['model']['document']['getRoots']()[0x0]));if(!_0xcae8b||!_0xcae8b['length'])continue;const _0x4b77aa=_0xcae8b['every'](_0x94058=>'marker'===_0x94058['type']&&_0x94058['name']['startsWith']('$markedRemove')),_0x180a94={'document':_0x1c200a['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x21bf53=_0x226818(_0xcae8b,_0x5489c2,_0x180a94)['operationsA'];for(const _0x58dd93 of _0x21bf53)if('insert'===_0x58dd93['type']){const _0x4d5657=_0x58dd93,_0x5a1e7c=_0x4d5657['nodes'];let _0x5c1416='';for(const _0x1f1f89 of _0x5a1e7c)_0x1f1f89&&_0x1f1f89['is']('model:$text')&&(_0x5c1416+=_0x1f1f89['data']);_0x7bdb3e['push']({'start':_0x4d5657['position'],'end':_0x4d5657['position'],'type':'insert','groupId':_0x19e700['id'],'text':_0x5c1416});}else{if('marker'===_0x58dd93['type']&&_0x58dd93['name']['startsWith']('$markedRemove')){const _0x571c3b=_0x58dd93;let _0xd15e39='remove-text';if(_0x4b77aa){const _0x406146=this['_findAdjacentContextDistance'](_0x571c3b['newRange']['start'],'backward',_0x1c200a['model']['schema']),_0xba36=this['_findAdjacentContextDistance'](_0x571c3b['newRange']['end'],'forward',_0x1c200a['model']['schema']);if(_0x406146||_0xba36){const _0x98913b=_0x571c3b['newRange']['start']['getShiftedBy'](-_0x406146),_0x19f366=_0x571c3b['newRange']['end']['getShiftedBy'](_0xba36);_0x7bdb3e['push']({'start':_0x98913b,'end':_0x19f366,'groupId':_0x19e700['id'],'type':'remove-context'});}else _0xd15e39='remove-only';}_0x7bdb3e['push']({'start':_0x571c3b['newRange']['start'],'end':_0x571c3b['newRange']['end'],'groupId':_0x19e700['id'],'type':_0xd15e39});}}}this['_insertMarkers'](_0x7bdb3e);}['clearAllMarkers'](){const _0x20436c=P(this['context']);_0x20436c['model']['change'](_0x39be4d=>{for(const _0x4939fc of this['_markers']['keys']())_0x20436c['model']['markers']['get'](_0x4939fc)&&_0x39be4d['removeMarker'](_0x4939fc);}),this['_markers']['clear']();}['switchToReadOnly'](){P(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){P(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x262abd){const _0x5c394e=P(this['context']),_0x83c187=_0x5c394e['model'],_0x3a7405=_0x262abd['map'](_0x277a5f=>this['_getMarkersDataForGroup'](_0x277a5f))['flat']();_0x83c187['change'](_0x2d94ac=>{for(const _0x9cfc9d of _0x3a7405){const _0x2f7513=_0x5c394e['model']['markers']['get'](_0x9cfc9d['id']);_0x2f7513&&('insert'===_0x9cfc9d['type']?_0x83c187['insertContent'](_0x2d94ac['createText'](_0x9cfc9d['text']||''),_0x2f7513['getRange']()['start']):'remove-text'!==_0x9cfc9d['type']&&'remove-only'!==_0x9cfc9d['type']||_0x83c187['deleteContent'](_0x83c187['createSelection'](_0x2f7513['getRange']())),_0x2d94ac['removeMarker'](_0x9cfc9d['id']),this['_markers']['delete'](_0x9cfc9d['id']));}});}['rejectChange'](_0x3562b2){const _0x53611a=P(this['context']),_0x26f321=this['_getMarkersDataForGroup'](_0x3562b2);_0x53611a['model']['change'](_0xe4a5d3=>{for(const _0x44de98 of _0x26f321)_0xe4a5d3['removeMarker'](_0x44de98['id']),this['_markers']['delete'](_0x44de98['id']);});}['getEditor'](){return P(this['context']);}['getMarkerElementForChange'](_0x27c029){const _0x2d023d=Array['from'](this['_markers']['values']())['filter'](_0x336957=>_0x336957['groupId']===_0x27c029);if(!_0x2d023d['length'])return null;const _0x575b8e=0x1===_0x2d023d['length']?_0x2d023d[0x0]:this['_sortMarkers'](_0x2d023d)[0x0],_0x3ddc87=P(this['context']),_0x233cee=_0x3ddc87['model']['markers']['get'](_0x575b8e['id']);if(!_0x233cee)return null;const _0x3838f8=_0x233cee['getRange'](),_0x261d62=_0x3ddc87['editing']['view']['getDomRoot']();if(!_0x261d62||!_0x3838f8)return null;const _0x239868=_0x261d62['querySelector']('[data-marker-id=\x22'+_0x575b8e['id']+'\x22]');return _0x239868?{'modelRange':_0x3838f8,'domElement':_0x239868}:null;}['_validateMarkers'](_0x5bf66a,_0x19b62b){const _0x1f9592=Array['from'](this['_markers']['keys']()),_0x51562d=new Map();for(const _0x10b54d of _0x1f9592){const _0xb2d192=_0x5bf66a['model']['markers']['get'](_0x10b54d);if(!_0xb2d192)continue;const _0x26154c=_0xb2d192['getStart']()['path'][0x0];_0x51562d['has'](_0x26154c)||_0x51562d['set'](_0x26154c,[]),_0x51562d['get'](_0x26154c)['push'](_0xb2d192);}const _0x46e11b=new Set();for(const _0xf1ece1 of _0x5bf66a['model']['document']['differ']['getChanges']()){let _0x1db3ce=-0x1,_0x3d08b3=null;if('insert'===_0xf1ece1['type'])_0x3d08b3=new _0x33fc08(_0xf1ece1['position'],_0xf1ece1['position']['getShiftedBy'](_0xf1ece1['length'])),_0x1db3ce=_0xf1ece1['position']['path'][0x0];else{if('remove'!==_0xf1ece1['type'])continue;_0x3d08b3=new _0x33fc08(_0xf1ece1['position']),_0x1db3ce=_0xf1ece1['position']['path'][0x0];}const _0xc4cfb=_0x51562d['get'](_0x1db3ce)||[];if(_0xc4cfb['length']){for(const _0x1250de of _0xc4cfb)if(_0x3d08b3['root']['rootName']===_0x1250de['getRange']()['root']['rootName']&&('insert'!==_0xf1ece1['type']||!_0x3d08b3['containsRange'](_0x1250de['getRange']()))&&(_0x3d08b3['isIntersecting'](_0x1250de['getRange']())||_0x3d08b3['start']['isTouching'](_0x1250de['getRange']()['end'])||_0x3d08b3['end']['isTouching'](_0x1250de['getRange']()['start']))){const _0x3f553e=this['_parseMarkerName'](_0x1250de['name']);Array['from'](this['_markers']['values']())['filter'](_0x3ebfa7=>_0x3ebfa7['groupId']===_0x3f553e['groupId'])['forEach'](_0xc01897=>_0x46e11b['add'](_0xc01897['id']));}}}if(_0x46e11b['size']){for(const _0x220320 of _0x46e11b)_0x19b62b['removeMarker'](_0x220320);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x597736){for(const {name:_0x449fb0,data:_0x5e9b2b}of _0x597736['model']['document']['differ']['getChangedMarkers']()){if(!_0x449fb0['startsWith'](me))continue;const _0x45b6f6=_0x5e9b2b['oldRange'],_0xc576ce=_0x5e9b2b['newRange'],_0x13d597=_0x45b6f6&&'$graveyard'===_0x45b6f6['root']['rootName'],_0x5e6873=_0xc576ce&&'$graveyard'===_0xc576ce['root']['rootName'];if(_0x13d597&&_0x5e6873)continue;const _0x1b4739=this['_parseMarkerName'](_0x449fb0);this['_markers']['get'](_0x449fb0)&&(_0x5e6873||!_0xc576ce?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x449fb0,'changeId':_0x1b4739['groupId']}):_0x13d597&&_0xc576ce&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x449fb0,'changeId':_0x1b4739['groupId']}));}}['_parseMarkerName'](_0x528aeb){const _0x4f9c45=_0x528aeb['split'](':'),_0x3c0d30=(_0x4f9c45[0x1]||'')['split']('_');return{'prefix':_0x4f9c45[0x0],'groupId':_0x3c0d30[0x0],'suffix':_0x3c0d30[0x1]};}['_translateOperationToEditorContent'](_0x5d3268,_0x219720,_0x5eb735){if('insert'===_0x5d3268['type']){const _0x3ade81=_0x5d3268;return new te(this['_changePosition'](_0x219720['concat'](_0x3ade81['position']['offset']),_0x5eb735),_0x3ade81['nodes'],_0x3ade81['baseVersion']);}if('marker'===_0x5d3268['type']&&_0x5d3268['name']['startsWith']('$markedRemove')){const _0xeadf44=_0x5d3268;return new _0x1a656e(_0xeadf44['name'],_0xeadf44['oldRange'],this['_changeRange'](_0xeadf44['newRange'],_0x219720['concat'](_0xeadf44['newRange']['start']['offset']),_0x219720['concat'](_0xeadf44['newRange']['end']['offset']),_0x5eb735),_0xeadf44['_markers'],_0xeadf44['affectsData'],_0xeadf44['baseVersion']);}return _0x5d3268;}['_groupAdjacentOperations'](_0x5ed4cc){if(!_0x5ed4cc['length'])return[];const _0xe56716=[];let _0x2528cf=0x0,_0x1b0e6f=0x0,_0x4ab275=[];for(let _0x1e17fc=0x0;_0x1e17fc<=_0x5ed4cc['length'];_0x1e17fc++){const _0x50deba=_0x5ed4cc[_0x1e17fc],_0x3c9ed2=_0x5ed4cc[_0x1e17fc-0x1];!_0x50deba||_0x3c9ed2&&!this['_getOperationEnd'](_0x3c9ed2)['isTouching'](this['_getOperationStart'](_0x50deba))?(_0xe56716['push']({'operations':_0x4ab275,'operationsIsolated':_0x4ab275['map'](_0x33721f=>this['_shiftOperation'](_0x33721f['clone'](),-_0x1b0e6f)),'groupOffset':_0x2528cf}),_0x4ab275=_0x50deba?[_0x50deba]:[],_0x1b0e6f+=_0x2528cf,_0x2528cf=0x0):_0x4ab275['push'](_0x50deba),_0x50deba&&'insert'===_0x50deba['type']&&(_0x2528cf+=_0x50deba['howMany']);}return _0xe56716;}['_findAdjacentContextDistance'](_0x13c618,_0x42c199,_0x341490,_0x5c7b8f=0x1){const _0x546f13=new _0x43fa8d({'startPosition':_0x13c618,'direction':_0x42c199});let _0x116eec=0x0;for(let _0x5ce747=0x0;_0x5ce747<_0x5c7b8f;_0x5ce747++){let _0x4e8047=0x0,_0x3f0a31=!0x1,_0x589115='forward'===_0x42c199?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x4fe44e}of _0x546f13)if(_0x4fe44e['is']('$textProxy')){const _0x3f7386=_0x589115['exec'](_0x4fe44e['data']);if(_0x3f7386&&_0x3f7386['length']){if(_0x4e8047+='forward'===_0x42c199?_0x3f7386['index']+_0x3f7386[0x0]['length']:_0x4fe44e['data']['length']-_0x3f7386['index'],_0x3f7386[0x0]['length']!==_0x4fe44e['data']['length'])break;_0x3f0a31=!0x0,_0x589115='forward'===_0x42c199?/^\w+/:/\w+$/;}else{if(_0x3f0a31)break;_0x4e8047+=_0x4fe44e['offsetSize'];}}else{if(_0x4fe44e['is']('element')){_0x341490['isInline'](_0x4fe44e)&&!_0x3f0a31&&(_0x4e8047+=0x1);break;}}_0x116eec+=_0x4e8047,_0x546f13['jumpTo'](_0x13c618['getShiftedBy']('forward'===_0x42c199?_0x116eec:-_0x116eec));}return _0x116eec;}['_getChangeContext'](_0x131396,_0x3def1a){const _0x357173=P(this['context'])['model']['schema'],_0x410c5f=this['_findAdjacentContextDistance'](_0x131396,'backward',_0x357173,0x6),_0x2c5b95=this['_findAdjacentContextDistance'](_0x3def1a,'forward',_0x357173,0x6),_0x4f15aa=_0x131396['getShiftedBy'](-_0x410c5f),_0x1f2cc3=_0x3def1a['getShiftedBy'](_0x2c5b95);return{'start':_0x4f15aa,'end':_0x1f2cc3,'hasContentBefore':!_0x4f15aa['isAtStart'],'hasContentAfter':!_0x1f2cc3['isAtEnd']};}['_insertMarkers'](_0x47fff4){const _0x325464=this['context']['plugins']['get']('AIEditing'),_0x2ae03=new Set();P(this['context'])['model']['change'](_0x4030f0=>{for(const _0x156b81 of _0x47fff4){const _0x4eba02=''+me+_0x156b81['type']+':'+_0x156b81['groupId']+'_'+_0x325464['_nextDataId'](_0x2ae03);this['_markers']['set'](_0x4eba02,{'id':_0x4eba02,'groupId':_0x156b81['groupId'],'type':_0x156b81['type'],'text':_0x156b81['text']}),_0x4030f0['addMarker'](_0x4eba02,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4030f0['createRange'](_0x156b81['start'],_0x156b81['end'])});}});}['_createGetContextFn'](_0x23c8dd,_0x435122,_0x5dbac6){let _0xcd4fd2='';return()=>{if(!_0xcd4fd2){const _0x4688f0=_0x435122['toView'](_0x23c8dd,{'showSuggestionHighlights':!0x0}),_0x40204f=_0x4688f0['getChild'](0x0);if(!_0x40204f)return'';let _0x822cb7=!0x1;const _0x1e8429=[];for(const _0x26f25f of _0x40204f['getChildren']())_0x26f25f['is']('element','span')&&_0x26f25f['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x822cb7=!0x1),_0x822cb7&&_0x1e8429['push'](_0x26f25f),_0x26f25f['is']('element','span')&&_0x26f25f['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x822cb7=!0x0);_0x40204f['_removeChildren'](0x0,_0x40204f['childCount']),_0x5dbac6?.['ellipsisBefore']&&_0x40204f['_appendChild']('…'),_0x40204f['_appendChild'](_0x1e8429),_0x5dbac6?.['ellipsisAfter']&&_0x40204f['_appendChild']('…');const _0x4f61c9=_0x435122['htmlProcessor']['domConverter']['viewToDom'](_0x4688f0),_0x300f7c=_0x435122['htmlProcessor']['htmlWriter']['getHtml'](_0x4f61c9);_0xcd4fd2=_0x300f7c;}return _0xcd4fd2;};}['_createGetContentFn'](_0x446b84,_0x1960f6){let _0xb3942d='';return()=>(_0xb3942d||(_0xb3942d=_0x1960f6['stringify'](_0x446b84,{'showSuggestionHighlights':!0x0})),_0xb3942d);}['_createGetContentUsingDataIdFn'](_0x2017e2,_0x154439,_0xc56e42){let _0x25cd95='';return()=>{if(!_0x25cd95){const _0xe3bf23=_0xc56e42['toView'](new _0x3c80b2(_0x2017e2)),_0x4d156e=_0xc56e42['htmlProcessor']['domConverter']['viewToDom'](_0xe3bf23)['querySelector']('[data-id=\x22'+_0x154439+'\x22]');_0x25cd95=_0x4d156e?.['outerHTML']||'';}return _0x25cd95;};}['_findMarkerElement'](_0x1785ff,_0x380490=0x5){let _0xc390ff=_0x1785ff,_0xb7c960=null;for(let _0x3e997b=0x0;_0x3e997b<_0x380490&&_0xc390ff;_0x3e997b++){if(!_0xc390ff['className']){_0xc390ff=_0xc390ff['parentElement'];continue;}if(!(''+_0xc390ff['className'])['includes']('ck-ai_review-mode-marker_')){_0xc390ff=_0xc390ff['parentElement'];continue;}if(!_0xc390ff['getAttribute']('data-marker-id'))break;_0xb7c960=_0xc390ff;break;}return _0xb7c960;}['_getMarkersDataForGroup'](_0x54ee87){return Array['from'](this['_markers']['values']())['filter'](_0x56a1a6=>_0x56a1a6['groupId']===_0x54ee87);}['_getOperationStart'](_0x1f43a8){return'insert'===_0x1f43a8['type']?_0x1f43a8['position']:_0x1f43a8['newRange']['start'];}['_getOperationEnd'](_0x52fd5a,_0xd949f4=!0x1){return'insert'===_0x52fd5a['type']?_0xd949f4?_0x52fd5a['position']:_0x52fd5a['position']['getShiftedBy'](_0x52fd5a['howMany']):_0x52fd5a['newRange']['end'];}['_shiftOperation'](_0x5ec6b1,_0x45c299){return'insert'===_0x5ec6b1['type']?_0x5ec6b1['position']=_0x5ec6b1['position']['getShiftedBy'](_0x45c299):'marker'===_0x5ec6b1['type']&&_0x5ec6b1['newRange']&&(_0x5ec6b1['newRange']=new _0x33fc08(_0x5ec6b1['newRange']['start']['getShiftedBy'](_0x45c299),_0x5ec6b1['newRange']['end']['getShiftedBy'](_0x45c299))),_0x5ec6b1;}['_changeOperationOwnerDocument'](_0x2dc16e,_0x545466){'insert'===_0x2dc16e['type']?_0x2dc16e['position']=this['_changePositionOwnerDocument'](_0x2dc16e['position'],_0x545466):'marker'===_0x2dc16e['type']&&_0x2dc16e['newRange']&&(_0x2dc16e['newRange']=this['_changeRangeOwnerDocument'](_0x2dc16e['newRange'],_0x545466));}['_changePositionOwnerDocument'](_0x4149bf,_0x55bdeb){return new _0xf3918b(_0x55bdeb,_0x4149bf['path']);}['_changeRangeOwnerDocument'](_0x380da8,_0x250160){return new _0x33fc08(this['_changePositionOwnerDocument'](_0x380da8['start'],_0x250160),this['_changePositionOwnerDocument'](_0x380da8['end'],_0x250160));}['_changePosition'](_0xcd7e0a,_0x50b326){return new _0xf3918b(_0x50b326,[..._0xcd7e0a]);}['_changeRange'](_0x5b325d,_0x5ca642,_0x135c9b,_0x5f4106){return new _0x33fc08(this['_changePosition'](_0x5ca642,_0x5f4106),this['_changePosition'](_0x135c9b,_0x5f4106));}['_sortMarkers'](_0x293225){const _0x41cc4e=_0x28c5a1=>{switch(_0x28c5a1){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x293225['sort']((_0x218f34,_0x4323e5)=>_0x41cc4e(_0x218f34['type'])-_0x41cc4e(_0x4323e5['type']));}['_hasSameTopLevelElement'](_0x5404af,_0x5a294a){const _0x3754ab=_0x5404af['getChild'](0x0),_0x1e385f=_0x5a294a['getChild'](0x0);return!(!_0x3754ab||!_0x1e385f)&&((!_0x3754ab['is']('element')||!_0x1e385f['is']('element')||_0x3754ab['name']===_0x1e385f['name'])&&!(_0x3754ab['is']('element')&&!_0x1e385f['is']('element')||!_0x3754ab['is']('element')&&_0x1e385f['is']('element')));}}class Va extends _0x1bcf21{static get['requires'](){return[ee,ie,re];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{pi as AIActions,ni as AIAdapter,qn as AIAssistant,G as AIAssistantUI,w as AIBalloon,Pa as AIChat,tt as AIChatController,it as AIChatHistory,yt as AIChatHistoryController,jt as AIChatHistoryUI,et as AIChatUI,s as AIConnector,c as AIEditing,Ha as AIEditorIntegration,Ot as AIQuickActionType,Ua as AIQuickActions,ui as AIQuickActionsUI,tr as AIRequestError,xs as AIReviewCheck,Rs as AIReviewCheckResult,Ts as AIReviewCheckRun,Va as AIReviewMode,ee as AIReviewModeController,re as AIReviewModeEditing,ie as AIReviewModeUI,at as AITabs,ue as AITextAdapter,bt as AIToggleButtonUI,zn as AWSTextAdapter,Xn as OpenAITextAdapter,ai as ShowAIAssistantCommand,co as ToggleAICommand,Cs as createResizeButton,Qn as getDefaultAICommands};