@ckeditor/ckeditor5-ai 47.6.1 → 47.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (324) hide show
  1. package/LICENSE.md +0 -4
  2. package/build/ai.js +2 -1
  3. package/dist/index.js +5 -5
  4. package/dist/translations/af.js +1 -1
  5. package/dist/translations/af.umd.js +1 -1
  6. package/dist/translations/ar.js +1 -1
  7. package/dist/translations/ar.umd.js +1 -1
  8. package/dist/translations/ast.js +1 -1
  9. package/dist/translations/ast.umd.js +1 -1
  10. package/dist/translations/az.js +1 -1
  11. package/dist/translations/az.umd.js +1 -1
  12. package/dist/translations/be.js +1 -1
  13. package/dist/translations/be.umd.js +1 -1
  14. package/dist/translations/bg.js +1 -1
  15. package/dist/translations/bg.umd.js +1 -1
  16. package/dist/translations/bn.js +1 -1
  17. package/dist/translations/bn.umd.js +1 -1
  18. package/dist/translations/bs.js +1 -1
  19. package/dist/translations/bs.umd.js +1 -1
  20. package/dist/translations/ca.js +1 -1
  21. package/dist/translations/ca.umd.js +1 -1
  22. package/dist/translations/cs.js +1 -1
  23. package/dist/translations/cs.umd.js +1 -1
  24. package/dist/translations/da.js +1 -1
  25. package/dist/translations/da.umd.js +1 -1
  26. package/dist/translations/de-ch.js +1 -1
  27. package/dist/translations/de-ch.umd.js +1 -1
  28. package/dist/translations/de.js +1 -1
  29. package/dist/translations/de.umd.js +1 -1
  30. package/dist/translations/el.js +1 -1
  31. package/dist/translations/el.umd.js +1 -1
  32. package/dist/translations/en-au.js +1 -1
  33. package/dist/translations/en-au.umd.js +1 -1
  34. package/dist/translations/en-gb.js +1 -1
  35. package/dist/translations/en-gb.umd.js +1 -1
  36. package/dist/translations/en.js +1 -1
  37. package/dist/translations/en.umd.js +1 -1
  38. package/dist/translations/eo.js +1 -1
  39. package/dist/translations/eo.umd.js +1 -1
  40. package/dist/translations/es-co.js +1 -1
  41. package/dist/translations/es-co.umd.js +1 -1
  42. package/dist/translations/es.js +1 -1
  43. package/dist/translations/es.umd.js +1 -1
  44. package/dist/translations/et.js +1 -1
  45. package/dist/translations/et.umd.js +1 -1
  46. package/dist/translations/eu.js +1 -1
  47. package/dist/translations/eu.umd.js +1 -1
  48. package/dist/translations/fa.js +1 -1
  49. package/dist/translations/fa.umd.js +1 -1
  50. package/dist/translations/fi.js +1 -1
  51. package/dist/translations/fi.umd.js +1 -1
  52. package/dist/translations/fr.js +1 -1
  53. package/dist/translations/fr.umd.js +1 -1
  54. package/dist/translations/gl.js +1 -1
  55. package/dist/translations/gl.umd.js +1 -1
  56. package/dist/translations/gu.js +1 -1
  57. package/dist/translations/gu.umd.js +1 -1
  58. package/dist/translations/he.js +1 -1
  59. package/dist/translations/he.umd.js +1 -1
  60. package/dist/translations/hi.js +1 -1
  61. package/dist/translations/hi.umd.js +1 -1
  62. package/dist/translations/hr.js +1 -1
  63. package/dist/translations/hr.umd.js +1 -1
  64. package/dist/translations/hu.js +1 -1
  65. package/dist/translations/hu.umd.js +1 -1
  66. package/dist/translations/hy.js +1 -1
  67. package/dist/translations/hy.umd.js +1 -1
  68. package/dist/translations/id.js +1 -1
  69. package/dist/translations/id.umd.js +1 -1
  70. package/dist/translations/it.js +1 -1
  71. package/dist/translations/it.umd.js +1 -1
  72. package/dist/translations/ja.js +1 -1
  73. package/dist/translations/ja.umd.js +1 -1
  74. package/dist/translations/jv.js +1 -1
  75. package/dist/translations/jv.umd.js +1 -1
  76. package/dist/translations/kk.js +1 -1
  77. package/dist/translations/kk.umd.js +1 -1
  78. package/dist/translations/km.js +1 -1
  79. package/dist/translations/km.umd.js +1 -1
  80. package/dist/translations/kn.js +1 -1
  81. package/dist/translations/kn.umd.js +1 -1
  82. package/dist/translations/ko.js +1 -1
  83. package/dist/translations/ko.umd.js +1 -1
  84. package/dist/translations/ku.js +1 -1
  85. package/dist/translations/ku.umd.js +1 -1
  86. package/dist/translations/lt.js +1 -1
  87. package/dist/translations/lt.umd.js +1 -1
  88. package/dist/translations/lv.js +1 -1
  89. package/dist/translations/lv.umd.js +1 -1
  90. package/dist/translations/ms.js +1 -1
  91. package/dist/translations/ms.umd.js +1 -1
  92. package/dist/translations/nb.js +1 -1
  93. package/dist/translations/nb.umd.js +1 -1
  94. package/dist/translations/ne.js +1 -1
  95. package/dist/translations/ne.umd.js +1 -1
  96. package/dist/translations/nl.js +1 -1
  97. package/dist/translations/nl.umd.js +1 -1
  98. package/dist/translations/no.js +1 -1
  99. package/dist/translations/no.umd.js +1 -1
  100. package/dist/translations/oc.js +1 -1
  101. package/dist/translations/oc.umd.js +1 -1
  102. package/dist/translations/pl.js +1 -1
  103. package/dist/translations/pl.umd.js +1 -1
  104. package/dist/translations/pt-br.js +1 -1
  105. package/dist/translations/pt-br.umd.js +1 -1
  106. package/dist/translations/pt.js +1 -1
  107. package/dist/translations/pt.umd.js +1 -1
  108. package/dist/translations/ro.js +1 -1
  109. package/dist/translations/ro.umd.js +1 -1
  110. package/dist/translations/ru.js +1 -1
  111. package/dist/translations/ru.umd.js +1 -1
  112. package/dist/translations/si.js +1 -1
  113. package/dist/translations/si.umd.js +1 -1
  114. package/dist/translations/sk.js +1 -1
  115. package/dist/translations/sk.umd.js +1 -1
  116. package/dist/translations/sl.js +1 -1
  117. package/dist/translations/sl.umd.js +1 -1
  118. package/dist/translations/sq.js +1 -1
  119. package/dist/translations/sq.umd.js +1 -1
  120. package/dist/translations/sr-latn.js +1 -1
  121. package/dist/translations/sr-latn.umd.js +1 -1
  122. package/dist/translations/sr.js +1 -1
  123. package/dist/translations/sr.umd.js +1 -1
  124. package/dist/translations/sv.js +1 -1
  125. package/dist/translations/sv.umd.js +1 -1
  126. package/dist/translations/th.js +1 -1
  127. package/dist/translations/th.umd.js +1 -1
  128. package/dist/translations/ti.js +1 -1
  129. package/dist/translations/ti.umd.js +1 -1
  130. package/dist/translations/tk.js +1 -1
  131. package/dist/translations/tk.umd.js +1 -1
  132. package/dist/translations/tr.js +1 -1
  133. package/dist/translations/tr.umd.js +1 -1
  134. package/dist/translations/tt.js +1 -1
  135. package/dist/translations/tt.umd.js +1 -1
  136. package/dist/translations/ug.js +1 -1
  137. package/dist/translations/ug.umd.js +1 -1
  138. package/dist/translations/uk.js +1 -1
  139. package/dist/translations/uk.umd.js +1 -1
  140. package/dist/translations/ur.js +1 -1
  141. package/dist/translations/ur.umd.js +1 -1
  142. package/dist/translations/uz.js +1 -1
  143. package/dist/translations/uz.umd.js +1 -1
  144. package/dist/translations/vi.js +1 -1
  145. package/dist/translations/vi.umd.js +1 -1
  146. package/dist/translations/zh-cn.js +1 -1
  147. package/dist/translations/zh-cn.umd.js +1 -1
  148. package/dist/translations/zh.js +1 -1
  149. package/dist/translations/zh.umd.js +1 -1
  150. package/lang/contexts.json +1 -0
  151. package/package.json +15 -16
  152. package/src/aiactions/aiactions.js +1 -1
  153. package/src/aiactions/model/aiactionsinteraction.js +1 -1
  154. package/src/aiactions/model/aiactionsreply.js +1 -1
  155. package/src/aiassistant/adapters/aiadapter.js +1 -1
  156. package/src/aiassistant/adapters/aitextadapter.js +1 -1
  157. package/src/aiassistant/adapters/awstextadapter.d.ts +15 -156
  158. package/src/aiassistant/adapters/awstextadapter.js +1 -1
  159. package/src/aiassistant/adapters/openaitextadapter.js +1 -1
  160. package/src/aiassistant/aiassistant.d.ts +2 -0
  161. package/src/aiassistant/aiassistant.js +1 -1
  162. package/src/aiassistant/aiassistantediting.js +1 -1
  163. package/src/aiassistant/aiassistantui.js +1 -1
  164. package/src/aiassistant/legacyerrors.js +1 -1
  165. package/src/aiassistant/ui/aiassistantcontroller.js +2 -2
  166. package/src/aiassistant/ui/form/aiformcontentarea.js +1 -1
  167. package/src/aiassistant/ui/form/aiformerrorview.js +1 -1
  168. package/src/aiassistant/ui/form/aiformpromptview.js +1 -1
  169. package/src/aiassistant/ui/form/aiformtoolbarview.js +1 -1
  170. package/src/aiassistant/ui/form/aiformview.js +1 -1
  171. package/src/aiassistant/ui/form/aihistorylistitemview.js +1 -1
  172. package/src/aiassistant/ui/form/aihistorylistview.js +1 -1
  173. package/src/aiassistant/ui/form/prompthistory.js +1 -1
  174. package/src/aiassistant/ui/showaiassistantcommand.js +1 -1
  175. package/src/aiassistant/utils/common-translations.js +1 -1
  176. package/src/aiassistant/utils/normalizecommandsconfig.js +1 -1
  177. package/src/aiballoon/aiballoon.js +1 -1
  178. package/src/aiballoon/ui/aiballoonview.js +1 -1
  179. package/src/aichat/aichat.js +1 -1
  180. package/src/aichat/aichatballoon.js +1 -1
  181. package/src/aichat/aichatcontroller.js +1 -1
  182. package/src/aichat/aichatui.js +1 -1
  183. package/src/aichat/model/aichatcontext.js +1 -1
  184. package/src/aichat/model/aichatconversation.js +1 -1
  185. package/src/aichat/model/aichatinteraction.js +1 -1
  186. package/src/aichat/ui/aichatballoonview.js +1 -1
  187. package/src/aichat/ui/aichatcontrolsview.js +1 -1
  188. package/src/aichat/ui/aichatfeedview.js +1 -1
  189. package/src/aichat/ui/aichatheaderview.js +1 -1
  190. package/src/aichat/ui/aichatview.js +1 -1
  191. package/src/aichat/ui/controls/aichatchipsoverflowmanager.js +1 -1
  192. package/src/aichat/ui/controls/aichatcontextitembuttonview.js +1 -1
  193. package/src/aichat/ui/controls/aichatcontextpanelurlinputview.js +1 -1
  194. package/src/aichat/ui/controls/aichatcontextpanelview.js +1 -1
  195. package/src/aichat/ui/controls/aichatcontrolsloaderview.js +1 -1
  196. package/src/aichat/ui/controls/aichatpromptcapabilitiesview.js +1 -1
  197. package/src/aichat/ui/controls/aichatpromptinputview.js +1 -1
  198. package/src/aichat/ui/controls/aichatpromptsuggestionslistview.js +1 -1
  199. package/src/aichat/ui/controls/resources/aichatcontextresourceslistview.js +1 -1
  200. package/src/aichat/ui/controls/resources/aichatcontextresourcesview.js +1 -1
  201. package/src/aichat/ui/controls/resources/aichatresourcelistitemview.js +1 -1
  202. package/src/aichat/ui/controls/resources/aichatresourcesballoonview.js +1 -1
  203. package/src/aichat/ui/controls/resources/aichatresourcessearchinputview.js +1 -1
  204. package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
  205. package/src/aichat/ui/feed/aichatfeedcustomelementview.js +1 -1
  206. package/src/aichat/ui/feed/aichatfeederroritemview.js +1 -1
  207. package/src/aichat/ui/feed/aichatfeedinteractionheaderview.js +1 -1
  208. package/src/aichat/ui/feed/aichatfeeditemview.js +1 -1
  209. package/src/aichat/ui/feed/aichatfeedreplyitemview.js +1 -1
  210. package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.js +1 -1
  211. package/src/aichat/ui/feed/aichatfeedsuggestionitemview.js +1 -1
  212. package/src/aichat/ui/feed/aichatfeedusermessageitem.js +1 -1
  213. package/src/aichat/utils/eventnames.js +1 -1
  214. package/src/aichat/utils/promisequeue.js +1 -1
  215. package/src/aichathistory/aichathistory.js +1 -1
  216. package/src/aichathistory/aichathistorycontroller.js +1 -1
  217. package/src/aichathistory/aichathistoryui.js +1 -1
  218. package/src/aichathistory/model/aichathistoryconversations.js +1 -1
  219. package/src/aichathistory/model/aichathistoryitem.js +1 -1
  220. package/src/aichathistory/ui/aichathistorylistitemview.js +2 -2
  221. package/src/aichathistory/ui/aichathistorylistview.js +1 -1
  222. package/src/aichathistory/ui/aichathistorysectionlistview.js +1 -1
  223. package/src/aichathistory/ui/aichathistoryview.js +1 -1
  224. package/src/aichatshortcuts/aichatshortcuts.js +1 -1
  225. package/src/aichatshortcuts/ui/aichatshortcutsview.js +1 -1
  226. package/src/aichatshortcuts/ui/aichatshortcutview.js +1 -1
  227. package/src/aicore/aiconnector.js +1 -1
  228. package/src/aicore/aiediting.js +1 -1
  229. package/src/aicore/model/aicapabilities.js +1 -1
  230. package/src/aicore/model/aicontext.js +1 -1
  231. package/src/aicore/model/aiinteraction.js +1 -1
  232. package/src/aicore/model/aimodels.js +1 -1
  233. package/src/aicore/model/aireply.js +1 -1
  234. package/src/aicore/pipeline/airesponseapplier.js +2 -2
  235. package/src/aicore/pipeline/airesponseparser.js +2 -2
  236. package/src/aicore/ui/aidisclaimerview.js +1 -1
  237. package/src/aicore/ui/aiskeleton.js +1 -1
  238. package/src/aicore/ui/aispinner.js +1 -1
  239. package/src/aicore/ui/suggestioncontainer/aiminitoolbarview.js +1 -1
  240. package/src/aicore/ui/suggestioncontainer/aisuggestionbodyview.js +1 -1
  241. package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.js +1 -1
  242. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartheaderview.js +1 -1
  243. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.js +1 -1
  244. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.js +1 -1
  245. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.js +1 -1
  246. package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
  247. package/src/aicore/ui/suggestioncontainer/aisuggestionloaderview.js +1 -1
  248. package/src/aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.js +1 -1
  249. package/src/aicore/ui/suggestioncontainer/aiwebsourcesview.js +1 -1
  250. package/src/aicore/utils/common-translations.js +1 -1
  251. package/src/aicore/utils/createresizebutton.js +1 -1
  252. package/src/aicore/utils/documentposition.js +1 -1
  253. package/src/aicore/utils/documentrange.js +1 -1
  254. package/src/aicore/utils/eventnames.js +1 -1
  255. package/src/aicore/utils/geteditorfromcontext.js +1 -1
  256. package/src/aicore/utils/getoperationsfromreply.js +1 -1
  257. package/src/aicore/utils/getsuggestionpartsfromreply.js +1 -1
  258. package/src/aicore/utils/htmlparser.js +1 -1
  259. package/src/aicore/utils/htmlstreamer.js +1 -1
  260. package/src/aicore/utils/scrollmanager.js +1 -1
  261. package/src/aieditorintegration/aieditorintegration.js +1 -1
  262. package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.js +1 -1
  263. package/src/aieditorintegration/aitogglebutton/toggleaicommand.js +1 -1
  264. package/src/aiquickactions/aiquickactions.js +1 -1
  265. package/src/aiquickactions/aiquickactionscommand.js +1 -1
  266. package/src/aiquickactions/aiquickactionsediting.js +1 -1
  267. package/src/aiquickactions/aiquickactionsui.js +1 -1
  268. package/src/aiquickactions/ui/aiquickactionsbuttoncreator.js +1 -1
  269. package/src/aiquickactions/ui/aiquickactionsdropdowncontentview.js +1 -1
  270. package/src/aiquickactions/ui/aiquickactionsdropdowncreator.js +1 -1
  271. package/src/aiquickactions/ui/aiquickactionsfilteredlistview.js +1 -1
  272. package/src/aiquickactions/ui/balloon/aiactionsballoondisclaimerview.js +1 -1
  273. package/src/aiquickactions/ui/balloon/aiactionsballoontoolbarview.js +1 -1
  274. package/src/aiquickactions/ui/balloon/aiactionsballoonview.js +1 -1
  275. package/src/aiquickactions/ui/dropdownmenubuttonwithhighlightview.js +1 -1
  276. package/src/aireviewcore/aireviewcorecontroller.js +1 -1
  277. package/src/aireviewcore/aireviewcoreediting.js +1 -1
  278. package/src/aireviewcore/aireviewcoreui.js +1 -1
  279. package/src/aireviewcore/model/aireviewcheck.js +1 -1
  280. package/src/aireviewcore/model/aireviewchecklist.js +1 -1
  281. package/src/aireviewcore/model/aireviewcheckresult.js +1 -1
  282. package/src/aireviewcore/model/aireviewcheckresultchange.js +1 -1
  283. package/src/aireviewcore/model/aireviewcheckrun.js +1 -1
  284. package/src/aireviewcore/model/aireviewsystemcheckrun.js +1 -1
  285. package/src/aireviewcore/ui/aireviewcoreballoonsuggestionview.js +1 -1
  286. package/src/aireviewcore/ui/aireviewcorechecklistitemresultview.js +1 -1
  287. package/src/aireviewcore/ui/aireviewcorecustomcheckview.js +1 -1
  288. package/src/aireviewcore/ui/aireviewcorefinishreviewbuttonview.js +1 -1
  289. package/src/aireviewcore/ui/aireviewcoregeneralerrorview.js +1 -1
  290. package/src/aireviewcore/ui/aireviewcorepromptinputview.js +1 -1
  291. package/src/aireviewcore/ui/aireviewcorereviewchecklistview.js +1 -1
  292. package/src/aireviewcore/ui/aireviewcorereviewcommandlistitemview.js +1 -1
  293. package/src/aireviewcore/ui/aireviewcorereviewcompletedview.js +1 -1
  294. package/src/aireviewcore/ui/aireviewcoreuicheckresultsview.js +1 -1
  295. package/src/aireviewcore/ui/aireviewcoreview.js +1 -1
  296. package/src/aireviewcore/ui/form/aireviewcoreformdropdown.js +1 -1
  297. package/src/aireviewcore/ui/form/aireviewcoreformmanager.js +1 -1
  298. package/src/aireviewmode/aireviewcheckdefinitions.js +1 -1
  299. package/src/aireviewmode/aireviewmode.js +1 -1
  300. package/src/aireviewmode/aireviewmodecontroller.js +1 -1
  301. package/src/aireviewmode/aireviewmodeui.js +1 -1
  302. package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
  303. package/src/aireviewmode/model/aireviewcheckextra.js +1 -1
  304. package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
  305. package/src/aireviewmode/model/aireviewextracheckrun.js +1 -1
  306. package/src/aireviewmode/model/aireviewmodechecklist.js +1 -1
  307. package/src/aitabs/aitabs.js +1 -1
  308. package/src/aitabs/aitabsmainview.js +1 -1
  309. package/src/aitabs/tabs/aitabsview.js +1 -1
  310. package/src/aitabs/tabs/tabbuttonview.js +1 -1
  311. package/src/aitabs/tabs/tabpanelview.js +1 -1
  312. package/src/aitranslate/aitranslate.js +1 -1
  313. package/src/aitranslate/aitranslatecontroller.js +1 -1
  314. package/src/aitranslate/aitranslateui.js +1 -1
  315. package/src/aitranslate/model/aitranslatecheck.js +1 -1
  316. package/src/aitranslate/model/aitranslatechecklist.js +1 -1
  317. package/src/aitranslate/model/aitranslatecheckrun.js +1 -1
  318. package/src/aitranslate/ui/aitranslatechecklistview.js +1 -1
  319. package/src/aitranslate/ui/aitranslatecheckresultsview.js +1 -1
  320. package/src/errors.js +1 -1
  321. package/src/errorsmap.js +1 -1
  322. package/src/index.js +1 -1
  323. package/build/966.ai.js +0 -5
  324. package/build/translations/en.js +0 -1
package/dist/index.js CHANGED
@@ -20,8 +20,8 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x5adfee,Command as At,ContextPlugin as _0x37abb2,Editor as _0x5a6451}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x3d8ab5,IconCheck as _0x1dd94c,IconError as _0x5325ee,IconSubmit as _0x13c99b,IconAIHistory as ot,IconMagicWand as _0x342837,IconRobotPencil as ti,IconMaximize as _0x2b97b8,IconMinimize as _0x3bc269,IconShowChangesOn as _0x455aeb,IconShowChangesOff as _0x3da748,IconDocument as _0x2040cd,IconBoxWithCross as _0x1e0042,IconBoxWithCheck as _0x45fb55,IconBoxWithMarker as _0x44249d,IconInfo as tc,IconLoupe as _0x31f317,IconCancel as _0x3b3d8d,IconStop as _0x30c4f4,IconAIChat as tt,IconPlus as _0xa967bf,IconPin as _0x44d873,IconThreeHorizontalDots as _0x21a59b,IconChevronDown as _0x222cc5,IconChevronUp as _0x68c9f1,IconOutdated as _0x35296c,IconEye as _0x1ef78b,IconEyeCrossedOut as _0x4d2895,IconChevronRight as _0x1ee0fb,IconAIReview as _0x3867f9,IconAITranslate as _0x1dbdc4}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x3e4e8c,CKEditorError as _0x1500e8,ObservableMixin as Vt,global as _0x3537fe,isVisible as _0x48958f,Rect as _0x34633d,Collection as _0x53af97,FocusTracker as ts,KeystrokeHandler as _0x356454,first as _0x33a8c,toArray as _0x503037,EmitterMixin as Ft,logWarning as Zt,logError as _0x4dee23,scrollViewportToShowTarget as _0x54e791,scrollAncestorsToShowTarget as _0x917d7b,ResizeObserver as _0x1a199c,_isMotionReduced as _0x6e294d,getConstrainedViewportRect as _0x2a7169,DomEmitterMixin as Rt}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x1b7f91,ButtonView as _0x3fc85a,View as _0x538d57,SpinnerView as _0x29d2d8,IconView as _0x1a5580,AutocompleteView as _0x6213f1,ListView as _0x1b0a54,ListItemGroupView as _0x1728c0,ListItemView as _0x5749b5,ButtonLabelView as _0x3ffbe5,FocusCycler as _0x19c87e,createLabeledTextarea as _0x550e60,Dialog as _0xc82d75,createDropdown as _0x238494,addMenuToDropdown as _0x30ebf6,MenuBarMenuView as _0x3c114,MenuBarMenuListItemButtonView as _0x58fafd,DialogViewPosition as _0x5e4c8a,MenuBarMenuListView as _0x3301ef,MenuBarMenuListItemView as _0x4dbed9,BodyCollection as _0x4b2ab0,BalloonPanelView as _0x51e059,clickOutsideHandler as _0x23d932,addListToDropdown as _0x57d60a,UIModel as _0x584377,submitHandler as _0x2d4a6e,LabeledFieldView as _0x449567,createLabeledInputText as _0x279926,FormHeaderView as _0x2c8dbc,HighlightedTextView as _0xe11984,ViewCollection as _0x4f2c93,FileDialogButtonView as _0x4b66f3,InputTextView as _0x1cab27,SearchTextView as _0x8635d1,ListItemButtonView as _0xa6313b,ButtonLabelWithHighlightView as _0x1eaeda,DropdownMenuPanelPositioningFunctions as _0x1a2e34,BalloonToolbar as Et,FormRowView as _0x553dac,TextareaView as _0x170ffb}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as nt,ClipboardMarkersUtils as _0x524068}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as ct,ViewDataTransfer as ut,ViewUpcastWriter as _0x3be1ca,Matcher as _0xf012f3,_DetachOperation as _0x34bf3b,_insertIntoModelNodeList as _0xdd4fe8,_removeFromModelNodeList as to,ModelRange as _0x1f26a0,transformOperationSets as _0x104b8e,ViewDowncastWriter as ft,ModelDocumentFragment as _0x27a70e,ModelPosition as _0x128f8a,ModelTreeWalker as Dt,MarkerOperation as Mt,InsertOperation as $t}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x4e5df5,escape as Wt,escapeRegExp as _0x32442b,debounce as Ht}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x978f5f,InvokeModelWithResponseStreamCommand as _0x438d78,InvokeModelCommand as _0x31c8cb}from'@aws-sdk/client-bedrock-runtime';import{createParser as gt}from'eventsource-parser';import{parseDocument as _0x13b8bc}from'htmlparser2';import{isTag as _0x32b8a9,findOne as _0x32e3c1,getParent as _0x11e924,findAll as _0x51c105,removeElement as _0x7119c8,replaceElement as _0x3d5dcc,prepend as _0x4512fa,prependChild as _0x56829d,appendChild as _0x56184d,append as _0x4dcf7a,find as _0x83201e,isComment as _0x10a170,getChildren as _0x5ecbbf,textContent as _0x4fc42c}from'domutils';import _0x2aee41 from'dom-serializer';import{Document as _0x175d6b,Element as _0x309db4,Text as _0x28e1e3,cloneNode as _0x257863,isDocument as _0x5de66b,isText as _0x211c5d,NodeWithChildren as _0x5329aa}from'domhandler';import{MarkdownGfmMdToHtml as _0x7213b8}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0xf97f88,DocumentCompare as _0x4f58a6,DATA_ID_MODEL_ATTRIBUTE as _0x1707b9,ConfirmMixin as _0x531f3e,LateFocusDropdownButtonView as _0x117d83,getAllMarkersDomElementsSorted as _0x589705,SuggestionsConversion as jt,DATA_ID_VIEW_ATTRIBUTE as Bt,getMarkerDomElement as Gt}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x4879b0}from'es-toolkit';import _0x1cf580 from'morphdom';import{IconWeb as _0x1904ed,IconClose as _0x223b2d,IconDocument as _0x59e6a4,IconSelection as _0x33062f,IconFileUpload as _0x2f42c6,IconLink as _0x1afd05,IconBulb as _0x2190ec,IconAI as _0x235661,IconPreviousArrow as _0x41367a,IconCheck as _0x28d1ec,IconDocumentOutline as _0x40ab64,IconPaperClip as _0x2509b0,IconBrowseFiles as _0x5ec29a,IconDropdownArrow as _0x41c19f,IconAIChat as _0x50a176,IconAIReview as _0xbfad04,IconAITranslate as St,IconAIAskAI as _0x2cc560,IconThumbUp as _0x235fb2,IconThumbDown as _0x176db2,IconCopy as _0x404dc2,IconShowChangesOff as _0x2b23b3,IconShowChangesOn as _0x5ce6ec,IconAIQuickActions as _0x5d0a10,IconAIChatCommands as Tt,IconAIImproveWriting as Ct,IconAIContinueWriting as kt,IconAIGrammarCheck as Nt,IconAIAdjustLength as yt,IconAIChangeTone as _t,IconAIOther as Qt,IconRefresh as _0x49b8b4,IconNextArrow as _0x5695ec}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x3682e4}from'diff';const li='_ungrouppedCommands';function ne(_0x4b6b82,_0x3c8530){const _0x31573b=(0x0,_0x3c8530['t'])('Other');return _0x4b6b82['length']?'groupId'in _0x4b6b82[0x0]?_0x4b6b82:[{'groupId':li,'groupLabel':_0x31573b,'order':0x1/0x0,'commands':_0x4b6b82}]:[{'groupId':li,'groupLabel':_0x31573b,'order':0x1/0x0,'commands':[]}];}const Wn=globalThis['DataTransfer'],wt='ai-ui';class te extends _0x5adfee{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1fed07}=this,_0xb8d286=['ck-fake-ai-selection'];_0x1fed07['config']['get']('ai.assistant.useTheme')&&_0xb8d286['push']('ck-ai-assistant-ui_theme'),_0x1fed07['conversion']['for']('editingDowncast')['markerToHighlight']({'model':wt,'view':{'classes':_0xb8d286,'priority':0xc}}),_0x1fed07['conversion']['for']('editingDowncast')['markerToElement']({'model':wt,'view':(_0x291bf0,{writer:_0x2803ec})=>{if(!_0x291bf0['markerRange']['isCollapsed'])return null;const _0x2fb50c=_0x2803ec['createUIElement']('span');return _0x2803ec['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x2fb50c),_0x2fb50c;}});}['afterInit'](){!async function(_0x1a7896){const _0x1f9430=_0x3b8704([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]),_0x4f6e03=0x3dffc4e1,_0x3357e4=0x3df840e9^_0x4f6e03,_0x4432aa=window[_0x3b8704([0x44,0x61,0x74,0x65])][_0x3b8704([0x6e,0x6f,0x77])](),_0x1efcfe=_0x1a7896[_0x3b8704([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x478239=new window[(_0x3b8704([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x27f86d=>{_0x1efcfe[_0x3b8704([0x6f,0x6e,0x63,0x65])](_0x3b8704([0x72,0x65,0x61,0x64,0x79]),_0x27f86d);}),_0x45d371={[_0x3b8704([0x6b,0x74,0x79])]:_0x3b8704([0x45,0x43]),[_0x3b8704([0x75,0x73,0x65])]:_0x3b8704([0x73,0x69,0x67]),[_0x3b8704([0x63,0x72,0x76])]:_0x3b8704([0x50,0x2d,0x32,0x35,0x36]),[_0x3b8704([0x78])]:_0x3b8704([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]),[_0x3b8704([0x79])]:_0x3b8704([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]),[_0x3b8704([0x61,0x6c,0x67])]:_0x3b8704([0x45,0x53,0x32,0x35,0x36])},_0x234798=_0x1efcfe[_0x3b8704([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3b8704([0x67,0x65,0x74])](_0x3b8704([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5b59c7(){let _0xc585fe,_0x32c7fd=null,_0x5e6ca8=null;try{if(_0x234798==_0x3b8704([0x47,0x50,0x4c]))return _0x3b8704([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0xc585fe=_0x433fbb(),!_0xc585fe)return _0x3b8704([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0xc585fe[_0x3b8704([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x5e6ca8=_0x99e44c(_0xc585fe[_0x3b8704([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0xc585fe[_0x3b8704([0x6a,0x74,0x69])])),await _0x59c6ca()?_0x5d671f()?_0x2e9d76()?_0x3b8704([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x2d5202()?(_0xc585fe[_0x3b8704([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3b8704([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x32c7fd=_0x53b08b(_0x3b8704([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x462b48()):_0x3b8704([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3b8704([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3b8704([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x3b8704([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2e9d76(){const _0x17b5e2=[_0x3b8704([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3b8704([0x74,0x72,0x69,0x61,0x6c])][_0x3b8704([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xc585fe[_0x3b8704([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x4432aa/0x3e8:0xe10*_0x3357e4;return _0xc585fe[_0x3b8704([0x65,0x78,0x70])]<_0x17b5e2;}function _0x5d671f(){const _0x482427=_0xc585fe[_0x3b8704([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x482427&&(!!_0x482427[_0x3b8704([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3b8704([0x2a]))||!!_0x482427[_0x3b8704([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3b8704([0x41,0x49])));}function _0x2d5202(){const _0x30aa35=_0xc585fe[_0x3b8704([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x30aa35||0x0==_0x30aa35[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x592763}=new URL(window[_0x3b8704([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x30aa35[_0x3b8704([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x592763))return!0x0;const _0x5fdad1=_0x592763[_0x3b8704([0x73,0x70,0x6c,0x69,0x74])](_0x3b8704([0x2e]));return _0x30aa35[_0x3b8704([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xd72ce3=>_0xd72ce3[_0x3b8704([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3b8704([0x2a])))[_0x3b8704([0x6d,0x61,0x70])](_0x5660c9=>_0x5660c9[_0x3b8704([0x73,0x70,0x6c,0x69,0x74])](_0x3b8704([0x2e])))[_0x3b8704([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x55b149=>_0x55b149[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5fdad1[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3b8704([0x6d,0x61,0x70])](_0x496420=>Array(_0x5fdad1[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x496420[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3b8704([0x66,0x69,0x6c,0x6c])](_0x496420[0x0]===_0x3b8704([0x2a])?_0x3b8704([0x2a]):'')[_0x3b8704([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x496420))[_0x3b8704([0x73,0x6f,0x6d,0x65])](_0x4a34e3=>_0x5fdad1[_0x3b8704([0x65,0x76,0x65,0x72,0x79])]((_0x481bbc,_0x3a0c3d)=>_0x4a34e3[_0x3a0c3d]===_0x481bbc||_0x4a34e3[_0x3a0c3d]===_0x3b8704([0x2a])));}function _0x462b48(){return _0x32c7fd&&_0x5e6ca8?new window[(_0x3b8704([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3127a1,_0x317f34)=>{_0x32c7fd[_0x3b8704([0x74,0x68,0x65,0x6e])](_0x3127a1,_0x317f34),_0x5e6ca8[_0x3b8704([0x74,0x68,0x65,0x6e])](_0x573fe5=>{_0x573fe5!=_0x3b8704([0x56,0x61,0x6c,0x69,0x64])&&_0x3127a1(_0x573fe5);},_0x317f34);}):_0x32c7fd||_0x5e6ca8||_0x3b8704([0x56,0x61,0x6c,0x69,0x64]);}}function _0x99e44c(_0x4eebce,_0x199861){return new window[(_0x3b8704([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4379ff=>{if(_0x32d0c2())return _0x4379ff(_0x3b8704([0x56,0x61,0x6c,0x69,0x64]));_0x599445(),_0x1efcfe[_0x3b8704([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3b8704([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xb1c4c1=!0x1;const _0x473594=_0x3e4e8c();function _0x400985(_0x494b03){return!!_0x494b03&&(typeof _0x494b03===_0x3b8704([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x494b03===_0x3b8704([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x494b03[_0x3b8704([0x74,0x68,0x65,0x6e])]===_0x3b8704([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x494b03[_0x3b8704([0x63,0x61,0x74,0x63,0x68])]===_0x3b8704([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x106510(_0x521244){_0x50a02a(_0x521244)[_0x3b8704([0x74,0x68,0x65,0x6e])](_0x32e4e4=>{if(!_0x32e4e4||_0x32e4e4[_0x3b8704([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3b8704([0x6f,0x6b]))return _0x3b8704([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x443584(_0x3da2a2(_0x473594+_0x199861))!=_0x32e4e4[_0x3b8704([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3b8704([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3b8704([0x56,0x61,0x6c,0x69,0x64]);})[_0x3b8704([0x74,0x68,0x65,0x6e])](_0xa65a=>(_0x5e7343(),_0xa65a),()=>{const _0x32ce5b=_0x33a489();return null==_0x32ce5b?(_0x5e7343(),_0x3b8704([0x56,0x61,0x6c,0x69,0x64])):_0x3b8704(_0x4432aa-_0x32ce5b>(0x19f340e1^_0x4f6e03)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3b8704([0x74,0x68,0x65,0x6e])](_0x4379ff)[_0x3b8704([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4379ff(_0x3b8704([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xd8464=0x3dc92a61^_0x4f6e03;function _0x5e7343(){const _0x43d23b=_0x3b8704([0x6c,0x6c,0x63,0x74,0x2d])+_0x443584(_0x3da2a2(_0x4eebce)),_0x145199=_0x15b397(_0x443584(window[_0x3b8704([0x4d,0x61,0x74,0x68])][_0x3b8704([0x63,0x65,0x69,0x6c])](_0x4432aa/_0xd8464)));window[_0x3b8704([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3b8704([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x43d23b,_0x145199);}function _0x33a489(){const _0x3105f8=_0x3b8704([0x6c,0x6c,0x63,0x74,0x2d])+_0x443584(_0x3da2a2(_0x4eebce)),_0xf1ddd2=window[_0x3b8704([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3b8704([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3105f8);return _0xf1ddd2?window[_0x3b8704([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x15b397(_0xf1ddd2),0x10)*_0xd8464:null;}function _0x50a02a(_0x327896){return new window[(_0x3b8704([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xe189dd,_0x4987f5)=>{_0x327896[_0x3b8704([0x74,0x68,0x65,0x6e])](_0xe189dd,_0x4987f5),window[_0x3b8704([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4987f5,0x3dfe1021^_0x4f6e03);});}}_0x1efcfe[_0x3b8704([0x6f,0x6e])](_0x3b8704([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x383edf,_0x3f55ba)=>{if(_0x3f55ba[0x0]!=_0x4eebce)return _0x4379ff(_0x3b8704([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3f55ba[0x1]={..._0x3f55ba[0x1],[_0x3b8704([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x473594};},{[_0x3b8704([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3b8704([0x68,0x69,0x67,0x68])}),_0x1efcfe[_0x3b8704([0x6f,0x6e])](_0x3b8704([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2daeea=>{_0x400985(_0x2daeea[_0x3b8704([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xb1c4c1=!0x0,_0x106510(_0x2daeea[_0x3b8704([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3b8704([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3b8704([0x6c,0x6f,0x77])}),_0x478239[_0x3b8704([0x74,0x68,0x65,0x6e])](()=>{_0xb1c4c1||_0x4379ff(_0x3b8704([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x32d0c2(){return _0x1efcfe[_0x3b8704([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3b8704([0x76,0x69,0x65,0x77])][_0x3b8704([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3b8704([0x61,0x75,0x74,0x6f]);}function _0x599445(){_0x1efcfe[_0x3b8704([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3b8704([0x76,0x69,0x65,0x77])][_0x3b8704([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3b8704([0x61,0x75,0x74,0x6f]);}}function _0x53b08b(_0x8daa79){const _0x139032=[new window[(_0x3b8704([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x57f3a0=>setTimeout(_0x57f3a0,0x3df6fa2d^_0x4f6e03)),_0x478239[_0x3b8704([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3b8704([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x36ff64=>{let _0x4ccd8d=0x0;_0x1efcfe[_0x3b8704([0x6d,0x6f,0x64,0x65,0x6c])][_0x3b8704([0x6f,0x6e])](_0x3b8704([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xf36d27,_0x1f1477)=>{_0x1f1477[0x0][_0x3b8704([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4ccd8d++,_0x4ccd8d==(0x3dffc109^_0x4f6e03)&&(_0x36ff64(),_0xf36d27[_0x3b8704([0x6f,0x66,0x66])]());});}))];return window[_0x3b8704([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3b8704([0x72,0x61,0x63,0x65])](_0x139032)[_0x3b8704([0x74,0x68,0x65,0x6e])](()=>_0x8daa79);}async function _0x1420d0(){await _0x478239,_0x1efcfe[_0x3b8704([0x6d,0x6f,0x64,0x65,0x6c])][_0x3b8704([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x69e6ac,_0x1efcfe[_0x3b8704([0x6d,0x6f,0x64,0x65,0x6c])][_0x3b8704([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x69e6ac,_0x1efcfe[_0x3b8704([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3b8704([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x475238(_0x5c44da){const _0x2eb078=_0x97fa8b();_0x1efcfe[_0x2eb078]=_0x3b8704([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x5c44da,_0x5c44da!=_0x3b8704([0x56,0x61,0x6c,0x69,0x64])&&_0x1420d0();}function _0x97fa8b(){const _0x312660=window[_0x3b8704([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3b8704([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3b8704([0x6e,0x6f,0x77])]())[_0x3b8704([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3b8704([0x2e]),'');let _0x22b1ed=_0x3b8704([0x6e]);for(let _0x58a629=0x0;_0x58a629<_0x312660[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x58a629+=0x2){let _0x1e34f4=window[_0x3b8704([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x312660[_0x3b8704([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x58a629,_0x58a629+0x2));_0x1e34f4>=_0x1f9430[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1e34f4-=_0x1f9430[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x22b1ed+=_0x1f9430[_0x1e34f4];}return _0x22b1ed;}function _0x433fbb(){const _0x4734d8=_0x234798[_0x3b8704([0x73,0x70,0x6c,0x69,0x74])](_0x3b8704([0x2e]));if(0x3!=_0x4734d8[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3ef300(_0x4734d8[0x1]);function _0x3ef300(_0x3125ff){const _0x3b8cca=_0x38668b(_0x3125ff);return _0x3b8cca&&_0x50b80f()?_0x3b8cca:null;function _0x50b80f(){const _0x149a36=_0x3b8cca[_0x3b8704([0x6a,0x74,0x69])],_0xd9116a=window[_0x3b8704([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x149a36[_0x3b8704([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x149a36[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x18afa4={..._0x3b8cca,[_0x3b8704([0x6a,0x74,0x69])]:_0x149a36[_0x3b8704([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x149a36[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x18afa4[_0x3b8704([0x76,0x63])],_0x3da2a2(_0x18afa4)==_0xd9116a;}}}async function _0x59c6ca(){let _0x538908=!0x0;try{const _0xa8e716=_0x234798[_0x3b8704([0x73,0x70,0x6c,0x69,0x74])](_0x3b8704([0x2e])),[_0x594e1a,_0x3e2132,_0x170963]=_0xa8e716;return _0x3451e2(_0x594e1a),await _0xa570f6(_0x594e1a,_0x3e2132,_0x170963),_0x538908;}catch{return!0x1;}function _0x3451e2(_0x2e5cc0){const _0x53498f=_0x38668b(_0x2e5cc0);_0x53498f&&_0x53498f[_0x3b8704([0x61,0x6c,0x67])]==_0x3b8704([0x45,0x53,0x32,0x35,0x36])||(_0x538908=!0x1);}async function _0xa570f6(_0xc372b3,_0x3ca196,_0x17583b){const _0x2819c7=window[_0x3b8704([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3b8704([0x66,0x72,0x6f,0x6d])](_0x13b077(_0x17583b),_0x1b7102=>_0x1b7102[_0x3b8704([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x3b3080=new window[(_0x3b8704([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3b8704([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0xc372b3+_0x3b8704([0x2e])+_0x3ca196),_0x53d5c9=window[_0x3b8704([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3b8704([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x53d5c9)return;const _0x343ec8=await _0x53d5c9[_0x3b8704([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3b8704([0x6a,0x77,0x6b]),_0x45d371,{[_0x3b8704([0x6e,0x61,0x6d,0x65])]:_0x3b8704([0x45,0x43,0x44,0x53,0x41]),[_0x3b8704([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3b8704([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3b8704([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x53d5c9[_0x3b8704([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3b8704([0x6e,0x61,0x6d,0x65])]:_0x3b8704([0x45,0x43,0x44,0x53,0x41]),[_0x3b8704([0x68,0x61,0x73,0x68])]:{[_0x3b8704([0x6e,0x61,0x6d,0x65])]:_0x3b8704([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x343ec8,_0x2819c7,_0x3b3080)||(_0x538908=!0x1);}}function _0x38668b(_0x2fc55c){return _0x2fc55c[_0x3b8704([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3b8704([0x65,0x79]))?JSON[_0x3b8704([0x70,0x61,0x72,0x73,0x65])](_0x13b077(_0x2fc55c)):null;}function _0x13b077(_0x5c4291){return window[_0x3b8704([0x61,0x74,0x6f,0x62])](_0x5c4291[_0x3b8704([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3b8704([0x2b]))[_0x3b8704([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3b8704([0x2f])));}function _0x3da2a2(_0x24e26f){let _0x39ff80=0x1505;function _0x44430d(_0x404633){for(let _0x1c0897=0x0;_0x1c0897<_0x404633[_0x3b8704([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1c0897++){const _0x35b934=_0x404633[_0x3b8704([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1c0897);_0x39ff80=(_0x39ff80<<0x5)+_0x39ff80+_0x35b934,_0x39ff80&=_0x39ff80;}}function _0x38ac81(_0x27711d){Array[_0x3b8704([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x27711d)?_0x27711d[_0x3b8704([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x38ac81):_0x27711d&&typeof _0x27711d==_0x3b8704([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3b8704([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x27711d)[_0x3b8704([0x73,0x6f,0x72,0x74])]()[_0x3b8704([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x2e20c3,_0x328a03])=>{_0x44430d(_0x2e20c3),_0x38ac81(_0x328a03);}):_0x44430d(window[_0x3b8704([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x27711d));}return _0x38ac81(_0x24e26f),_0x39ff80>>>0x0;}function _0x443584(_0x5bb233){return _0x5bb233[_0x3b8704([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3b8704([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3b8704([0x30]));}function _0x15b397(_0x28891c){return _0x28891c[_0x3b8704([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3b8704([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3b8704([0x6a,0x6f,0x69,0x6e])]('');}function _0x69e6ac(){}function _0x3b8704(_0x5a94c4){return _0x5a94c4['map'](_0x20ba0d=>String['fromCharCode'](_0x20ba0d))['join']('');}_0x475238(await _0x5b59c7());}(this);}['showFakeVisualSelection'](){const _0x20a018=this['editor']['model'];_0x20a018['change'](_0x11bc55=>{const _0x52ae13=_0x20a018['document']['selection']['getRanges']();let _0x458239=0x0;for(const _0xb63c3a of _0x52ae13){const _0xcd3920=wt+':'+_0x458239;if(_0x20a018['markers']['has'](_0xcd3920))_0x11bc55['updateMarker'](_0xcd3920,{'range':_0xb63c3a});else{if(_0xb63c3a['start']['isAtEnd']){const _0x2a04a2=_0xb63c3a['start']['getLastMatchingPosition'](({item:_0x147693})=>!_0x20a018['schema']['isContent'](_0x147693),{'boundaries':_0xb63c3a});_0x11bc55['addMarker'](_0xcd3920,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x11bc55['createRange'](_0x2a04a2,_0xb63c3a['end'])});}else _0x11bc55['addMarker'](_0xcd3920,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xb63c3a});}_0x458239++;}});}['hideFakeVisualSelection'](){const _0x422bd0=this['editor']['model'],_0x56332f=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](wt));_0x56332f['length']&&_0x422bd0['change'](_0x2dd5f4=>{_0x56332f['forEach'](_0x3dcca8=>{_0x2dd5f4['removeMarker'](_0x3dcca8);});});}['insertContent'](_0x35c86d,_0x52a291){const _0x13ad0b=this['_getAISelection'](),_0x4edb08=_0x52a291||_0x13ad0b['getFirstRange']();this['editor']['model']['canEditAt'](_0x4edb08)&&this['editor']['model']['change'](_0x354c24=>{this['hideFakeVisualSelection'](),_0x52a291||this['_resetContentOfSelectedTableCells'](_0x354c24,_0x13ad0b),this['_pasteHTMLUsingClipboard']({'insertAt':_0x4edb08,'writer':_0x354c24,'html':_0x35c86d});});}['insertContentBelow'](_0x198a15){const {model:_0x539c02}=this['editor'],_0x313080=this['_getAISelection']();_0x539c02['change'](()=>{const _0x23527b=this['_prepareTableInsertBelowPosition'](_0x198a15,_0x313080)||this['_getDefaultInsertBelowPosition'](_0x313080);this['insertContent'](_0x198a15,_0x23527b);});}['_getAISelection'](){const _0x4cc1c7=this['editor']['model'],_0x523e83=Array['from'](_0x4cc1c7['markers']['getMarkersGroup'](wt))['map'](_0x28709d=>_0x28709d['getRange']());return _0x4cc1c7['createSelection'](_0x523e83);}['_pasteHTMLUsingClipboard']({writer:_0x47c6b6,html:_0x2a73f1,insertAt:_0x269ac8}){const {view:_0x3200c6}=this['editor']['editing'],_0x559794=this['editor']['plugins']['get'](nt),_0x113877=new Wn();_0x113877['setData']('text/html',_0x2a73f1);const _0x29fd2d=new ClipboardEvent('paste',{'clipboardData':_0x113877}),_0x515681=new ct(_0x3200c6,_0x29fd2d,{'dataTransfer':new ut(_0x113877)});_0x47c6b6['setSelection'](_0x269ac8);const _0x47dbce=(_0x1a064b,_0xe3938e)=>{_0xe3938e['resultRange']&&_0x47c6b6['setSelection'](_0xe3938e['resultRange']);};_0x559794['once']('contentInsertion',_0x47dbce,{'priority':'lowest'}),_0x3200c6['document']['fire']('paste',_0x515681),_0x559794['off']('contentInsertion',_0x47dbce);}['_getDefaultInsertBelowPosition'](_0x4cded7){const {model:_0x4a0295}=this['editor'],_0x11f081=Array['from'](_0x4cded7['getSelectedBlocks']());return _0x11f081['length']?_0x4a0295['createPositionAfter'](_0x11f081['pop']()):_0x4cded7['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3e4c46,_0x6bbfd1){const {model:_0x1dd2a9,plugins:_0x570afd}=this['editor'];if(_0x570afd['has']('TableUtils')){const _0xc0ed3b=_0x570afd['get']('TableUtils')['getSelectedTableCells'](_0x6bbfd1);if(_0xc0ed3b['length']){const _0x55c3f0=this['_getTableRowCountFromContent'](_0x3e4c46),_0x30b8c7=this['_createEmptyTableRows'](_0xc0ed3b,_0x55c3f0);return _0x1dd2a9['createPositionAt'](_0x30b8c7,0x0);}}return null;}['_getTableRowCountFromContent'](_0x4a7d53){const _0x200f32=this['editor']['plugins']['get']('TableUtils'),_0x5a4841=this['editor']['data']['parse'](_0x4a7d53),_0x52c103=Array['from'](_0x5a4841['getChildren']())['filter'](_0x574453=>_0x574453['is']('element','table'));let _0x46235c=0x0;return _0x52c103['forEach'](_0x2252b7=>{_0x46235c+=_0x200f32['getRows'](_0x2252b7);}),_0x46235c;}['_createEmptyTableRows'](_0x45e941,_0x562fad){const _0x4452f9=this['editor']['plugins']['get']('TableUtils'),_0x4a9ad5=_0x4452f9['getRowIndexes'](_0x45e941),_0x2c06c4=_0x4452f9['getColumnIndexes'](_0x45e941),_0x5d2d85=_0x4a9ad5['last']+0x1,_0x1fa60f=_0x2c06c4['first'],_0x415d92=_0x45e941[0x0]['findAncestor']('table');for(let _0x11097c=0x0;_0x11097c<_0x562fad;_0x11097c++)_0x4452f9['insertRows'](_0x415d92,{'at':_0x5d2d85});return _0x415d92['getChild'](_0x5d2d85)['getChild'](_0x1fa60f);}['_resetContentOfSelectedTableCells'](_0x462a8b,_0x619b57){const {plugins:_0x1e1fff}=this['editor'],{model:_0x8c7538}=_0x462a8b;if(!_0x1e1fff['has']('TableUtils'))return;_0x1e1fff['get']('TableUtils')['getSelectedTableCells'](_0x619b57)['length']&&_0x8c7538['deleteContent'](_0x619b57);}}class hi extends _0x5adfee{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x1500e8('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x44941c){super(_0x44941c),this['name']='AIRequestError';}}function Yn(_0x160341,_0x327b3e,_0x29725e){const t=_0x160341['t'];switch(_0x327b3e){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',_0x29725e);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x29725e);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'},_0x29725e);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 _0x327b3e;}}class di extends At{['_commandDefinitions'];constructor(_0x25710c,_0x438d11){super(_0x25710c),this['_commandDefinitions']=_0x438d11,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x25a7e7,_0x54b369,_0x587760)=>{this['isEnabled']&&(this['enabledCommandsIds']=js(this['_commandDefinitions'],_0x587760));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x15f0c,_0x5ad5b4,_0x3b8a89)=>{this['enabledCommandsIds']=_0x3b8a89?js(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x1122a4=this['editor']['model'];this['_hasContext']=function(_0x2559c1){const _0x252379=_0x2559c1['document']['selection'];return _0x252379['isCollapsed']?0x0!==[..._0x252379['getSelectedBlocks']()]['length']&&![..._0x252379['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x2559c1['hasContent'](_0x252379['getFirstRange']());}(_0x1122a4);const _0x15d04e=_0x1122a4['document']['selection'],_0x2e7c5f=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x2d8b02 of _0x15d04e['getRanges']())for(const _0x4f271d of _0x2d8b02['getItems']())if(_0x4f271d['is']('element')&&_0x2e7c5f['includes'](_0x4f271d['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x23efdb='',_0xda98bc='',_0xaa0777='custom'){this['editor']['plugins']['get'](ee)['showUI'](_0x23efdb,_0xda98bc,_0xaa0777);}}function js(_0x585c19,_0x562927){const _0xa026bf=new Set();for(const _0x56b146 of _0x585c19['values']())(_0x562927||!0x1===_0x56b146['requiresContent'])&&_0xa026bf['add'](_0x56b146['id']);return Array['from'](_0xa026bf);}const vs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class ui extends/* #__PURE__ -- @preserve */
24
- Vt(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x59c02a,_0x5ed35e,_0xc8c4b9){super(),this['editor']=_0x59c02a,this['textAdapter']=_0x5ed35e,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xc8c4b9,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x3885e6,_0xd20f48,_0x5012e7)=>{this['view']['value']=this['_sanitizeHTML'](_0x5012e7);}),this['listenTo'](this['view'],'submitPrompt',(_0x39edd6,_0x26303d)=>{const _0xaa800f=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x26303d,_0xaa800f,'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:_0x389166,query:_0x124b7c,htmlContent:_0x5a1082,label:_0x3a3d94,mainActionLabel:_0x417811}){this['view']['prompt']=_0x3a3d94,this['view']['mainAction']=_0x417811,this['initialContext']=_0x5a1082,_0x124b7c&&(this['view']['isRendered']?this['_handleQuery'](_0x124b7c,_0x5a1082,_0x389166,_0x3a3d94):this['view']['once']('render',()=>{this['_handleQuery'](_0x124b7c,_0x5a1082,_0x389166,_0x3a3d94);}));}['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'](_0x4c8ccf,_0x486e4b,_0x5a976c,_0x547364){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x486e4b,this['previousQuery']=_0x4c8ccf,this['previousLabel']=_0x547364||_0x4c8ccf,this['previousActionId']=_0x5a976c,new Promise(_0x5956a2=>{this['textAdapter']['makeRequest']({'query':_0x4c8ccf,'context':_0x486e4b,'onData':_0x38e6af=>{this['currentResponse']=_0x38e6af,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5a976c})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x454337=>{_0x454337 instanceof er?this['view']['handleError'](_0x454337['message']):this['view']['handleError'](),_0x5956a2();})['finally'](()=>{this['stopProcessing'](),_0x5956a2();});});}['_parseAndNormalizeContent'](_0x5307a6,_0x4a91cf=!0x1){const _0x17303c=vs['exec'](_0x5307a6);_0x5307a6=_0x17303c?_0x5307a6['substring'](_0x17303c[0x1]['length']):_0x5307a6['length']<0x64&&!_0x4a91cf?'':this['_stripMarkdownSyntax'](_0x5307a6);const _0x526f4d=this['_domParser']['parseFromString'](_0x5307a6,'text/html');if(_0x17303c){const _0x23c771=Array['from'](_0x526f4d['body']['childNodes']);_0x23c771['reverse']();for(const _0x2ef603 of _0x23c771){if(_0x2ef603['nodeType']==Node['ELEMENT_NODE'])break;_0x2ef603['remove']();}}const _0x4dd625=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x526f4d['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4dd625);const _0x4de2a6=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x362f96=this['editor']['data']['toModel'](_0x4dd625);return _0x4de2a6||_0x362f96['markers']['clear'](),this['editor']['data']['stringify'](_0x362f96);}['_normalizeResponseHeadings'](_0x17a402){const _0x52f311=new _0x3be1ca(this['editor']['editing']['view']['document']),_0x1a40f4=new _0xf012f3({'name':/^h[1-5]$/}),_0xa519fe=[];let _0x37fd78=!0x1;for(const _0x214a77 of _0x17a402)_0x214a77['is']('element')&&_0x1a40f4['match'](_0x214a77)&&(_0xa519fe['push'](_0x214a77),'h1'==_0x214a77['name']&&(_0x37fd78=!0x0));if(_0x37fd78){for(const _0x583c0e of _0xa519fe)_0x52f311['rename']('h'+(parseInt(_0x583c0e['name'][0x1])+0x1),_0x583c0e);}}['_isH1TagSupportEnabled'](){const {data:_0x298645,editing:_0x1d780a}=this['editor'],_0x500b20=_0x298645['htmlProcessor']['toView']('<h1></h1>'),_0x2b59f3=_0x298645['toView'](_0x298645['toModel'](_0x500b20));return!!_0x1d780a['view']['domConverter']['viewToDom'](_0x2b59f3)['querySelector']('h1');}['_sanitizeHTML'](_0x4e6dbc){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4e6dbc),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x31b5c4){const _0x2e7f82=_0x31b5c4['trim']();return _0x2e7f82['startsWith']('```html')?_0x2e7f82['endsWith']('```')?_0x2e7f82['substring'](0x7,_0x2e7f82['length']-0x3):_0x2e7f82['substring'](0x7):_0x31b5c4;}}const fi={'REPLACE':'replace','INSERT':'insert'};class Pr extends _0x1b7f91{constructor(_0x2ec1a5){super(_0x2ec1a5),this['set']('isVisible',!0x1),this['set']('mainAction',fi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x334966=>Yn(_0x2ec1a5,'AI_'+_0x334966['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Yn(_0x2ec1a5,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Yn(_0x2ec1a5,'Try\x20again')),this['stopButton']=this['_createButton'](Yn(_0x2ec1a5,'Stop'));const _0x54f1dc=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x54f1dc['if']('isVisible','ck-hidden',_0x3c7674=>!_0x3c7674)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x27ecab,_0x52e103){const _0x28c3cf=new _0x3fc85a(this['locale']);return _0x28c3cf['set']({'label':_0x27ecab,'class':_0x52e103||'','isVisible':!0x0,'withText':!0x0}),_0x28c3cf;}}class Ir extends _0x538d57{['contentFieldView'];['copyButtonView'];constructor(_0x844fbc,_0x44da1a=''){super(_0x844fbc),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2fbee4=this['bindTemplate'];this['contentFieldView']=new $n(_0x844fbc,_0x44da1a),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x2fbee4['if']('isVisible','ck-hidden',_0x15f8c3=>!_0x15f8c3)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x2fbee4['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 _0x14fcaf=!0x1;this['on']('change:value',(_0x1105bc,_0x11b0a3,_0x255d47)=>{const _0x521f55=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x255d47),this['isProcessing']&&_0x521f55&&!_0x14fcaf&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x90aa7e,_0x577416,_0x2e5ec0)=>{_0x14fcaf=!0x1,_0x2e5ec0?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x14fcaf=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x14fcaf=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x15cc5b=this['locale'],_0x545394=new _0x3fc85a(this['locale']),_0x4fdaaa='ck-ai-form__copy-button';return _0x545394['set']({'label':Yn(_0x15cc5b,'Copy'),'icon':_0x3d8ab5,'class':_0x4fdaaa,'tooltip':!0x0}),_0x545394['bind']('isVisible')['to'](this,'value',_0x168ef6=>!!_0x168ef6),_0x545394['bind']('isEnabled')['to'](this,'isProcessing',_0x2f8398=>!_0x2f8398),_0x545394['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x545394['icon']=_0x1dd94c,_0x545394['class']=_0x4fdaaa+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x545394['icon']=_0x3d8ab5,_0x545394['class']=_0x4fdaaa;},0x3e8);}),_0x545394;}['_copyHTMLToClipboard'](_0x1eb2df){const {window:_0x792cce,document:_0x43b379}=_0x3537fe;if(_0x792cce['ClipboardItem']){const {Blob:_0x46a191,ClipboardItem:_0x5220f5}=_0x792cce,_0x2fe219=[new _0x5220f5({'text/html':new _0x46a191([_0x1eb2df['innerHTML']],{'type':'text/html'}),'text/plain':new _0x46a191([_0x1eb2df['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2fe219);}else{const _0x30c0a3=_0x43b379['createElement']('div');_0x30c0a3['style']['position']='absolute',_0x30c0a3['style']['left']='-9999px',_0x30c0a3['innerHTML']='<span>[</span>'+_0x1eb2df['innerHTML']+'<span>]</span>',_0x43b379['body']['appendChild'](_0x30c0a3);const _0x59bfe1=_0x43b379['createRange']();_0x59bfe1['setStartAfter'](_0x30c0a3['firstElementChild']),_0x59bfe1['setEndBefore'](_0x30c0a3['lastElementChild']);const _0x2140a6=_0x792cce['getSelection']();_0x2140a6['removeAllRanges'](),_0x2140a6['addRange'](_0x59bfe1),_0x43b379['execCommand']('copy'),_0x30c0a3['remove']();}}}class $n extends _0x538d57{constructor(_0x3ebb56,_0x2dfdd3=''){super(_0x3ebb56),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2dfdd3,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2e8ab2){this['element']['innerHTML']=_0x2e8ab2;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x1c7b37=new _0x538d57(),_0x120bc1=this['locale'],_0x205dcf=new _0x29d2d8();return _0x205dcf['isVisible']=!0x0,_0x1c7b37['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x205dcf,{'text':Yn(_0x120bc1,'AI\x20is\x20writing...')}]}),_0x1c7b37['render'](),_0x1c7b37;}}class Vr extends _0x538d57{constructor(_0x4807e1,_0x32e36f=''){super(_0x4807e1);const _0x36e7e5=new _0x1a5580(),_0xf32393=this['bindTemplate'];this['set']('text',_0x32e36f),_0x36e7e5['content']=_0x5325ee,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x36e7e5,{'text':_0xf32393['to']('text')}]});}}class Hr extends _0x6213f1{['submitButtonView'];['showHistoryButtonView'];constructor(_0x9b1096,_0x526bf5){super(_0x9b1096,_0x526bf5),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',(_0xc4e136,_0x32841c)=>{_0xc4e136['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x32841c());});}['_createSubmitButton'](){const _0x153c43=new _0x3fc85a(this['locale']),_0x459ee7=this['locale'];return _0x153c43['set']({'icon':_0x13c99b,'label':Yn(_0x459ee7,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x153c43['on']('execute',()=>{this['submit']();}),_0x153c43['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x6b8a6f,_0xf0c287)=>!_0x6b8a6f&&_0xf0c287),_0x153c43;}['_createShowHistoryButton'](){const _0x27e761=new _0x3fc85a(this['locale']),_0x538b35=this['resultsView'],_0x56e314=this['locale'];_0x27e761['set']({'label':Yn(_0x56e314,'History'),'withText':!0x1,'icon':ot,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x27e761['bind']('isOn')['to'](_0x538b35,'isVisible'),_0x27e761['bind']('isEnabled')['to'](this,'isEnabled'),_0x27e761['on']('execute',()=>{_0x538b35['isVisible']=!_0x538b35['isVisible'],_0x538b35['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x13bfae=()=>{_0x3537fe['window']['requestAnimationFrame'](()=>{if(_0x48958f(this['element'])){const _0x380bbd=new _0x34633d(this['queryView']['fieldView']['element']),_0x7e6cda=_0x380bbd['width'],_0x5972bc='rtl'===_0x56e314['uiLanguageDirection']?'left':'right';_0x380bbd['excludeScrollbarsAndBorders'](),_0x27e761['element']['style'][_0x5972bc]=_0x7e6cda-_0x380bbd['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x13bfae),this['on']('render',_0x13bfae),_0x27e761;}['submit'](){const _0x397407=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x397407);}['focus'](_0x523af4){-0x1===_0x523af4?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Rr extends _0x1b0a54{['historyGroupView'];['clearHistoryButton'];constructor(_0x522dd7){super(_0x522dd7),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x1728c0(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Yn(_0x522dd7,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x42bb7e=0x0;for(const _0x1e5bea of this['items'])_0x42bb7e+=_0x1e5bea['items']['length'];return{'resultsCount':_0x42bb7e,'totalItemsCount':_0x42bb7e};}['_createClearHistoryButton'](){const _0x13f62d=this['locale'],_0x3008cf=new _0x3fc85a(this['locale']);return _0x3008cf['set']({'label':'('+Yn(_0x13f62d,'Clear')+')','withText':!0x0}),_0x3008cf['on']('execute',()=>this['fire']('clearHistory')),_0x3008cf;}}class Br extends _0x5749b5{constructor(_0x5edca8){super();const _0x2f667c=new _0x3ffbe5(),_0x176845=new _0x3fc85a(this['locale'],_0x2f667c);this['children']['add'](_0x176845),_0x176845['set']({'label':_0x5edca8['prompt'],'withText':!0x0}),_0x176845['on']('execute',()=>{this['fire']('execute',{'value':_0x4e5df5(_0x5edca8['prompt'])});});}}const Sr='CKEditor/AIFormView/PromptHistory';class qr extends _0x53af97{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0xd3228a,_0x3970c9)=>{const _0x1e0a0e=Fr(_0x3970c9['prompt']);for(const _0x15714a of this)if(_0x15714a!=_0x3970c9&&Fr(_0x15714a['prompt'])===_0x1e0a0e){this['remove'](_0x15714a);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x5a2dff=sessionStorage['getItem'](Sr)||'[]';this['addMany'](JSON['parse'](_0x5a2dff));}['_saveToSessionStorage'](){sessionStorage['setItem'](Sr,JSON['stringify'](this['map'](_0x1e721f=>_0x1e721f)));}}function Fr(_0x519a30){return _0x519a30['toLowerCase']()['trim']();}class pi extends _0x538d57{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x294e6d,_0x1056ec,_0x238603=''){super(_0x294e6d),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',fi['REPLACE']),this['_promptHistory']=new qr(),this['errorView']=new Vr(_0x294e6d),this['contentArea']=new Ir(_0x294e6d,_0x238603),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 _0x356454(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x19c87e({'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 _0x5b5896=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x1056ec],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x5b5896['if']('isError','ck-hidden',_0x4a8bc9=>!_0x4a8bc9)]},'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'](_0x38073e=0x1){-0x1===_0x38073e?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 _0x5ec883=this['locale'],_0x4ecc=new Hr(_0x5ec883,{'queryView':{'label':Yn(_0x5ec883,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x550e60,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Yn(_0x5ec883,'Empty\x20history'),'secondary':Yn(_0x5ec883,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4ecc['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x134213,_0x4bd04f)=>_0x134213&&!_0x4bd04f),this['listenTo'](_0x4ecc,'submit',(_0x4c3d32,_0x17edd5)=>{this['prompt']=_0x17edd5;const _0x3cf170=Wt(_0x17edd5);this['fire']('submitPrompt',_0x3cf170),_0x17edd5['trim']()&&this['_promptHistory']['add']({'prompt':_0x3cf170},0x0);},{'priority':'high'}),_0x4ecc;}['_createHistoryView'](){const _0x523a6a=new Rr(this['locale']);return _0x523a6a['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Br),_0x523a6a['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x523a6a;}['_createToolbar'](){const _0x2a86f2=new Pr(this['locale']);return _0x2a86f2['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x33298e,_0x15080c,_0x41d7fa)=>_0x33298e&&!_0x15080c&&!!_0x41d7fa),_0x2a86f2['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x2a86f2['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x39007c,_0x139cb7,_0x205fb4)=>_0x39007c&&!_0x139cb7&&!!_0x205fb4),_0x2a86f2['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x2a86f2['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x414e27,_0xafc6ab)=>_0x414e27&&!_0xafc6ab),_0x2a86f2['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x2a86f2['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x2a86f2['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x2a86f2;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2cb558=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Yn(_0x2cb558,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0xe4b011){const _0x440174=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0xe4b011||Yn(_0x440174,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const lt=globalThis['DataTransfer'];class ee extends _0x5adfee{['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[_0x524068,te,hi,_0xc82d75];}constructor(_0x1a74e7){super(_0x1a74e7),_0x1a74e7['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1a74e7['config']['define']('ai.assistant.contentAreaCssClass',''),_0x1a74e7['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1a74e7['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x56f7ee}=this;this['_aiAdapter']=_0x56f7ee['plugins']['get'](hi),this['_dialog']=_0x56f7ee['plugins']['get'](_0xc82d75),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1b34e0=new di(_0x56f7ee,Array['from'](this['_commandDefinitions']['values']()));_0x56f7ee['commands']['add']('showAIAssistant',_0x1b34e0),_0x56f7ee['ui']['componentFactory']['add']('aiCommands',_0x1dee28=>{const _0x5550ef=_0x238494(_0x1dee28);return _0x5550ef['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x5550ef['buttonView']['set']({'label':Yn(_0x1dee28,'AI\x20Commands'),'icon':_0x342837,'tooltip':!0x0}),_0x5550ef['on']('execute',_0x5dee33=>this['_onExecute'](_0x5dee33['source']['id'])),_0x30ebf6(_0x5550ef,_0x56f7ee['ui']['view']['body'],function(_0x14b6ad){const _0x5d103d=ne(_0x14b6ad['config']['get']('ai.assistant.commands'),_0x14b6ad['locale']),_0x469609=gi(_0x14b6ad,_0x5d103d)['filter'](_0x5634ca=>_0x5634ca['commands']['length']);if(0x1===_0x469609['length'])return gi(_0x14b6ad,_0x469609[0x0]['commands'])['map'](_0x313344=>({'id':_0x313344['id'],'label':_0x313344['label']}));return _0x469609['map'](_0x2056d4=>{const {groupId:_0x1af14b,groupLabel:_0x1fee53,commands:_0x5469d4}=_0x2056d4,_0x3bbb82=gi(_0x14b6ad,_0x5469d4)['map'](_0x14c89b=>({'id':_0x14c89b['id'],'label':_0x14c89b['label']}));return{'id':_0x1af14b,'menu':_0x1fee53||_0x1af14b,'children':_0x3bbb82};});}(_0x56f7ee),{'ariaLabel':Yn(_0x1dee28,'AI\x20Commands')}),_0x5550ef['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1b34e0['on']('change:enabledCommandsIds',_0x4a1518),_0x5550ef['menuView']['once']('render',_0x4a1518),_0x5550ef;function _0x4a1518(){_0x5550ef['isEnabled']=_0x1b34e0['enabledCommandsIds']['length']>0x0;for(const _0x12f66d of _0x5550ef['menuView']['buttons'])_0x12f66d['isEnabled']=_0x1b34e0['enabledCommandsIds']['includes'](_0x12f66d['id']);}}),_0x56f7ee['ui']['componentFactory']['add']('menuBar:aiCommands',_0x289dc0=>{const _0x4c3c26=new _0x3c114(_0x289dc0);_0x4c3c26['buttonView']['set']({'label':Yn(_0x289dc0,'AI\x20Commands'),'icon':_0x342837}),_0x4c3c26['bind']('isEnabled')['to'](_0x1b34e0,'enabledCommandsIds',_0x2b4df8=>_0x2b4df8['length']>0x0);const _0x134ae2=ne(_0x56f7ee['config']['get']('ai.assistant.commands'),_0x289dc0);return this['_populateMenuBarMenu'](_0x1b34e0,_0x4c3c26,_0x134ae2,_0x2e8dc1=>this['_onExecute'](_0x2e8dc1)),_0x4c3c26;}),_0x56f7ee['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x373a18=this['_createAIAssistantUIButton'](_0x3fc85a);return _0x373a18['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x373a18;}),_0x56f7ee['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x39a309=this['_createAIAssistantUIButton'](_0x58fafd);return _0x39a309['set']({'role':'menuitemcheckbox'}),_0x39a309;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x131dd9=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xf88d1c;for(const _0x57691b in _0x131dd9){const _0x267a2e=_0x57691b,_0x1ba112=_0x131dd9[_0x267a2e];if('aiLicenseKeyValid'==_0x1ba112||'aiLicenseKeyInvalid'==_0x1ba112||'aiLicenseKeyExpired'==_0x1ba112||'aiLicenseKeyDomainLimit'==_0x1ba112||'aiLicenseKeyNotAllowed'==_0x1ba112||'aiLicenseKeyEvaluationLimit'==_0x1ba112||'aiLicenseKeyUsageLimit'==_0x1ba112){delete _0x131dd9[_0x267a2e],_0xf88d1c=_0x1ba112,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0xf88d1c&&_0x131dd9['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0xf88d1c&&_0x131dd9['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0xf88d1c&&_0x131dd9['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0xf88d1c&&_0x131dd9['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0xf88d1c&&_0x131dd9['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0xf88d1c&&_0x131dd9['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x446975='',_0xcadf5d='',_0x193fd8='custom'){const _0x3e30c=this['editor'],_0x446fa8=_0x3e30c['editing']['view'],_0x2f41da=_0x3e30c['plugins']['get'](te),_0x4e02e2=_0x3e30c['plugins']['get'](_0x524068);_0x2f41da['showFakeVisualSelection']();const _0x28a49a=new lt(),_0x5b7a8c=new ClipboardEvent('copy',{'clipboardData':_0x28a49a}),_0xf5e56=new ut(_0x28a49a),_0x490812=new ct(_0x446fa8,_0x5b7a8c,{'dataTransfer':_0xf5e56});_0x4e02e2['_forceMarkersCopy']('comment',()=>{_0x446fa8['document']['fire']('copy',_0x490812);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new ui(_0x3e30c,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x25d948=_0xf5e56['getData']('text/html');const _0x1b152c=_0x3e30c['model']['document']['selection'],_0x1a65ac=Array['from'](_0x1b152c['getRanges']());0x1===_0x1a65ac['length']&&_0x1a65ac[0x0]['isFlat']&&!_0x1b152c['getSelectedElement']()&&''!==_0x25d948['replace'](/&nbsp;/g,'')['trim']()&&(_0x25d948='<p>'+_0x25d948+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x193fd8,'query':_0x446975,'htmlContent':_0x25d948,'label':_0xcadf5d,'mainActionLabel':fi[_0x3e30c['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ti,'title':Yn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x5e4c8a['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x2f41da['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x3ad671=new Map(),_0x1c342f=ne(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0xfc6ed1 of _0x1c342f)for(const _0x4ca1d9 of _0xfc6ed1['commands'])_0x3ad671['set'](_0x4ca1d9['id'],{..._0x4ca1d9,'groupId':_0xfc6ed1['groupId'],'groupLabel':_0xfc6ed1['groupLabel']||_0xfc6ed1['groupId']});return _0x3ad671;}['_createAIAssistantUIButton'](_0x242bee){const _0x5cb26f=this['editor'],_0x5bbb71=_0x5cb26f['commands']['get']('showAIAssistant'),_0x1a60b5=new _0x242bee(_0x5cb26f['locale']);return _0x1a60b5['set']({'label':Yn(_0x5cb26f['locale'],'AI\x20Assistant'),'icon':ti,'isToggleable':!0x0}),_0x1a60b5['bind']('isEnabled')['to'](_0x5bbb71),_0x1a60b5['bind']('isOn')['to'](this['_dialog'],'id',_0x2ef3c9=>'aiAssistant'===_0x2ef3c9),this['listenTo'](_0x1a60b5,'execute',()=>{_0x1a60b5['isOn']?this['hideUI']():_0x5bbb71['execute']();}),_0x1a60b5;}['_initView'](){const _0x1b39fc=this['editor']['plugins']['get'](te);this['_formView']=new pi(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',()=>{_0x1b39fc['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1b39fc['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2df792,ui:{ariaLiveAnnouncer:_0x2885a6}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5837e9,_0x2826c8,_0x48f720)=>{const _0x319692=this['_aiAssistantController']['currentContext'];_0x48f720?_0x2885a6['announce'](Yn(_0x2df792,'AI\x20is\x20writing')):_0x319692&&_0x2885a6['announce'](Yn(_0x2df792,'Generated\x20content:\x20%0',_0x319692),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3a5b6b,_0xee3309,_0x1472eb)=>{if(_0x1472eb){const _0x2f35a5=this['_formView']['errorView']['text'];_0x2885a6['announce'](Yn(_0x2df792,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2f35a5));}});}['_onExecute'](_0x148919){const _0x7af901=this['_commandDefinitions']['get'](_0x148919),_0x115275=this['editor'],_0x58cb19=_0x115275['model']['document']['selection'],_0xf0d42=_0x115275['commands']['get']('showAIAssistant'),_0x293a2d=_0x115275['plugins']['get'](te),_0x57490e=''+(_0x7af901['groupId']!==li?_0x7af901['groupLabel']+':\x20':'')+_0x7af901['label'];if(!0x1!==_0x7af901['requiresContent']&&_0x58cb19['isCollapsed']){const _0x384083=_0x33a8c(_0x58cb19['getSelectedBlocks']())||_0x115275['model']['schema']['getLimitElement'](_0x58cb19);_0x115275['model']['change'](_0x300a9f=>{_0x300a9f['setSelection'](_0x384083,'in');});}_0x293a2d['showFakeVisualSelection'](),_0xf0d42['execute'](_0x7af901['prompt'],_0x57490e,'command:'+_0x148919);}['_populateMenuBarMenu'](_0x46f0cb,_0x2ef6ed,_0x3cd6b2,_0x1fc2da){const _0x85268a=this['editor'],_0xe2eb4e=_0x85268a['locale'],_0x243506=new _0x3301ef(_0xe2eb4e),_0x4f86ec=gi(_0x85268a,_0x3cd6b2)['filter'](_0x244dde=>_0x244dde['commands']['length']);0x1===_0x4f86ec['length']?this['_getMenuBarGroupButtons']({'command':_0x46f0cb,'commands':_0x4f86ec[0x0]['commands'],'parentMenuView':_0x2ef6ed,'onExecute':_0x1fc2da})['forEach'](_0x517aee=>_0x243506['items']['add'](_0x517aee)):_0x4f86ec['forEach'](({groupId:_0x32cb33,groupLabel:_0x2db3f0,commands:_0x53504a})=>{const _0x5f10ed=new _0x4dbed9(_0xe2eb4e,_0x2ef6ed),_0x18a198=new _0x3c114(_0xe2eb4e),_0x58e232=new _0x3301ef(_0xe2eb4e),_0x1565f8=this['_getMenuBarGroupButtons']({'command':_0x46f0cb,'commands':_0x53504a,'parentMenuView':_0x18a198,'onExecute':_0x1fc2da});_0x18a198['buttonView']['set']({'label':_0x2db3f0||_0x32cb33}),_0x18a198['delegate']('execute')['to'](_0x2ef6ed),_0x58e232['items']['addMany'](_0x1565f8),_0x18a198['panelView']['children']['add'](_0x58e232),_0x5f10ed['children']['add'](_0x18a198),_0x243506['items']['add'](_0x5f10ed);}),_0x2ef6ed['panelView']['children']['add'](_0x243506);}['_getMenuBarGroupButtons']({command:_0x46a743,commands:_0x16acd2,parentMenuView:_0x3f9e85,onExecute:_0x5a165f}){const _0x167725=this['editor'],_0x57634a=_0x167725['locale'];return gi(_0x167725,_0x16acd2)['map'](_0x3a8718=>{const _0x160df9=new _0x4dbed9(_0x57634a,_0x3f9e85),_0x10e1b0=new _0x58fafd(_0x57634a);return _0x10e1b0['set']({'label':_0x3a8718['label']}),_0x10e1b0['delegate']('execute')['to'](_0x3f9e85),_0x10e1b0['on']('execute',()=>_0x5a165f(_0x3a8718['id'])),_0x10e1b0['bind']('isEnabled')['to'](_0x46a743,'enabledCommandsIds',_0x5da7a8=>_0x5da7a8['includes'](_0x3a8718['id'])),_0x160df9['children']['add'](_0x10e1b0),_0x160df9;});}}function wi(_0x488146,_0x50f588){return void 0x0!==_0x488146['order']&&void 0x0===_0x50f588['order']?0x1:void 0x0===_0x488146['order']&&void 0x0!==_0x50f588['order']?-0x1:void 0x0!==_0x488146['order']&&void 0x0!==_0x50f588['order']?_0x488146['order']-_0x50f588['order']:0x0;}function gi(_0x417377,_0x3733b0){_0x3733b0['sort'](wi);const _0x83b0dc={},_0x451485=[];for(const _0x7371f1 of _0x3733b0)if(void 0x0!==_0x7371f1['order']){if(_0x7371f1['order']in _0x83b0dc)throw new _0x1500e8('ai-commands-config-order-collision',_0x417377,{'conflictingDefinitions':[_0x7371f1,_0x83b0dc[_0x7371f1['order']]]});_0x83b0dc[_0x7371f1['order']]=_0x7371f1,_0x451485['splice'](_0x7371f1['order'],0x0,_0x7371f1);}else _0x451485['push'](_0x7371f1);return _0x451485;}class qn extends _0x5adfee{static get['requires'](){return[ee,te];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x80e28d){super(_0x80e28d);const _0x1e21c8=_0x80e28d['config'],_0x9b4cd0=_0x80e28d['locale'];_0x1e21c8['define']('ai.assistant.preserveComments',!0x0),_0x1e21c8['define']('ai.assistant.commands',Qn(_0x9b4cd0)),_0x1e21c8['define']('ai.assistant.extraCommandGroups',[]),_0x1e21c8['define']('ai.assistant.removeCommands',[]);let _0x427362=ne(_0x1e21c8['get']('ai.assistant.commands'),_0x9b4cd0);const _0x48cdf3=_0x1e21c8['get']('ai.assistant.extraCommandGroups'),_0x304e35=_0x1e21c8['get']('ai.assistant.removeCommands');_0x48cdf3['forEach'](_0x329405=>{const _0x194fef=_0x427362['find'](_0x366b23=>_0x366b23['groupId']===_0x329405['groupId']);_0x194fef?_0x194fef['commands']=_0x194fef['commands']['concat'](_0x329405['commands']):_0x427362['push'](_0x329405);}),_0x427362=_0x427362['filter'](_0x1a8e57=>!_0x304e35['includes'](_0x1a8e57['groupId'])),_0x427362['forEach'](_0x25e860=>{_0x25e860['commands']=_0x25e860['commands']['filter'](_0x3824c3=>!_0x304e35['includes'](_0x3824c3['id']));}),_0x1e21c8['set']('ai.assistant.commands',_0x427362);}}function Qn(_0x439d2e){return[{'groupId':'editOrReview','groupLabel':Yn(_0x439d2e,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Yn(_0x439d2e,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Yn(_0x439d2e,'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(_0x439d2e,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Yn(_0x439d2e,'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(_0x439d2e,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Yn(_0x439d2e,'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(_0x439d2e,'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(_0x439d2e,'Change\x20tone'),'commands':[{'id':'professional','label':Yn(_0x439d2e,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Yn(_0x439d2e,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Yn(_0x439d2e,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Yn(_0x439d2e,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Yn(_0x439d2e,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Yn(_0x439d2e,'Change\x20style'),'commands':[{'id':'business','label':Yn(_0x439d2e,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Yn(_0x439d2e,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Yn(_0x439d2e,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Yn(_0x439d2e,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Yn(_0x439d2e,'Translate'),'commands':[{'id':'translateEnglish','label':Yn(_0x439d2e,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Yn(_0x439d2e,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Yn(_0x439d2e,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Yn(_0x439d2e,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Yn(_0x439d2e,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Yn(_0x439d2e,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Yn(_0x439d2e,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Yn(_0x439d2e,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class qe extends _0x5adfee{['abortController'];static get['requires'](){return[hi];}constructor(_0x4bb824){super(_0x4bb824),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](hi)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x4475ab){return this['sendRequest'](_0x4475ab)['catch'](_0x550884=>{if(_0x550884 instanceof er)return Promise['reject'](_0x550884);if('AbortError'==_0x550884['name'])return Promise['resolve']();throw console['error'](_0x550884),new _0x1500e8('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x115162,_0x1f3724){const _0x257ab0=this['editor']['locale'],_0x4eafd6={'Content-Type':'application/json'};if('object'==typeof _0x115162)Object['assign'](_0x4eafd6,_0x115162);else{if(_0x115162)try{const _0x1a9c35=await _0x115162(_0x1f3724);Object['assign'](_0x4eafd6,_0x1a9c35);}catch{return Promise['reject'](new er(Yn(_0x257ab0,'AI_ERROR_GET_HEADERS')));}}return _0x4eafd6;}async['_prepareRequestParameters'](_0xd3dcd1,_0x102c00){const _0x248d56=this['editor']['locale'];if('object'==typeof _0xd3dcd1)return _0xd3dcd1;try{return await _0xd3dcd1(_0x102c00);}catch{return Promise['reject'](new er(Yn(_0x248d56,'AI_ERROR_GET_PARAMETERS')));}}}class Xn extends qe{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x1c77c0){super(_0x1c77c0),_0x1c77c0['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x1c77c0['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x1c77c0['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x1c77c0['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x1c77c0['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x1c77c0['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x3850fb,context:_0x20cdab,onData:_0x26a61a,actionId:_0x578b8d}){const _0xafe56b=this['editor']['locale'],_0x2e1703=await this['prepareMessages'](_0x3850fb,_0x20cdab,_0x578b8d),_0x2d667d=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x578b8d),_0x3df2d1=await this['_prepareRequestParameters'](this['_requestParameters'],_0x578b8d),_0x37319d={'messages':_0x2e1703,..._0x3df2d1},_0x342486={'method':'POST','headers':_0x2d667d,'body':JSON['stringify'](_0x37319d),'signal':this['abortController']['signal']},_0x10a29b=await fetch(this['_apiUrl'],_0x342486);if(_0x10a29b['ok'])return _0x3df2d1['stream']?await this['_readStreamableResponse'](_0x10a29b,_0x26a61a):await this['_readStaticResponse'](_0x10a29b,_0x26a61a),Promise['resolve']();{const _0x3587a5=await _0x10a29b['text']();return _0x3587a5['includes']('context_length_exceeded')?Promise['reject'](new er(Yn(_0xafe56b,'AI_ERROR_CONTEXT_LENGTH'))):_0x3587a5['includes']('Moderation')?Promise['reject'](new er(Yn(_0xafe56b,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x3587a5));}}async['prepareMessages'](_0x335ac8,_0x327778,_0x304408){let _0x24dc6b,_0x518459;return _0x327778?(_0x24dc6b='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.',_0x518459='Instruction:\x0a'+_0x335ac8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x327778):(_0x24dc6b='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.',_0x518459=_0x335ac8),[{'role':'system','content':_0x24dc6b},{'role':'user','content':_0x518459}];}async['_readStreamableResponse'](_0x1fe465,_0x21bf76){const _0xcb105c=_0x1fe465['body']['getReader'](),_0x29d8ac=new TextDecoder();let _0x2101c8='',_0x2299c7='',_0x429e66='',_0x3211c7=!0x1;for(;!_0x3211c7;){const {done:_0x399aba,value:_0x5e71c5}=await _0xcb105c['read'](),_0x873162=_0x2101c8+_0x29d8ac['decode'](_0x5e71c5);let _0x2415c2='';_0x3211c7=_0x399aba;try{_0x2415c2=this['_cleanUpData'](_0x873162),_0x2101c8='';}catch{_0x2101c8=_0x873162;continue;}_0x2299c7+=_0x2415c2,!_0x3211c7&&this['_isBufferIncomplete'](_0x2299c7)||_0x2299c7&&(_0x429e66+=_0x2299c7,_0x2299c7='',_0x21bf76(_0x429e66));}return Promise['resolve']();}async['_readStaticResponse'](_0xe8e60b,_0x38dcbc){return _0x38dcbc((await _0xe8e60b['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x2a8797){const _0x46f80a=_0x2a8797['split']('<')['length']!==_0x2a8797['split']('>')['length'],_0xc3f3f7=_0x2a8797['length']<0x1e;return _0x46f80a&&_0xc3f3f7;}['_cleanUpData'](_0x10b0a1){return _0x10b0a1['split'](/\n(?![^{]*\})/g)['map'](_0x3ad556=>_0x3ad556['replace']('data:\x20',''))['filter'](_0x4ed128=>_0x4ed128&&_0x4ed128['length']>0x0&&'[DONE]'!==_0x4ed128)['map'](_0x48c08c=>{const {choices:_0x1303af}=JSON['parse'](_0x48c08c);if(_0x1303af[0x0]?.['delta']?.['content'])return _0x1303af[0x0]['delta']['content'];})['filter'](_0x539e9d=>_0x539e9d)['join']('');}}class zn extends qe{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x1f81cc){super(_0x1f81cc),_0x1f81cc['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x1f81cc['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']=_0x1f81cc['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x1f81cc['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x1f81cc['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x1f81cc['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x240e32,context:_0x12fa85,onData:_0x4f2951,actionId:_0x84348e}){const {model:_0x3cb261,stream:_0x1f792c,..._0x1bc8c2}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x84348e),_0x199485={'prompt':await this['preparePrompt'](_0x240e32,_0x12fa85,_0x3cb261,_0x84348e),..._0x1bc8c2};this['_apiUrl']?await this['_processProxyRequest'](_0x199485,_0x3cb261,_0x1f792c,_0x4f2951,_0x84348e):await this['_processAWSRequest'](_0x199485,_0x3cb261,_0x1f792c,_0x4f2951);}async['preparePrompt'](_0x8c50c7,_0x5fba36,_0x33588a,_0x32ad0b){let _0x1ea9a9,_0x508894;return _0x5fba36?(_0x1ea9a9='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.',_0x508894='Instruction:\x0a'+_0x8c50c7+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5fba36):(_0x1ea9a9='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.',_0x508894=_0x8c50c7),'meta.llama'==this['getModelFamily'](_0x33588a)?'<<SYS>>\x0a'+_0x1ea9a9+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x508894+'\x0a[/INST]':'Human:\x0a'+_0x1ea9a9+'\x0a'+_0x508894+'\x0a\x0aAssistant:';}['getModelFamily'](_0x60c059){if(/^anthropic\.claude/['test'](_0x60c059))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x60c059))return'ai21.j2';if(/^cohere\.command/['test'](_0x60c059))return'cohere.command';if(/^meta\.llama/['test'](_0x60c059))return'meta.llama';throw new er(Yn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x60c059));}async['_processProxyRequest'](_0x186d2c,_0x15fa67,_0x2ba023,_0x890548,_0x310283){const _0xc79158={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x310283),'body':JSON['stringify']({..._0x186d2c,'model':_0x15fa67,'stream':_0x2ba023}),'signal':this['abortController']['signal']},_0x426e2a=await fetch(this['_apiUrl'],_0xc79158);_0x2ba023?await this['_readStreamableResponse'](_0x426e2a,_0x15fa67,_0x890548):await this['_readStaticResponse'](_0x426e2a,_0x15fa67,_0x890548);}async['_processAWSRequest'](_0x4bfd2b,_0x2c1cfa,_0x244b15,_0x1452a5){const _0x38cb2b=new _0x978f5f(this['_bedrockClientConfig']),_0x4df590={'body':JSON['stringify'](_0x4bfd2b),'contentType':'application/json','accept':'application/json','modelId':_0x2c1cfa};let _0x5ebce;if(_0x244b15){const _0x44dd1b=new _0x438d78(_0x4df590);_0x5ebce=await _0x38cb2b['send'](_0x44dd1b,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x5ebce,_0x2c1cfa,_0x1452a5);}else{const _0x7007c5=new _0x31c8cb(_0x4df590);_0x5ebce=await _0x38cb2b['send'](_0x7007c5,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x5ebce,_0x2c1cfa,_0x1452a5);}}async['_readAsyncIterableResponse'](_0x4bdfc4,_0x5754ce,_0x47bc0d){const _0xc96036=_0x4bdfc4['body'],_0x53f469=new TextDecoder('utf-8');let _0x40b841='';for await(const _0x534825 of _0xc96036)if(_0x534825['chunk']){const _0x3a6349=_0x53f469['decode'](_0x534825['chunk']['bytes']),_0x4c7912=JSON['parse'](_0x3a6349);_0x40b841+=this['_getGeneratedText'](_0x4c7912,_0x5754ce),_0x47bc0d(_0x40b841);}return Promise['resolve']();}async['_readStreamableResponse'](_0x46a418,_0xe8e1d2,_0x538e97){const _0x4b560a=_0x46a418['body'],_0x33b1c5=new TextDecoder('utf-8'),_0x37bb97=_0x4b560a['getReader']();let _0x2aea46='',_0x157190='',_0x3c9340=!0x1;for(;!_0x3c9340;){const {done:_0x2025b6,value:_0x519298}=await _0x37bb97['read']();if(_0x3c9340=_0x2025b6,_0x3c9340)break;const _0x442a06=(_0x2aea46+_0x33b1c5['decode'](_0x519298))['split']('\x0a')['map'](_0x39b3a9=>{try{return _0x2aea46='',JSON['parse'](_0x39b3a9);}catch{return _0x2aea46=_0x39b3a9,null;}})['filter'](_0x15f394=>null!==_0x15f394);_0x442a06['length']&&(_0x157190+=_0x442a06['map'](_0x4f5b9f=>this['_getGeneratedText'](_0x4f5b9f,_0xe8e1d2))['join'](''),_0x538e97(_0x157190));}return Promise['resolve']();}async['_readStaticResponse'](_0x2d7178,_0x12c9f7,_0x27e029){let _0x343871;return _0x343871=_0x2d7178 instanceof Response?await _0x2d7178['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x2d7178['body'])),(_0x27e029(this['_getGeneratedText'](_0x343871,_0x12c9f7)),Promise['resolve']());}['_getGeneratedText'](_0x2074db,_0x272168){switch(this['getModelFamily'](_0x272168)){case'anthropic.claude':return _0x2074db['completion'];case'ai21.j2':return _0x2074db['completions'][0x0]['data']['text'];case'cohere.command':return _0x2074db['generations'][0x0]['text'];case'meta.llama':return _0x2074db['generation'];}}}class ia extends _0x3fc85a{constructor(_0x382cdd,_0x27d90e={}){super(_0x382cdd),this['isToggleable']=!0x0,this['set']('side',_0x27d90e['side']||'top');const _0x556fe0=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x503037(_0x27d90e['class']||[]),_0x556fe0['to']('side',_0x319219=>'ck-tab-button_'+_0x319219),_0x556fe0['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x538d57{['children'];constructor(_0x1a8847,_0x383984={}){super(_0x1a8847);const _0x2a7a27=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x503037(_0x383984['class']||[]),_0x2a7a27['to']('class'),_0x2a7a27['if']('isVisible','ck-hidden',_0xaf1b3a=>!_0xaf1b3a)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x538d57{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x51dbab,_0x14d4ca={}){super(_0x51dbab),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x14d4ca['side']||'top'),this['set']('isMaximized',!0x1);const _0xf5c86e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x503037(_0x14d4ca['class']||[]),_0xf5c86e['to']('side',_0x214d44=>'ck-tabs_'+_0x214d44),_0xf5c86e['to']('class'),_0xf5c86e['to']('isMaximized',_0x26d6d7=>_0x26d6d7?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0xf5c86e['to']('side',_0x22368e=>'ck-tabs__buttons-container_'+_0x22368e)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0xf5c86e['to']('side',_0x2a1294=>'ck-tabs__panels-container_'+_0x2a1294)]},'children':this['panelViews']},..._0x503037(_0x14d4ca['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x344ff8){const _0x2ba2fd=this['_tabs']['get'](_0x344ff8);return _0x2ba2fd||null;}['addTab'](_0x1e3bb9){const _0x2302c7=this['_setupButton']({'id':_0x1e3bb9['id'],'label':_0x1e3bb9['buttonLabel'],'icon':_0x1e3bb9['buttonIcon'],'order':_0x1e3bb9['order']}),_0x2adc64=new ea(this['locale']);return _0x2adc64['render'](),_0x1e3bb9['content']&&_0x2adc64['children']['add'](_0x1e3bb9['content']),this['panelViews']['add'](_0x2adc64),this['_tabs']['set'](_0x1e3bb9['id'],{'button':_0x2302c7,'panel':_0x2adc64,'order':void 0x0!==_0x1e3bb9['order']?_0x1e3bb9['order']:null}),this['fire']('addTab:'+_0x1e3bb9['id'],{'id':_0x1e3bb9['id'],'button':_0x2302c7,'panel':_0x2adc64}),null===this['activeTab']?this['activateTab'](_0x1e3bb9['id']):this['_hidePanel'](_0x1e3bb9['id']),{'button':_0x2302c7,'panel':_0x2adc64};}['activateTab'](_0x5540a2){if(null!==_0x5540a2&&!this['getTab'](_0x5540a2))throw new _0x1500e8('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x5540a2});this['activeTab']!==_0x5540a2&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x5540a2,_0x5540a2&&this['_showPanel'](_0x5540a2),this['fire']('activateTab:'+_0x5540a2,_0x5540a2));}['showTab'](_0x3cd810){if(!this['getTab'](_0x3cd810))throw new _0x1500e8('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3cd810});this['_showPanel'](_0x3cd810),this['_showButton'](_0x3cd810),this['fire']('show:'+_0x3cd810,_0x3cd810);}['hideTab'](_0x4f5365){if(!this['getTab'](_0x4f5365))throw new _0x1500e8('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4f5365});const _0x24d28b=this['activeTab'];this['_hidePanel'](_0x4f5365),this['_hideButton'](_0x4f5365);const _0x369f9=this['getTabIds']();_0x24d28b===_0x4f5365&&_0x369f9['length']>0x1&&this['activateTab'](_0x369f9['find'](_0x50fe25=>_0x50fe25!==_0x4f5365)),this['fire']('hide:'+_0x4f5365,_0x4f5365);}['_getPanel'](_0x1bec31){const _0x30fa09=this['_tabs']['get'](_0x1bec31);return _0x30fa09?_0x30fa09['panel']:null;}['_showPanel'](_0x38a9a5){null!==this['activeTab']&&this['activeTab']!==_0x38a9a5||this['_getPanel'](_0x38a9a5)['show']();}['_hidePanel'](_0x4ef127){const _0x17491e=this['_getPanel'](_0x4ef127);_0x17491e['isVisible']&&(this['activeTab']===_0x4ef127&&(this['activeTab']=null),_0x17491e['hide']());}['_getButton'](_0x3abbeb){const _0x16bf18=this['_tabs']['get'](_0x3abbeb);return _0x16bf18?_0x16bf18['button']:null;}['_showButton'](_0x5cf3fa){this['_getButton'](_0x5cf3fa)['show']();}['_hideButton'](_0x34e7e3){this['_getButton'](_0x34e7e3)['hide']();}['_setupButton'](_0x52e78c){const _0x49144c=new ia(this['locale'],{'side':this['side']}),_0xbae0b6=this['buttonViews'];if(_0x49144c['set']({'label':_0x52e78c['label'],'icon':_0x52e78c['icon'],'tooltip':!0x0,'withText':!0x0}),_0x49144c['bind']('isOn')['to'](this,'activeTab',_0x28a215=>_0x28a215===_0x52e78c['id']),_0x49144c['bind']('side')['to'](this,'side'),_0x52e78c['order']){const _0x134e8d=[...this['_tabs']]['reduce']((_0x167a32,_0x2b8194)=>{const _0x581a44=_0x2b8194[0x0],{order:_0x363c60}=_0x2b8194[0x1];return!_0x363c60||_0x363c60>_0x52e78c['order']?_0x167a32:_0x363c60>=_0x167a32['order']?{'id':_0x581a44,'order':_0x363c60}:_0x167a32;},{'id':'','order':0x0}),_0x257cc9=_0xbae0b6['getIndex'](this['_getButton'](_0x134e8d['id']));_0xbae0b6['add'](_0x49144c,_0x257cc9+0x1);}else _0xbae0b6['add'](_0x49144c);return _0x49144c['on']('execute',()=>{this['activateTab'](_0x52e78c['id']);}),_0x49144c;}}const Ti=['overlay','sidebar','custom'],yi=['left','right'];class bi extends ss{constructor(_0x5b17ec,_0xf4f23f={}){super(_0x5b17ec,_0xf4f23f),this['set']('type',_0xf4f23f['type']||'sidebar'),this['set']('side',_0xf4f23f['side']||'right'),this['set']('isVisible',_0xf4f23f['visibleByDefault']??!0x0);const _0x1a5385=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x1a5385['if']('type','ck-ai-tabs__overlay',_0x5519cd=>'overlay'===_0x5519cd),_0x1a5385['if']('type','ck-ai-tabs__sidebar',_0x569139=>'sidebar'===_0x569139),_0x1a5385['if']('isVisible','ck-hidden',_0x348e00=>!_0x348e00)]}}),this['buttonViews']['on']('add',(_0x500cb6,_0x396a83)=>{_0x396a83['set']('withText',!0x1);});}}class H extends _0x37abb2{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2e0a73){super(_0x2e0a73);const _0x291c41=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x291c41)throw new _0x1500e8('ai-tabs-configuration-not-found');if(void 0x0!==_0x291c41['showResizeButton']&&(this['showResizeButton']=_0x291c41['showResizeButton']),'sidebar'!==_0x291c41['type']&&'overlay'!==_0x291c41['type']||_0x291c41['side']&&(this['side']=_0x291c41['side']),'sidebar'===_0x291c41['type']){if(this['container']=_0x291c41['element'],this['set']('type','sidebar'),!this['container'])throw new _0x1500e8('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x291c41['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===_0x291c41['visibleByDefault']||_0x291c41['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 _0x5a6451&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x4f9990){if(_0x4f9990&&this['type']!==_0x4f9990){if(!Ti['includes'](_0x4f9990))throw new _0x1500e8('ai-tabs-unsupported-ui-type');this['type']=_0x4f9990;}}['switchSide'](_0x3bc225){if(_0x3bc225&&this['side']!==_0x3bc225){if(!yi['includes'](_0x3bc225))throw new _0x1500e8('ai-tabs-unsupported-ui-side');this['side']=_0x3bc225;}}['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 _0x37abb2{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x25e2f3){super(_0x25e2f3),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 _0x5d433c=this['context']['plugins']['get']('CloudServices');if(!_0x5d433c['token'])throw new _0x1500e8('ai-missing-token',this);this['_token']=_0x5d433c['token'];}['startConversation'](_0x469600,_0x562537){const _0x57d5ce=this['_sendApiRequest']('/conversations','POST',{'id':_0x469600,'group':_0x562537});return{'getConversation':async()=>(await _0x57d5ce['request'])['json'](),'abortController':_0x57d5ce['abortController']};}['queryAssistant']({message:_0x37b8c4,conversationId:_0x3aa650,parts:_0x1be833,capabilities:_0x312205,model:_0x563aaf,attributes:_0x4f561b}){const _0x163f35={'prompt':_0x37b8c4,'content':_0x1be833,'model':_0x563aaf,..._0x312205&&{'capabilities':_0x312205},..._0x4f561b&&{'attributes':_0x4f561b}},_0x45cca0=this['_sendApiRequest']('/conversations/'+_0x3aa650+'/messages','POST',_0x163f35);return{'getStream':async()=>{const _0x1f71e0=(await _0x45cca0['request'])['body'];return this['_getStreamReader'](_0x1f71e0);},'abortController':_0x45cca0['abortController']};}['executeCustomAction']({content:_0x4277e9,message:_0xec2f01,model:_0x507787,outputFormat:_0x4ce40}){const _0x2fbd75={'content':[{'type':'text','content':_0x4277e9}],'prompt':_0xec2f01,'model':_0x507787,'outputFormat':_0x4ce40},_0x1e4459=this['_sendApiRequest']('/actions/custom/calls','POST',_0x2fbd75);return{'getStream':async()=>{const _0x2dab19=(await _0x1e4459['request'])['body'];return this['_getStreamReader'](_0x2dab19);},'abortController':_0x1e4459['abortController']};}['executeAction']({actionName:_0x594167,content:_0x2c6498,args:_0x1b6a0e}){const _0x12920f={'content':[{'type':'text','content':_0x2c6498}],'args':_0x1b6a0e},_0x158443=this['_sendApiRequest']('/actions/system/'+_0x594167+'/calls','POST',_0x12920f);return{'getStream':async()=>{const _0x20f055=(await _0x158443['request'])['body'];return this['_getStreamReader'](_0x20f055);},'abortController':_0x158443['abortController']};}['uploadFile'](_0x7dcc3a,_0x48881f,_0x20094b){const _0x28107e=new FormData();_0x28107e['append']('file',_0x48881f,_0x48881f['name']),_0x20094b&&_0x28107e['append']('attributes',JSON['stringify'](_0x20094b));const _0x4a4739=this['_sendApiRequest']('/conversations/'+_0x7dcc3a+'/files','POST',_0x28107e);return{'getId':async()=>(await _0x4a4739['request'])['json'](),'abortController':_0x4a4739['abortController']};}['fetchDocument'](_0x1a6d6d,_0x19c1e0){const _0x497a5a=this['_sendApiRequest']('/conversations/'+_0x1a6d6d+'/documents/'+_0x19c1e0,'GET');return{'getDocument':async()=>(await _0x497a5a['request'])['json'](),'abortController':_0x497a5a['abortController']};}['uploadDocument'](_0x59b468,_0x693390,_0x14934a){const _0x47c602={'content':_0x693390};_0x14934a&&(_0x47c602['attributes']=_0x14934a);const _0x2a82b1=this['_sendApiRequest']('/conversations/'+_0x59b468+'/documents','POST',_0x47c602);return{'getId':async()=>(await _0x2a82b1['request'])['json'](),'abortController':_0x2a82b1['abortController']};}['fetchConversations'](_0x22142a,_0x4ed75e={}){const _0x1ad596=new URLSearchParams();_0x1ad596['append']('group',_0x22142a),_0x1ad596['append']('excludeEmpty',!0x1!==_0x4ed75e['excludeEmpty']?'true':'false'),_0x1ad596['append']('limit',_0x4ed75e['limit']?_0x4ed75e['limit']['toString']():'100'),_0x1ad596['append']('sortBy',_0x4ed75e['sortBy']?_0x4ed75e['sortBy']:'createdAt'),_0x1ad596['append']('order',_0x4ed75e['order']?_0x4ed75e['order']:'desc');const _0x5f1753=this['_sendApiRequest']('/conversations?'+_0x1ad596['toString'](),'GET');return{'getConversations':async()=>{const _0x39a51c=await _0x5f1753['request'];return(await _0x39a51c['json']())['items'];},'abortController':_0x5f1753['abortController']};}['deleteConversation'](_0x47a662){const _0x11be49=this['_sendApiRequest']('/conversations/'+_0x47a662,'DELETE');return{'execute':async()=>{await _0x11be49['request'];},'abortController':_0x11be49['abortController']};}['updateConversation'](_0x5b8159,_0x17f3aa){const _0x47eead=this['_sendApiRequest']('/conversations/'+_0x5b8159,'PATCH',_0x17f3aa);return{'getResult':async()=>(await _0x47eead['request'],_0x17f3aa),'abortController':_0x47eead['abortController']};}['fetchConversation'](_0x139056){const _0x312888=this['_sendApiRequest']('/conversations/'+_0x139056,'GET');return{'getConversation':async()=>(await _0x312888['request'])['json'](),'abortController':_0x312888['abortController']};}['fetchConversationMessages'](_0x4f4d5a){const _0x231bf7=this['_sendApiRequest']('/conversations/'+_0x4f4d5a+'/messages','GET');return{'getMessages':async()=>{const _0x4c5959=await _0x231bf7['request'];return(await _0x4c5959['json']())['items'];},'abortController':_0x231bf7['abortController']};}['uploadUrl'](_0x48c978,_0xbe7149,_0x8e0678){const _0x20dbd0=this['_sendApiRequest']('/conversations/'+_0x48c978+'/web-resources','POST',{'url':_0xbe7149,'attributes':_0x8e0678});return{'getId':async()=>(await _0x20dbd0['request'])['json'](),'abortController':_0x20dbd0['abortController']};}['getModels'](_0x138bb3='en'){const _0x44625e=new URLSearchParams();_0x44625e['append']('language',_0x138bb3);const _0x391d58='/models/1?'+_0x44625e['toString'](),_0xf7f1e5=this['_sendApiRequest'](_0x391d58,'GET');return{'list':async()=>await(await _0xf7f1e5['request'])['json'](),'abortController':_0xf7f1e5['abortController']};}['deleteFile'](_0x2e7de9,_0x50d26d){const _0x227333=this['_sendApiRequest']('/conversations/'+_0x2e7de9+'/files/'+_0x50d26d,'DELETE');return{'execute':async()=>{await _0x227333['request'];},'abortController':_0x227333['abortController']};}['deleteDocument'](_0x166796,_0x5ef208){const _0x2ec76d=this['_sendApiRequest']('/conversations/'+_0x166796+'/documents/'+_0x5ef208,'DELETE');return{'execute':async()=>{await _0x2ec76d['request'];},'abortController':_0x2ec76d['abortController']};}['deleteWebResource'](_0xdf3550,_0x1599fb){const _0x3cb30b=this['_sendApiRequest']('/conversations/'+_0xdf3550+'/web-resources/'+_0x1599fb,'DELETE');return{'execute':async()=>{await _0x3cb30b['request'];},'abortController':_0x3cb30b['abortController']};}['callSystemReview']({reviewName:_0xced7f6,content:_0x2bd62,args:_0x13517a}){const _0x497ec9=this['_sendApiRequest']('/reviews/system/'+_0xced7f6+'/calls','POST',{'content':[{'type':'text','content':_0x2bd62}],'args':_0x13517a});return{'getStream':async()=>{const _0x20934f=(await _0x497ec9['request'])['body'];return this['_getStreamReader'](_0x20934f);},'abortController':_0x497ec9['abortController']};}['callCustomReview']({content:_0x2f3b57,prompt:_0x12a25a,model:_0x536a62}){const _0x113ed8=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x2f3b57}],'prompt':_0x12a25a,'model':_0x536a62});return{'getStream':async()=>{const _0x15e0a0=(await _0x113ed8['request'])['body'];return this['_getStreamReader'](_0x15e0a0);},'abortController':_0x113ed8['abortController']};}['upsertAIChatRating'](_0x90d302,_0x3fae02,_0x5e2b3e){const _0xc0e3de=this['_sendApiRequest']('/conversations/'+_0x90d302+'/messages/'+_0x3fae02+'/ratings','PUT',{'positiveCount':_0x5e2b3e['positiveCount'],'totalCount':_0x5e2b3e['totalCount'],'modificationId':_0x5e2b3e['modificationId']});return{'execute':async()=>{await _0xc0e3de['request'];},'abortController':_0xc0e3de['abortController']};}['upsertAIActionRating'](_0x469fd2,_0x188fad,_0x511efb){const _0x5e0d39=this['_sendApiRequest']('/actions/system/'+_0x469fd2+'/calls/'+_0x188fad+'/ratings','PUT',{'positiveCount':_0x511efb['positiveCount'],'totalCount':_0x511efb['totalCount']});return{'execute':async()=>{await _0x5e0d39['request'];},'abortController':_0x5e0d39['abortController']};}['upsertCustomAIActionRating'](_0x2257ca,_0x5a9fff){const _0x406a5f=this['_sendApiRequest']('/actions/custom/calls/'+_0x2257ca+'/ratings','PUT',{'positiveCount':_0x5a9fff['positiveCount'],'totalCount':_0x5a9fff['totalCount']});return{'execute':async()=>{await _0x406a5f['request'];},'abortController':_0x406a5f['abortController']};}['upsertAIReviewRating'](_0x2f9c09,_0x4a08d3,_0x3af337,_0x7cb0cb){const _0x2b1143=this['_sendApiRequest']('/reviews/system/'+_0x2f9c09+'/calls/'+_0x4a08d3+'/ratings','PUT',{'positiveCount':_0x3af337['positiveCount'],'totalCount':_0x3af337['totalCount'],'dataId':_0x7cb0cb});return{'execute':async()=>{await _0x2b1143['request'];},'abortController':_0x2b1143['abortController']};}['upsertCustomAIReviewRating'](_0x5eafc9,_0x34f114,_0x1f3ca3){const _0x531472=this['_sendApiRequest']('/reviews/custom/calls/'+_0x5eafc9+'/ratings','PUT',{'positiveCount':_0x34f114['positiveCount'],'totalCount':_0x34f114['totalCount'],'dataId':_0x1f3ca3});return{'execute':async()=>{await _0x531472['request'];},'abortController':_0x531472['abortController']};}['_sendApiRequest'](_0x440eea,_0x1244ba,_0x1d513f){const _0x239f29=new AbortController(),_0x565b09=_0x1d513f instanceof FormData,_0x21bbf9={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x1d513f&&!_0x565b09&&(_0x21bbf9['Content-Type']='application/json');const _0x9e83db={'method':_0x1244ba,'headers':_0x21bbf9,'signal':_0x239f29['signal']};return _0x1d513f&&(_0x9e83db['body']=_0x565b09?_0x1d513f:JSON['stringify'](_0x1d513f)),{'request':fetch(''+this['_apiUrl']+_0x440eea,_0x9e83db)['catch'](_0x43584b=>{this['_handleError'](_0x43584b);})['then'](_0x164c08=>_0x164c08['ok']?_0x164c08:_0x164c08['json']()['then'](_0x36a95d=>{throw{'url':this['_apiUrl'],'path':_0x440eea,'method':_0x1244ba,'body':_0x1d513f,'status':(_0x164c08||{})['status'],'statusText':(_0x164c08||{})['statusText'],'code':_0x36a95d['code'],'message':_0x36a95d['message'],'traceId':_0x36a95d['traceId']};})),'abortController':_0x239f29};}async*['_getStreamReader'](_0x2521f9){const _0xc2db25=[],_0x17c978=_0x2521f9['getReader'](),_0x40e5e8=gt({'onError':_0x4eb933=>{this['_handleError'](_0x4eb933);},'onEvent':_0xc8ebe1=>{_0xc8ebe1['data']=JSON['parse'](_0xc8ebe1['data']),_0xc2db25['push'](_0xc8ebe1);}});try{let _0x29b934=!0x1;for(;!_0x29b934;){const {done:_0x9c575,value:_0x412a90}=await _0x17c978['read']();_0x9c575&&(_0x29b934=!0x0),_0x40e5e8['feed'](this['_decoder']['decode'](_0x412a90,{'stream':!0x0})),yield*_0xc2db25,_0xc2db25['length']=0x0;}}catch(_0x1b5d71){this['_handleError'](_0x1b5d71);}finally{_0x17c978['releaseLock'](),_0x40e5e8['reset']();}}['_handleError'](_0x391908){if(_0x391908 instanceof _0x1500e8)throw _0x391908;if(_0x391908 instanceof Error&&'AbortError'===_0x391908['name'])throw new _0x1500e8('ai-request-aborted',this,{'originalError':_0x391908});throw new _0x1500e8('ai-request-failed',this,{'originalError':_0x391908});}}function m(_0x17900d,_0x10ebab,_0x462d2d){const t=_0x17900d['t'];switch(_0x10ebab){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'},_0x462d2d);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_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});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_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});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\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});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_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\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.'},_0x462d2d);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.'},_0x462d2d);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_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});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.'},_0x462d2d);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_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});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_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x462d2d);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x462d2d);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x462d2d);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.'},_0x462d2d);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.'},_0x462d2d);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.'},_0x462d2d);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.'},_0x462d2d);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'},_0x462d2d);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_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','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_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});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.'},_0x462d2d);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_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_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_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});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'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x10ebab;}}function Cs(_0xe8d494,_0x506bf5){const _0x601a5e=new _0x3fc85a(_0xe8d494),_0x120cec=m(_0xe8d494,'AI_TABS_LABEL_MINIMIZE'),_0xe1b38d=m(_0xe8d494,'AI_TABS_LABEL_MAXIMIZE');return _0x601a5e['set']({'withText':!0x1,'icon':_0x2b97b8,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x601a5e['bind']('label')['to'](_0x506bf5,'isMaximized',_0x3cdc1=>_0x3cdc1?_0x120cec:_0xe1b38d),_0x601a5e['bind']('icon')['to'](_0x506bf5,'isMaximized',_0x3f7eaf=>_0x3f7eaf?_0x3bc269:_0x2b97b8),_0x601a5e['bind']('isOn')['to'](_0x506bf5,'isMaximized'),_0x601a5e['on']('execute',()=>{_0x506bf5['fire']('resizeTabs');}),_0x601a5e;}function Qe(_0x9ea90e){return _0x13b8bc(_0x9ea90e);}function Y(_0x1bb8c8){return _0x2aee41(_0x1bb8c8);}function Z(_0x28d802,_0x1e7d90,_0x37af93){const _0x146206=null!==_0x1e7d90?_0x14d4f8=>_0x14d4f8['attribs'][_0x28d802]===_0x1e7d90:_0x28190e=>Boolean(_0x28190e['attribs'][_0x28d802]);return _0x32e3c1(_0x3619af=>_0x32b8a9(_0x3619af)&&_0x146206(_0x3619af),_0x37af93);}function Ki(_0x5720d6,_0x3b64e1,_0x5ea439){const _0x3141cd=null!==_0x3b64e1?_0x5605cb=>_0x5605cb['attribs'][_0x5720d6]===_0x3b64e1:_0x22bfbd=>Boolean(_0x22bfbd['attribs'][_0x5720d6]);return _0x51c105(_0x2bf3f9=>_0x32b8a9(_0x2bf3f9)&&_0x3141cd(_0x2bf3f9),_0x5ea439);}function q(_0x4cd465,_0x4d7200){return _0x4cd465&&_0x32b8a9(_0x4cd465)?_0x4cd465['attribs'][_0x4d7200]:null;}function Es(_0x2716c4,_0x583a47,_0x31c9dc){_0x32b8a9(_0x2716c4)&&(null===_0x31c9dc?delete _0x2716c4['attribs'][_0x583a47]:_0x2716c4['attribs'][_0x583a47]=_0x31c9dc);}function Zi(_0x1fff1c,_0x7c69ea,_0x274a5e){const _0x1294ee=_0x7c69ea['cloneNode'](!0x0);'beforebegin'===_0x274a5e?_0x4512fa(_0x1fff1c,_0x1294ee):'afterbegin'===_0x274a5e?_0x56829d(_0x1fff1c,_0x1294ee):'beforeend'===_0x274a5e?_0x56184d(_0x1fff1c,_0x1294ee):'afterend'===_0x274a5e&&_0x4dcf7a(_0x1fff1c,_0x1294ee);}function Ke(_0x79ee04){const _0x42176f=[];let _0x61f828=_0x79ee04;for(;_0x61f828;)_0x61f828=_0x11e924(_0x61f828),_0x61f828&&_0x42176f['push'](_0x61f828);return _0x42176f;}function Jn(_0x33747f){return _0x33747f['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Ss(_0xe47165){let _0x4c1ad=0x0;for(;_0xe47165['parentNode'];)_0xe47165=_0xe47165['parentNode'],_0x4c1ad++;return _0x4c1ad;}function Ws(_0x13c893){const _0x571cc4=[];let _0x169172=_0x13c893['nextSibling'];for(;_0x169172;)_0x571cc4['push'](_0x169172),_0x169172=_0x169172['nextSibling'];_0x571cc4['forEach'](_0x5c2776=>{_0x7119c8(_0x5c2776);});}class Ze extends/* #__PURE__ -- @preserve */
25
- Vt(){['_m2html'];constructor(){super(),this['_m2html']=new _0x7213b8();}['convertMarkdownToHTML'](_0x6b4cf1){const _0xc832be=this['_m2html']['parse'](_0x6b4cf1);return this['parseAndNormalizeHTML'](_0xc832be);}['parseAndNormalizeHTML'](_0x5164e0){return this['_parseHTML'](_0x5164e0);}['_parseHTML'](_0x385e25){const _0x3240d1=Qe('<dummy>'+_0x385e25['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x3240d1['children']=_0x3240d1['children'][0x0]['children'],_0x3240d1;}}class $e extends/* #__PURE__ -- @preserve */
26
- Vt(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x57a1ad){super(),this['_generateUid']=_0x57a1ad||_0x3e4e8c;}['merge'](_0xf32982,_0x561cb2,_0x4371fd){const _0x1dc309=_0xf32982['cloneNode'](!0x0);if(0x0===_0x561cb2['childNodes']['length']){const _0x2fc45a=[];return Ki('data-id','new-element',_0x1dc309)['forEach'](_0x542e6d=>{const _0x10305c=this['_generateUid']();Es(_0x542e6d,'data-id',_0x10305c),_0x2fc45a['push'](_0x10305c);}),this['_removeSpecialComments'](_0x1dc309),{'parsedContent':_0x1dc309,'newNodeIds':_0x2fc45a,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x4371fd&&_0x4371fd['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x1dc309),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ki('data-id',null,_0x561cb2)['map'](_0x5b86a3=>q(_0x5b86a3,'data-id'))['filter'](_0x5ba948=>!!_0x5ba948));let _0x25a19c=-0x1,_0x42e5de=!0x1;const _0x3cecf9=_0x1dc309['childNodes'],_0x105d56=Array['from'](_0x3cecf9)['filter'](_0x3a5a54=>!(0x3===_0x3a5a54['nodeType']&&''===Y(_0x3a5a54)['trim']())),_0x599d8f=_0x105d56['length'];for(let _0x3327cb=0x0;_0x3327cb<_0x599d8f;_0x3327cb++){const _0x308a8d=_0x105d56[_0x3327cb],_0x1fc8e4=_0x105d56[_0x3327cb+0x1];if(this['_isNewNode'](_0x308a8d)){if(-0x1===_0x25a19c&&(_0x25a19c=_0x3327cb),this['_markWrappedElements'](_0x308a8d),!this['_isNewNode'](_0x1fc8e4)){const [_0x1c6c0c,_0x251c7d]=this['_findReferenceNode'](_0x308a8d,_0x42e5de,_0x561cb2);if(_0x1c6c0c){const _0xc03fbc=Array['from'](_0x105d56)['slice'](_0x25a19c,_0x3327cb+0x1);this['_insertNodes'](_0x1c6c0c,_0xc03fbc,_0x251c7d),_0x25a19c=-0x1;}}}else{if(this['_isExistingContentComment'](_0x308a8d))_0x42e5de=!0x0;else{if(this['_isExistingNode'](_0x308a8d)){const _0x31fd00=q(_0x308a8d,'data-id');if(_0x31fd00&&this['_existingDataIds']['has'](_0x31fd00)){const _0x2bfd6e=Z('data-id',_0x31fd00,_0x561cb2);this['_replaceNode'](_0x2bfd6e,_0x308a8d);}if(this['_touchedNodesState']['removedIds']['includes'](_0x31fd00)){const _0x15017e=this['_touchedNodesState']['removedIds']['indexOf'](_0x31fd00);this['_touchedNodesState']['removedIds']['splice'](_0x15017e,0x1);}}else{if(this['_isDelNode'](_0x308a8d)){const _0x5c6244=q(_0x308a8d,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x5c6244)||this['_storeDeletedElementIds'](_0x308a8d);}}}}}for(const _0x48c01d of this['_touchedNodesState']['removedIds']){const _0xc9b521=Z('data-id',_0x48c01d,_0x561cb2);if(_0xc9b521){if(_0x4371fd&&_0x4371fd['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x48c01d;const _0x514836=_0x4371fd['replaceRemovedWith']['cloneNode'](!0x0);Es(_0x514836,'data-id',_0x48c01d),Es(_0x514836,'data-removed','true'),_0x3d5dcc(_0xc9b521,_0x514836);}else _0x7119c8(_0xc9b521);}}if(Ki('data-wrapped-id',null,_0x561cb2)['forEach'](_0x36d9a9=>{const _0x500085=Z('data-id',q(_0x36d9a9,'data-wrapped-id'),_0x561cb2);var _0x2e2bf5,_0x215a11;_0x500085&&(_0x215a11=_0x36d9a9,_0x7119c8(_0x2e2bf5=_0x500085),_0x3d5dcc(_0x215a11,_0x2e2bf5));}),Ki('data-id','new-element',_0x561cb2)['forEach'](_0x106482=>{const _0x4a5bb4=this['_getUid'](_0x106482);Es(_0x106482,'data-id',_0x4a5bb4),this['_touchedNodesState']['newIds']['push'](_0x4a5bb4);}),this['_removeSpecialComments'](_0x561cb2),_0x4371fd&&_0x4371fd['markUnstableElements']&&this['_markUnstableElements'](_0x561cb2,_0x4371fd['markUnstableElementsDepth']||0x0),_0x4371fd&&_0x4371fd['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x39e46b=Z('data-id',this['_touchedNodesState']['lastTouchedId'],_0x561cb2);for(;_0x39e46b;)Ws(_0x39e46b),_0x39e46b=_0x39e46b['parentNode'];}return{'parsedContent':_0x561cb2,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x3ff1b7,_0x48eef5,_0x5d8bdb){for(const _0x41b1ea of _0x48eef5){const _0x3687d1=this['_getUid'](_0x41b1ea);Es(_0x41b1ea,'data-id',_0x3687d1),this['_touchedNodesState']['newIds']['push'](_0x3687d1),this['_touchedNodesState']['lastTouchedId']=_0x3687d1;}const _0x49ef22='afterbegin'===_0x5d8bdb||'afterend'===_0x5d8bdb?_0x48eef5['reverse']():_0x48eef5;for(const _0x323e2b of _0x49ef22)Zi(_0x3ff1b7,_0x323e2b,_0x5d8bdb);}['_replaceNode'](_0x3b134a,_0x403db7){if(!_0x3b134a)return;if(_0x20fb07=_0x403db7,Jn(Y(_0x3b134a))===Jn(Y(_0x20fb07)))return;var _0x20fb07;const _0x5cffcc=this['_getUid'](_0x3b134a);Es(_0x403db7,'data-id',_0x5cffcc),this['_touchedNodesState']['modifiedIds']['push'](_0x5cffcc),this['_touchedNodesState']['lastTouchedId']=_0x5cffcc,_0x3d5dcc(_0x3b134a,_0x403db7['cloneNode'](!0x0));}['_findReferenceNode'](_0x5c6ce4,_0x1dc857,_0x288464){const _0x41e30e=this['_findPrevElementWithDataId'](_0x5c6ce4,!0x1);if(_0x41e30e){const _0x120cfc=this['_getNodeDataId'](_0x41e30e),_0x5b1065=Z('data-id',_0x120cfc,_0x288464);if(_0x5b1065)return[_0x5b1065,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x120cfc);}const _0x2fc355=this['_findNextElementWithDataId'](_0x5c6ce4,!0x1);if(_0x2fc355){const _0x45248e=this['_getNodeDataId'](_0x2fc355),_0x5d1a13=Z('data-id',_0x45248e,_0x288464);if(_0x5d1a13)return[_0x5d1a13,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x45248e);}return _0x1dc857?_0x5c6ce4['nextSibling']?this['_findFallbackReferenceNode'](_0x5c6ce4,_0x288464):[_0x288464['childNodes'][_0x288464['childNodes']['length']-0x1],'afterend']:[_0x288464['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x11cfbe,_0x3c288a){const _0x26c177=[],_0x2d8ffc=this['_findPrevElementWithDataId'](_0x11cfbe,!0x0);if(_0x2d8ffc){const _0x5a93d0=Z('data-id',this['_getNodeDataId'](_0x2d8ffc),_0x3c288a);_0x5a93d0&&_0x26c177['push']([_0x5a93d0,'afterend']);}const _0x5c5e4c=this['_findNextElementWithDataId'](_0x11cfbe,!0x0);if(_0x5c5e4c){const _0x252366=Z('data-id',this['_getNodeDataId'](_0x5c5e4c),_0x3c288a);_0x252366&&_0x26c177['push']([_0x252366,'beforebegin']);}if(_0x26c177['length']>0x1)return Ss(_0x26c177[0x0][0x0])<=Ss(_0x26c177[0x1][0x0])?_0x26c177[0x0]:_0x26c177[0x1];return 0x1===_0x26c177['length']?_0x26c177[0x0]:[_0x3c288a['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x56905f,_0x4e2ddb){let _0x1bad2b=_0x56905f['nextSibling'],_0x8162a5=null,_0x3a1ed9=!0x1;for(;_0x1bad2b;){if(_0x10a170(_0x1bad2b)){if(this['_isDelNode'](_0x1bad2b)&&(_0x8162a5=_0x1bad2b),this['_isExistingContentComment'](_0x1bad2b)&&_0x4e2ddb&&!_0x3a1ed9){_0x3a1ed9=!0x0,_0x1bad2b=_0x1bad2b['nextSibling'];continue;}break;}const _0x32ba63=q(_0x1bad2b,'data-id');if(_0x32ba63&&'new-element'!==_0x32ba63&&this['_existingDataIds']['has'](_0x32ba63)){_0x8162a5=_0x1bad2b;break;}_0x1bad2b=_0x1bad2b['nextSibling'];}return _0x8162a5;}['_findPrevElementWithDataId'](_0x2c4175,_0x226ba9){let _0x5d7fa2=_0x2c4175['previousSibling'],_0x491839=null,_0x11281e=!0x1;for(;_0x5d7fa2;){if(_0x10a170(_0x5d7fa2)){if(this['_isDelNode'](_0x5d7fa2)&&(_0x491839=_0x5d7fa2),this['_isExistingContentComment'](_0x5d7fa2)&&_0x226ba9&&!_0x11281e){_0x11281e=!0x0,_0x5d7fa2=_0x5d7fa2['previousSibling'];continue;}break;}const _0x3e4d24=q(_0x5d7fa2,'data-id');if(_0x3e4d24&&'new-element'!==_0x3e4d24&&this['_existingDataIds']['has'](_0x3e4d24)){_0x491839=_0x5d7fa2;break;}_0x5d7fa2=_0x5d7fa2['previousSibling'];}return _0x491839;}['_markWrappedElements'](_0x1fee71){_0x32b8a9(_0x1fee71)&&Ki('data-id',null,_0x1fee71)['forEach'](_0x4e546e=>{this['_isExistingNode'](_0x4e546e)&&!this['_hasWrappedParent'](_0x4e546e)&&(Es(_0x4e546e,'data-wrapped-id',q(_0x4e546e,'data-id')),Es(_0x4e546e,'data-id',null));});}['_getNodeDataId'](_0x56baa5){if(!_0x56baa5)return null;if(_0x32b8a9(_0x56baa5))return q(_0x56baa5,'data-id');if(_0x10a170(_0x56baa5)){const _0x199011=Y(_0x56baa5)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x199011&&_0x199011[0x1])return _0x199011[0x1];}return null;}['_storeDeletedElementIds'](_0x1fdeb6){if(_0x10a170(_0x1fdeb6)){const _0x46fb11=Y(_0x1fdeb6)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x46fb11&&_0x46fb11[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x46fb11[0x1]);}}['_getUid'](_0x5a2a4e){return this['_isExistingNode'](_0x5a2a4e)?q(_0x5a2a4e,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x284c02){(function(_0x1442f3){return _0x83201e(_0x506862=>_0x10a170(_0x506862),_0x1442f3,!0x0,0x1/0x0);}(_0x284c02)['filter'](_0x3e31bc=>this['_isDelNode'](_0x3e31bc)||this['_isExistingContentComment'](_0x3e31bc))['forEach'](_0x33ebff=>{_0x7119c8(_0x33ebff);}));}['_markLastTagElementUnstable'](_0x27fee2){const _0x20e6c7=_0x27fee2['childNodes'],_0x5ce50e=_0x20e6c7[_0x20e6c7['length']-0x1];_0x5ce50e&&_0x32b8a9(_0x5ce50e)&&Es(_0x5ce50e,'data-unstable','true');}['_markUnstableElements'](_0x3b7532,_0x85abe2){const _0x27e3d2=Z('data-unstable','true',_0x3b7532);if(!_0x27e3d2)return;const _0x46274f=Ke(_0x27e3d2)['slice'](0x0,-0x1),_0x95b9fe=_0x46274f['length'];let _0x5a7127=_0x27e3d2;if(_0x95b9fe>_0x85abe2){let _0x2de385=_0x95b9fe,_0x233b6b=null;for(;_0x2de385>_0x85abe2&&_0x2de385>=0x0;)_0x2de385--,_0x233b6b=_0x46274f[_0x2de385];_0x233b6b&&(_0x5a7127=_0x233b6b,Es(_0x27e3d2,'data-unstable',null),Es(_0x233b6b,'data-unstable','true'));}else{if(_0x95b9fe<_0x85abe2){let _0xb4a205=_0x95b9fe,_0x191b44=_0x27e3d2;for(;_0xb4a205<_0x85abe2;){const _0x301bb0=_0x191b44['childNodes']['filter'](_0x571fa5=>_0x32b8a9(_0x571fa5));if(0x0===_0x301bb0['length'])break;_0xb4a205++,_0x191b44=_0x301bb0[_0x301bb0['length']-0x1];}_0x191b44&&(_0x5a7127=_0x191b44,Es(_0x27e3d2,'data-unstable',null),Es(_0x191b44,'data-unstable','true'));}}let _0x3739fd=_0x5a7127;for(;_0x3739fd;){for(;_0x3739fd['nextSibling'];)_0x3739fd=_0x3739fd['nextSibling'],_0x32b8a9(_0x3739fd)&&Es(_0x3739fd,'data-unstable','true');_0x3739fd=_0x3739fd['parentNode'];}}['_isNewNode'](_0x32e4c5){return Boolean('new-element'===q(_0x32e4c5,'data-id'));}['_isExistingNode'](_0x3d395d){return Boolean((q(_0x3d395d,'data-id')||'')['length']>0x0&&'new-element'!==q(_0x3d395d,'data-id'));}['_isDelNode'](_0xd1fd82){return!!_0xd1fd82&&Boolean(_0x10a170(_0xd1fd82)&&Y(_0xd1fd82)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x5c5a34){let _0x1f5c79=_0x5c5a34['parentNode'];for(;_0x1f5c79;){if(q(_0x1f5c79,'data-wrapped-id'))return!0x0;_0x1f5c79=_0x1f5c79['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x3dd556){return Boolean(_0x10a170(_0x3dd556)&&Y(_0x3dd556)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function f({editor:_0x253071,changeGroups:_0x54444d,documentContextContent:_0x2c1fde,showDiff:_0x5978aa,trimUnchanged:_0x27f6d1=!0x0}){return _0x54444d['map'](_0xd74dc8=>{const _0x469d9d=new _0x175d6b([]),_0x18d2d0=new _0x175d6b([]);for(const _0x556ca3 of _0xd74dc8['changes'])if(_0x5978aa&&'removed'==_0x556ca3['type']||_0x18d2d0['children']['push'](_0x556ca3['node']['cloneNode'](!0x0)),'new'!=_0x556ca3['type']&&(_0x5978aa||'removed'!=_0x556ca3['type'])){const _0x4402f8=_0x32e3c1(_0x565730=>q(_0x565730,'data-id')==_0x556ca3['id'],_0x2c1fde,!0x0);_0x4402f8&&_0x469d9d['children']['push'](_0x4402f8['cloneNode'](!0x0));}const {content:_0xfb269d,hasChanges:_0x4c0dc3}=function(_0x4b9dae,_0x436291,_0x502362,_0xfafc26,_0x4517c4=!0x0){const _0x5c59e5=_0x4b9dae['plugins']['get']('DocumentCompare'),_0x90dd46=Y(_0x436291),_0x2f636=Y(_0x502362),_0x40d6e1=_0x4b9dae['data']['parse'](_0x90dd46,'$root'),_0x5a0e58=_0x4b9dae['model']['createPositionAt'](_0x40d6e1,0x0),_0x15dbfc=_0x5c59e5['getDiff'](_0x90dd46,_0x2f636,{'anchor':_0x5a0e58,'markDeletions':_0xfafc26}),_0x33cd9a=_0x15dbfc['getOperations']();if(0x0==_0x33cd9a['length'])return{'content':_0x436291['cloneNode'](!0x0),'hasChanges':!0x1};_0xfafc26?function(_0x51b2f3,_0x201e37,_0x11a1a8){if(0x0==_0x51b2f3['length'])return;const _0x18cea2=_0x11a1a8['plugins']['get']('DocumentCompare'),_0x32ae9d=_0x11a1a8['plugins']['get']('SuggestionsConversion');_0x11a1a8['model']['change'](_0x5cf092=>{const _0x1a90e0=new Set();for(let _0x1efe33=0x0;_0x1efe33<_0x51b2f3['length'];_0x1efe33++){const _0x46a3f2=_0x51b2f3[_0x1efe33];if(_0x46a3f2['baseVersion']=null,_0x46a3f2['isDocumentOperation']=!0x1,_0x18cea2['isMarkedRemoveOperation'](_0x46a3f2)){const _0x395f61=_0xf97f88(_0x46a3f2['newRange'],_0x11a1a8['model']),_0x4c0d5d='suggestion:deletion:'+_0x3e4e8c()+':$aiSuggestion';_0x201e37['markers']['set'](_0x4c0d5d,_0x395f61);}else switch(_0x46a3f2['type']){case'rename':{if(_0x46a3f2['oldName']==_0x46a3f2['newName'])break;_0x5cf092['batch']['addOperation'](_0x46a3f2),_0x11a1a8['model']['applyOperation'](_0x46a3f2);const _0x411de6='$elementName',_0x46cae8=_0x46a3f2['position'],_0x538254=_0x11a1a8['model']['createRange'](_0x46cae8,_0x11a1a8['model']['createPositionAt'](_0x46cae8['nodeAfter'],'end')),_0x36126e='suggestion:attribute:'+_0x411de6+':'+_0x3e4e8c()+':$aiSuggestion';_0x201e37['markers']['set'](_0x36126e,_0x538254);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x46a3f2['oldValue']==_0x46a3f2['newValue'])break;_0x5cf092['batch']['addOperation'](_0x46a3f2),_0x11a1a8['model']['applyOperation'](_0x46a3f2);const _0x3dd76c=_0x46a3f2['key'];if(!_0x32ae9d['isRegisteredAttribute'](_0x3dd76c))break;const _0x5e592c=_0xf97f88(_0x46a3f2['range'],_0x11a1a8['model']),_0x1fcc9c='suggestion:attribute:'+_0x3dd76c+':'+_0x3e4e8c()+':$aiSuggestion';_0x201e37['markers']['set'](_0x1fcc9c,_0x5e592c);break;}case'insert':{_0x5cf092['batch']['addOperation'](_0x46a3f2),_0x11a1a8['model']['applyOperation'](_0x46a3f2);if(_0x51b2f3[_0x1efe33+0x1]&&'move'==_0x51b2f3[_0x1efe33+0x1]['type']){no(_0x201e37,_0x46a3f2);break;}const _0x4eac17=_0x46a3f2['position'],_0x38f7dd=_0x46a3f2['howMany'],_0x1bb792=_0xf97f88(_0x11a1a8['model']['createRange'](_0x4eac17,_0x4eac17['getShiftedBy'](_0x38f7dd)),_0x11a1a8['model']),_0xd7c0c8='suggestion:insertion:'+_0x3e4e8c()+':$aiSuggestion';_0x201e37['markers']['set'](_0xd7c0c8,_0x1bb792);break;}case'split':{_0x5cf092['batch']['addOperation'](_0x46a3f2),_0x11a1a8['model']['applyOperation'](_0x46a3f2);const _0x5c27e0=_0x46a3f2['splitPosition'],_0x49e969=_0x46a3f2['moveTargetPosition'],_0x1349ab=_0x11a1a8['model']['createRange'](_0x5c27e0,_0x49e969),_0x572df='suggestion:insertion:'+_0x3e4e8c()+':$aiSuggestion';_0x201e37['markers']['set'](_0x572df,_0x1349ab);break;}case'move':{_0x5cf092['batch']['addOperation'](_0x46a3f2),_0x11a1a8['model']['applyOperation'](_0x46a3f2),_0x51b2f3[_0x1efe33-0x1]&&'insert'==_0x51b2f3[_0x1efe33-0x1]['type']&&no(_0x201e37,_0x46a3f2);const _0x6dc664=_0x46a3f2['getMovedRangeStart'](),_0x45e802=_0x46a3f2['howMany'];for(let _0x3d9843=0x0;_0x3d9843<_0x45e802;_0x3d9843++){const _0x98750d=_0x6dc664['getShiftedBy'](_0x3d9843)['nodeAfter'];_0x1a90e0['add'](_0x98750d);}break;}case'remove':{const _0x2eecc9=_0x46a3f2['sourcePosition'],_0x5f4d0b=_0x46a3f2['howMany'],_0x333815=new _0x34bf3b(_0x2eecc9,_0x5f4d0b);_0x5cf092['batch']['addOperation'](_0x333815),_0x11a1a8['model']['applyOperation'](_0x333815);break;}}}for(const _0x51d86a of _0x1a90e0){const _0x13d490=_0x11a1a8['model']['createRangeOn'](_0x51d86a),_0x1fb9a6='suggestion:formatBlock:$fakeWrap:'+_0x3e4e8c()+':$aiSuggestion';_0x201e37['markers']['set'](_0x1fb9a6,_0xf97f88(_0x13d490,_0x11a1a8['model']));}});}(_0x33cd9a,_0x40d6e1,_0x4b9dae):_0x4b9dae['model']['change'](_0x1bc9fd=>{for(const _0x4708b4 of _0x33cd9a)if('remove'==_0x4708b4['type']){const _0x3ed767=_0x4708b4['sourcePosition'],_0x236c8a=_0x4708b4['howMany'],_0x4d6a08=new _0x34bf3b(_0x3ed767,_0x236c8a);_0x1bc9fd['batch']['addOperation'](_0x4d6a08),_0x4b9dae['model']['applyOperation'](_0x4d6a08);}else{if('marker'==_0x4708b4['type']){const _0x1790a7=_0x4708b4['name'],_0x32773e=_0x4708b4['newRange'];null!==_0x32773e?_0x40d6e1['markers']['set'](_0x1790a7,_0x32773e):_0x40d6e1['markers']['delete'](_0x1790a7);}else _0x4708b4['baseVersion']=null,_0x4708b4['isDocumentOperation']=!0x1,_0x1bc9fd['batch']['addOperation'](_0x4708b4),_0x4b9dae['model']['applyOperation'](_0x4708b4);}});if(_0x4517c4){const _0x3ac255=W(_0x4b9dae,_0x33cd9a,_0x40d6e1);G(_0x4b9dae['model'],_0x3ac255),function(_0x145934,_0x4fa9a7){const _0x5ebdd7=_0x4fa9a7['getFirstRange']()['start'];let _0x48e6b1=_0x4fa9a7['getFirstRange']()['end'];const _0x1ced87=_0x5ebdd7['root'];(_0x48e6b1['textNode']||_0x48e6b1['nodeAfter']&&_0x48e6b1['nodeAfter']['is']('$text'))&&(_0xdd4fe8(_0x48e6b1,'...'),_0x48e6b1=_0x48e6b1['getShiftedBy'](0x3)),(_0x5ebdd7['textNode']||_0x5ebdd7['nodeBefore']&&_0x5ebdd7['nodeBefore']['is']('$text'))&&(_0xdd4fe8(_0x5ebdd7,'...'),function(_0x872773,_0x351163,_0x3a0176){for(let [_0x2455e0,_0x52d103]of _0x872773['markers']){const _0x2ce001=_0x52d103['_getTransformedByInsertion'](_0x351163,_0x3a0176,!0x1);_0x52d103=_0x2ce001[0x0],_0x872773['markers']['set'](_0x2455e0,_0x52d103);}}(_0x1ced87,_0x5ebdd7,0x3),_0x5ebdd7['parent']==_0x48e6b1['parent']&&(_0x48e6b1=_0x48e6b1['getShiftedBy'](0x3)));const _0x4b1219=_0x145934['createRange'](_0x145934['createPositionAt'](_0x1ced87,0x0),_0x5ebdd7),_0x147323=_0x145934['createRange'](_0x48e6b1,_0x145934['createPositionAt'](_0x1ced87,'end')),_0xd51d8a=[..._0x4b1219['getMinimalFlatRanges'](),..._0x147323['getMinimalFlatRanges']()];_0xd51d8a['reverse']();for(const _0x160c7c of _0xd51d8a)to(_0x160c7c),Zn(_0x1ced87,_0x160c7c);}(_0x4b9dae['model'],_0x3ac255);}const _0x434dc8=_0x4b9dae['data']['stringify'](_0x40d6e1,{'showSuggestionHighlights':!0x0});return{'content':Qe(_0x434dc8),'hasChanges':!0x0};}(_0x253071,_0x469d9d,_0x18d2d0,_0x5978aa,_0x27f6d1);return{'type':_0xd74dc8['changes'][0x0]['type'],'index':_0xd74dc8['index'],'content':_0xfb269d,'hasChanges':_0x4c0dc3};});}function no(_0x33ab10,_0x5df962){for(const [_0x5ab8f7,_0x522136]of _0x33ab10['markers']){const _0x47107a=_0x1f26a0['_createFromRanges'](_0x522136['getTransformedByOperation'](_0x5df962));_0x33ab10['markers']['set'](_0x5ab8f7,_0x47107a);}}function W(_0x1e5d5d,_0x34b4b4,_0x39b507){const _0x13200a=_0x1e5d5d['plugins']['get']('DocumentCompare');let _0x3dacdb=_0x1e5d5d['model']['createPositionAt'](_0x39b507,Number['POSITIVE_INFINITY']),_0x3acaf=_0x1e5d5d['model']['createPositionAt'](_0x39b507,0x0);for(const _0x2ab3ad of _0x34b4b4){let _0x34bd74,_0x32c916;if(_0x13200a['isMarkedRemoveOperation'](_0x2ab3ad))_0x34bd74=_0x2ab3ad['newRange']['start'],_0x32c916=_0x2ab3ad['newRange']['end'];else switch(_0x3dacdb=_0x3dacdb['getTransformedByOperation'](_0x2ab3ad),_0x3acaf=_0x3acaf['getTransformedByOperation'](_0x2ab3ad),_0x2ab3ad['type']){case'rename':_0x34bd74=_0x2ab3ad['position'],_0x32c916=_0x34bd74['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x34bd74=_0x2ab3ad['range']['start'],_0x32c916=_0x2ab3ad['range']['end'];break;case'insert':_0x34bd74=_0x2ab3ad['position'],_0x32c916=_0x34bd74['getShiftedBy'](_0x2ab3ad['howMany']);break;case'split':_0x34bd74=_0x2ab3ad['splitPosition'],_0x32c916=_0x2ab3ad['moveTargetPosition'];break;case'merge':{const _0x24877a=_0x2ab3ad['targetPosition']['path']['slice'](0x0,-0x1);_0x34bd74=_0x1e5d5d['model']['createPositionFromPath'](_0x39b507,_0x24877a),_0x32c916=_0x34bd74['getShiftedBy'](0x1);break;}case'remove':{const _0x204442=_0x2ab3ad['howMany'],_0x23d644=_0x2ab3ad['sourcePosition']['_getTransformedByInsertion'](_0x2ab3ad['targetPosition'],_0x204442),_0x4a449b=_0x2ab3ad['getMovedRangeStart']();'remove'==_0x2ab3ad['type']?(_0x34bd74=_0x23d644,_0x32c916=_0x23d644):(_0x34bd74=_0x4a449b,_0x32c916=_0x4a449b['getShiftedBy'](_0x204442));break;}}_0x34bd74&&_0x34bd74['isBefore'](_0x3dacdb)&&(_0x3dacdb=_0x34bd74['clone'](),_0x3dacdb['stickiness']='toNone'),_0x32c916&&_0x32c916['isAfter'](_0x3acaf)&&(_0x3acaf=_0x32c916['clone'](),_0x3acaf['stickiness']='toNone');}return _0x1e5d5d['model']['createSelection'](_0x1e5d5d['model']['createRange'](_0x3dacdb,_0x3acaf));}function G(_0x2c5e83,_0x54f441){ro(_0x2c5e83,_0x54f441,'forward');const _0x232e07=_0x54f441['getFirstRange']();_0x54f441['setTo']([]),_0x54f441['setTo'](_0x232e07,{'backward':!0x0}),ro(_0x2c5e83,_0x54f441,'backward');}function ro(_0x2641e8,_0x20e077,_0x216f1b){let _0x423731=0x14;for(;_0x423731;){_0x2641e8['modifySelection'](_0x20e077,{'unit':'word','direction':_0x216f1b}),_0x423731--;const _0x41f724=_0x20e077['focus']['forward'==_0x216f1b?'nodeBefore':'nodeAfter'];if(_0x41f724&&_0x41f724['is']('element')&&_0x2641e8['schema']['isBlock'](_0x41f724)&&_0x2641e8['schema']['isObject'](_0x41f724))break;}}function Zn(_0x5b0d6,_0x2f6f9e){for(const [_0x228a07,_0x36afe1]of _0x5b0d6['markers']){const _0x19bb58=_0x36afe1['_getTransformedByDeletion'](_0x2f6f9e['start'],_0x2f6f9e['end']['offset']-_0x2f6f9e['start']['offset']);null!=_0x19bb58?_0x5b0d6['markers']['set'](_0x228a07,_0x19bb58):_0x5b0d6['markers']['delete'](_0x228a07);}}class pe extends Vt(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x175d6b([]);['parsedMergedContent']=new _0x175d6b([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x3798e0,content:_0x50941c='',isDone:_0x1006b8=!0x1,interactionId:_0xdb1c75,areActionsDisabled:_0x13b4f1,documentContextContent:_0x1776a3,editor:_0x3f2b3f,id:_0x99fcdd}){super(),this['id']=_0x99fcdd||_0x3e4e8c(),this['interactionId']=_0xdb1c75,this['type']=_0x3798e0,this['areActionsDisabled']=!!_0x13b4f1,this['editor']=_0x3f2b3f,this['aiResponseParser']=new Ze(),this['aiResponseApplier']=new $e(),this['documentContextContent']=Qe(_0x1776a3||''),this['set']('isDone',_0x1006b8),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x50941c);}['appendContent'](_0x3b559c){this['set']('content',this['content']+_0x3b559c);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x289632,_0x39e303){this['changeGroups'][_0x289632]['state']=_0x39e303,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x289632,'state':_0x39e303});}['getContentParts']({showDiff:_0x461c6c,groupIndex:_0x1e859a}){if(!this['editor'])throw new _0x1500e8('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x42f134=this['_getCachedContentParts'](_0x461c6c,_0x1e859a);if(_0x42f134)return _0x42f134;let _0x408361=[];if(void 0x0===_0x1e859a)_0x408361=this['changeGroups'];else{const _0x5dba6a=this['changeGroups']['find'](({index:_0x20f650})=>_0x20f650===_0x1e859a);if(!_0x5dba6a)throw new _0x1500e8('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x1e859a});_0x408361=[_0x5dba6a];}const _0x5608ac=f({'editor':this['editor'],'showDiff':_0x461c6c,'changeGroups':_0x408361,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x461c6c,_0x5608ac),_0x5608ac;}['_getCachedContentParts'](_0x2c536c,_0x24c769){const _0x1a99e6=_0x2c536c?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x1a99e6]['length'])return null;const _0x21ee70=this['cachedSuggestionContentParts'][_0x1a99e6];if(void 0x0===_0x24c769)return _0x21ee70['length']>0x0&&_0x21ee70['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x2c536c,null),null):_0x4879b0(_0x21ee70);{const _0x1bc941=_0x21ee70['find'](({index:_0x115c0d})=>_0x115c0d===_0x24c769);if(_0x1bc941)return[_0x4879b0(_0x1bc941)];}return null;}['_setCachedContentParts'](_0x2193e5,_0x478f4b){const _0x46a636=_0x2193e5?'withDiff':'withoutDiff';_0x478f4b?_0x478f4b['forEach'](_0x5cadd8=>{const _0x44f546=this['cachedSuggestionContentParts'][_0x46a636],_0xff1c95=_0x44f546['find'](({index:_0x130f18})=>_0x130f18===_0x5cadd8['index']);if(_0xff1c95){const _0x5271b4=_0x44f546['indexOf'](_0xff1c95);_0x44f546['splice'](_0x5271b4,0x1,_0x5cadd8);}else _0x44f546['push'](_0x5cadd8);}):this['cachedSuggestionContentParts'][_0x46a636]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x2c4b61=this['changeGroups'];this['updateChangeGroups']();const _0x127867=this['_getDifferentChangeGroups'](_0x2c4b61,this['changeGroups']);(_0x127867['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x127867),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x5d4b06,_0x414fd3){const _0x36a341=[];for(const _0xfc6a6b of _0x414fd3){const _0x1b66b1=_0x5d4b06[_0xfc6a6b['index']];_0x1b66b1?_0x1b66b1['changes']['length']!==_0xfc6a6b['changes']['length']?_0x36a341['push'](_0xfc6a6b):_0x1b66b1['changes']['forEach']((_0x516660,_0x1c2af2)=>{const _0x391260=_0xfc6a6b['changes'][_0x1c2af2];_0x516660['id']!==_0x391260['id']&&_0x36a341['push'](_0xfc6a6b);}):_0x36a341['push'](_0xfc6a6b);}return _0x36a341;}['updateChangeGroups'](){const _0x125532=new _0x309db4('p',{},[new _0x309db4('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x28e1e3(m(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x53ab77=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x125532,'cutAfterLastChange':!this['isDone']});if(!_0x53ab77['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x53ab77['parsedContent'];let _0x4ec0ea=[];if(_0x51c105(_0x8adffc=>{const _0x595ae4=q(_0x8adffc,'data-id');if(!_0x595ae4||!_0x5b69cd(_0x595ae4))return!0x1;const _0x5ef227=[_0x8adffc,...Ke(_0x8adffc)]['at'](-0x2);if(_0x8adffc!=_0x5ef227){const _0x36dcfb=q(_0x5ef227,'data-id');_0x5b69cd(_0x36dcfb)||(_0x4ec0ea['push']({'node':_0x5ef227,'id':_0x36dcfb,'type':'modified'}),_0x53ab77['modifiedNodeIds']['push'](_0x36dcfb));}else _0x53ab77['modifiedNodeIds']['includes'](_0x595ae4)?_0x4ec0ea['push']({'node':_0x8adffc,'type':'modified','id':_0x595ae4}):_0x53ab77['newNodeIds']['includes'](_0x595ae4)?_0x4ec0ea['push']({'node':_0x8adffc,'type':'new','id':_0x595ae4,'anchorId':q(_0x8adffc['previousSibling'],'data-id')}):_0x4ec0ea['push']({'node':_0x8adffc,'type':'removed','id':_0x595ae4});return!0x0;},this['parsedMergedContent']),_0x4ec0ea=_0x4ec0ea['filter'](({node:_0x23483c})=>[...Ke(_0x23483c),_0x23483c]['every'](_0x4944e3=>!q(_0x4944e3,'data-unstable'))),0x0==_0x4ec0ea['length'])return;const _0x550d33=[[_0x4ec0ea[0x0]]];for(let _0xe8ac38=0x1;_0xe8ac38<_0x4ec0ea['length'];_0xe8ac38++){const _0x363a50=_0x550d33[_0x550d33['length']-0x1],_0x38f3b2=_0x363a50[_0x363a50['length']-0x1];_0x4ec0ea[_0xe8ac38]['node']['previousSibling']==_0x38f3b2['node']&&'modified'!=_0x4ec0ea[_0xe8ac38]['type']&&'modified'!=_0x38f3b2['type']?_0x363a50['push'](_0x4ec0ea[_0xe8ac38]):_0x550d33['push']([_0x4ec0ea[_0xe8ac38]]);}for(const _0xe6cb29 of _0x550d33){const _0x1960ff=_0xe6cb29[0x0],_0x4713ef=_0xe6cb29[_0xe6cb29['length']-0x1],_0xa8d44b=_0x5cb674(_0x1960ff['node']['previousSibling']);_0xa8d44b&&_0xe6cb29['unshift'](_0xa8d44b);const _0x386040=_0x5cb674(_0x4713ef['node']['nextSibling']);_0x386040&&_0xe6cb29['push'](_0x386040);}function _0x5b69cd(_0x32384f){return _0x53ab77['modifiedNodeIds']['includes'](_0x32384f)||_0x53ab77['newNodeIds']['includes'](_0x32384f)||_0x53ab77['removedNodeIds']['includes'](_0x32384f);}function _0x5cb674(_0x138178){if(_0x138178&&q(_0x138178,'data-id')&&!q(_0x138178,'data-unstable')){const _0x591b00=q(_0x138178,'data-id');if(!_0x5b69cd(_0x591b00))return{'node':_0x138178,'type':'context','id':_0x591b00};}return null;}this['changeGroups']=_0x550d33['map']((_0x32c653,_0x151292)=>({'changes':_0x32c653,'state':'pending','index':_0x151292}));}}const zt=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class qt extends Ft(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x2dc890,editor:_0x4b6d2b}){super(),this['id']=_0x3e4e8c(),this['connector']=_0x2dc890,this['isStopped']=!0x0,this['editor']=_0x4b6d2b;}async['start'](){const _0x1054e0=[];let _0x3f3b3d,_0x2630d7,_0x131794;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x230b77=await this['currentRequest']['getStream']();for await(const _0x533be1 of _0x230b77){if(this['isStopped'])return;if('error'==_0x533be1['event'])return void this['fire']('error',{'error':new _0x1500e8('ai-chat-interaction-error',this)});switch(_0x533be1['event']){case'message-metadata':this['messageId']=_0x533be1['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x533be1['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x533be1['data']['conversationTitle'],!0x0);break;case'source':_0x1054e0['push'](_0x533be1['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x3f3b3d='modification-delta'==_0x533be1['event']?'modification':'text',_0x2630d7='modification-delta'==_0x533be1['event']?_0x533be1['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x3f3b3d&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x3f3b3d,'interactionId':this['id'],'id':_0x2630d7}),'modification'==_0x3f3b3d&&(this['currentReply']['sources']=_0x1054e0['splice'](0x0))),this['currentReply']['appendContent'](_0x533be1['data']['textDelta']);break;case'mcp-tool-result':_0x131794=JSON['parse'](_0x533be1['data']['result']),this['_handleToolResultData']({'toolName':_0x533be1['data']['toolName'],'data':_0x131794['data'],'attributes':_0x131794['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x533be1['data']['toolName'],'data':_0x533be1['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x1054e0['length']>0x0&&(this['currentReply']['sources']=_0x1054e0['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x20a768){return this['replies']['find'](_0x1d3b33=>_0x1d3b33['id']===_0x20a768);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x2fd547=>_0x2fd547['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x4e0263){const _0x2d161d=new pe({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x4e0263});return this['replies']['push'](_0x2d161d),_0x2d161d['delegate'](...zt)['to'](this),this['fire']('replyCreated',_0x2d161d),_0x2d161d;}['setConversationTitle'](_0x45fa3d,_0x42f17b=!0x1){this['fire']('setConversationTitle',_0x45fa3d,_0x42f17b);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x45f591){this['fire']('toolDataReceived',{'type':'result','toolName':_0x45f591['toolName'],'data':structuredClone(_0x45f591['data']||{}),'attributes':structuredClone(_0x45f591['attributes']||{})},this);}['_handleToolNotificationData'](_0x16c6de){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x16c6de['toolName'],'data':structuredClone(_0x16c6de['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Jt=function(_0x3143cd){return _0x3143cd['TOOL']='mcp-tool-context',_0x3143cd['FILE']='file',_0x3143cd['DOCUMENT']='document',_0x3143cd['URL']='web-resource',_0x3143cd['TEXT']='text',_0x3143cd['SELECTION']='selection',_0x3143cd;}({}),Xt=function(_0x4b4e48){return _0x4b4e48['TEXT']='text',_0x4b4e48['MARKDOWN']='markdown',_0x4b4e48['HTML']='html',_0x4b4e48;}({});const Yt=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),xe=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class be extends Vt(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x25268f,config:_0x518782,ownerId:_0x41beda}){super(),this['_connector']=_0x25268f,this['_config']=_0x518782,this['_ownerId']=_0x41beda;}['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'](_0x32f0fe){const _0x3779d5=await this['_createContextItemFromContent'](_0x32f0fe);return this['_addToConversationContextItem'](_0x3779d5),'current-document'===_0x3779d5['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x3779d5;}async['_createContextItemFromContent'](_0x3b0a80){if(_0x3b0a80['type']===Jt['DOCUMENT']){const _0x5034c3=await this['_connector']['fetchDocument'](this['_ownerId'],_0x3b0a80['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x3b0a80['type'],'content':_0x5034c3['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x5034c3['attributes']?.['version'],'sessionId':_0x5034c3['attributes']?.['sessionId']};}if(_0x3b0a80['type']===Jt['TOOL'])return{'id':_0x3b0a80['id'],'uiId':_0x3b0a80['id'],'label':_0x3b0a80['data']?.['label']||_0x3b0a80['id'],'type':Jt['TOOL'],'mcpServerName':_0x3b0a80['mcpServerName'],'toolName':_0x3b0a80['toolName'],'data':_0x3b0a80['data']||{}};return{'id':_0x3b0a80['id'],'uiId':_0x3b0a80['id'],'label':_0x3b0a80['attributes']?.['label']||_0x3b0a80['name']||_0x3b0a80['url']||_0x3b0a80['id'],'type':_0x3b0a80['type'],..._0x3b0a80?.['attributes']?.['resourceId']?{'resourceId':_0x3b0a80['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x173db5){const _0x139786=this['_pendingContextItems']['get'](_0x173db5);_0x139786?.['isReadOnly']||this['_removeContextItem'](_0x173db5);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x46a829 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x46a829['uiId']);const _0x344905=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x344905&&this['_addContextItem']({..._0x344905,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x3f2a9a){for(const _0xce962a of _0x3f2a9a['values']())this['_addToConversationContextItem'](_0xce962a);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'](_0x107901){return Array['from'](_0x107901['values']())['map'](_0x2eff93=>this['_mapContextItemToRequestData'](_0x2eff93))['filter'](_0x46a452=>null!==_0x46a452);}async['addFilesToContext'](_0x3dc3b0,_0x202441,_0x5b17cc=Jt['FILE']){const _0xbe6d63='files-'+_0x3e4e8c();this['_startUploadOperation'](_0xbe6d63);try{await Promise['all'](_0x3dc3b0['map'](async _0x4ffdf1=>{const _0x5b4b69='file-'+_0x3e4e8c(),_0x1cfdad=Wt(_0x4ffdf1['name']);try{this['_addContextItem']({'type':_0x5b17cc,'label':_0x202441?.['label']||_0x1cfdad,'uiId':_0x5b4b69,'resourceId':_0x202441?.['resourceId']},!0x0);const _0x54e418=this['_connector']['uploadFile'](this['_ownerId'],_0x4ffdf1,_0x202441);this['_ongoingUploads']['set'](_0x5b4b69,_0x54e418['abortController']);const {id:_0x11a194}=await _0x54e418['getId']();this['_ongoingUploads']['delete'](_0x5b4b69),this['_finishContextItemLoading']({'type':_0x5b17cc,'id':_0x11a194,'label':_0x202441?.['label']||_0x1cfdad,'uiId':_0x5b4b69,'resourceId':_0x202441?.['resourceId']},!0x1);}catch(_0x4f41e3){this['_ongoingUploads']['delete'](_0x5b4b69);if(!(_0x4f41e3 instanceof _0x1500e8&&_0x4f41e3['message']['startsWith']('ai-request-aborted'))){const _0x35a420=Yt['get'](_0x4f41e3['code'])||'ai-chat-file-upload-failed',_0x462769=new _0x1500e8(_0x35a420,null,{'fileName':_0x1cfdad,..._0x4f41e3});_0x462769['stack']=_0x4f41e3['stack'],this['fire']('error',{'error':_0x462769});}this['_removeContextItem'](_0x5b4b69);}}));}finally{this['_finishUploadOperation'](_0xbe6d63);}}['addCurrentDocumentToContext'](_0x437b85){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x5186a7={'type':Jt['DOCUMENT'],'uiId':'current-document','label':_0x437b85,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x5186a7);}async['updateCurrentDocument'](_0xcf690c,_0x283b67,_0x472c38,_0xad8a35){const _0x40e6cd=this['_pendingContextItems']['get']('current-document');if(_0x40e6cd&&_0xcf690c){_0x40e6cd['selection']=_0xad8a35?_0xad8a35['map'](_0x222eb1=>({'start':_0x222eb1['start'],'end':_0x222eb1['end']})):[];try{if(_0x40e6cd['version']===_0x283b67)return;const {id:_0x208813}=await this['_connector']['uploadDocument'](this['_ownerId'],_0xcf690c,{'version':_0x283b67,'sessionId':_0x472c38})['getId']();_0x40e6cd['id']=_0x208813,_0x40e6cd['content']=_0xcf690c,_0x40e6cd['version']=_0x283b67,_0x40e6cd['sessionId']=_0x472c38;}catch(_0x14f9c2){const _0x3d5d6b=new _0x1500e8('ai-chat-document-upload-failed',null);_0x3d5d6b['stack']=_0x14f9c2['stack'],this['fire']('error',{'error':_0x3d5d6b});}}}['addSelectionToContext'](_0x4937c1){this['_addContextItem']({'type':Jt['SELECTION'],'label':_0x4937c1,'uiId':'selection','content':_0x4937c1});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x2a072c,_0x3f3063){const _0x3de2b5='url-'+_0x3e4e8c();this['_startUploadOperation'](_0x3de2b5);const _0x4f7fa0='url-'+_0x3e4e8c();try{this['_addContextItem']({'type':Jt['URL'],'label':_0x3f3063?.['label']||_0x2a072c,'uiId':_0x4f7fa0,'resourceId':_0x3f3063?.['resourceId']},!0x0);const _0x577811=this['_connector']['uploadUrl'](this['_ownerId'],_0x2a072c,_0x3f3063);this['_ongoingUploads']['set'](_0x4f7fa0,_0x577811['abortController']);const {id:_0x111b96}=await _0x577811['getId']();this['_ongoingUploads']['delete'](_0x4f7fa0),this['_finishContextItemLoading']({'type':Jt['URL'],'id':_0x111b96,'label':_0x3f3063?.['label']||_0x2a072c,'uiId':_0x4f7fa0,'resourceId':_0x3f3063?.['resourceId']},!0x1);}catch(_0x5ab03f){this['_ongoingUploads']['delete'](_0x4f7fa0),(_0x5ab03f['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x1500e8('ai-chat-url-upload-failed',this,{'url':_0x2a072c,'originalError':_0x5ab03f}),'url':_0x2a072c}),this['_removeContextItem'](_0x4f7fa0));}finally{this['_finishUploadOperation'](_0x3de2b5);}}['addToolItemToContext'](_0x51034b){_0x51034b['id']=_0x51034b['id']??_0x3e4e8c()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x51034b['uiId'],_0x51034b),this['fire']('contextItemAdded',{'contextItem':_0x51034b,'isLoading':!0x1});}async['loadSourceResources'](_0x490132,_0x2ad32e,_0x4e0a97){const _0x2d8c27=this['_addContextOptionsState']['sources']['find'](_0x48c0bc=>_0x48c0bc['id']===_0x490132);if(!_0x2d8c27)return this['fire']('error',{'error':new _0x1500e8('ai-chat-source-not-found',this,{'sourceId':_0x490132}),'sourceId':_0x490132}),[];try{const _0x9f197d=(await _0x2d8c27['getResources'](_0x2ad32e))['map'](_0x1635fb=>{const _0x3ed9ac=this['_isResourceInContext'](_0x1635fb['id']);return{..._0x1635fb,'isInContext':_0x3ed9ac};});return _0x2d8c27['resources']=_0x9f197d,this['fire']('sourceResourcesLoaded',{'sourceId':_0x490132,'source':_0x2d8c27,'resources':_0x9f197d,'uid':_0x4e0a97}),_0x9f197d;}catch(_0x2cbf2b){return this['fire']('error',{'error':new _0x1500e8('ai-chat-source-resources-load-failed',this,{'sourceId':_0x490132,'originalError':_0x2cbf2b}),'sourceId':_0x490132,'sourceLabel':_0x2d8c27['label']}),[];}}async['addResourceToContext'](_0x4ee8ed,_0x4d8b50){if(this['_isResourceInContext'](_0x4d8b50['id']))return;let _0x3c24c8=_0x4d8b50['data'];if(!_0x3c24c8&&_0x4ee8ed['getData'])try{_0x3c24c8=await _0x4ee8ed['getData'](_0x4d8b50['id']);}catch(_0x28f2b7){return void this['fire']('error',{'error':new _0x1500e8('ai-chat-resource-load-failed',this,{'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id'],'originalError':_0x28f2b7}),'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id']});}if(_0x3c24c8)switch(_0x4d8b50['type']){case Jt['URL']:if('string'!=typeof _0x3c24c8)return void this['fire']('error',{'error':new _0x1500e8('ai-chat-context-invalid-data',this,{'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id'],'expectedType':'string','actualType':typeof _0x3c24c8}),'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id']});await this['addUrlToContext'](_0x3c24c8,{'label':_0x4d8b50['label'],'resourceId':_0x4d8b50['id']});break;case Jt['FILE']:if(!(_0x3c24c8 instanceof File))return void this['fire']('error',{'error':new _0x1500e8('ai-chat-context-invalid-data',this,{'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id'],'expectedType':'File','actualType':typeof _0x3c24c8}),'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id']});await this['addFilesToContext']([_0x3c24c8],{'label':_0x4d8b50['label'],'resourceId':_0x4d8b50['id']});break;case Jt['TEXT']:if('object'!=typeof _0x3c24c8||!('content'in _0x3c24c8)||!('type'in _0x3c24c8))return void this['fire']('error',{'error':new _0x1500e8('ai-chat-context-invalid-data',this,{'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x3c24c8}),'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id']});_0x3c24c8=be['_convertTextResourceToFile'](_0x3c24c8,_0x4d8b50['label']),await this['addFilesToContext']([_0x3c24c8],{'label':_0x4d8b50['label'],'resourceId':_0x4d8b50['id']},Jt['TEXT']);break;case Jt['TOOL']:break;default:this['fire']('error',{'error':new _0x1500e8('ai-chat-context-unsupported-type',this,{'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id'],'resourceType':_0x4d8b50['type']}),'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id']});}else this['fire']('error',{'error':new _0x1500e8('ai-chat-resource-no-data',this,{'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id']}),'resourceId':_0x4d8b50['id'],'sourceId':_0x4ee8ed['id']});}static['_convertTextResourceToFile'](_0x515586,_0x4d2189){switch(_0x515586['type']){case Xt['MARKDOWN']:return new File([_0x515586['content']],_0x4d2189,{'type':'text/markdown'});case Xt['HTML']:return new File([_0x515586['content']],_0x4d2189,{'type':'text/html'});default:return new File([_0x515586['content']],_0x4d2189,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x5703b6){switch(_0x5703b6['type']){case Jt['FILE']:return{'type':Jt['FILE'],'id':_0x5703b6['id']};case Jt['URL']:return{'type':Jt['URL'],'id':_0x5703b6['id']};case Jt['DOCUMENT']:return{'type':Jt['DOCUMENT'],'id':_0x5703b6['id'],..._0x5703b6['selection']?.['length']&&{'selection':_0x5703b6['selection']}};case Jt['TEXT']:return{'type':Jt['FILE'],'id':_0x5703b6['id']};case Jt['TOOL']:{const _0x25b487=_0x5703b6;return{'type':Jt['TOOL'],'mcpServerName':_0x25b487['mcpServerName'],'toolName':_0x25b487['toolName'],'data':_0x25b487['data'],'id':_0x25b487['id']};}default:return null;}}['_addContextItem'](_0x1f3e05,_0x5c35cc=!0x1){if(this['_pendingContextItems']['set'](_0x1f3e05['uiId'],_0x1f3e05),_0x1f3e05['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x1f3e05,'isLoading':_0x5c35cc}),'current-document'===_0x1f3e05['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x1f3e05['resourceId']){const _0x21a8bc=this['_findSourceIdsByResourceId'](_0x1f3e05['resourceId']);_0x21a8bc&&_0x21a8bc['forEach'](_0x249de7=>{this['_updateResourceInContextState'](_0x249de7,_0x1f3e05['resourceId'],!0x0);});}}['_removeContextItem'](_0x5daf02){const _0x56855b=this['_pendingContextItems']['get'](_0x5daf02),_0x23b0d0=this['_ongoingUploads']['get'](_0x5daf02);if(_0x23b0d0&&(_0x23b0d0['abort'](),this['_ongoingUploads']['delete'](_0x5daf02)),_0x56855b?.['resourceId']){const _0x3c14c1=this['_findSourceIdsByResourceId'](_0x56855b['resourceId']);_0x3c14c1&&_0x3c14c1['forEach'](_0x97bcaf=>{this['_updateResourceInContextState'](_0x97bcaf,_0x56855b['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x5daf02),this['fire']('contextItemRemoved',{'uiId':_0x5daf02,'type':_0x56855b?.['type']}),'current-document'===_0x5daf02&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x56f110,_0x59ac9e){if(this['_pendingContextItems']['has'](_0x56f110['uiId'])&&(this['_pendingContextItems']['set'](_0x56f110['uiId'],_0x56f110),this['fire']('contextItemLoadingEnded',{'contextItem':_0x56f110,'isLoading':_0x59ac9e}),_0x56f110['resourceId'])){const _0x411786=this['_findSourceIdsByResourceId'](_0x56f110['resourceId']);_0x411786&&_0x411786['forEach'](_0x9494e6=>{this['_updateResourceInContextState'](_0x9494e6,_0x56f110['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x4ae8e2){this['_conversationContextItems']['set'](_0x4ae8e2['uiId'],_0x4ae8e2);}['_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'](),'customItems':this['_config']?.['customItems']?.['map'](_0x3c0434=>({..._0x3c0434,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x20ac62=>({..._0x20ac62,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x234232=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x234232,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x1c018d){for(const _0x1bcf14 of this['_pendingContextItems']['values']())if(_0x1bcf14['resourceId']===_0x1c018d)return!0x0;for(const _0x3759d0 of this['_conversationContextItems']['values']())if(_0x3759d0['resourceId']===_0x1c018d)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x39390d){const _0xa56e01=[];for(const _0x3f29d5 of this['_addContextOptionsState']['sources']){_0x3f29d5['resources']['find'](_0x5acff4=>_0x5acff4['id']===_0x39390d)&&_0xa56e01['push'](_0x3f29d5['id']);}return 0x0===_0xa56e01['length']?null:_0xa56e01;}['_updateResourceInContextState'](_0x43a336,_0x10e169,_0x28cbb3){const _0x15617c=this['_addContextOptionsState']['sources']['find'](_0x22b3d2=>_0x22b3d2['id']===_0x43a336);if(!_0x15617c)return;const _0x31405f=_0x15617c['resources']['find'](_0x22cd6e=>_0x22cd6e['id']===_0x10e169);_0x31405f&&(_0x31405f['isInContext']=_0x28cbb3,this['fire']('resourceStateChanged',{'sourceId':_0x43a336,'resourceId':_0x10e169,'isInContext':_0x28cbb3}));}['_startUploadOperation'](_0x51cf7c){this['_ongoingUploadOperations']['set'](_0x51cf7c,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x2a7020){this['_ongoingUploadOperations']['delete'](_0x2a7020),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Me=['capabilitiesUpdated'];class ye extends Ft(){['_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'](_0x1f9957){const _0x5e45ff={};return _0x1f9957&&_0x1f9957['isWebSearchEnabled']&&(_0x5e45ff['webSearch']={}),_0x1f9957&&_0x1f9957['isReasoningEnabled']&&(_0x5e45ff['reasoning']={}),_0x5e45ff;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x4b147d){_0x4b147d!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x4b147d,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x372067){_0x372067!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x372067,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Se extends qt{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x3b74d5){super(_0x3b74d5),this['conversationId']=_0x3b74d5['conversationId'],this['contextItems']=_0x3b74d5['contextItems'],this['capabilities']=_0x3b74d5['capabilities'],this['userMessage']=_0x3b74d5['userMessage'],this['model']=_0x3b74d5['model'],this['attributes']=_0x3b74d5['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':be['mapContextItemsToRequestData'](this['contextItems']),'capabilities':ye['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class F extends Ft(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x4cb5ea){super(),this['options']=_0x4cb5ea,this['connector']=_0x4cb5ea['connector'],this['chatModels']=_0x4cb5ea['chatModels'],this['id']=_0x4cb5ea['conversationId'],this['isFromHistory']=_0x4cb5ea['isFromHistory'];}async['init'](_0x26baa7){try{this['chatContext']=new be({'connector':this['connector'],'config':_0x26baa7,'ownerId':this['id']}),this['chatContext']['delegate'](...xe)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new ye(),this['chatCapabilities']['delegate'](...Me)['to'](this),this['chatCapabilities']['init']();const _0x3befb9=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x3befb9});const _0x2f8d66=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x2f8d66&&await this['setModel'](_0x2f8d66);}catch(_0x40180e){const _0x24c9dd=new _0x1500e8('ai-chat-conversation-init-failed',null,{'message':_0x40180e['message']||_0x40180e});_0x24c9dd['stack']=_0x40180e['stack'],this['fire']('error',{'error':_0x24c9dd});}}async['start'](){if(this['isStarted'])throw new _0x1500e8('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x1500e8('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x396cff}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x396cff,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x39e130){const _0x550a58=new _0x1500e8('ai-chat-conversation-start-failed',null,{'message':_0x39e130['message'],'conversationId':this['id']});throw _0x550a58['stack']=_0x39e130['stack'],this['fire']('error',{'error':_0x550a58}),_0x550a58;}}async['load'](_0x1d3b46,_0x490092){try{const _0x1b35aa=await this['connector']['fetchConversation'](_0x1d3b46)['getConversation'](),_0xc916e8=await this['connector']['fetchConversationMessages'](_0x1d3b46)['getMessages'](),_0x3563ed=_0xc916e8[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x1b35aa['id'],'title'in _0x1b35aa?this['fire']('setConversationTitle',_0x1b35aa['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0xea4208=(await this['chatModels']['getAll']())['find'](_0x33ea9f=>_0x33ea9f['id']['toLowerCase']()===_0x3563ed['toLowerCase']());return this['selectedModel']=_0xea4208,this['fire']('modelSelected',{'selectedModel':_0xea4208,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0xc916e8,_0x490092,_0x3563ed),this['currentInteraction']=void 0x0,this;}catch(_0x4803b3){const _0x100f31=new _0x1500e8('ai-chat-conversation-init-from-id-failed',null,{'message':_0x4803b3['message'],'conversationId':_0x1d3b46});throw _0x100f31['stack']=_0x4803b3['stack'],this['fire']('error',{'error':_0x100f31}),_0x100f31;}}async['_processMessagesToInteractions'](_0x31a5a3,_0x1b9929,_0x3c559c){let _0x4da35e;for(const _0x31cb6c of _0x31a5a3)if('user'===_0x31cb6c['role']){const _0x256fb6=await this['_extractContextItems'](_0x31cb6c),_0x26cbe1={'isReasoningEnabled':Object['hasOwn'](_0x31cb6c['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x31cb6c['capabilities'],'webSearch')};_0x4da35e=this['createInteraction']({'userMessage':_0x31cb6c['prompt'],'contextItems':_0x256fb6,'capabilities':_0x26cbe1,'modelId':_0x3c559c,'attributes':_0x31cb6c['attributes']}),this['currentInteraction']=_0x4da35e,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x31cb6c['role']&&_0x4da35e){const _0x324181=[];for(const _0x18a370 of _0x31cb6c['content'])switch(_0x18a370['type']){case'text':case'modification':{const _0x4d4f64=_0x4da35e['getDocumentContext']()?.['sessionId']!==_0x1b9929;_0x4da35e['currentReply']=_0x4da35e['createReply']({'type':_0x18a370['type'],'isDone':!0x0,'interactionId':_0x4da35e['id'],'areActionsDisabled':_0x4d4f64}),_0x4da35e['currentReply']['appendContent'](_0x18a370['content']),_0x324181['length']>0x0&&(_0x4da35e['currentReply']['sources']=_0x324181['splice'](0x0));break;}case'url':_0x324181['push'](_0x18a370);break;case'mcp-tool-result':{const {data:_0x1acc05,attributes:_0x5bbb11}=JSON['parse'](_0x18a370['content']);_0x4da35e['_handleToolResultData']({'toolName':_0x18a370['toolName'],'data':_0x1acc05,'attributes':_0x5bbb11});break;}}}}}async['_extractContextItems'](_0x5fb04){const _0x2d8b4f=new Map();if(!_0x5fb04['content'])return _0x2d8b4f;for(const _0x2f468d of _0x5fb04['content']){const _0x2d4ab9=await this['chatContext']['populateFromMessage'](_0x2f468d);_0x2d4ab9&&_0x2d8b4f['set'](_0x2d4ab9['id'],_0x2d4ab9);}return _0x2d8b4f;}async['handleUserInteraction']({userMessage:_0x2a2863,attributes:_0x4740c2}){if(!this['isStarted'])throw new _0x1500e8('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x1500e8('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x5f4785=this['chatContext']['getPendingContextItems'](),_0x31984c=this['chatCapabilities']['getCapabilitiesConfig'](),_0x4950fd=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x2a2863,'contextItems':_0x5f4785,'capabilities':_0x31984c,'modelId':_0x4950fd,'attributes':_0x4740c2}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x555818){if(_0x555818 instanceof _0x1500e8)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x555818});else{const _0x293f61=Yt['get'](_0x555818['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x1500e8(_0x293f61,null,{'error':_0x555818})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x2dcdd3,contextItems:_0x3fb45c,capabilities:_0x315c39,modelId:_0x3c8bf5,attributes:_0x34ed8a}){const _0x26e80e=new Se({'userMessage':_0x2dcdd3,'contextItems':_0x3fb45c,'capabilities':_0x315c39,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x3c8bf5,'attributes':_0x34ed8a});return _0x26e80e['delegate'](...zt)['to'](this),this['interactions']['push'](_0x26e80e),this['fire']('interactionCreated',_0x26e80e),_0x26e80e;}['getInteraction'](_0x5efa59){return this['interactions']['find'](_0x22a0f4=>_0x22a0f4['id']===_0x5efa59);}['removeInteraction'](_0x3094a9){const _0x458c78=this['getInteraction'](_0x3094a9);_0x458c78&&(_0x458c78['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x458c78),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x46c9ed){this['chatContext']['addCurrentDocumentToContext'](_0x46c9ed);}async['updateCurrentDocumentInContext']({content:_0x380a3c,version:_0x102b32,sessionId:_0x2e23a7,selections:_0x1cb025}){await this['chatContext']['updateCurrentDocument'](_0x380a3c,_0x102b32,_0x2e23a7,_0x1cb025);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x24e8bd){this['chatContext']['addSelectionToContext'](_0x24e8bd);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x40d382){this['chatContext']['addFilesToContext'](_0x40d382);}['addUrlToContext'](_0x38b5e3){this['chatContext']['addUrlToContext'](_0x38b5e3);}['addToolItemToContext'](_0x41c084){this['chatContext']['addToolItemToContext'](_0x41c084);}['addResourceToContext'](_0x2b8a59,_0x54da1a){this['chatContext']['addResourceToContext'](_0x2b8a59,_0x54da1a);}['loadSourceResources'](_0x536c6c,_0x1b1e30,_0x52f6db){return this['chatContext']['loadSourceResources'](_0x536c6c,_0x1b1e30,_0x52f6db);}['removeFromContext'](_0x385455){this['chatContext']['removeFromContext'](_0x385455);}['setWebSearch'](_0x3b1709){this['chatCapabilities']['setWebSearch'](_0x3b1709);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x45ee20){this['chatCapabilities']['setReasoning'](_0x45ee20);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x18ec66){_0x18ec66?!0x1===await this['chatModels']['isAvailable'](_0x18ec66)&&(Zt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x18ec66}),_0x18ec66=(await this['chatModels']['getAvailableModels']())[0x0]):(Zt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x18ec66=(await this['chatModels']['getAvailableModels']())[0x0]),_0x18ec66['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x18ec66,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x18ec66}));}}class X extends Ft(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x10c746,config:_0x292c0d,locale:_0x4e3a9f}){super(),this['_connector']=_0x10c746,this['_config']=_0x292c0d,this['_locale']=_0x4e3a9f;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()),this['_modelsRequest'];}async['getAvailableModels'](){const _0x53d2a9=await this['getAll']();let _0x1daa9b;return _0x1daa9b=this['_availableModels']?this['_filterModels'](_0x53d2a9,this['_availableModels']):_0x53d2a9['filter'](_0x52405b=>_0x52405b['recommended']),_0x1daa9b;}async['getModel'](_0xfa4685){const _0x528baa=await this['getAll']();if(!_0x528baa['length'])return null;if(_0xfa4685){const _0x2ac4bd=this['_getModelById'](_0x528baa,_0xfa4685);if(_0x2ac4bd)return _0x2ac4bd;Zt('ai-chat-model-id-unrecognized',{'modelId':_0xfa4685,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x3e88e8=await this['getAvailableModels']();if(!_0x3e88e8['length'])return null;if(this['_defaultModelId']){const _0x296680=this['_getModelById'](_0x3e88e8,this['_defaultModelId']);if(_0x296680)return _0x296680;Zt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x3e88e8[0x0]['id']});}return _0x3e88e8[0x0];}async['isAvailable'](_0x5b1cc5){return(await this['getAvailableModels']())['some'](_0x5b1e38=>_0x5b1e38['name']===_0x5b1cc5['name']&&_0x5b1e38['provider']===_0x5b1cc5['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x5c0816=this['_locale']['uiLanguage']||'en',_0xf12fce=this['_connector']['getModels'](_0x5c0816),_0x37905f=await _0xf12fce['list']();this['_modelList']=_0x37905f['items']['map'](_0x115dbd=>ze(_0x115dbd)?{..._0x115dbd,'name':m(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x115dbd);}catch(_0x44cbdd){throw _0x4dee23('ai-models-unable-to-retrieve',{'error':_0x44cbdd}),_0x44cbdd;}return[...this['_modelList']];}['_filterModels'](_0x256bc1,_0x4915c5){let _0x3e4f23;if(_0x4915c5){_0x3e4f23=[];const _0x31e281=new Set(),_0x85be8d='string'==typeof _0x4915c5?[_0x4915c5['toLocaleLowerCase']()]:_0x4915c5['map'](_0xd01aad=>_0xd01aad['toLocaleLowerCase']());for(const _0x2a84ad of _0x85be8d)for(const _0x37e335 of _0x256bc1)!_0x31e281['has'](_0x37e335['id'])&&this['_isMatchingFilter'](_0x37e335,_0x2a84ad)&&(_0x3e4f23['push'](_0x37e335),_0x31e281['add'](_0x37e335['id']));}else _0x3e4f23=_0x256bc1;return _0x3e4f23;}['_isMatchingFilter'](_0x1a3e75,_0x1ae01c){const _0x106823=_0x1a3e75['id']['toLocaleLowerCase'](),_0x5b604c=_0x1a3e75['name']['toLocaleLowerCase'](),_0x48729b=_0x1a3e75['provider']['toLocaleLowerCase']();return _0x106823===_0x1ae01c||_0x5b604c===_0x1ae01c||ze(_0x1a3e75)&&'auto'===_0x1ae01c||_0x48729b===_0x1ae01c||_0x106823['startsWith'](_0x1ae01c);}['_getModelById'](_0x48de18,_0x5491ab){return _0x48de18['find'](_0x145619=>ze(_0x145619)&&'auto'===_0x5491ab?_0x145619:_0x145619['id']===_0x5491ab)||null;}}function ze(_0xa13998){return _0xa13998['id']['startsWith']('agent');}function D(_0x4e79ab){if(_0x4e79ab instanceof _0x5a6451)return _0x4e79ab;if(_0x4e79ab?.['editors']&&_0x4e79ab['editors']['get'](0x0))return _0x4e79ab['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.'),_0x4e79ab['editors']['get'](0x0);throw new _0x1500e8('ai-get-editor-from-context-no-editor');}function y({editor:_0x115f37,interaction:_0x1f09cd,reply:_0x74b28e,groups:_0x2d4a9f,transform:_0x589fcc,documentCompare:_0x3aa300,documentCompareOptions:_0x5664a5}){const _0x209c10=_0x1f09cd['getDocumentContext']();if(!_0x209c10)return[];const _0x52cc87=_0x209c10['content'],_0x25ffcc=_0x209c10['version'],_0x534696=_0x74b28e['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x1ce9db}of _0x2d4a9f){const _0x4e1d60=_0x1ce9db['filter'](_0x43a446=>'new'!=_0x43a446['type'])['map'](_0x1bdb66=>Z('data-id',_0x1bdb66['id'],_0x534696)),_0x5769e4=_0x1ce9db['filter'](_0x3bd228=>'removed'!=_0x3bd228['type'])['map'](_0x20a725=>_0x20a725['node']['cloneNode'](!0x0));let _0x179228=null;if(_0x4e1d60['length']){_0x179228=_0x4e1d60[0x0]['previousSibling'];for(let _0x3df406=0x0;_0x3df406<_0x4e1d60['length'];_0x3df406++)_0x7119c8(_0x4e1d60[_0x3df406]);}if(_0x5769e4['length']){_0x179228||(_0x1ce9db[0x0]['anchorId']?_0x179228=Z('data-id',_0x1ce9db[0x0]['anchorId'],_0x534696):(_0x179228=_0x5769e4['shift'](),_0x56829d(_0x534696,_0x179228)));for(let _0x1e8c4e=0x0;_0x1e8c4e<_0x5769e4['length'];_0x1e8c4e++)_0x4dcf7a(_0x179228,_0x5769e4[_0x1e8c4e]),_0x179228=_0x5769e4[_0x1e8c4e];}}const _0x231772=Y(_0x534696),_0x23304d=_0x3aa300['getDiff'](_0x52cc87,_0x231772,_0x5664a5)['getOperations']();if(_0x589fcc){const _0x1a52d7=_0x115f37['model']['document']['history']['getOperations'](_0x25ffcc),_0x2e4f3f={'document':_0x115f37['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x104b8e(_0x23304d,_0x1a52d7,_0x2e4f3f)['operationsA'];}return _0x23304d;}function d(_0xb99f27,_0xffa192){if('marker'!=_0xffa192['type'])return;const _0x1b7e68=_0xb99f27['model']['markers']['get'](_0xffa192['name']);_0x1b7e68&&(_0xffa192['oldRange']=_0x1b7e68['getRange']());}class x extends _0x37abb2{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[s,_0x4f58a6];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x4b2ab0(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new X({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x441d5b=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x516b25,_0x192065)=>{this['_handleUIUserMessage']({'userMessage':_0x192065});}),this['listenTo'](_0x441d5b,'resizedTabs',(_0x1f1d93,_0x4d6b35)=>{this['_setIsMaximized'](_0x4d6b35);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x441d5b['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x54e011,_0x4e5441)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x4e5441));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x31e878,_0x2518d9)=>{this['activeConversation']?.['addUrlToContext'](_0x2518d9);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x1c6caa,_0x26283d)=>{_0x26283d['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x3d488d,_0x31c184)=>{this['activeConversation']?.['addResourceToContext'](_0x31c184['source'],_0x31c184['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x18307e,_0x490a37)=>{this['_removeFromContext'](_0x490a37);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x29c485,_0x15400a)=>{this['activeConversation']?.['loadSourceResources'](_0x15400a['sourceId'],_0x15400a['query'],_0x15400a['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x15799f,_0x4fcacf)=>{this['activeConversation']?.['setModel'](_0x4fcacf);}),this['listenTo'](this['_aiChatUi'],'like',(_0x5ec921,{replyId:_0x5ca32e})=>{console['log']('Liked\x20response',_0x5ca32e);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x1acb4d,{replyId:_0x2366c7})=>{console['log']('Disliked\x20response',_0x2366c7);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x1abf7b,_0x405e81)=>{this['_insertSuggestion'](_0x405e81);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x1a0922,{replyId:_0xbc32b0,partIndex:_0x37c84f})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0xbc32b0,_0x37c84f);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x1427a9,{replyId:_0x19bad9,partIndex:_0x804ac3})=>{const _0x4f9ba3=this['_getDocumentRangeForReplyChanges'](_0x19bad9,_0x804ac3);_0x4f9ba3&&'$graveyard'!=_0x4f9ba3['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x4f9ba3['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x53c143,_0x2331fe)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x2331fe);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x39177b,{replyId:_0x2252ae,showDiff:_0x1bcbd9})=>{const {reply:_0x52f3d}=this['getInteractionAndReplyById'](_0x2252ae),_0x3daecc=_0x52f3d['getContentParts']({'showDiff':_0x1bcbd9});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x52f3d['id'],'parts':_0x3daecc,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x4322ef,{replyId:_0x1dbef4,partIndex:_0x117170})=>{this['_rejectSuggestion']({'replyId':_0x1dbef4,'partIndex':_0x117170}),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon'),this['set']('_aiChatBalloonShowDiff',!0x1),this['_aiChatBalloon']['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](this['_aiChatBalloon'],'toggleSuggestionDisplayMode',()=>{const {replyId:_0x3fdb9a,partIndex:_0x20d7c7}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x144efc}=this['getInteractionAndReplyById'](_0x3fdb9a),_0x43649f=_0x144efc['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x20d7c7});this['_aiChatBalloon']['updateContent']({'part':_0x43649f[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x323b1e,partIndex:_0x4f0fe2}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x323b1e,'partIndex':_0x4f0fe2}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x353280,partIndex:_0x5614e}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x353280,'partIndex':_0x5614e}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x4a209d,partIndex:_0x3aec92}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x4a209d,'partIndex':_0x3aec92}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x1b0baf,partIndex:_0x5862ba}=this['_currentPreviewedChangeGroup'],_0x1753ea=this['_getPresentableSiblingContentPartIndex'](_0x1b0baf,_0x5862ba,'next');null!==_0x1753ea&&this['_openBalloonFor'](_0x1b0baf,_0x1753ea);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0xbe135d,partIndex:_0x1d247e}=this['_currentPreviewedChangeGroup'],_0xbe93da=this['_getPresentableSiblingContentPartIndex'](_0xbe135d,_0x1d247e,'previous');null!==_0xbe93da&&this['_openBalloonFor'](_0xbe135d,_0xbe93da);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x4ecabb,{id:_0x2f137b})=>{if('aiChatBalloon'!==_0x2f137b)return;const {replyId:_0x2f62e7,partIndex:_0x310697}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x2f62e7,'index':_0x310697,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0x5a6451?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x440013,_0xc7143)=>{_0xc7143['on']('ready',()=>{this['_integrateEditor'](_0xc7143);});});const _0x4e917b=this['context']['config']['get']('ai.chat.initialConversation');let _0x138179=_0x4e917b;if('lastCreated'!=_0x4e917b||(_0x138179=await this['_getLastCreatedConversationId'](),_0x138179))return'new'==_0x138179?this['_startConversationSafely']():this['loadConversation'](_0x138179);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x423465){const _0x3ff092=D(this['context']);if(!_0x3ff092['plugins']['has']('TrackChanges'))throw new _0x1500e8('ai-no-track-changes',null);const _0xcc42fe=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x4d2ed5,interaction:_0x2ebf51}=this['getInteractionAndReplyById'](_0x423465['replyId']),_0x98d78c=this['_getDocumentRangeForReplyChanges'](_0x423465['replyId'],_0x423465['partIndex']),_0x123c31=void 0x0!==_0x423465['partIndex']?[_0x4d2ed5['changeGroups'][_0x423465['partIndex']]]:_0x4d2ed5['changeGroups']['filter'](_0x27276f=>'pending'==_0x27276f['state']),_0x7af6e6=_0x123c31['map'](_0x38dd85=>_0x4d2ed5['changeGroups']['indexOf'](_0x38dd85));if(!_0x98d78c||'$graveyard'==_0x98d78c['range']['root']['rootName'])return void _0x7af6e6['forEach'](_0x418860=>_0x4d2ed5['setChangeGroupState'](_0x418860,'outdated'));_0x7af6e6['forEach'](_0x2eec77=>_0x4d2ed5['setChangeGroupState'](_0x2eec77,'accepted'));const _0x3c66a3=y({'editor':_0x3ff092,'reply':_0x4d2ed5,'interaction':_0x2ebf51,'groups':_0x123c31,'transform':!0x0,'documentCompare':_0xcc42fe,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x3de377;_0x98d78c&&this['_scrollToSuggestionRange'](_0x98d78c['range']),_0x3ff092['model']['change'](_0x4b6e8e=>{_0x3de377=_0x4b6e8e['batch'],_0x3ff092['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3c66a3),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x3de377,{'interactionId':_0x2ebf51['id'],'replyId':_0x4d2ed5['id'],'indexes':_0x7af6e6['slice']()}),this['_updateRatings'](_0x4d2ed5);}['_applySuggestion'](_0x4e24d8){const _0x5ec2ec=D(this['context']),_0x4f87d9=this['context']['plugins']['get'](_0x4f58a6),{reply:_0x501332,interaction:_0x22da37}=this['getInteractionAndReplyById'](_0x4e24d8['replyId']),_0x59d42a=this['_getDocumentRangeForReplyChanges'](_0x4e24d8['replyId'],_0x4e24d8['partIndex']),_0x2f7ca4=void 0x0!==_0x4e24d8['partIndex']?[_0x501332['changeGroups'][_0x4e24d8['partIndex']]]:_0x501332['changeGroups']['filter'](_0x305813=>'pending'==_0x305813['state']),_0x25126e=_0x2f7ca4['map'](_0x367b6f=>_0x501332['changeGroups']['indexOf'](_0x367b6f));if(!_0x59d42a||'$graveyard'==_0x59d42a['range']['root']['rootName'])return void _0x25126e['forEach'](_0x14fc94=>_0x501332['setChangeGroupState'](_0x14fc94,'outdated'));_0x25126e['forEach'](_0x2794be=>_0x501332['setChangeGroupState'](_0x2794be,'accepted'));const _0x4d876e=y({'editor':_0x5ec2ec,'reply':_0x501332,'interaction':_0x22da37,'groups':_0x2f7ca4,'transform':!0x0,'documentCompare':_0x4f87d9,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x521f10;_0x59d42a&&this['_scrollToSuggestionRange'](_0x59d42a['range']),_0x5ec2ec['model']['change'](_0x22091a=>{_0x521f10=_0x22091a['batch'];for(const _0x3a5314 of _0x4d876e)_0x3a5314['baseVersion']=_0x5ec2ec['model']['document']['version'],d(_0x5ec2ec,_0x3a5314),_0x22091a['batch']['addOperation'](_0x3a5314),_0x5ec2ec['model']['applyOperation'](_0x3a5314);}),this['_batchToChanges']['set'](_0x521f10,{'interactionId':_0x22da37['id'],'replyId':_0x501332['id'],'indexes':_0x25126e['slice']()}),this['_updateRatings'](_0x501332);}['_rejectSuggestion'](_0xee1d30){const {reply:_0x122602}=this['getInteractionAndReplyById'](_0xee1d30['replyId']);_0x122602['setChangeGroupState'](_0xee1d30['partIndex'],'rejected');}['_openBalloonFor'](_0x511ecd,_0x46bc96){if(!this['_aiChatBalloon'])return;const {reply:_0x3f592f}=this['getInteractionAndReplyById'](_0x511ecd),_0x482fbd=_0x3f592f['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x4cc6eb,_0x14087b;if(void 0x0!==_0x46bc96?(_0x14087b=_0x482fbd['find'](_0x5a900b=>_0x5a900b['index']==_0x46bc96),_0x4cc6eb=_0x14087b?.['index']):(_0x14087b=_0x482fbd[0x0],_0x4cc6eb=_0x14087b['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x511ecd&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x4cc6eb)return;const _0x965fe6=this['_getUserPresentableContentPartDocumentRange'](_0x511ecd,_0x3f592f,_0x14087b);if(!_0x965fe6)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x511ecd,'partIndex':_0x4cc6eb},this['_scrollToSuggestionRange'](_0x965fe6,!0x0);const _0x487a7d=this['_getPresentableSiblingContentPartIndex'](_0x511ecd,_0x4cc6eb,'next');this['_aiChatBalloon']['updateContent']({'part':_0x14087b,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x4cc6eb,'title':m(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x4cc6eb+0x1)['toString']()),'showRotator':null!==_0x487a7d,'ranges':[_0x965fe6],'areActionsDisabled':_0x3f592f['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x511ecd,_0x4cc6eb),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x511ecd,'index':_0x4cc6eb,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x4fcdb9,_0x1eb333,_0x1362a6){const {reply:_0x414a2a}=this['getInteractionAndReplyById'](_0x4fcdb9),_0x16de30=_0x414a2a['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x16de30['length'])return null;const _0x3a73a2=_0x16de30['findIndex'](_0x269543=>_0x269543['index']==_0x1eb333),_0x2b77a2='next'==_0x1362a6?0x1:-0x1;let _0x26b430=_0x16de30['at']((_0x3a73a2+_0x2b77a2)%_0x16de30['length'])['index'],_0x1b294b=_0x16de30[_0x26b430];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x4fcdb9,_0x414a2a,_0x1b294b);){if(_0x26b430=_0x16de30['at']((_0x26b430+_0x2b77a2)%_0x16de30['length'])['index'],_0x26b430===_0x3a73a2)return null;_0x1b294b=_0x16de30[_0x26b430];}return _0x26b430;}['_getUserPresentableContentPartDocumentRange'](_0x2e3b36,_0x4c460d,_0x59afeb){const _0x4c9e1c=_0x4c460d['changeGroups'];if(!_0x59afeb['hasChanges'])return null;const _0xe98bdb=_0x4c9e1c['find'](_0x1cc56c=>_0x1cc56c['index']==_0x59afeb['index']);if('pending'!==_0xe98bdb?.['state'])return null;const _0x370f7c=this['_getDocumentRangeForReplyChanges'](_0x2e3b36,_0x59afeb['index']);if(!_0x370f7c)return null;const {range:_0x408b05,currentIndex:_0x1ae86d}=_0x370f7c;return'$graveyard'==_0x408b05['root']['rootName']?(_0x4c460d['setChangeGroupState'](_0x1ae86d,'outdated'),null):_0x370f7c['range'];}['_getDocumentRangeForReplyChanges'](_0x152363,_0x85916c){const _0x451372=D(this['context']),{reply:_0x3e3921,interaction:_0x585f3c}=this['getInteractionAndReplyById'](_0x152363),_0x1e321a=_0x3e3921['changeGroups']['filter'](_0x101891=>'pending'==_0x101891['state']),_0x58f45e=_0x1e321a['map'](_0x272c0a=>_0x3e3921['changeGroups']['indexOf'](_0x272c0a));void 0x0===_0x85916c&&(_0x85916c=_0x58f45e[0x0]);const _0x1c2610=_0x58f45e['indexOf'](_0x85916c);if(-0x1==_0x1c2610)return null;const _0x3da5e7=_0x1e321a[_0x1c2610],_0x87668c=new _0x175d6b([]),_0x496273=new _0x175d6b([]);for(const _0xd65080 of _0x3da5e7['changes'])if('removed'!=_0xd65080['type']&&_0x496273['children']['push'](_0xd65080['node']['cloneNode'](!0x0)),'new'!=_0xd65080['type']){const _0x1dad29=_0x32e3c1(_0x1ef5fc=>q(_0x1ef5fc,'data-id')==_0xd65080['id'],_0x3e3921['documentContextContent'],!0x0);_0x87668c['children']['push'](_0x1dad29['cloneNode'](!0x0));}if(0x0==_0x87668c['children']['length']){if(_0x3da5e7['changes'][0x0]['anchorId']){const _0x117dda=Z('data-id',_0x3da5e7['changes'][0x0]['anchorId'],_0x3e3921['documentContextContent']);_0x87668c['children']['unshift'](_0x117dda['cloneNode'](!0x0)),_0x496273['children']['unshift'](_0x117dda['cloneNode'](!0x0)),_0x117dda['nextSibling']&&(_0x87668c['children']['push'](_0x117dda['nextSibling']['cloneNode'](!0x0)),_0x496273['children']['push'](_0x117dda['nextSibling']['cloneNode'](!0x0)));}else{const _0x578b10=_0x3e3921['documentContextContent']['children'][0x0];if(!_0x578b10)return null;_0x87668c['children']['push'](_0x578b10['cloneNode'](!0x0)),_0x496273['children']['push'](_0x578b10['cloneNode'](!0x0));}}const _0x3c8555=_0x585f3c['getDocumentContext'](),_0x4ae76f=_0x451372['data']['parse'](_0x3c8555['content']),_0x3ec360=Y(_0x87668c),_0x3b9a92=_0x451372['data']['parse'](_0x3ec360),_0x24ae47=_0x451372['data']['parse'](_0x3ec360),_0x1e5c9d=_0x451372['model']['createPositionAt'](_0x3b9a92,0x0),_0x4ee245=Y(_0x496273),_0x395175={'anchor':_0x1e5c9d,'markDeletions':!0x1},_0x105965=_0x451372['plugins']['get'](_0x4f58a6)['getDiff'](_0x3ec360,_0x4ee245,_0x395175)['getOperations']();if(!_0x105965['length'])return null;_0x451372['model']['change'](_0x37b74d=>{for(const _0x284b9a of _0x105965)if('remove'==_0x284b9a['type']){const _0x2f7226=_0x284b9a['sourcePosition'],_0x51dc95=_0x284b9a['howMany'],_0x5ac0ec=new _0x34bf3b(_0x2f7226,_0x51dc95);_0x37b74d['batch']['addOperation'](_0x5ac0ec),_0x451372['model']['applyOperation'](_0x5ac0ec);}else'marker'!==_0x284b9a['type']&&(_0x284b9a['baseVersion']=null,_0x284b9a['isDocumentOperation']=!0x1,_0x37b74d['batch']['addOperation'](_0x284b9a),_0x451372['model']['applyOperation'](_0x284b9a));});const _0x5b6e51=W(_0x451372,_0x105965,_0x3b9a92);G(_0x451372['model'],_0x5b6e51);const _0x188041=_0x5b6e51['getFirstRange']()['start']['path']['slice'](),_0x59eed4=_0x5b6e51['getFirstRange']()['end']['path']['slice'](),_0x3f8db3=[];let _0x1b6992=_0x3b9a92,_0xc552d0=_0x24ae47;for(let _0x407ce3=0x0;_0x407ce3<_0x59eed4['length'];_0x407ce3++){const _0x2dec4e=_0x1b6992['maxOffset']-_0x59eed4[_0x407ce3];_0x3f8db3[_0x407ce3]=_0xc552d0['maxOffset']-_0x2dec4e,_0x1b6992=_0x1b6992['getChildAtOffset'](_0x59eed4[_0x407ce3]),_0xc552d0=_0xc552d0['getChildAtOffset'](_0x3f8db3[_0x407ce3]);}const _0x1d07c2=_0x451372['model']['createRange'](_0x451372['model']['createPositionFromPath'](_0x24ae47,_0x188041),_0x451372['model']['createPositionFromPath'](_0x24ae47,_0x3f8db3)),_0x52a7bd=_0x24ae47['getChild'](0x0)['getAttribute'](_0x1707b9),_0x50fc51=Array['from'](_0x4ae76f['getChildren']())['find'](_0x4ffd6b=>_0x4ffd6b['getAttribute'](_0x1707b9)==_0x52a7bd)['getPath'](),_0x540895=_0x1d07c2['start']['path']['slice'](),_0x52959a=_0x1d07c2['end']['path']['slice']();_0x540895[0x0]=_0x50fc51[0x0]+_0x540895[0x0],_0x52959a[0x0]=_0x50fc51[0x0]+_0x52959a[0x0];let _0x355308=_0x451372['model']['createRange'](_0x451372['model']['createPositionFromPath'](_0x451372['model']['document']['getRoot'](),_0x540895),_0x451372['model']['createPositionFromPath'](_0x451372['model']['document']['getRoot'](),_0x52959a));const _0x30df1a=_0x451372['model']['document']['history']['getOperations'](_0x3c8555['version']);for(const _0x3175e8 of _0x30df1a)_0x355308=_0x1f26a0['_createFromRanges'](_0x355308['getTransformedByOperation'](_0x3175e8));return{'range':_0x355308,'currentIndex':_0x85916c};}['_integrateEditor'](_0x5976ae){if(!_0x5976ae['plugins']['has']('Undo'))return;const _0x10c6a9=_0x5976ae['commands']['get']('undo'),_0x48b065=_0x5976ae['commands']['get']('redo');this['listenTo'](_0x10c6a9,'revert',(_0x2dc1b9,_0x58c2f0,_0x3f95b4)=>{const _0x5d341f=this['_batchToChanges']['get'](_0x58c2f0);if(!_0x5d341f)return;const _0x5b3ffe=this['activeConversation']['getInteraction'](_0x5d341f['interactionId'])['getReply'](_0x5d341f['replyId']);_0x5d341f['indexes']['forEach'](_0x3561bb=>_0x5b3ffe['setChangeGroupState'](_0x3561bb,'pending')),this['_batchToChanges']['delete'](_0x58c2f0),this['_batchToChanges']['set'](_0x3f95b4,_0x5d341f);}),this['listenTo'](_0x48b065,'revert',(_0x5b3f4e,_0x208092,_0x37153e)=>{const _0x2df425=this['_batchToChanges']['get'](_0x208092);if(!_0x2df425)return;const _0x6bdf8c=this['activeConversation']['getInteraction'](_0x2df425['interactionId'])['getReply'](_0x2df425['replyId']);_0x2df425['indexes']['forEach'](_0x42e701=>_0x6bdf8c['setChangeGroupState'](_0x42e701,'accepted')),this['_batchToChanges']['delete'](_0x208092),this['_batchToChanges']['set'](_0x37153e,_0x2df425);});}async['loadConversation'](_0x1ea26c){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](H)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x1ea26c)['getConversation'](),await this['_startConversationSafely'](_0x1ea26c),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x1ea26c,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x1f3b95){this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x1ea26c}),this['_logError'](new _0x1500e8('ai-chat-conversation-not-found',this,{'error':_0x1f3b95}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x347315=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x359376=await _0x347315['getConversations']();return _0x359376['length']?_0x359376[0x0]['id']:'new';}catch(_0x57a763){return this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x3e4e8c()}),this['_logError'](new _0x1500e8('ai-chat-conversation-init-failed',this,{'error':_0x57a763})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x29d9ee){this['activeConversation']['id']===_0x29d9ee&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](m(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x186ea9=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x186ea9),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x24d9b7,attributes:_0x4fb17a}){await this['_handleUIUserMessage']({'userMessage':_0x24d9b7,'attributes':_0x4fb17a});}['getGroupId'](){const _0x2e2812=this['context']['config']['get']('collaboration.channelId');if(!_0x2e2812)throw new _0x1500e8('ai-chat-missing-channel-id',this);return _0x2e2812;}async['_startConversationSafely'](_0x2d5d61){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x2d5d61);}catch(_0x538c5f){this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x2d5d61||_0x3e4e8c()}),console['error'](_0x538c5f),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x476afc){let _0x4ac835;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x476afc||!this['activeConversation']?_0x4ac835=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x4ac835=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x4b5478=this['getGroupId'](),_0x449ba7=_0x476afc||_0x3e4e8c();this['activeConversation']=new F({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x4ac835,'conversationId':_0x449ba7,'group':_0x4b5478,'getEditor':()=>D(this['context']),'isFromHistory':!!_0x476afc}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x15b46e,_0x566919)=>{this['_aiChatUi']['createConversation'](_0x566919),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x476afc||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x397033,_0x76d24c)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x76d24c['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x200c64,_0x1acd24)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x1acd24);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0xaa06b4=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0xaa06b4);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x506245=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x506245);}),this['activeConversation']['on']('webSearchFinished',(_0x2d9e52,_0x553171)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x553171,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x535263,_0x119eec)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x119eec,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0xa628a8,_0x13ba03)=>{this['_aiChatUi']['removeFeedInteraction'](_0x13ba03['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x3cae7c,_0x1bbe79,_0x297e5f)=>{this['updateConversationTitle'](_0x1bbe79,_0x297e5f);}),this['activeConversation']['on']('replyCreated',(_0x138423,_0x5f179b)=>{'text'===_0x5f179b['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x5f179b):this['_aiChatUi']['addFeedItemAISuggestion'](_0x5f179b);}),this['activeConversation']['on']('replyContentUpdated',async(_0x35b847,_0x2f5eb5)=>{await this['_updateReplyContent']({'reply':_0x2f5eb5});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x18ba15,{reply:_0x57dd46,index:_0x583bf8,state:_0x32de00})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x57dd46['id'],'index':_0x583bf8,'state':_0x32de00}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x57dd46['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x583bf8&&this['_aiChatBalloon']?.['setState'](_0x32de00);}),this['activeConversation']['on']('contextItemAdded',(_0x25992f,_0x50a892)=>{if(this['_aiChatUi']['addContextItem'](_0x50a892['contextItem'],_0x50a892['isLoading']),'selection'===_0x50a892['contextItem']['type']){const _0x455d5b=[...D(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x455d5b,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x1afaf5,_0x8a1a9f)=>{this['_aiChatUi']['removeContextItem'](_0x8a1a9f['uiId']),'current-document'==_0x8a1a9f['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x8a1a9f['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x5ad17a,_0xf85c29)=>{this['_aiChatUi']['setContextItemLoading'](_0xf85c29['contextItem']['uiId'],_0xf85c29['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x18d466,_0x5289be)=>{this['_aiChatUi']['setConversationContext'](_0x5289be['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x24240b,_0x583ce2)=>{this['_aiChatUi']['setAddContextOptions'](_0x583ce2['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x14edd1,_0x1440d9)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x1440d9['sourceId'],_0x1440d9['source'],_0x1440d9['resources'],_0x1440d9['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x10b7eb,_0xad45a6)=>{this['_aiChatUi']['updateResourceState'](_0xad45a6['sourceId'],_0xad45a6['resourceId'],_0xad45a6['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x46dcb8,_0x362bb2)=>{this['_aiChatUi']['updateCapabilities'](_0x362bb2);}),this['activeConversation']['on']('modelSelected',async(_0x3982f2,_0x519ed4)=>{const _0x32d1b0=(await this['_aiChatModels']['getAll']())['find'](_0x492332=>_0x492332['id']===_0x519ed4['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x32d1b0,_0x519ed4['isDisabled']);}),this['activeConversation']['on']('error',(_0x7c7708,{error:_0x3e4ef6,interactionId:_0x4ab590,fileName:_0x311f2b,url:_0x537f68,sourceId:_0x59b807,sourceLabel:_0x4e4b6e})=>{const _0x1a5a2a=_0x4ab590?_0x4ab590+':'+_0x3e4e8c():_0x3e4e8c();_0x3e4ef6['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':m(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x1a5a2a}):_0x3e4ef6['message']['startsWith']('ai-chat-conversation-init-failed')||_0x3e4ef6['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6)):_0x3e4ef6['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x311f2b),'id':_0x1a5a2a}):_0x3e4ef6['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x537f68),'id':_0x1a5a2a}):_0x3e4ef6['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x1a5a2a}):_0x3e4ef6['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x1a5a2a}):_0x3e4ef6['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x59b807&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x59b807),this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x4e4b6e||'source'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6)):_0x3e4ef6['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6)):_0x3e4ef6['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6)):_0x3e4ef6['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6)):_0x3e4ef6['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6)):_0x3e4ef6['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6)):_0x3e4ef6['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x1a5a2a}),this['_logError'](_0x3e4ef6));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x476afc||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x285888,attributes:_0x5c5bda}){if(!this['activeConversation'])throw new _0x1500e8('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x564c73=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x564c73);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x285888,'attributes':_0x5c5bda});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x322f59){this['_aiChatUi']['setIsMaximized'](_0x322f59);}['_logError'](_0xaf7c72){_0x4dee23(_0xaf7c72['message']);}['_removeFromContext'](_0x8d1a63){this['activeConversation']?.['removeFromContext'](_0x8d1a63);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x2bac73){const [_0x43a53e,_0x591c7d]=_0x2bac73['split'](':'),_0x41b2bb=this['activeConversation']['getInteraction'](_0x43a53e),_0x5d9e6b=_0x41b2bb['getReply'](_0x591c7d);return{'interaction':_0x41b2bb,'reply':_0x5d9e6b};}['_scrollToSuggestionRange'](_0x571913,_0x35032c=!0x1){const _0x17deba=D(this['context']),_0x348cda={'target':_0x17deba['editing']['view']['domConverter']['viewRangeToDom'](_0x17deba['editing']['mapper']['toViewRange'](_0x571913)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x35032c};_0x35032c&&(_0x348cda['alignToTop']=!0x0),_0x54e791(_0x348cda);}['updateConversationTitle'](_0x163417,_0x189556=!0x1){this['_aiChatUi']['setConversationTitle'](_0x163417||m(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x189556);}async['_updateReplyContent']({reply:_0xda5182,renderingStrategy:_0x315508}){const {id:_0x457ca2,interactionId:_0x856423,isDone:_0x226eba,type:_0x336713,parsedContent:_0x1ca63d}=_0xda5182,_0x3164a0=_0x856423+':'+_0x457ca2;if('modification'===_0x336713){const _0x35fc22=_0xda5182['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3164a0,'parts':_0x35fc22,'renderingStrategy':_0x315508,'isDone':_0x226eba});}else'text'===_0x336713&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x3164a0,'parsedContent':_0x1ca63d,'renderingStrategy':_0x315508,'isDone':_0x226eba});_0x226eba&&_0xda5182['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x3164a0,_0xda5182['sources']);}async['_stopLastInteraction'](){const _0x5d91e3=this['activeConversation']?.['lastInteraction'];_0x5d91e3&&(_0x5d91e3['stop'](),this['_aiChatUi']['stopInteraction'](_0x5d91e3));}async['_flushLastInteractionUI'](){const _0x553275=this['activeConversation']?.['lastInteraction'];if(_0x553275){for await(const _0x1d56b9 of _0x553275['replies'])await this['_updateReplyContent']({'reply':_0x1d56b9,'renderingStrategy':'static'});}}['_updateRatings'](_0xf05f45){const _0x56a525={'positiveCount':_0xf05f45['changeGroups']['filter'](_0x4c1a87=>'accepted'===_0x4c1a87['state'])['length'],'totalCount':_0xf05f45['changeGroups']['length'],'modificationId':_0xf05f45['id']},_0x238917=this['activeConversation']['getInteraction'](_0xf05f45['interactionId'])['messageId'];_0x238917&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x238917,_0x56a525);}['_registerToolDataCallback'](_0x55ca11){let _0x3c65f=null,_0x23f0a9=null;this['on']('toolDataReceived',(_0x547876,_0xab67fb,_0x225279)=>{_0x225279['id']!==_0x3c65f&&(_0x3c65f=_0x225279['id'],_0x23f0a9=this['_getAIChatInteractionAPI'](_0x225279)),_0x55ca11(_0xab67fb,_0x23f0a9);});}['_getAIChatInteractionAPI'](_0x2510eb){const _0x3631b4=this['_aiChatUi'],_0x2a1f99=()=>{_0x2510eb['resetWebSearchState'](),_0x2510eb['resetReasoningState'](),_0x3631b4['clearLoadingMessage']();},_0x24f219=()=>{_0x2510eb['currentReply']&&(_0x2510eb['currentReply']['done'](),_0x2510eb['currentReply']=void 0x0);};return{'insertTextReply':(_0x544ae5,_0x11be64)=>{_0x24f219(),_0x2a1f99();const _0x440b38=_0x2510eb['currentReply']=_0x2510eb['createReply']({'type':'text','interactionId':_0x2510eb['id'],'content':_0x544ae5,'id':_0x11be64||_0x3e4e8c()});return _0x24f219(),_0x440b38;},'insertCustomElement':async(_0x301395,_0x30ad98)=>(_0x24f219(),_0x2a1f99(),_0x3631b4['addFeedItemCustomElement'](_0x301395,_0x30ad98||_0x3e4e8c())),'setLoadingMessage':_0x135bc6=>{_0x3631b4['setLoadingMessage'](_0x135bc6);},'clearLoadingMessage':()=>{_0x3631b4['clearLoadingMessage']();}};}}const a='ai-selection';class o extends _0x37abb2{constructor(_0x1daf6a){super(_0x1daf6a),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_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 _0x13b169=D(this['context']),_0x21f5ca=_0x13b169['plugins']['has']('RealTimeCollaborationClient')&&_0x13b169['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x21f5ca||_0x3e4e8c();}return this['_sessionId'];}async['getDocumentData'](){const _0x322def=D(this['context']),_0x5c7edc=_0x322def['model'],_0x2e469a=_0x322def['data']['toView'](_0x5c7edc['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x1b8eae=new ft(_0x322def['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x2e469a,_0x1b8eae);let _0x436595=await this['_getDocumentDataStringFromView'](_0x2e469a);const _0x26c48c=this['_getMarkersInDocumentOrder'](),_0x4e1b55=[];for(const _0x1914a0 of _0x26c48c){const _0x31921f='<'+_0x1914a0['name']+':start></'+_0x1914a0['name']+':start>',_0x2167ec=_0x436595['indexOf'](_0x31921f);_0x436595=_0x436595['substring'](0x0,_0x2167ec)+_0x436595['substring'](_0x2167ec+_0x31921f['length']);const _0xb9b1d2='<'+_0x1914a0['name']+':end></'+_0x1914a0['name']+':end>',_0x2a1a92=_0x436595['indexOf'](_0xb9b1d2);_0x436595=_0x436595['substring'](0x0,_0x2a1a92)+_0x436595['substring'](_0x2a1a92+_0xb9b1d2['length']),_0x4e1b55['push']({'markerName':_0x1914a0['name'],'start':_0x2167ec,'end':_0x2a1a92,'htmlFragment':_0x436595['substring'](_0x2167ec,_0x2a1a92)});}return{'content':_0x436595,'version':_0x322def['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x4e1b55};}async['afterInit'](){this['context']instanceof _0x5a6451?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x241f42,_0x297a7b)=>{_0x297a7b['on']('ready',()=>{this['_integrateEditor'](_0x297a7b);});});}['_setOutputDataProcessor'](_0x397e45){this['_outputDataProcessor']=_0x397e45;}async['_getDocumentDataStringFromView'](_0x5bce39){let _0x454bc6;const _0xb0a00=D(this['context']);if(this['_outputDataProcessor']){const _0x5e20f1=_0xb0a00['data']['processor']['domConverter']['viewToDom'](_0x5bce39),_0x28ea53=await this['_outputDataProcessor'](_0x5e20f1);_0x454bc6=_0xb0a00['data']['processor']['htmlWriter']['getHtml'](_0x28ea53);}else _0x454bc6=_0xb0a00['data']['processor']['toData'](_0x5bce39);return _0x454bc6;}['_integrateEditor'](_0x11503f){_0x11503f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':a,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x11503f['conversion']['for']('dataDowncast')['markerToElement']({'model':a,'view':(_0x2ad973,{writer:_0x4eb535,options:_0x1725bb})=>_0x1725bb['convertAiChatSelectionMarker']?_0x4eb535['createUIElement'](_0x2ad973['markerName']+':'+(_0x2ad973['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x58a9b4,_0x2ffd6f,_0x35cec6=!0x1,_0x1b0fd0=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x1b0fd0)return!0x1;const _0x2b1386=D(this['context'])['model'];return _0x2b1386['change'](_0x4b0c45=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x2ffd6f,this['_displayedFakeSelectionLocked']=_0x35cec6;let _0x439229=0x0;for(let _0x30be1c of _0x58a9b4){const _0x56b329=a+':'+_0x439229;if(_0x30be1c['start']['isAtEnd']){const _0x10b82d=_0x30be1c['start']['getLastMatchingPosition'](({item:_0x2cc1f6})=>!_0x2b1386['schema']['isContent'](_0x2cc1f6),{'boundaries':_0x30be1c});_0x30be1c=_0x4b0c45['createRange'](_0x10b82d,_0x30be1c['end']);}_0x4b0c45['addMarker'](_0x56b329,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x30be1c}),_0x439229++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x417d85){if(this['_displayedFakeSelectionId']!=_0x417d85)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x4e47e9=D(this['context']),_0x163c0c=_0x4e47e9['model']['markers']['getMarkersGroup'](a);return _0x4e47e9['model']['change'](_0x5c2ff9=>{for(const _0x587e05 of _0x163c0c)_0x5c2ff9['removeMarker'](_0x587e05);}),!0x0;}async['modelToDataWithIds'](_0x468ce5){const _0x260833=D(this['context']),_0x12eee9=_0x260833['data']['toView'](_0x468ce5),_0x1c3867=new ft(_0x260833['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x12eee9,_0x1c3867),this['_getDocumentDataStringFromView'](_0x12eee9);}['_setDataIdsOnChildren'](_0x441cf2,_0x260e92){let _0x5699c2=!0x1;const _0x17a5e9=new Set();for(const _0x5a9626 of _0x441cf2['getChildren']()){const _0x2e688c=_0x5a9626['is']('emptyElement')||_0x5a9626['is']('containerElement');if(!_0x5a9626['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x5a9626,_0x260e92)||_0x2e688c)&&(_0x260e92['setAttribute']('data-id',this['_nextDataId'](_0x17a5e9),_0x5a9626),_0x5699c2=!0x0);}return _0x5699c2;}['_nextDataId'](_0x50c12c){let _0xdce210;do{_0xdce210='';for(let _0x1b298b=0x0;_0x1b298b<0x4;_0x1b298b++)_0xdce210+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x50c12c['has'](_0xdce210));return _0x50c12c['add'](_0xdce210),_0xdce210;}['getSelectionText'](){const {model:_0x401e47}=D(this['context']),_0x3fe767=_0x401e47['document']['selection'],_0x1bfa15=[];for(const _0x142654 of _0x3fe767['getRanges']())for(const _0x4c4cf2 of _0x142654['getItems']())_0x4c4cf2['is']('$textProxy')?_0x1bfa15['push'](_0x4c4cf2['data']):_0x4c4cf2['is']('element')&&_0x1bfa15['length']>0x0&&'\x20'!==_0x1bfa15[_0x1bfa15['length']-0x1]&&_0x1bfa15['push']('\x20');return _0x1bfa15['length']?'\x22'+_0x1bfa15['join']('')['trim']()+'\x22':m(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x381ada=D(this['context'])['model'];return Array['from'](_0x381ada['markers']['getMarkersGroup'](a))['sort']((_0x368e50,_0x45ce4f)=>_0x368e50['getStart']()['isBefore'](_0x45ce4f['getStart']())?-0x1:_0x368e50['getStart']()['isAfter'](_0x45ce4f['getStart']())?0x1:0x0);}}const V=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],it=[...V,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x4b47d7){this['options']={'delay':_0x4b47d7['delay']??0x14,'textNodeStyle':_0x4b47d7['textNodeStyle'],'onStreamUpdate':_0x4b47d7['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x139241,targetElement:_0x46ea48,abortSignal:_0x24a3d2}){this['isStreaming']&&this['stop'](),_0x24a3d2?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x257863(_0x139241,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x586f8d=0x0;_0x586f8d<this['currentIndex'];_0x586f8d++)this['nodesList'][_0x586f8d]['shouldBeStreamed']=!0x0;do{const _0x46c84e=Date['now'](),_0x26c100=this['nodesList'][this['currentIndex']],_0x1ee038=_0x46c84e-this['lastUpdateTime'];if(_0x26c100){_0x26c100['shouldBeStreamed']=!0x0;let _0x172bf4=_0x26c100['parent'];for(;_0x172bf4;)_0x172bf4['shouldBeStreamed']=!0x0,_0x172bf4=_0x172bf4['parent'];}if(_0x1ee038<this['options']['delay'])try{const {promise:_0x19c6e9,abortController:_0x3e33f9}=Os(this['options']['delay']-_0x1ee038);this['timeoutAbortController']=_0x3e33f9,await _0x19c6e9;}catch(_0x412051){return;}_0x1cf580(_0x46ea48,'<'+_0x46ea48['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x46ea48['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x57c0fe}){Array['from'](_0x57c0fe['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x4a825a=>{_0x4a825a['replaceWith'](_0x4a825a['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x1db65d){let _0x14142f='';if(function(_0x364d72){return _0x5de66b(_0x364d72);}(_0x1db65d)){for(const _0x18a9a8 of _0x1db65d['children'])_0x14142f+=this['renderNode'](_0x18a9a8);}else{if(Ls(_0x1db65d)){if(!_0x1db65d['shouldBeStreamed'])return'';const _0x415ae2=_0x1db65d,_0x3ce96c=Object['entries'](_0x415ae2['attribs'])['map'](([_0x164c3b,_0x5c5d2c])=>_0x164c3b+'=\x22'+_0x5c5d2c+'\x22')['join']('\x20');_0x14142f+='<'+_0x415ae2['tagName']+(_0x3ce96c?'\x20'+_0x3ce96c:'')+'>';for(const _0x5594ac of _0x5ecbbf(_0x415ae2))_0x14142f+=this['renderNode'](_0x5594ac);_0x14142f+='</'+_0x415ae2['tagName']+'>';}else{if(!Ts(_0x1db65d))return'';if(!_0x1db65d['shouldBeStreamed'])return'';!function(_0xde3479){if(!_0xde3479['parent']||!Ls(_0xde3479['parent']))return!0x1;if(!ys['includes'](_0xde3479['parent']['tagName']))return!0x1;return!_0x4fc42c(_0xde3479)['match'](/^\s*[<>]\s*$/);}(_0x1db65d)?_0x14142f+=_0x2aee41(_0x1db65d):_0x14142f+=_0x2aee41(new _0x309db4('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x1db65d]));}}return _0x14142f;}['getParsedDocumentNodeList'](){const _0x48ab35=[];return function(_0x307306,_0x232e04){const _0x3fcba7=_0x5e4f1a=>{if(_0x232e04(_0x5e4f1a),_0x5e4f1a instanceof _0x5329aa)for(let _0x17b0e7=0x0;_0x17b0e7<_0x5e4f1a['children']['length'];_0x17b0e7++){const _0x10609d=_0x5e4f1a['children'][_0x17b0e7];_0x3fcba7(_0x10609d);}};for(let _0x42d127=0x0;_0x42d127<_0x307306['children']['length'];_0x42d127++)_0x3fcba7(_0x307306['children'][_0x42d127]);}(this['document'],_0x3958e7=>{if(Ts(_0x3958e7)){const _0x126d75=this['splitTextNodeIntoWordNodes'](_0x3958e7);_0x126d75['length']&&_0x48ab35['push'](..._0x126d75);}_0x3958e7['isWordSplitSource']||_0x3958e7['isWordSplitResult']||_0x48ab35['push'](_0x3958e7);}),_0x48ab35;}['splitTextNodeIntoWordNodes'](_0x31d2fc){if(_0x31d2fc['isWordSplitSource']||_0x31d2fc['isWordSplitResult'])return[];const _0x22e2c1=_0x4fc42c(_0x31d2fc)['match'](/(?:\s*\S+\s*)/g),_0x210337=[];if(_0x22e2c1&&_0x22e2c1['length']>0x1){for(const _0x30ae5c of _0x22e2c1){const _0x5dd940=new _0x28e1e3(_0x30ae5c);_0x5dd940['isWordSplitResult']=!0x0,_0x4512fa(_0x31d2fc,_0x5dd940),_0x210337['push'](_0x5dd940);}_0x31d2fc['isWordSplitSource']=!0x0,_0x7119c8(_0x31d2fc);}return _0x210337;}}const ys=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Ts(_0x27296e){return _0x211c5d(_0x27296e);}function Ls(_0x6d98c3){return _0x32b8a9(_0x6d98c3);}function Os(_0x1a3195){const _0x313cc3=new AbortController();return{'promise':new Promise((_0x486e07,_0x1435ea)=>{const _0x367e60=setTimeout(_0x486e07,_0x1a3195);_0x313cc3['signal']['addEventListener']('abort',()=>{clearTimeout(_0x367e60),_0x1435ea();});}),'abortController':_0x313cc3};}class xr extends _0x538d57{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x55aa85){super();const _0x59072e=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']=_0x55aa85,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x59072e['if']('isDone','ck-ai-chat__feed__item_done'),_0x59072e['if']('isVisible','ck-hidden',_0x5aa240=>!_0x5aa240),'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'](_0x141f7a=>{_0x141f7a['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x48fd3e,_0x59872b,_0x3c0872){await this['htmlStreamer']['stream']({'document':_0x48fd3e,'targetElement':_0x59872b,'abortSignal':_0x3c0872});}}class oa extends _0x538d57{['showChangesToggleView'];constructor(_0x306c22,_0x5da5ff){super(_0x306c22),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Or(_0x306c22),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':m(_0x306c22,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x5da5ff['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x579f89=>_0x579f89?_0x455aeb:_0x3da748),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0xd5bb8b=new _0x1a5580();_0xd5bb8b['content']=_0x2040cd,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x5da5ff['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0xd5bb8b,{'tag':'span','children':[m(_0x306c22,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Or extends _0x3fc85a{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Wr={'accepted':_0x45fb55,'rejected':_0x1e0042,'outdated':_0x1e0042};class as extends _0x538d57{['stateIconView'];constructor(_0x5aa9b2){super(_0x5aa9b2);const _0x95f3dd=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new Yr(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x95f3dd['to']('state',_0x1650e3=>'ck-ai-suggestion__content-part-state_'+_0x1650e3),_0x95f3dd['if']('isVisible','ck-hidden',_0xce82b1=>!_0xce82b1)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x95f3dd['to']('state',_0x3a8b48=>{switch(_0x3a8b48){case'accepted':return m(_0x5aa9b2,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return m(_0x5aa9b2,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return m(_0x5aa9b2,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x28d9bf){this['state']=_0x28d9bf;}}class Yr extends _0x1a5580{constructor(){super(),this['set']('state','accepted'),this['content']=Wr[this['state']],this['on']('change:state',()=>{this['content']=Wr[this['state']];});}}class os extends _0x1b7f91{['_applyButton'];['_suggestButton'];constructor(_0xd7ac61,_0x258e28,_0x1bcb93){super(_0xd7ac61);const _0x14a4de=Boolean(_0x1bcb93);this['set']('isEnabled',!_0x14a4de),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x160197=[];if(_0x14a4de){const _0xd0b36=new _0x3fc85a(_0xd7ac61);_0xd0b36['set']({'label':m(_0xd7ac61,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc}),_0x160197['push'](_0xd0b36);}else{_0x258e28['includes']('applySuggestion')&&(this['_applyButton']=new _0x3fc85a(_0xd7ac61),this['_applyButton']['set']({'label':m(_0xd7ac61,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x45fb55}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x160197['push'](this['_applyButton'])),_0x258e28['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x3fc85a(_0xd7ac61),this['_suggestButton']['set']({'label':m(_0xd7ac61,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x44249d}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x160197['push'](this['_suggestButton']));const _0x59a530=new _0x3fc85a(_0xd7ac61);_0x59a530['set']({'label':m(_0xd7ac61,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1e0042}),_0x59a530['bind']('isEnabled')['to'](this),_0x59a530['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x160197['push'](_0x59a530);}this['items']['addMany'](_0x160197);const _0x339864=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x339864['if']('isVisible','ck-hidden',_0x106810=>!_0x106810)]}});}['setButtonsVisibility']({showApplyButton:_0xc2d564,showSuggestButton:_0x357e8f}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0xc2d564),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x357e8f);}}class vn extends _0x538d57{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x4907a3,{part:_0x2e34de,uiIndex:_0x58b2b6,availableActions:_0x17db5a,areActionsDisabled:_0x3bb961}){super(_0x4907a3),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new os(_0x4907a3,_0x17db5a,_0x3bb961),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x2e34de['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x2e34de['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x2e34de['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new as(_0x4907a3),this['titleLabelView']=new Sn(_0x4907a3,_0x58b2b6),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],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',(_0x47f94c,_0x33954f,_0x4e59f3,_0x4baf08)=>{'pending'===_0x4baf08?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x4e59f3?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x4e59f3),this['children']['add'](this['stateView']));});}}class Sn extends _0x538d57{constructor(_0x598e82,_0x392e80){super(_0x598e82),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[m(_0x598e82,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x392e80['toString']())]});}}class es extends _0x538d57{['htmlStreamer'];constructor(_0x67e089){super(_0x67e089),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x207a4f,renderingStrategy:_0x14e7dc,abortSignal:_0x19d82d}){'streaming'===_0x14e7dc?await this['htmlStreamer']['stream']({'document':_0x207a4f['content'],'targetElement':this['element'],'abortSignal':_0x19d82d}):this['element']['innerHTML']=Y(_0x207a4f['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x538d57{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x4b4079,{part:_0x379804,uiIndex:_0xa8ab35,areActionsDisabled:_0x611bf5,availableActions:_0x36d04c}){super(_0x4b4079);const _0x5d3e56=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x3c1c1c=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x611bf5;};this['on']('change:state',_0x3c1c1c),this['on']('change:isDone',_0x3c1c1c),_0x3c1c1c(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0x4b4079,{'part':_0x379804,'uiIndex':_0xa8ab35,'availableActions':_0x36d04c,'areActionsDisabled':_0x611bf5}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...V)['to'](this),this['_streamableContentView']=new es(_0x4b4079),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x5d3e56['to']('state',_0x3e457b=>'ck-ai-suggestion__body__content-part_'+_0x3e457b),_0x5d3e56['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x5d3e56['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x5d3e56['if']('isVisible','ck-hidden',_0x5b55a=>!_0x5b55a)]},'children':this['_children'],'on':{'mouseenter':_0x5d3e56['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x379804['index']});}),'mouseleave':_0x5d3e56['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x379804['index']});}),'click':_0x5d3e56['to'](_0x10f313=>{const _0x2ceff7=_0x10f313['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x2ceff7)&&this['fire']('showChangeInText',{'index':_0x379804['index']});})}});}async['updateContent']({part:_0x576f2f,renderingStrategy:_0x2ae0bd,showUnchangedParts:_0x5b68a3=!0x1,abortSignal:_0x3b2d5b}){this['partDefinition']=_0x576f2f,this['isVisible']=this['partDefinition']['hasChanges']||_0x5b68a3,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x576f2f,'renderingStrategy':_0x2ae0bd,'abortSignal':_0x3b2d5b});}['markAsDone'](){this['isDone']=!0x0;}}class g extends Ft(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x47586f){const _0x5e3178=this['createTask'](_0x47586f);return this['queue']['push'](_0x5e3178),this['_processQueue'](),_0x5e3178['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(_0x123fce=>{this['once']('_queueEmpty',()=>{_0x123fce();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x188a9d=this['queue']['shift']();try{await _0x188a9d['callback'](this['_abortController']['signal']),_0x188a9d['resolve']();}catch(_0x4af24e){_0x188a9d['reject'](_0x4af24e);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x957dc0){let _0x2854eb,_0x5c12f2;const _0x1de4d9=new Promise((_0x282c78,_0x35634b)=>{_0x2854eb=_0x282c78,_0x5c12f2=_0x35634b;});return{'callback':_0x957dc0,'resolve':_0x2854eb,'reject':_0x5c12f2,'completePromise':_0x1de4d9};}}class Pe extends xr{constructor(_0x21f703){super(_0x21f703),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x21f703['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x1c0160){this['element']['innerHTML']=_0x1c0160;}}const S=['applySuggestion','insertSuggestion'];class ra extends _0x538d57{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x5ea3eb,_0x28386b=[...S],_0x2885d9){super(_0x5ea3eb);const _0x425dab=this['bindTemplate'],_0x1985ce=Boolean(_0x2885d9);if(this['set']('isEnabled',!_0x1985ce),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x1985ce){const _0x50a073=new _0x3fc85a(_0x5ea3eb);_0x50a073['set']({'label':m(_0x5ea3eb,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc});const _0x239a67=new _0x538d57(_0x5ea3eb);_0x239a67['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[m(_0x5ea3eb,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x50a073]}]}),this['children']['add'](_0x239a67);}else this['_applyChangesButton']=new _0x3fc85a(_0x5ea3eb),this['_applyChangesButton']['set']({'label':m(_0x5ea3eb,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x28386b['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x3fc85a(_0x5ea3eb),this['_insertSuggestionsButton']['set']({'label':m(_0x5ea3eb,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x28386b['includes']('insertSuggestion'),'class':'ck-ai-button-secondary'}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x4a2e8d=>{_0x4a2e8d['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x425dab['if']('isVisible','ck-hidden',_0x3796ee=>!_0x3796ee)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x102bff){this['isVisible']=_0x102bff;}['_switchButtonLabelsPlurality'](_0x243cc5){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x243cc5?(this['_applyChangesButton']['label']=m(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=m(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=m(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=m(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class yr extends _0x538d57{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x990f4,_0x32fc73){super(_0x990f4),this['bodyCollection']=_0x32fc73,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',_0x2358de=>!_0x2358de)]},'children':this['children']});const _0x5a7b40=new _0x538d57(this['locale']),_0x3172a1=new _0x1a5580();_0x3172a1['content']=_0x1904ed,_0x5a7b40['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x3172a1,{'tag':'span','children':[{'text':m(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x5a7b40),this['_setupBalloonPanel'](_0x990f4);}['addSource'](_0x54e78d){this['children']['add'](new Cr(this['locale'],_0x54e78d,this['balloonPanelView']));}['_setupBalloonPanel'](_0x4a11cb){this['balloonPanelView']=new _0x51e059(_0x4a11cb),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Cr extends _0x3fc85a{['balloonPanelView'];['source'];constructor(_0x13a4a1,_0x298235,_0x311594){super(_0x13a4a1),this['source']=_0x298235,this['balloonPanelView']=_0x311594,this['set']({'label':_0x298235['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x488004=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x488004['to'](()=>{window['open'](_0x298235['url'],'_blank');}),'mouseenter':_0x488004['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x488004['to'](()=>{this['_hideTooltip']();})}}),_0x298235['favicon']){const _0x3607fd=new _0x538d57(_0x13a4a1);_0x3607fd['setTemplate']({'tag':'img','attributes':{'src':_0x298235['favicon']||_0x1904ed,'alt':_0x298235['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x3607fd);}else this['set']('icon',_0x1904ed);}['_createTooltipContentView'](_0x58350f,_0x5f5c61){const _0x31da=new _0x538d57(_0x58350f),_0x55d30b=[];let _0x485c2f;_0x5f5c61?.['favicon']?(_0x485c2f=new _0x538d57(_0x58350f),_0x485c2f['setTemplate']({'tag':'img','attributes':{'src':_0x5f5c61['favicon'],'alt':_0x5f5c61['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x485c2f=new _0x1a5580(),_0x485c2f['content']=_0x1904ed,_0x485c2f['extendTemplate']({'attributes':{'alt':_0x5f5c61['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x55d30b['push'](_0x485c2f);const _0x1716b5=new _0x538d57(_0x58350f);_0x1716b5['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x5f5c61['url']},'children':[{'text':new URL(_0x5f5c61['url'])?.['hostname']}]}),_0x55d30b['push'](_0x1716b5);const _0x265aa1=new _0x538d57(_0x58350f);_0x265aa1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x55d30b});const _0x30b6d1=new _0x538d57(_0x58350f);return _0x30b6d1['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x5f5c61['title']['length']>0x190?_0x5f5c61['title']['substring'](0x0,0x190)+'...':_0x5f5c61['title']}]}),_0x31da['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x265aa1,_0x30b6d1]}),_0x31da;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x51e059['defaultPositions']['northArrowSouth'],_0x51e059['defaultPositions']['northArrowSouthWest'],_0x51e059['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x17afe5=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x17afe5);}}class ga extends _0x538d57{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x7ef0d7,_0x1a4a95){super(_0x7ef0d7);const {areActionsDisabled:_0x14cda2,showUnchangedParts:_0x485835,availableActions:_0xed5c5f}=_0x1a4a95;this['_areActionsDisabled']=_0x14cda2,this['_showUnchangedParts']=_0x485835,this['_availableActions']=_0xed5c5f,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new g(),this['_emptyPartsWarningView']=new Pe({'id':'empty-parts-warning','initialContent':m(_0x7ef0d7,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x7ef0d7,_0x1a4a95['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new yr(this['locale'],_0x1a4a95['bodyCollection']),_0x1a4a95['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...V)['to'](this),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'],this['_actionsView'],this['_sourcesView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x1a12a1,renderingStrategy:_0x11a831,abortSignal:_0x50733b}){this['_children']['length']?_0x1a12a1['forEach'](_0x3c9201=>{const _0x334162=this['_cachedContentParts']['findIndex'](_0x34f036=>_0x34f036['index']==_0x3c9201['index']);-0x1===_0x334162?this['_cachedContentParts']['push'](_0x3c9201):this['_cachedContentParts'][_0x334162]=_0x3c9201;}):this['_cachedContentParts']=_0x1a12a1;const _0x49fbaf=this['_showUnchangedParts']?_0x1a12a1:_0x1a12a1['filter'](_0x374db7=>_0x374db7['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x49fbaf['length']>0x1);for(const _0x39a5de of _0x49fbaf)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x3568cf=>{let _0x10fda3=this['getPartView'](_0x39a5de['index']);_0x10fda3||(_0x10fda3=new na(this['locale'],{'part':_0x39a5de,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x10fda3['delegate'](...V)['to'](this),this['_children']['add'](_0x10fda3),this['hasPendingParts']=!0x0),await _0x10fda3['updateContent']({'part':_0x39a5de,'renderingStrategy':_0x11a831,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x3568cf}),_0x10fda3['markAsDone']();});return _0x50733b?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x1cce4e,_0xb33d2){const _0x5da3f5=this['getPartView'](_0x1cce4e);_0x5da3f5&&(_0x5da3f5['state']=_0xb33d2),this['hasPendingParts']='pending'==_0xb33d2||Array['from'](this['_children'])['some'](_0x2375e1=>'pending'==_0x2375e1['state']);}['setPartActive'](_0x5c964c,_0x589ca7){if(!0x1===_0x5c964c){for(const _0x139caf of this['_children'])_0x139caf['isActive']=!0x1;}else{const _0x92881=this['getPartView'](_0x5c964c);_0x92881&&(_0x92881['isActive']=_0x589ca7);}}['updateSources'](_0x1a5906){_0x1a5906['forEach'](_0x48ba6c=>this['_sourcesView']['addSource'](_0x48ba6c)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x584921){return this['_children']['find'](_0xd5789b=>_0xd5789b['partDefinition']['index']==_0x584921)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x1e2c5c=!this['_cachedContentParts']['find'](({hasChanges:_0x3c792f})=>_0x3c792f),_0x51d1e3=!!this['_cachedContentParts']['find'](({hasChanges:_0x18ddb0})=>!_0x18ddb0);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x51d1e3,_0x1e2c5c?this['_emptyPartsWarningView']['setContent'](m(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](m(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x1ee7d4=>_0x1ee7d4['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x4d9223=>_0x4d9223['partDefinition']['hasChanges'])['length']>0x0;}}class hn extends _0x538d57{['bodyView'];['children'];['headerView'];constructor(_0x395daf,_0x25b314,_0x5063e5){super(_0x395daf);const {showDiff:_0x3b2b29,areActionsDisabled:_0x57ff09,showUnchangedParts:_0x25dcb7,availableActions:_0x48c9a6}=_0x25b314;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x395daf,{'showDiff':_0x3b2b29}),this['headerView']['on']('toggleShowChanges',(_0x139484,_0x48bd37)=>{this['areChangesVisible']=_0x48bd37['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x48bd37['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ga(_0x395daf,{'areActionsDisabled':_0x57ff09,'showUnchangedParts':!!_0x25dcb7,'availableActions':_0x48c9a6,'bodyCollection':_0x5063e5}),this['bodyView']['delegate'](...V)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x3d3ff7){await this['bodyView']['updateContentParts'](_0x3d3ff7);}['updateSources'](_0x263af7){this['bodyView']['updateSources'](_0x263af7);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class ke extends xr{['containerView'];constructor(_0x1f98cf,_0x3ea5dd,_0x274efb){super(_0x3ea5dd),this['set']('isTrackChangesOn',!0x1),this['containerView']=new hn(_0x1f98cf,{'showDiff':_0x3ea5dd['showDiff'],'areActionsDisabled':_0x3ea5dd['areActionsDisabled'],'availableActions':_0x3ea5dd['availableActions']},_0x274efb),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x321003,_0xcaa591)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0xcaa591['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),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',(_0x1d40b1,{index:_0xf69551})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0xf69551});}),this['containerView']['on']('applySuggestion',(_0x54458b,{index:_0x83ea9e}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x83ea9e});}),this['containerView']['on']('insertSuggestion',(_0x38b36b,{index:_0x3c2c4b}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3c2c4b});}),this['containerView']['on']('rejectSuggestion',(_0xfbdc8f,{index:_0x41b4ad})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x41b4ad});}),this['containerView']['on']('mouseOverSuggestion',(_0xafc64c,{index:_0x401264})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x401264});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x5316a8,{index:_0x3a87b7})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3a87b7});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x34134d){await this['containerView']['updateContent'](_0x34134d);}['updatePartState'](_0x285a6e,_0x4a1581){this['containerView']['bodyView']['updatePartState'](_0x285a6e,_0x4a1581);}['setPartActive'](_0x219d04,_0x43d273){!0x1===_0x219d04?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x219d04,_0x43d273);}['updateSources'](_0x2aca66){this['containerView']['updateSources'](_0x2aca66);}['getPartView'](_0xe70b77){return this['containerView']['bodyView']['getPartView'](_0xe70b77);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class je extends xr{['replyContainer'];['_bodyCollection'];constructor(_0x38a996,_0x4e97a7,_0x414651){super(_0x4e97a7),this['_bodyCollection']=_0x414651,this['locale']=_0x38a996,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x538d57(),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':Qe(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x1f83a2,renderingStrategy:_0x5a4c04,abortSignal:_0x2f5905}){'streaming'===_0x5a4c04?await this['streamIntoElement'](_0x1f83a2,this['replyContainer']['element'],_0x2f5905):this['replyContainer']['element']['innerHTML']=_0x2aee41(_0x1f83a2);}['updateSources'](_0x5ba726){const _0x5f4607=new yr(this['locale'],this['_bodyCollection']);_0x5f4607['children']['addMany'](_0x5ba726['map'](_0x3cf102=>new Cr(this['locale'],_0x3cf102,_0x5f4607['balloonPanelView']))),_0x5f4607['isVisible']=!0x0,this['children']['add'](_0x5f4607);}}class De extends _0x29d2d8{constructor(_0x2ab724=void 0x0){super();const _0x2af4f3=_0x2ab724?'ck-ai-spinner_'+_0x2ab724:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x2af4f3]}});}}const xn={'file':_0x2f42c6,'document':_0x59e6a4,'web-resource':_0x1afd05,'text':_0x2f42c6,'selection':_0x33062f,'mcp-tool-context':_0x59e6a4},$r='ck-ai-chat-context-chip',Qr='ck-ai-chat-context-chip_wide',Xr='ck-ai-chat-context-chip_document',Zr='ck-ai-chat-context-chip__label',la='ck-ai-chat-context-chip__type-icon',ua='ck-ai-chat-context-controls__chip-tooltip',In='n';class xo extends _0x3fc85a{constructor(_0x5205b4,_0x45121b,_0x400e4e,_0x4a966a,_0x44f1b8=!0x1){super(_0x5205b4),this['_isAnimationOnEnterEnabled']=_0x4a966a,this['_initializeProperties'](_0x45121b,_0x400e4e,_0x44f1b8),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'](_0x457648,_0x966cf6,_0x837f1d){this['set']('label',_0x457648['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x457648['type']),this['set']('id',_0x457648['uiId']),this['set']('readonly',_0x966cf6),this['set']('isLoading',_0x837f1d);}['_setupTemplate'](){const _0x1830dc=this['_createIconView'](),_0x3b20d9=this['_createRemoveButton'](),_0x3d95c0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x3d95c0),'children':this['_createTemplateChildren'](_0x1830dc,_0x3b20d9,_0x3d95c0)});}['_createTemplateAttributes'](_0x30b48b){return{'class':[$r,_0x30b48b['if']('itemType',Xr,_0xb8b5ec=>'document'==_0xb8b5ec),_0x30b48b['if']('itemType',Qr,_0x388c4f=>'selection'==_0x388c4f)],'data-cke-tooltip-text':_0x30b48b['to']('label',On),'data-cke-tooltip-position':In,'data-cke-tooltip-class':ua};}['_createTemplateChildren'](_0x2b3a69,_0x16f373,_0x2c9bde){const _0x5789b8=this['_createLabelElement'](_0x2c9bde),_0x4ef365=this['_createLoaderIcon']();return this['readonly']?[_0x2b3a69,_0x5789b8]:[_0x2b3a69,_0x4ef365,_0x5789b8,_0x16f373];}['_createLabelElement'](_0x74fa94){return{'tag':'span','attributes':{'class':Zr},'children':[{'text':_0x74fa94['to']('label')}]};}['_createRemoveButton'](){const _0x1d672c=new _0x3fc85a(this['locale']);return _0x1d672c['set']({'label':m(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x223b2d}),this['_setupRemoveButtonEvent'](_0x1d672c),_0x1d672c;}['_setupRemoveButtonEvent'](_0x6f939b){_0x6f939b['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x415923=this['bindTemplate'],_0x209eca=new _0x1a5580();return _0x209eca['content']=xn[this['itemType']],_0x209eca['extendTemplate']({'attributes':{'class':[la,_0x415923['if']('isLoading','ck-hidden',_0x58e9d2=>_0x58e9d2)]}}),_0x209eca;}['_handleAnimationEndOnce'](_0x31f903,_0x5579fb){if(!_0x31f903)return;const _0x128b60=()=>{_0x5579fb(),_0x31f903['removeEventListener']('animationend',_0x128b60),_0x31f903['removeEventListener']('webkitAnimationEnd',_0x128b60);};_0x31f903['addEventListener']('animationend',_0x128b60),_0x31f903['addEventListener']('webkitAnimationEnd',_0x128b60);}['_createLoaderIcon'](){const _0x5950e0=new De('small');return _0x5950e0['bind']('isVisible')['to'](this,'isLoading',_0x521ef0=>_0x521ef0),_0x5950e0;}}function On(_0x4d1138){if(!_0x4d1138)return _0x4d1138;if(_0x4d1138['length']<=0x78)return _0x4d1138;const _0x417cd7=_0x4d1138['slice'](0x0,0x78),_0x31fbe8=_0x417cd7['lastIndexOf']('\x20');return(_0x31fbe8>0x0?_0x417cd7['slice'](0x0,_0x31fbe8):_0x417cd7)+'…';}const an={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},wn='300px';class fo{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x19e519,_0x2ee825,_0x1ab650,_0x3e0864,_0x574e66){this['_locale']=_0x19e519,this['_visibleChips']=_0x2ee825,this['_config']={...an,..._0x1ab650,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x1ab650['cssClasses']}},this['_overflowChips']=new _0x53af97(),this['_bodyCollection']=_0x3e0864,this['_parentView']=_0x574e66||null;}['setContainerElement'](_0x4b91cb){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x4b91cb,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 _0x49d1ec=[...this['_visibleChips'],...this['_overflowChips']],_0xfd4a2d=this['_createCalculationContainer'](),_0x3e2fc0=this['_calculateOverflowInContainer'](_0xfd4a2d,_0x49d1ec),_0x96e6a8=_0xfd4a2d['_ancestorsToRestore'];_0x96e6a8&&this['_restoreAncestorVisibility'](_0x96e6a8),_0xfd4a2d['remove'](),this['_applyOverflowResults'](_0x49d1ec,_0x3e2fc0);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x23d932({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x222f0d=new _0x3fc85a(this['_locale']);_0x222f0d['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x24be8e=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x24be8e['push'](this['_config']['cssClasses']['controlsButton']),_0x222f0d['extendTemplate']({'attributes':{'class':_0x24be8e}}),_0x222f0d;}['_createShowMoreBalloonPanelView'](){const _0x75aba0=new _0x51e059(this['_locale']);return _0x75aba0['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x75aba0),_0x75aba0;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x3c7771=>{_0x3c7771['disableAnimationOnEnter']();});const _0x812ec7=new _0x538d57(this['_locale']);_0x812ec7['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x812ec7);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x938403=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x938403?'':'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'](_0x24d5cd){const _0x52c994=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x17ce2b=this['_containerElement']?.['classList'];if(_0x17ce2b){const _0x39399e=_0x17ce2b[0x0]||'',_0x4c344d=_0x24d5cd['querySelector']('.'+_0x39399e),_0x4d0fe1=_0x24d5cd['querySelector'](_0x52c994);return _0x4c344d||_0x4d0fe1||_0x24d5cd;}return _0x24d5cd['querySelector'](_0x52c994)||_0x24d5cd;}['_calculateContainerWidth'](){const _0x7131d2=this['_parentView']?.['element']||this['_containerElement'];if(!_0x7131d2)return wn;const _0x52c6bf=window['getComputedStyle'](_0x7131d2)['width'];if('auto'===_0x52c6bf||'0px'===_0x52c6bf||!_0x52c6bf){const _0x1dd5a3=_0x7131d2['parentElement'];if(_0x1dd5a3){const _0x4c6d20=window['getComputedStyle'](_0x1dd5a3);return'auto'!==_0x4c6d20['width']?_0x4c6d20['width']:wn;}return wn;}return _0x52c6bf;}['_applyCalculationStyles'](_0x483865,_0x4132b5){this['_config']['cssClasses']['calculationContainer']&&_0x483865['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x483865['style']['width']=_0x4132b5,_0x483865['style']['position']='absolute',_0x483865['style']['top']='-9999px',_0x483865['style']['left']='-9999px',_0x483865['style']['opacity']='0',_0x483865['style']['pointerEvents']='none',_0x483865['style']['zIndex']='-1',_0x483865['style']['visibility']='visible\x20!important',_0x483865['style']['display']='block\x20!important',_0x483865['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x24bee4){_0x24bee4['forEach'](({element:_0x2eb6ed,originalDisplay:_0x207642,originalVisibility:_0x4678ff})=>{_0x2eb6ed['style']['display']=_0x207642,_0x2eb6ed['style']['visibility']=_0x4678ff;});}['_makeAncestorsVisible'](_0x488476){const _0x3f750d=[];let _0x1b218c=_0x488476;for(;_0x1b218c&&_0x1b218c!==document['body'];){const _0x877a79=window['getComputedStyle'](_0x1b218c);'none'!==_0x877a79['display']&&'hidden'!==_0x877a79['visibility']||(_0x3f750d['push']({'element':_0x1b218c,'originalDisplay':_0x1b218c['style']['display'],'originalVisibility':_0x1b218c['style']['visibility']}),_0x1b218c['style']['display']='block',_0x1b218c['style']['visibility']='visible'),_0x1b218c=_0x1b218c['parentElement'];}return _0x3f750d;}['_createContainerElements'](){let _0x21e2af,_0x2acda9;return this['_parentView']?.['element']?(_0x21e2af=this['_parentView']['element']['cloneNode'](!0x0),_0x2acda9=this['_findTargetContainer'](_0x21e2af)):(_0x21e2af=document['createElement']('div'),_0x2acda9=_0x21e2af),{'calculationContainer':_0x21e2af,'targetContainer':_0x2acda9};}['_createCalculationContainer'](){const {calculationContainer:_0x310561,targetContainer:_0x3db9f6}=this['_createContainerElements'](),_0x1c1417=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x310561,_0x1c1417);const _0x1c77a0=this['_parentView']?.['element']||this['_containerElement'],_0x23fa6b=_0x1c77a0?.['parentElement'];_0x23fa6b?_0x23fa6b['appendChild'](_0x310561):document['body']['appendChild'](_0x310561),_0x310561['_targetContainer']=_0x3db9f6;const _0x3f3ee1=this['_makeAncestorsVisible'](_0x23fa6b||null);return _0x310561['offsetWidth'],_0x310561['_ancestorsToRestore']=_0x3f3ee1,_0x310561;}['_calculateOverflowInContainer'](_0x54182a,_0x47043e){const _0x2f7ea4=_0x54182a['_targetContainer']||_0x54182a,_0xa5d981=[],{rowCount:_0x161462}=this['_renderChipsAndCountRows'](_0x2f7ea4,_0x47043e);if(_0x161462<=this['_config']['maxVisibleRows'])return _0xa5d981;const _0x4d794c=_0x47043e['slice']();for(;_0x4d794c['length']>0x0;){if(this['_testButtonFit'](_0x54182a,_0x2f7ea4,_0x4d794c)){const _0x452304=_0x47043e['filter'](_0x42f3f0=>!_0x4d794c['includes'](_0x42f3f0));_0xa5d981['push'](..._0x452304);break;}if(!_0x4d794c['pop']())break;}return _0xa5d981;}['_renderChipsAndCountRows'](_0x4b1dfc,_0x47b442){_0x4b1dfc['innerHTML']='',_0x47b442['forEach'](_0x207aff=>{if(_0x207aff['element']){const _0xe40faa=_0x207aff['element']['cloneNode'](!0x0);_0x4b1dfc['appendChild'](_0xe40faa);}}),_0x4b1dfc['offsetWidth'];const _0x574420=_0x4b1dfc['children'],_0x42f225=[];return Array['from'](_0x574420)['forEach'](_0x563821=>{const _0xdedf6c=_0x563821['getBoundingClientRect']()['top'];_0x42f225['some'](_0x4b2761=>Math['abs'](_0x4b2761-_0xdedf6c)<this['_config']['rowDetectionTolerance'])||_0x42f225['push'](_0xdedf6c);}),{'rowCount':_0x42f225['length']};}['_createMockButton'](){const _0x1d1199=document['createElement']('button');return _0x1d1199['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x1d1199['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x1d1199['textContent']='+\x201',_0x1d1199;}['_testButtonFit'](_0x4cbe8f,_0x5d5db3,_0x1b5f55){this['_renderChipsAndCountRows'](_0x5d5db3,_0x1b5f55);const _0x1db0ff=this['_createMockButton']();_0x4cbe8f['appendChild'](_0x1db0ff),_0x4cbe8f['offsetWidth'];const _0x2faab3=[..._0x5d5db3['children'],_0x1db0ff],_0x5364c9=[];_0x2faab3['forEach'](_0x32d637=>{const _0x607ee1=_0x32d637['getBoundingClientRect']()['top'];_0x5364c9['some'](_0x4d625d=>Math['abs'](_0x4d625d-_0x607ee1)<this['_config']['rowDetectionTolerance'])||_0x5364c9['push'](_0x607ee1);});const _0x2cfd7a=_0x5364c9['length'];return _0x1db0ff['remove'](),_0x2cfd7a<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x13b7c0,_0x469af3){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x13b7c0['forEach'](_0x47a0ac=>{_0x469af3['includes'](_0x47a0ac)?this['_overflowChips']['add'](_0x47a0ac):this['_visibleChips']['add'](_0x47a0ac);});}['_updateOverflowUI'](_0x1a04f9){if(_0x1a04f9>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x1a04f9>0x0&&this['_showMoreButtonView']){const _0x5ee162=''+this['_config']['showMoreLabelPrefix']+(_0x1a04f9<0x63?_0x1a04f9:'99');this['_showMoreButtonView']['label']=_0x5ee162;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x4586f4,_0x3631a3){this['_distributeChips'](_0x4586f4,_0x3631a3),this['_updateOverflowUI'](_0x3631a3['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x39352f=>{_0x39352f[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 _0x4a54c8=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x4a54c8['width']||0x0===_0x4a54c8['height'])return!0x1;const _0x112d51=window['innerHeight']||document['documentElement']['clientHeight'],_0x4e07a6=window['innerWidth']||document['documentElement']['clientWidth'],_0x3cbf00=0xc8;return _0x4a54c8['bottom']>=-0xc8&&_0x4a54c8['top']<=_0x112d51+_0x3cbf00&&_0x4a54c8['right']>=-0xc8&&_0x4a54c8['left']<=_0x4e07a6+_0x3cbf00;}}const da='ck-ai-chat__feed__context-chips',Aa='ck-ai-chat-context-chips-wrapper',Ia='ck-ai-chat-context-chips-wrapper-balloon',Ea='ck-ai-chat-controls-button',pa='ck-ai-chat-controls_context_show-more-button',Ta='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0x538d57{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x5867ff,_0x281cd1,_0x5a8bfa){super(_0x5867ff),this['_bodyCollection']=_0x5a8bfa,this['_createContextChips'](_0x281cd1);const _0x395e4b={'cssClasses':{'showMoreButton':pa,'showMoreBalloon':Ta,'overflowContainer':Ia,'controlsButton':Ea}};this['_overflowManager']=new fo(_0x5867ff,this['_contextChips'],_0x395e4b,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[da,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Aa},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x40d387=this['element']['querySelector']('.'+Aa);_0x40d387&&(this['_overflowManager']['setContainerElement'](_0x40d387),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x2aae06){for(const _0x226fd6 of _0x2aae06){const _0x296710=new xo(this['locale'],_0x226fd6,!0x0,!0x1);this['_contextChips']['add'](_0x296710);}}}class Ve extends xr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x33cabb,_0x3c09de,_0x1b659e){super(_0x3c09de),this['_locale']=_0x33cabb,this['_bodyCollection']=_0x1b659e,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'](_0x410871=>!_0x410871['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x538d57(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 xr{['capabilities'];constructor(_0x37f39f,_0x59e5fc){super(_0x59e5fc);const {isWebSearchEnabled:_0x30689c,isReasoningEnabled:_0xaece58}=_0x59e5fc['capabilities'],_0x4f1b77=[];let _0x117993='';_0x30689c&&_0xaece58?(_0x117993=m(_0x37f39f,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x4f1b77['push'](ca(_0x1904ed)),_0x4f1b77['push'](ca(_0x2190ec))):_0x30689c?(_0x117993=m(_0x37f39f,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x4f1b77['push'](ca(_0x1904ed))):_0xaece58&&(_0x117993=m(_0x37f39f,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x4f1b77['push'](ca(_0x2190ec))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x117993?'':'ck-hidden']}});const _0x1c9649=new _0x538d57();_0x1c9649['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x4f1b77,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x117993]}]}),this['children']['add'](_0x1c9649),this['capabilities']=_0x59e5fc['capabilities'];}}function ca(_0xc45502){const _0x582bf9=new _0x1a5580();return _0x582bf9['content']=_0xc45502,_0x582bf9;}const Fs=['wheel','touchstart','pointerdown','keydown'],qs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Fe{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x8c06b1){this['element']=_0x8c06b1,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x75a739 of Fs){const _0x4843df='keydown'!==_0x75a739;this['element']['addEventListener'](_0x75a739,this['_onUserEvent']['bind'](this),{'passive':_0x4843df,'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'](_0xaae677){if(this['isRunning']){if('keydown'===_0xaae677['type']){const _0x1d8d22=_0xaae677['key'];if(!qs['includes'](_0x1d8d22))return;}_0xaae677 instanceof WheelEvent?_0xaae677['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x5862af,scrollHeight:_0x2d8c1c,clientHeight:_0x769c9f}=this['element'];return _0x2d8c1c-_0x5862af-_0x769c9f<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Oe extends _0x538d57{constructor(_0x471211,_0x3d2b07){super(_0x471211),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x3d2b07)});}['_createSkeletonItems'](_0x2a3ce6){const _0x38f4df=['ck','ck-ai-skeleton__item'];return _0x2a3ce6['map'](_0xd0c1f9=>{let _0x20d14e='';switch(_0xd0c1f9['attributes']['align']){case'right':_0x20d14e='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x20d14e='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x20d14e='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0xd0c1f9['tag'],'attributes':{'class':[..._0x38f4df,_0xd0c1f9['attributes']['class']?_0xd0c1f9['attributes']['class']:''],'style':'width:\x20'+_0xd0c1f9['attributes']['width']+';\x20height:\x20'+_0xd0c1f9['attributes']['height']+';'+_0x20d14e}};});}}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(_0x3d3004,_0x5a6afc,_0x43b21c,_0x1952ac){return new Array(_0x3d3004)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x5a6afc,'height':_0x43b21c,'align':_0x1952ac}}));}class We extends xr{constructor(_0x1f02b9){super(_0x1f02b9),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class Ci extends _0x538d57{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x591821,_0x36db87){super(_0x591821),this['_bodyCollection']=_0x36db87,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...it)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Fe(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x8be157,_0x4081b0){let _0x399ba9;return'ai-reply'===_0x8be157?_0x399ba9=new je(this['locale'],_0x4081b0,this['_bodyCollection']):'ai-suggestion-reply'===_0x8be157?(_0x399ba9=new ke(this['locale'],_0x4081b0,this['_bodyCollection']),_0x399ba9['bind']('isTrackChangesOn')['to'](this)):_0x399ba9='user-message'===_0x8be157?new Ve(this['locale'],_0x4081b0,this['_bodyCollection']):'interaction-header'===_0x8be157?new et(this['locale'],_0x4081b0):'custom-element'===_0x8be157?new We(_0x4081b0):new Pe(_0x4081b0),this['children']['add'](_0x399ba9),_0x399ba9;}async['updateReplyItem']({id:_0x51c9d3,parsedContent:_0x299d21,renderingStrategy:_0x2493f2,abortSignal:_0x366771}){const _0x1d6cdb=this['getItemById'](_0x51c9d3);if(!(_0x1d6cdb instanceof je))throw new _0x1500e8('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x1d6cdb,'id':_0x51c9d3,'parsedContent':_0x299d21});await _0x1d6cdb['updateContent']({'parsedContent':_0x299d21,'renderingStrategy':_0x2493f2,'abortSignal':_0x366771});}async['updateWebSources'](_0x1996aa,_0x3c0aa0){const _0x4b39f9=this['getItemById'](_0x1996aa);if(_0x4b39f9 instanceof ke)_0x4b39f9['updateSources'](_0x3c0aa0);else{if(!(_0x4b39f9 instanceof je))throw new _0x1500e8('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x4b39f9,'id':_0x1996aa,'sources':_0x3c0aa0});_0x4b39f9['updateSources'](_0x3c0aa0);}}async['updateSuggestionItem']({id:_0x57620d,parts:_0x350af2,renderingStrategy:_0x273381,abortSignal:_0x9bf109}){const _0x46087b=this['getItemById'](_0x57620d);if(!(_0x46087b instanceof ke))throw new _0x1500e8('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x46087b,'id':_0x57620d,'parts':_0x350af2});await _0x46087b['updateContent']({'parts':_0x350af2,'renderingStrategy':_0x273381,'abortSignal':_0x9bf109});}['updateSuggestionPartState']({id:_0x546cd1,index:_0x5a807a,state:_0x2c4ee1}){const _0x110838=this['getItemById'](_0x546cd1);if(!(_0x110838 instanceof ke))throw new _0x1500e8('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x546cd1});_0x110838['updatePartState'](_0x5a807a,_0x2c4ee1);}['setSuggestionPartActive']({id:_0x3eb13b,index:_0x4f89b8,isActive:_0x2cc1ca}){const _0x2d77ca=this['getItemById'](_0x3eb13b);if(!(_0x2d77ca instanceof ke))throw new _0x1500e8('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x3eb13b});this['children']['filter'](_0x1a3bd1=>_0x1a3bd1 instanceof ke)['forEach'](_0x36e3e7=>{_0x36e3e7['setPartActive'](!0x1);}),_0x2d77ca['setPartActive'](_0x4f89b8,_0x2cc1ca);}['markItemAsDone'](_0x5bcc31){this['getItemById'](_0x5bcc31)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x29b671=>_0x29b671['options']['id']);}['removeItem'](_0x222149){this['children']['remove'](this['getItemById'](_0x222149));}['hasItem'](_0x512dc3){return!!this['children']['find'](_0x47873e=>_0x47873e['options']['id']['includes'](_0x512dc3));}['scrollToSuggestion'](_0xeb0f02,_0x54cb26){const _0x52925b=this['getItemById'](_0xeb0f02);if(!(_0x52925b instanceof ke))return void Zt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0xeb0f02,'partIndex':_0x54cb26});const _0x4dd1ac=_0x52925b['getPartView'](_0x54cb26);_0x4dd1ac?_0x917d7b(_0x4dd1ac['element'],0x14,this['element']['parentElement'],!0x0,!0x0):Zt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0xeb0f02,'partIndex':_0x54cb26});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x4e0a22=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x4e0a22,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x43acb7=new Oe(this['locale'],Be['aiFeed']);return _0x43acb7['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x1f72cd=>!_0x1f72cd)]}}),_0x43acb7;}['_createFeedItems'](){const _0x40866b=new _0x538d57(this['locale']);return _0x40866b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x40866b;}['_createFeedLoader'](){const _0x5811b3=new _0x538d57(this['locale']);return _0x5811b3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x8f0e3a=>!_0x8f0e3a)]},'children':this['_createLoaderChildren']()}),_0x5811b3;}['_createLoaderChildren'](){const _0x2a1a9d=new De();return _0x2a1a9d['isVisible']=!0x0,[_0x2a1a9d,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x4500b5){const _0xe9cd20=this['children']['find'](_0x35fd9b=>_0x35fd9b['options']['id']['includes'](_0x4500b5));if(!_0xe9cd20)throw new _0x1500e8('ai-chat-feed-view-item-not-found',this,{'id':_0x4500b5});return _0xe9cd20;}['setLoadingMessage'](_0x12c777){this['set']('loadingMessage',_0x12c777);}['toggleLoadingSkeleton'](_0x2a518e){this['set']('isLoadingSkeletonVisible',_0x2a518e);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class dh extends _0x1b0a54{['filter'](){let _0x4da721=0x0;for(const _0x1a24f8 of this['items'])_0x4da721+=_0x1a24f8['items']['length'];return{'resultsCount':_0x4da721,'totalItemsCount':_0x4da721};}}const _h='ck-ai-chat__prompt-input_highlighted';class ms extends _0x6213f1{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x2f7869,_0x19990a){super(_0x2f7869,{'queryView':{'label':'','creator':_0x550e60,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new dh(_0x2f7869),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x19990a,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ms['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ms['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',(_0x443703,_0x55bd9c)=>!_0x443703&&!_0x55bd9c),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x5c1ada,_0x55e030)=>{this['isUploadInProgress']||this['isEmpty']||_0x5c1ada['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x55e030());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x400851=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x400851)return this['queryView']['errorText']=m(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x422e3c=Wt(_0x400851);this['fire']('sendUserMessage',_0x422e3c),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x13b29d){this['queryView']['fieldView']['set']('placeholder',_0x13b29d);}['focus'](_0xf01622=!0x1){super['focus'](),_0xf01622&&(this['element']['classList']['contains'](_h)||(this['element']['classList']['add'](_h),setTimeout(()=>{this['element']['classList']['remove'](_h);},0x320)));}['_createSubmitButton'](){const _0x4b2cdb=new _0x3fc85a(this['locale']);return _0x4b2cdb['set']({'icon':_0x13c99b,'label':m(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x4b2cdb['on']('execute',()=>{this['submit']();}),_0x4b2cdb;}['setIsUploadInProgress'](_0x4f9bfd){this['isUploadInProgress']=_0x4f9bfd;}['_setUpAddContextButtonPositioning'](){const _0x4840b1=this['locale'],_0x5a37b9=()=>{_0x3537fe['window']['requestAnimationFrame'](()=>{if(_0x48958f(this['element'])){const _0x5b4679=new _0x34633d(this['queryView']['fieldView']['element']),_0x93c348=new _0x34633d(this['_addContextButtonView']['element']),_0x4cd1e4=_0x5b4679['width'],_0x30f0f3='rtl'===_0x4840b1['uiLanguageDirection']?'right':'left';_0x5b4679['excludeScrollbarsAndBorders']();const _0x11ec62=_0x4cd1e4-_0x5b4679['width']+0x1;this['_addContextButtonView']['element']['style'][_0x30f0f3]='calc('+(_0x4cd1e4-_0x93c348['width']-_0x11ec62)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x5a37b9),this['on']('render',()=>{_0x5a37b9(),this['_queryViewResizeObserver']=new _0x1a199c(this['queryView']['fieldView']['element'],()=>{_0x5a37b9();});});}}const ma='ck-ai-chat__prompt-capabilities',Ca='ck-ai-chat-controls-button',wa='ck-ai-chat-controls-button--commands',fa='ck-ai-button-tertiary',Sa='ck-ai-chat-controls__model-selection',ba='ck-ai-chat-controls__model-selection__item-name',Ra='ck-ai-chat-controls__model-selection__item-description',Oa='ck-ai-chat-controls__model-selection__item-capabilities',ka='n';class ds extends _0x538d57{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x2e6fb2){super(_0x2e6fb2),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),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,'modelDisplayMode',_0x679131=>'selector'===_0x679131),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x2a832c=>_0x2a832c?this['_modelSelectionDropdown']['buttonView']['label']:m(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0xdad200=>_0xdad200),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x3cd36a=>_0x3cd36a),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x25c5b1=>m(this['locale'],_0x25c5b1?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x2d67e1=>_0x2d67e1),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x330fe3=>m(this['locale'],_0x330fe3?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ma]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x53af97(),_0x57d60a(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x44083d,_0x461e8b){if(_0x461e8b)this['set']('modelDisplayMode','hidden');else{const _0x4349d4=0x1===_0x44083d['length'];this['set']('modelDisplayMode',_0x4349d4?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x44083d?.['length'])for(const _0x23b2e2 of _0x44083d){const _0x1a0dae=new _0x584377({'label':_0x23b2e2['name'],'withText':!0x0,'role':'menuitemradio','id':_0x23b2e2['id'],'model':_0x23b2e2});_0x1a0dae['bind']('isOn')['to'](this,'activeModelId',_0x22eb23=>_0x22eb23===_0x23b2e2['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1a0dae,'labelView':new Na(this['locale'],_0x23b2e2)});}}['setWebSearch'](_0x1f6345){this['set']('webSearchActive',_0x1f6345);}['setReasoning'](_0x286896){this['set']('reasoningActive',_0x286896);}['setModel'](_0x2958c0){if(!_0x2958c0)return;this['activeModelId']=_0x2958c0['id'],this['activeModelName']=_0x2958c0['name']||_0x2958c0['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x2958c0['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x2958c0['name']);const _0x1f715b=_0x2958c0['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x1f715b),this['_webSearchButton']['set']('isVisible',_0x1f715b);const _0x28b7c3=_0x2958c0['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x28b7c3),this['_reasoningButton']['set']('isVisible',_0x28b7c3);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x781d8f){this['set']('modelSelectorEnabled',!0x1),_0x781d8f&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x57c612=new _0x3fc85a();return _0x57c612['set']({'label':m(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x1904ed,'class':Ca,'isToggleable':!0x0,'tooltipPosition':ka}),_0x57c612['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x57c612;}['_createReasoningButton'](){const _0x14073c=new _0x3fc85a();return _0x14073c['set']({'label':m(this['locale'],'AI_CHAT_REASONING'),'icon':_0x2190ec,'class':Ca,'isToggleable':!0x0,'tooltipPosition':ka}),_0x14073c['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x14073c;}['_createCommandsButton'](){const _0x2f2679=new _0x3fc85a();return _0x2f2679['set']({'label':m(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x235661,'withText':!0x0,'class':Ca,'isToggleable':!0x0,'tooltip':m(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':ka}),_0x2f2679['extendTemplate']({'attributes':{'class':[wa]}}),_0x2f2679['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x2f2679;}['_createModelSelectionDropdown'](){const _0x3623d0=_0x238494(this['locale']);return _0x3623d0['set']({'panelPosition':'ne','class':[Sa]}),_0x3623d0['buttonView']['set']({'label':m(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':ka,'class':fa}),this['listenTo'](_0x3623d0,'execute',_0x4a8f26=>{this['fire']('selectModel',_0x4a8f26['source']['model']);}),_0x3623d0;}['_createModelNameView'](){const _0x3e9cf2=new ya(this['locale']);return _0x3e9cf2['bind']('text')['to'](this,'activeModelName',_0x33d349=>_0x33d349??''),_0x3e9cf2['bind']('isVisible')['to'](this,'modelDisplayMode',_0x2bcd3e=>'name'===_0x2bcd3e),_0x3e9cf2;}}let Na=class extends _0x3ffbe5{constructor(_0x3ba446,_0x2eba17){super();const _0x3b6e3f=this['bindTemplate'],_0x51475c=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x3b6e3f['to']('style'),'id':_0x3b6e3f['to']('id')},'children':[{'tag':'div','attributes':{'class':[ba]},'children':[{'text':_0x3b6e3f['to']('text')}]},{'tag':'div','attributes':{'class':[Ra]},'children':[{'tag':'span','children':[{'text':_0x2eba17['description']}]}]},{'tag':'div','attributes':{'class':[Oa]},'children':_0x51475c}]}),_0x51475c['addMany'](this['_getCapabilityParts'](_0x3ba446,_0x1904ed,'AI_CHAT_SEARCH_WEB',_0x2eba17['capabilities']['webSearch']?.['enabled']??!0x1)),_0x51475c['addMany'](this['_getCapabilityParts'](_0x3ba446,_0x2190ec,'AI_CHAT_REASONING',_0x2eba17['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x4a5b7b,_0x551a69,_0xfcfbe9,_0x1833bc){const _0x2b709a=new _0x1a5580();_0x2b709a['content']=_0x551a69;const _0x57f4c8=new _0x538d57(_0x4a5b7b);_0x57f4c8['setTemplate']({'tag':'span','children':[{'text':m(_0x4a5b7b,_0xfcfbe9)+':\x20'}]});const _0x580a79=new _0x538d57(_0x4a5b7b);return _0x580a79['setTemplate']({'tag':'span','children':[{'text':m(_0x4a5b7b,_0x1833bc?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x2b709a,_0x57f4c8,_0x580a79];}},ya=class extends _0x538d57{constructor(_0x506005){super(_0x506005),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x5b245e=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x5b245e['if']('isVisible','ck-hidden',_0x1b9204=>!_0x1b9204)]},'children':[{'text':_0x5b245e['to']('text')}]});}};const va='ck-ai-chat-context-controls__url-form',xa='ck-ai-chat-context-controls__url-input-section';class Io extends _0x538d57{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x3ab6cd){super(_0x3ab6cd),this['focusTracker']=new ts(),this['keystrokes']=new _0x356454(),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 _0x19c87e({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x1bbc51=>{this['focusTracker']['add'](_0x1bbc51['element']),this['keystrokes']['listenTo'](_0x1bbc51['element']);}),_0x2d4a6e({'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'](_0x1c4e5c){this['urlInputField']['errorText']=_0x1c4e5c,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x3a87e9=new _0x3fc85a(this['locale']);return _0x3a87e9['set']({'icon':_0x41367a,'tooltip':m(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x3782ae,_0x30cd6d,_0x4dca98)=>{_0x3a87e9['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x4dca98?'':'\x20ck-hidden')]});}),_0x3a87e9;}['_createUrlInputField'](){const _0x3c9431=new _0x449567(this['locale'],_0x279926);return _0x3c9431['set']({'label':m(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x3c9431['fieldView']['set']({'placeholder':m(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x3c9431;}['_createConfirmButton'](){const _0x5e3323=new _0x3fc85a(this['locale']);return _0x5e3323['set']({'icon':_0x28d1ec,'tooltip':m(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x5e3323;}['_setupTemplate'](){const _0x518129=new _0x2c8dbc(this['locale'],{'label':m(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x518129['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':va,'tabindex':'-1'},'children':[_0x518129,{'tag':'div','attributes':{'class':xa},'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',_0x262365=>{_0x262365['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x227cf0,_0x5470ae)=>{this['clear'](),this['fire']('cancel'),_0x5470ae();});}['_handleSubmit'](){const _0x26bc2d=this['getValue']()['trim']();_0x26bc2d?this['_isValidUrl'](_0x26bc2d)?(this['clearError'](),this['fire']('submitUrl',_0x26bc2d)):this['setError'](m(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](m(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0xd41f72=this['getValue']()['trim'](),_0x18ba3f=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0xd41f72['length']>0x0&&!_0x18ba3f;}['_isValidUrl'](_0x2823fc){try{return!!new URL(_0x2823fc);}catch{return!0x1;}}}const La='ck-ai-chat-resources__item',Da='ck-ai-chat-resources__item--in-context',Pa='ck-ai-chat-resources__item-title',Ha='ck-ai-chat-resources__item__icon';class hc extends _0x5749b5{['resource'];['_titleView'];['_iconView'];constructor(_0x4e7ddd,_0x16bc79){super(_0x4e7ddd),this['resource']=_0x16bc79,this['set']('isInContext',!!_0x16bc79['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x152481){if(_0x152481['isInContext'])return _0x28d1ec;switch(_0x152481['type']){case Jt['DOCUMENT']:return _0x59e6a4;case Jt['URL']:return _0x1afd05;case Jt['FILE']:case Jt['TEXT']:return _0x2f42c6;default:return _0x40ab64;}}['highlightText'](_0x4b5891){if(!_0x4b5891||''===_0x4b5891['trim']())return void this['_titleView']['highlightText'](null);const _0x5541c6=new RegExp(_0x32442b(_0x4b5891),'gi');this['_titleView']['highlightText'](_0x5541c6);}['updateResourceState'](_0x34e3ac){this['resource']['isInContext']=_0x34e3ac,this['isInContext']=_0x34e3ac,this['_updateIcon']();}['_createTitleView'](){const _0x200d0d=new _0xe11984();return _0x200d0d['text']=this['resource']['label'],_0x200d0d['extendTemplate']({'tag':'span','attributes':{'class':[Pa]}}),_0x200d0d;}['_createIconView'](){const _0x41eb95=new _0x1a5580();return _0x41eb95['content']=this['getResourceIcon'](this['resource']),_0x41eb95;}['_setupTemplate'](){const _0x1bbfbb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[La,_0x1bbfbb['if']('isVisible','ck-hidden',_0x3225d7=>!_0x3225d7),_0x1bbfbb['if']('isInContext',Da)]},'children':[{'tag':'div','attributes':{'class':[Ha]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x1bbfbb['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Ma='ck-ai-chat-resources__list';class Ur extends _0x1b0a54{['_source'];constructor(_0x3098ac,_0x2d3172){super(_0x3098ac),this['_source']=_0x2d3172,this['extendTemplate']({'attributes':{'class':[Ma]}});}['setResources'](_0x3620d4,_0x360bda){this['items']['clear']();let _0x72c8de=_0x3620d4;if(this['_source']['useDefaultFiltering']&&_0x360bda&&''!==_0x360bda['trim']()){const _0x28bfc9=new RegExp(_0x360bda['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x72c8de=_0x3620d4['filter'](_0x105515=>_0x28bfc9['test'](_0x105515['label']));}for(const _0x2fe363 of _0x72c8de){const _0x4842a1=new hc(this['locale'],_0x2fe363);_0x4842a1['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x2fe363);}),this['items']['add'](_0x4842a1);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x360bda);}['highlightText'](_0x25ac54){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x384050=>{_0x384050['highlightText'](_0x25ac54);});}['updateResourceState'](_0x539cbf,_0x2dfbee){for(const _0xe9774c of this['items']){const _0x2439b7=_0xe9774c;_0x2439b7['resource']['id']===_0x539cbf&&_0x2439b7['updateResourceState'](_0x2dfbee);}}['_handleResourceSelection'](_0x5e84a1,_0x46b386){this['fire']('addResourceToContext',{'source':_0x5e84a1,'resource':_0x46b386});}}class zr extends _0x449567{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x300e97){const t=_0x300e97['t'],_0x2d1380={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x279926,'label':m(_0x300e97,'AI_CHAT_SEARCH_RESOURCES')};super(_0x300e97,_0x2d1380['creator']),this['label']=_0x2d1380['label'],this['_viewConfig']=_0x2d1380,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x300e97,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x17b970){this['fire']('search',_0x17b970);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x1a5580(),this['iconView']['content']=_0x31f317,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x147ba9,t){this['resetButtonView']=new _0x3fc85a(_0x147ba9),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x3b3d8d,'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',_0x55bd3b=>!_0x55bd3b),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 nc extends _0x538d57{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x474ba5,_0x433932){super(_0x474ba5),this['_source']=_0x433932['source'],this['_searchInputVisibleFrom']=_0x433932['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 _0x4f2c93([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new zr(this['locale']);}['_createSearchSection'](){const _0x3f99db=new _0x538d57(this['locale']);return _0x3f99db['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x14f1b0,_0x129c64)=>{this['loadResources'](_0x129c64),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x129c64);}),_0x3f99db;}['_createResourcesListView'](){const _0x1ff34f=new Ur(this['locale'],this['_source']);return _0x1ff34f['delegate']('addResourceToContext')['to'](this),_0x1ff34f['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x1ff34f;}['_createSkeletonView'](){const _0x39ea1a=new Oe(this['locale'],Be['aiChatResources']);return _0x39ea1a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x179acb=>!_0x179acb)]}}),_0x39ea1a;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x488d9b){const _0x1573b5=_0x3e4e8c();this['_latestLoadResourcesUid']=_0x1573b5,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x488d9b,'uid':_0x1573b5}),this['isLoading']=!0x0;}['setResources'](_0xf7e304,_0xe86f82){if(_0xe86f82&&_0xe86f82!==this['_latestLoadResourcesUid'])return;const _0x96df7d=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0xf7e304,_0x96df7d),_0xf7e304['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x17b2da,_0x2eaca0){this['_resourcesListView']['updateResourceState'](_0x17b2da,_0x2eaca0);}}const Ua='ck-ai-chat-context-controls__source-balloon-panel',Va='ck-button-icon\x20ck-button-back',Ba='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Po{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0xa1bb77,_0x465327,_0x19458b){this['_locale']=_0xa1bb77,this['_bodyCollection']=_0x465327,this['_config']=_0x19458b;}['showSourceResourcesBalloon']({source:_0x97d63e,withBackButton:_0x15e456}){let _0x3e51e3=this['_sourceResourceBalloons']['get'](_0x97d63e['id']);_0x3e51e3||(_0x3e51e3=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x97d63e['id'],_0x3e51e3),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x3e51e3)),this['_addSourceResourceContent']({'balloonPanel':_0x3e51e3,'source':_0x97d63e,'withBackButton':_0x15e456}),_0x3e51e3['show']();const _0xd6f747=this['_config']['getTargetElement']();_0xd6f747&&_0x3e51e3['pin']({'target':_0xd6f747,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x5a5fd6,_0x4c5978,_0x317694){const _0xf46629=this['_sourceResourceBalloons']['get'](_0x5a5fd6);if(!_0xf46629)return;const _0x5eb2e1=this['_getResourcesViewFromBalloon'](_0xf46629);_0x5eb2e1&&(_0x5eb2e1['setResources'](_0x4c5978,_0x317694),_0x5eb2e1['once']('change:isLoading',()=>{_0xf46629['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x47418b){const _0x373c04=this['_sourceResourceBalloons']['get'](_0x47418b);_0x373c04&&requestAnimationFrame(()=>{_0x373c04['hide'](),this['_sourceResourceBalloons']['delete'](_0x47418b),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x1adf86 of this['_sourceResourceBalloons']['values']())if(_0x1adf86['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x1a9006,_0x1f678e,_0x5a7445){const _0x1f965e=this['_sourceResourceBalloons']['get'](_0x1a9006);if(!_0x1f965e||!_0x1f965e['isVisible'])return;const _0x25df86=this['_config']['getTargetElement']();if(!_0x25df86)return;_0x1f965e['pin']({'target':_0x25df86,'limiter':this['_config']['getLimiterElement']()});const _0x7f5399=this['_getResourcesViewFromBalloon'](_0x1f965e);_0x7f5399&&_0x7f5399['updateResourceState'](_0x1f678e,_0x5a7445);}['destroy'](){for(const _0x2e85a8 of this['_sourceResourceBalloons']['values']())_0x2e85a8['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x5af3b1=new _0x51e059(this['_locale']);return _0x5af3b1['extendTemplate']({'attributes':{'class':Ua}}),this['_bodyCollection']['add'](_0x5af3b1),_0x5af3b1;}['_addSourceResourceContent']({balloonPanel:_0x193eff,source:_0x3a2bb5,withBackButton:_0x50d81a}){_0x193eff['content']['clear']();const _0x53ffd9=this['_createBalloonHeader']({'balloonPanel':_0x193eff,'source':_0x3a2bb5,'withBackButton':_0x50d81a});_0x193eff['content']['add'](_0x53ffd9);const _0x962e9b=this['_createBalloonResourcesView'](_0x3a2bb5);_0x193eff['content']['add'](_0x962e9b);}['_createBalloonHeader']({balloonPanel:_0x509c07,source:_0x53f629,withBackButton:_0x52316e}){const _0x99ddc8=new _0x2c8dbc(this['_locale'],{'label':_0x53f629['label'],'class':Ba});return _0x52316e&&_0x99ddc8['children']['add'](this['_createBackButton'](_0x509c07),0x0),_0x99ddc8;}['_createBackButton'](_0x39fdbb){const _0x4d59bb=new _0x3fc85a(this['_locale']);return _0x4d59bb['set']({'icon':_0x41367a,'tooltip':m(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Va}),_0x4d59bb['on']('execute',()=>{_0x39fdbb['hide'](),this['_config']['onBackToContext']();}),_0x4d59bb;}['_createBalloonResourcesView'](_0x57cb18){const _0x5e0fa6=new nc(this['_locale'],{'source':_0x57cb18,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x5e0fa6['on']('loadSourceResources',(_0xe0e7d2,_0x57b0c4)=>{this['_config']['onLoadSourceResources'](_0x57b0c4);}),_0x5e0fa6['on']('addResourceToContext',(_0x51235b,_0x474840)=>{this['_config']['onResourceSelected'](_0x474840['source'],_0x474840['resource']),this['closeSourceResourceBalloon'](_0x57cb18['id']);}),_0x5e0fa6;}['_getResourcesViewFromBalloon'](_0x519d4e){const _0xc26807=_0x519d4e['content']['get'](0x1);return _0xc26807 instanceof nc?_0xc26807:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x4a2db5){_0x23d932({'emitter':_0x4a2db5,'contextElements':[_0x4a2db5['element']],'callback':()=>{_0x4a2db5['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x4a2db5['isVisible']});}}const gs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Ro='ck-ai-chat-context-controls',So='ck-ai-chat-context-controls__pending-contexts',Oo='ck-ai-chat-context-controls__add-context-balloon-panel',Uo='ck-ai-chat-context-controls__add-context-button',Lo='ck-ai-chat-context-controls__url-balloon-panel',No='ck-ai-chat-context-controls__balloon-button',Ho='ck-ai-chat-context-controls__balloon-button-source',jo='ck-ai-chat-controls-button',Fo='ck-ai-chat-context-chips-wrapper-balloon',Bo='ck-ai-chat-controls_context_show-more-button',Mo='ck-ai-chat-context-controls__show-more-balloon-panel',Xo='ck-ai-chat',yo=[_0x51e059['defaultPositions']['northArrowSouthWest'],_0x51e059['defaultPositions']['northArrowSouth'],_0x51e059['defaultPositions']['northArrowSouthEast'],_0x51e059['defaultPositions']['southArrowNorthWest'],_0x51e059['defaultPositions']['southArrowNorth'],_0x51e059['defaultPositions']['southArrowNorthEast']];class bs extends _0x538d57{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x4c64ac,_0x4d73c3){super(_0x4c64ac),this['bodyCollection']=_0x4d73c3['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x4c64ac),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x4c64ac),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x4c64ac),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x4c64ac,_0x4d73c3);const _0x4197d1={'cssClasses':{'showMoreButton':Bo,'showMoreBalloon':Mo,'overflowContainer':Fo,'controlsButton':jo}};this['_overflowManager']=new fo(_0x4c64ac,this['_currentContextsChips'],_0x4197d1,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'](_0x1b516d,_0x393bfa){const _0x47efcc=this['_createContextButton'](_0x1b516d,'current',!0x0,_0x393bfa);this['_addContextToCollection'](_0x47efcc,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x4ed3f5){this['_removeContextFromCollection'](_0x4ed3f5,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x4ed3f5,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x3d2374,_0x4ceff5){let _0x392ab=this['_currentContextsChips']['find'](_0xd5dc24=>_0xd5dc24['id']===_0x3d2374);_0x392ab||(_0x392ab=this['_overflowManager']['overflowChips']['find'](_0x24477c=>_0x24477c['id']===_0x3d2374)),_0x392ab&&(_0x392ab['isLoading']=_0x4ceff5);}['setConversationContext'](_0x59e368){this['_conversationContextsChips']['clear']();for(const _0x53ea9a of _0x59e368){const _0x33f4b7=this['_createContextButton'](_0x53ea9a,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x33f4b7,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x3cf2bf,_0x104c7d,_0x50366d){this['_resourcesBalloonView']['updateResourceState'](_0x3cf2bf,_0x104c7d,_0x50366d);}['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']({source:_0x5b2512,withBackButton:_0x4e9c38}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x5b2512,'withBackButton':_0x4e9c38}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x173dd9,_0xc64a7d,_0x535b65,_0x493f1d){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x173dd9,_0x535b65,_0x493f1d);}['closeSourceResourceBalloon'](_0x1f24b6){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x1f24b6),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x5b8bf9){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x5b8bf9),this['_setAddContextButtonEnabled'](_0x5b8bf9);}['_setAddContextButtonEnabled'](_0x53d550){const _0x5186a9=!_0x53d550['document']['isHidden']&&_0x53d550['document']['enabled'],_0x14bc41=_0x53d550['urls']['enabled'],_0x3db11e=_0x53d550['files']['enabled'],_0x51ad3f=_0x53d550['sources']['length']>0x0,_0x7e284b=_0x53d550['customItems']&&_0x53d550['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x5186a9||_0x14bc41||_0x3db11e||_0x51ad3f||_0x7e284b;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Ro,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':So},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x20bca4){const _0x5e46eb=new _0x3fc85a(_0x20bca4);return _0x5e46eb['set']({'label':m(_0x20bca4,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':jo+'\x20'+Uo,'icon':_0x2509b0,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x5e46eb;}['_createAddContextBalloonPanelView'](_0x47ea0f){return this['_createBaseBalloonPanel'](_0x47ea0f,Oo);}['_createUrlBalloonPanelView'](_0xd267bc){const _0xc63c0e=this['_createBaseBalloonPanel'](_0xd267bc,Lo);return this['_addUrlContent'](_0xc63c0e,_0xd267bc),_0xc63c0e;}['_createResourcesBalloonView'](_0x4bba03,_0x4fb4aa){const _0x7cbd72={'searchInputVisibleFrom':_0x4fb4aa['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':yo});},'onResourceSelected':(_0x96b7ab,_0x514e2e)=>{this['fire']('addResourceToContext',{'source':_0x96b7ab,'resource':_0x514e2e});},'onLoadSourceResources':_0x33a289=>{this['fire']('loadSourceResources',_0x33a289);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Po(_0x4bba03,_0x4fb4aa['bodyCollection'],_0x7cbd72);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Xo)||document['body'];}['_createBaseBalloonPanel'](_0x820c46,_0x4794ad){const _0x24ae45=new _0x51e059(_0x820c46);return _0x24ae45['extendTemplate']({'attributes':{'class':_0x4794ad}}),this['bodyCollection']['add'](_0x24ae45),_0x24ae45;}['_setBalloonPanelContent'](_0xf37768,_0xaf8ba9,_0x27eb93){if(_0xf37768['content']['clear'](),!_0x27eb93['document']['isHidden']&&_0x27eb93['document']['enabled']){const _0x155857=this['_createBalloonButton'](_0xaf8ba9,{'label':m(_0xaf8ba9,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x59e6a4});_0x155857['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0xf37768['content']['add'](_0x155857);}if(_0x27eb93['urls']['enabled']){const _0x4fe60f=this['_createBalloonButton'](_0xaf8ba9,{'label':m(_0xaf8ba9,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x1afd05});_0x4fe60f['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':yo}),this['_urlInputView']['focus']();}),_0xf37768['content']['add'](_0x4fe60f);}if(_0x27eb93['files']['enabled']){const _0x5c05cb=new _0x4b66f3(_0xaf8ba9);_0x5c05cb['set']({'label':m(_0xaf8ba9,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x5ec29a,'withText':!0x0,'tooltip':!0x0,'class':No,'allowMultipleFiles':!0x0}),_0x5c05cb['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x5c05cb['on']('done',(_0x519dd6,_0x414313)=>{this['fire']('addFileToContext',_0x414313);}),_0x5c05cb['tooltip']=!0x0,_0xf37768['content']['add'](_0x5c05cb);}for(const _0x3d5f7b of _0x27eb93['sources']){const _0x4cbc28=this['_createBalloonButton'](_0xaf8ba9,{'label':_0x3d5f7b['label'],'icon':_0x3d5f7b['icon']||_0x40ab64,'type':'source'});_0xf37768['content']['add'](_0x4cbc28),_0x4cbc28['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x3d5f7b,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x5cca86 of _0x27eb93['customItems']||[]){const _0x4ac8e5=this['_createBalloonButton'](_0xaf8ba9,{'label':_0x5cca86['label'],'icon':_0x5cca86['icon']||_0x40ab64,'type':'customItem'});_0xf37768['content']['add'](_0x4ac8e5),_0x4ac8e5['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x5cca86);});}this['_hasExactlyOneSource']=0x1===_0xf37768['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0xbed4f8,_0x3e4c27){this['_urlInputView']=new Io(_0x3e4c27),this['_urlInputView']['on']('submitUrl',(_0x5cf2a4,_0x5ac25e)=>{this['_handleUrlSubmit'](_0x5ac25e);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':yo}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':yo});}),_0xbed4f8['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x50efa7,_0x6584d9){const _0x3f9803='source'===_0x6584d9['type']?new Ga(_0x50efa7):new _0x3fc85a(_0x50efa7);return _0x3f9803['set']({'label':_0x6584d9['label'],'icon':_0x6584d9['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':No}),_0x3f9803;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x23d932({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x19d64e){const _0x1830d4=this['_addContextBalloonConfig'];_0x1830d4['buttonView']['isOn']=_0x19d64e,_0x19d64e?_0x1830d4['balloonView']['show']():_0x1830d4['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x574dfa,buttonView:_0x32a8a3,hideMethod:_0x3a8bc7}=this['_addContextBalloonConfig'];_0x23d932({'emitter':_0x574dfa,'contextElements':[_0x574dfa['element'],_0x32a8a3['element']],'callback':()=>{_0x3a8bc7();},'activator':()=>_0x32a8a3['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x238b26,_0x2893af,_0x403a54=!0x1,_0x151980=!0x1){const _0x2e6c35='conversation'===_0x2893af||!0x0===_0x238b26['isReadOnly'],_0xfc2992=new xo(this['locale'],_0x238b26,_0x2e6c35,_0x403a54,_0x151980);return _0x2e6c35||_0xfc2992['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0xfc2992['id']);}),_0xfc2992;}['_addContextToCollection'](_0x5667f6,_0x55e6ce){_0x55e6ce['add'](_0x5667f6,0x0);}['_removeContextFromCollection'](_0x2c5de6,_0x4009b5){const _0x4605d4=_0x4009b5['find'](_0x35478c=>_0x35478c['id']===_0x2c5de6);_0x4605d4&&_0x4009b5['remove'](_0x4605d4);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':yo}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x256b45){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x256b45);}}class Ga extends _0x3fc85a{['arrowView'];constructor(_0x388a8d){super(_0x388a8d),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ho]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x593d9e=new _0x1a5580();return _0x593d9e['content']=_0x41c19f,_0x593d9e['extendTemplate']({'attributes':{'class':Ho+'__arrow'}}),_0x593d9e;}}class ws extends _0x538d57{['_cancelButtonView'];['_loaderView'];constructor(_0x111d0c){super(_0x111d0c),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 _0x308107=new _0x3fc85a(this['locale']);return _0x308107['set']({'label':m(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x30c4f4}),_0x308107['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x308107;}['_createLoaderView'](){const _0x275872=new _0x538d57(this['locale']);return _0x275872['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':m(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x275872;}}class xi extends _0x538d57{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x136b37,_0x3c925a){super(_0x136b37),this['_contextPanelView']=this['_createContextPanelView'](_0x136b37,{'bodyCollection':_0x3c925a['bodyCollection'],'searchInputVisibleFrom':_0x3c925a['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x136b37),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x136b37),this['_loaderView']=this['_createLoaderView'](_0x136b37),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x136b37),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'](...gs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x381b85=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x381b85['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x381b85['if']('isLoading','ck-hidden',_0xf12e15=>_0xf12e15||!this['isModelAvailable']),_0x381b85['if']('isModelAvailable','ck-hidden',_0x1e0fbd=>!_0x1e0fbd||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x381b85['if']('isLoading','ck-hidden',_0x137c7a=>!_0x137c7a)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x381b85['if']('isModelAvailable','ck-hidden',_0xf6c90e=>_0xf6c90e)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x23d932({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x4bf278,_0x570eb1){return new bs(_0x4bf278,_0x570eb1);}['_createPromptInputView'](_0x1e14c2){return new ms(_0x1e14c2,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x444871){return new ds(_0x444871);}['_createLoaderView'](_0x10299b){return new ws(_0x10299b);}['_createModelUnavailableMessageView'](_0x256e12){const _0x3da4d3=new _s(_0x256e12);return _0x3da4d3['delegate']('startConversation')['to'](this),_0x3da4d3;}['_handlePromptInputFocus'](_0x54b34e,_0x17fcd3,_0x54c858){_0x54c858?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x2bfd9d,_0x202bd8){this['_contextPanelView']['addContextItem'](_0x2bfd9d,_0x202bd8);}['removeContextItem'](_0x18c011){this['_contextPanelView']['removeContextItem'](_0x18c011);}['setContextItemLoading'](_0x3f11bd,_0x3e1e19){this['_contextPanelView']['setContextItemLoading'](_0x3f11bd,_0x3e1e19);}['setIsUploadInProgress'](_0x1ab7b4){this['_promptInputView']['setIsUploadInProgress'](_0x1ab7b4);}['setConversationContext'](_0x53e965){this['_contextPanelView']['setConversationContext'](_0x53e965);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x30f4f4,_0xd86a75,_0x478882){this['_contextPanelView']['updateResourceState'](_0x30f4f4,_0xd86a75,_0x478882);}['setWebSearch'](_0x415eec){this['_promptCapabilitiesView']['setWebSearch'](_0x415eec);}['setReasoning'](_0x4c6843){this['_promptCapabilitiesView']['setReasoning'](_0x4c6843);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x4d369b){this['_contextPanelView']['setAddContextOptions'](_0x4d369b);}['setInputPlaceholder'](_0x43f93d){this['_promptInputView']['setPlaceholderText'](_0x43f93d);}['setModelList'](_0x3fbcb1,_0x49db02){this['_promptCapabilitiesView']['setModelList'](_0x3fbcb1,_0x49db02);}['setModel'](_0x4a324f){_0x4a324f?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x4a324f)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x210f2f){this['_promptCapabilitiesView']['disableModelSelector'](_0x210f2f);}['populateSourceResourceBalloon'](_0xdcd3cd,_0x4c1622,_0x47965d,_0x52ce1e){this['_contextPanelView']['populateSourceResourceBalloon'](_0xdcd3cd,_0x4c1622,_0x47965d,_0x52ce1e);}['closeSourceResourceBalloon'](_0x5f0425){this['_contextPanelView']['closeSourceResourceBalloon'](_0x5f0425);}['focusPromptInput'](_0xaad71a=!0x1){this['_promptInputView']['focus'](_0xaad71a);}['setPromptInputValue'](_0x515d91){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x515d91;}}class _s extends _0x538d57{constructor(_0x348a82){super(_0x348a82);const _0x4c8e61=new _0x3fc85a(_0x348a82);_0x4c8e61['set']({'label':m(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x4c8e61['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':m(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x4c8e61]}]});}}class Si extends _0x2c8dbc{['conversationStartButton'];['resizeButton'];constructor(_0x516b32,_0x19f351){super(_0x516b32,{'label':m(_0x516b32,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':tt}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x516b32),this['children']['add'](this['conversationStartButton']),_0x19f351&&(this['resizeButton']=Cs(_0x516b32,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x5b8694){const _0x27287f=new _0x3fc85a(_0x5b8694);return _0x27287f['set']({'label':m(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0xa967bf,'class':'ck-ai-chat__start-conversation'}),_0x27287f['on']('execute',()=>{this['fire']('startConversation');}),_0x27287f;}}class Bi extends _0x538d57{constructor(_0x563612){super(_0x563612),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':m(_0x563612,'AI_DISCLAIMER_TEXT')}]}]});}}class K extends _0x538d57{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x136eba,_0x581a2e){super(_0x136eba),this['_bodyCollection']=new _0x4b2ab0(_0x136eba),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Si(_0x136eba,_0x581a2e['showResizeButton']),this['chatHeader']['delegate'](...it)['to'](this),this['chatFeed']=new Ci(_0x136eba,this['_bodyCollection']),this['chatFeed']['delegate'](...it)['to'](this),this['chatControls']=new xi(_0x136eba,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x581a2e['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...it)['to'](this),this['chatDisclaimer']=new Bi(_0x136eba),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x136eba['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x4c4831,_0x48b93d,_0x1b02d8,_0x194683){this['chatControls']['populateSourceResourceBalloon'](_0x4c4831,_0x48b93d,_0x1b02d8,_0x194683);}['closeSourceResourceBalloon'](_0x2a055b){this['chatControls']['closeSourceResourceBalloon'](_0x2a055b);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class P extends _0x37abb2{static get['requires'](){return[H];}['_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(_0x42c2d7){super(_0x42c2d7);const _0x38e2f0=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new g(),this['_view']=new K(this['context']['locale'],{'showResizeButton':_0x38e2f0['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...it)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x12f9d1,{showDiff:_0x368350})=>{this['showDiff']=_0x368350;}),_0x38e2f0['view']['addTab']({'id':'chat','buttonLabel':m(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':tt,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x40600f=>_0x40600f),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x48d63b=>_0x48d63b),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0xfd9ad3){const _0x4a7cc1=this['context']['config']['get']('ai.chat.welcomeMessage')??m(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0xfd9ad3['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x4a7cc1}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0x98adc7,staticMessage:_0x1f2919}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x98adc7,'initialContent':'<p>'+_0x1f2919+'</p>'});}['addFeedItemUserMessage'](_0x432485){const _0x4558e5=_0x432485['attributes']?.['displayedPrompt']||_0x432485['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x432485['contextItems']['values']()),'initialContent':'<p>'+_0x4558e5+'</p>','id':_0x432485['id']});}['addFeedItemError']({errorMessage:_0x4a443e,id:_0x5ac3ba}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x4a443e+'</p>','id':_0x5ac3ba});}['addFeedItemAIReply'](_0x4d97e8){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x4d97e8['interactionId']+':'+_0x4d97e8['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x48a600){const _0x296eb5=D(this['context']);let _0x41e095=_0x296eb5['config']['get']('ai.availableReplyActions')||[...S];if(_0x296eb5['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x130eb7=_0x296eb5['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x130eb7,'value');}}else _0x41e095=_0x41e095['filter'](_0x415b8c=>'insertSuggestion'!=_0x415b8c);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x48a600['interactionId']+':'+_0x48a600['id'],'areActionsDisabled':_0x48a600['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x41e095}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x41de16,_0x16abb9){const _0x177d4f=this['_view']['chatFeed']['children']['last'];if(_0x177d4f instanceof et)return this['_view']['chatFeed']['children']['remove'](_0x177d4f),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x41de16['id'],'capabilities':{'isWebSearchEnabled':_0x177d4f['capabilities']['isWebSearchEnabled']||_0x16abb9['isWebSearchEnabled'],'isReasoningEnabled':_0x177d4f['capabilities']['isReasoningEnabled']||_0x16abb9['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x41de16['id'],'capabilities':_0x16abb9});}async['addFeedItemCustomElement'](_0x4b6f9b,_0x3ff8cf){let _0x42c14b;return await this['_promiseQueue']['enqueue'](async()=>{_0x42c14b=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x4b6f9b,'id':_0x3ff8cf});}),_0x42c14b;}['removeFeedItem'](_0x4e642f){this['_view']['chatFeed']['removeItem'](_0x4e642f);}['hasFeedItem'](_0x363334){return this['_view']['chatFeed']['hasItem'](_0x363334);}['updateFeedInteractionHeader'](_0x1e8d02){const _0x191d91=this['_view']['chatFeed']['children']['find'](_0x384843=>_0x384843['options']['id']==_0x1e8d02['id']&&_0x384843 instanceof et);_0x191d91&&_0x191d91['set']('isVisible',_0x1e8d02['isVisible']);}async['updateFeedItemAIReplyContent'](_0x370866){const _0x152c0c=_0x370866['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x4e2100=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x370866,'abortSignal':_0x4e2100,'renderingStrategy':_0x152c0c}),_0x370866['isDone']&&this['markFeedItemAsDone'](_0x370866['id']);});}['updateFeedItemAIReplySources'](_0x1ac7fe,_0x36a70f){this['_view']['chatFeed']['updateWebSources'](_0x1ac7fe,_0x36a70f);}async['updateFeedItemAIReplySuggestionContent'](_0x4d5c17){const _0x38ff0c=_0x4d5c17['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x2e3b6b=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x4d5c17,'abortSignal':_0x2e3b6b,'renderingStrategy':_0x38ff0c}),_0x4d5c17['isDone']&&this['markFeedItemAsDone'](_0x4d5c17['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0xb225f2){this['_view']['chatFeed']['updateSuggestionPartState'](_0xb225f2);}['setFeedItemAIReplySuggestionPartActive'](_0x464961){this['_view']['chatFeed']['setSuggestionPartActive'](_0x464961);}['markFeedItemAsDone'](_0x31049b){this['_view']['chatFeed']['markItemAsDone'](_0x31049b);}['removeFeedInteraction'](_0x4e67e3){this['_view']['chatFeed']['getItemIds']()['filter'](_0x33d235=>_0x33d235['startsWith'](_0x4e67e3))['forEach'](_0x3994a6=>this['_view']['chatFeed']['removeItem'](_0x3994a6));}['startInteraction'](){const _0x2f28d7=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x2f28d7),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0xdba771){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x52d62a=>_0x52d62a['startsWith'](_0xdba771['id']))['forEach'](_0x7f5dc=>this['markFeedItemAsDone'](_0x7f5dc)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x824a9b,_0x75f9bb){this['_view']['chatControls']['addContextItem'](_0x824a9b,_0x75f9bb);}['removeContextItem'](_0xd4fa0d){this['_view']['chatControls']['removeContextItem'](_0xd4fa0d);}['setContextItemLoading'](_0x342f78,_0xbf7e6a){this['_view']['chatControls']['setContextItemLoading'](_0x342f78,_0xbf7e6a);}['setIsUploadInProgress'](_0x5a63d5){this['_view']['chatControls']['setIsUploadInProgress'](_0x5a63d5);}['setConversationContext'](_0x2b66ac){this['_view']['chatControls']['setConversationContext'](_0x2b66ac);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x27b172,_0x2ad85f,_0x2617e2){this['_view']['chatControls']['updateResourceState'](_0x27b172,_0x2ad85f,_0x2617e2);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x375958){this['_view']['chatControls']['setAddContextOptions'](_0x375958);}['updateCapabilities'](_0x59e4d2){this['_view']['chatControls']['setWebSearch'](_0x59e4d2['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x59e4d2['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x59e4d2));}['setSelectedModel'](_0x33685f,_0x513123){this['_view']['chatControls']['setModel'](_0x33685f),_0x513123&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x4e401d){this['feedItemRenderingStrategy']=_0x4e401d;}['toggleLoadingSkeleton'](_0x255ce7){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x255ce7);}['resetConversationTitle'](){this['setConversationTitle'](m(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x37cab5,_0x4cd2c9=!0x1){if(_0x4cd2c9&&!_0x6e294d()&&_0x37cab5['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x37cab5);this['_view']['chatHeader']['label']=_0x37cab5;}['setLoadingMessage'](_0x172e6d){this['_view']['chatFeed']['setLoadingMessage'](_0x172e6d);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x36a24b){let _0x3a82c5=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x36a24b[_0x3a82c5],_0x3a82c5++,_0x3a82c5===_0x36a24b['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x16f018){this['_view']['chatHeader']['isMaximized']=_0x16f018;}['prepareLoadingMessage'](_0x17487c){return _0x17487c['isWebSearchEnabled']&&_0x17487c['isReasoningEnabled']?m(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x17487c['isWebSearchEnabled']?m(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x17487c['isReasoningEnabled']?m(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):m(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x1d2336){return _0x1d2336?_0x1d2336['isWebSearchEnabled']&&_0x1d2336['isReasoningEnabled']?m(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x1d2336['isWebSearchEnabled']?m(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x1d2336['isReasoningEnabled']?m(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):m(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):m(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x6e5831,_0x24cd69,_0x26617d,_0x5c13f8){this['_view']['populateSourceResourceBalloon'](_0x6e5831,_0x24cd69,_0x26617d,_0x5c13f8);}['closeSourceResourceBalloon'](_0x55adf4){this['_view']['closeSourceResourceBalloon'](_0x55adf4);}['setPromptInputValue'](_0x45f988){this['_view']['chatControls']['setPromptInputValue'](_0x45f988);}['focusPromptInput'](_0x5ad31a=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x5ad31a);}['scrollFeedToSuggestion'](_0x58a357,_0xc87046){this['_view']['chatFeed']['scrollToSuggestion'](_0x58a357,_0xc87046);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Fi extends _0x1b0a54{['sections'];constructor(_0x431b68,_0x4b5ade){super(_0x431b68),this['sections']=_0x4b5ade,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x385323){let _0x56412c=0x0,_0x3e8c09=0x0;for(const _0x1476d5 of this['sections']){const {resultsCount:_0x2c3a3c,totalItemsCount:_0x50f34f}=_0x1476d5['filter'](_0x385323);_0x56412c+=_0x2c3a3c,_0x3e8c09+=_0x50f34f;}return{'resultsCount':_0x56412c,'totalItemsCount':_0x3e8c09};}}class Pi extends _0x5749b5{['title'];['itemsViews'];['_itemsListView'];constructor(_0x479f6b,{title:_0x375ffc,items:_0x49244d}){super(_0x479f6b);const _0x2c51cc=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x375ffc,this['itemsViews']=_0x49244d;const _0xb08395=new _0x538d57(_0x479f6b);_0xb08395['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x1b0a54(_0x479f6b),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x2c51cc['if']('isVisible','ck-hidden',_0x533016=>!_0x533016)]},'children':[_0xb08395,this['_itemsListView']]});}['filter'](_0x4ba1af){const _0x316714=this['itemsViews']['length'];let _0x2a75fb=0x0;for(const _0x11af1c of this['itemsViews']){if(_0x4ba1af){const _0x3fff08=_0x11af1c['isMatching'](_0x4ba1af);_0x11af1c['isVisible']=!!_0x3fff08,_0x11af1c['highlightText'](_0x4ba1af);}else _0x11af1c['isVisible']=!0x0,_0x11af1c['highlightText'](null);_0x11af1c['isVisible']&&_0x2a75fb++;}return this['isVisible']=_0x2a75fb>0x0,{'resultsCount':_0x2a75fb,'totalItemsCount':_0x316714};}['getItem'](_0x1b633a){return this['itemsViews']['find'](_0x41774a=>_0x41774a['id']===_0x1b633a);}['removeItem'](_0x539058){const _0x31e5af=this['itemsViews']['indexOf'](_0x539058);-0x1!==_0x31e5af&&(this['itemsViews']['splice'](_0x31e5af,0x1),this['_itemsListView']['items']['remove'](_0x539058));}}class Ui extends/* #__PURE__ -- @preserve */
27
- _0x531f3e(_0x5749b5){['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(_0x47b8c9,_0x4b7ab7){super(_0x47b8c9);const _0x2b71a6=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x4b7ab7['pinned']),this['set']('loadingState',null),this['id']=_0x4b7ab7['id'];const {title:_0x2e6889,createdAt:_0x21f1dc,active:_0x4a40c=!0x1}=_0x4b7ab7;this['_titleView']=new _0xe11984(),this['_titleView']['text']=_0x2e6889,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0xbf5451=this['_createCheckView'](),_0x316183=this['_createPinButtonView'](_0x47b8c9),_0x197cdc=this['_createMenuDropdownView'](),_0x320920=this['_createEditInputView'](_0x47b8c9,_0x2e6889),_0x175d4b=this['_createAcceptEditButtonView'](_0x47b8c9,_0x320920),_0x5c7219=this['_createCancelEditButtonView'](_0x47b8c9,_0x320920);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x316183),this['actions']['add'](_0x197cdc),this['on']('change:isEdit',(_0x15463c,_0x1ebf06,_0x163eb8)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x163eb8?(this['actions']['add'](_0x175d4b),this['actions']['add'](_0x5c7219),this['mainContent']['add'](_0x320920),_0x320920['element']['focus']()):(this['actions']['add'](_0x316183),this['actions']['add'](_0x197cdc),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x4a40c?'ck-ai-chat-history__item--active':'',_0x2b71a6['if']('isVisible','ck-hidden',_0x1c6de8=>!_0x1c6de8),_0x2b71a6['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',_0x2b71a6['if']('loadingState','ck-hidden',_0xb1486b=>!!_0xb1486b)]},'children':_0x4a40c?[_0xbf5451]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x2b71a6['if']('loadingState','ck-hidden',_0x3c7eca=>!_0x3c7eca)]},'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',_0x2b71a6['if']('loadingState','ck-hidden',_0x598e94=>!!_0x598e94)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x2b71a6['if']('loadingState','ck-hidden',_0x2a8838=>!_0x2a8838)]},'children':[{'text':_0x2b71a6['to']('loadingState',_0x56016b=>_0x56016b?m(this['locale'],Ui['LOADING_LABELS'][_0x56016b]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x21f1dc]}]},{'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'](_0x45df1b){this['_titleView']['text']=Wt(_0x45df1b);}['updateLoadingState'](_0x69afad,_0x3c4b38){this['set']('loadingState',_0x3c4b38?_0x69afad:null);}['_createCheckView'](){const _0x28512c=new _0x1a5580();return _0x28512c['set']({'content':_0x1dd94c}),_0x28512c;}['_createPinButtonView'](_0x1b369a){const _0x4bb5b9=new _0x3fc85a(_0x1b369a);return _0x4bb5b9['set']({'label':m(_0x1b369a,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x44d873,'withText':!0x1,'tooltip':!0x0}),_0x4bb5b9['bind']('isOn')['to'](this,'pinned'),_0x4bb5b9['on']('execute',()=>{const _0x144658=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x144658});}),_0x4bb5b9;}['_createMenuDropdownView'](){const _0x125d2c=_0x238494(this['locale'],_0x117d83),_0x5cec9c=_0x125d2c['panelView']['children'];_0x125d2c['buttonView']['set']({'label':m(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x21a59b}),_0x125d2c['panelPosition']='sw';const _0x39df50=new _0x3fc85a(this['locale']);_0x39df50['label']=m(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x39df50['withText']=!0x0,_0x39df50['on']('execute',()=>{this['isEdit']=!0x0;});const _0x1e2192=new _0x3fc85a(this['locale']);_0x1e2192['label']=m(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x1e2192['withText']=!0x0,_0x1e2192['on']('execute',()=>{this['showConfirm'](m(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x6bfb6d=new _0x1b0a54(this['locale']),_0x22ab0a=new _0x5749b5(this['locale']);_0x22ab0a['children']['add'](_0x39df50);const _0x182315=new _0x5749b5(this['locale']);return _0x182315['children']['add'](_0x1e2192),_0x6bfb6d['items']['addMany']([_0x22ab0a,_0x182315]),_0x5cec9c['add'](_0x6bfb6d),_0x125d2c;}['_createEditInputView'](_0x13602b,_0x248a80){const _0xa830eb=new _0x1cab27(_0x13602b),_0x52cc23=_0xa830eb['bindTemplate'];return _0xa830eb['value']=_0x248a80,_0xa830eb['extendTemplate']({'on':{'keydown':_0x52cc23['to'](_0x3f42d0=>{'Enter'==_0x3f42d0['key']&&this['_commitEditInputValue'](_0xa830eb);})}}),_0xa830eb;}['_createAcceptEditButtonView'](_0x56c26,_0x17b55d){const _0x517f5a=new _0x3fc85a(_0x56c26);return _0x517f5a['set']({'icon':_0x1dd94c,'withText':!0x1,'tooltip':m(_0x56c26,'AI_CHAT_HISTORY_ACCEPT')}),_0x517f5a['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x517f5a['on']('execute',()=>{this['_commitEditInputValue'](_0x17b55d);}),_0x517f5a;}['_commitEditInputValue'](_0x3ae25d){const _0x3e81ea=_0x3ae25d['element']['value']||'';this['_titleView']['text']=_0x3e81ea,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x3e81ea});}['_createCancelEditButtonView'](_0x455dc2,_0x37c6b3){const _0x24d61e=new _0x3fc85a(_0x455dc2);return _0x24d61e['set']({'icon':_0x3b3d8d,'withText':!0x1,'tooltip':m(_0x455dc2,'AI_CHAT_HISTORY_CANCEL')}),_0x24d61e['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x24d61e['on']('execute',()=>{this['isEdit']=!0x1,_0x37c6b3['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x24d61e;}['_createSpinnerView'](){const _0x19b087=new De('tiny');return _0x19b087['isVisible']=!0x0,_0x19b087;}['isMatching'](_0x194c6f){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x194c6f)?{'title':!0x0}:null;}['highlightText'](_0x94dbfb){this['_titleView']['highlightText'](_0x94dbfb);}}class at extends _0x538d57{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x17abf9,_0x9e1816){super(_0x17abf9),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x564ac1=new _0x2c8dbc(_0x17abf9,{'label':m(_0x17abf9,'AI_CHAT_HISTORY_HEADING'),'icon':ot,'class':'ck-ai-header\x20ck-ai-header_history'});_0x9e1816&&(this['resizeButton']=Cs(_0x17abf9,this),_0x564ac1['children']['add'](this['resizeButton'])),this['sectionsView']=new Fi(_0x17abf9,[]),this['sectionsView']['delegate'](...Wi)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0xce7510=>!_0xce7510)]}}),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':[_0x564ac1,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['mainErrorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'],this['isMainErrorViewVisible']=!this['isSearchViewVisible']&&!!this['errorMessage'];}['_createSearchView'](){const _0x5b561d=new _0x8635d1(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':m(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x1263a4=>m(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x1263a4),'secondary':m(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x288eb3=this['_createErrorView']();return _0x288eb3['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x3fbf8f=>!_0x3fbf8f)]}}),_0x5b561d['on']('render',()=>{_0x5b561d['children']['add'](_0x288eb3,0x1);}),_0x5b561d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x4739be=>!_0x4739be)]}}),_0x5b561d;}['_createSkeletonView'](){const _0x2d3b11=new Oe(this['locale'],Be['aiHistory']);return _0x2d3b11['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x1a572b=>!_0x1a572b)]}}),_0x2d3b11;}['_createErrorView'](){const _0x14588e=new _0x538d57(this['locale']),_0x451e6c=new _0x3fc85a(this['locale']);_0x451e6c['set']({'withText':!0x1,'icon':_0x3b3d8d,'class':'ck-ai-notification_error__dismiss-button'}),_0x451e6c['bind']('isVisible')['to'](this,'hasItems',_0x16d55a=>!!_0x16d55a),_0x451e6c['on']('execute',()=>{this['errorMessage']='';});const _0x44f7f2=this['bindTemplate'];return _0x14588e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x44f7f2['to']('errorMessage')}]},_0x451e6c]}),_0x14588e;}['_createEmptyStateView'](){const _0x43a5e5=new _0x3fc85a(this['locale']);_0x43a5e5['set']({'label':m(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0xa967bf,'class':'ck-ai-chat__start-conversation'}),_0x43a5e5['on']('execute',()=>{this['fire']('openChat');});const _0x533ba5=new _0x538d57(this['locale']);return _0x533ba5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x3b146b=>!_0x3b146b)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[m(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x43a5e5]}),_0x533ba5;}['_createListItemViews'](_0x55c6f5,_0x24843b){const _0x33fce8=[];for(const _0x2bfc40 of _0x55c6f5){const _0x338d58=new Ui(_0x24843b,_0x2bfc40);_0x338d58['delegate'](...Wi)['to'](this),_0x33fce8['push'](_0x338d58);}return _0x33fce8;}['updateHistoryItemsWithCategories'](_0xb9ab0c){const _0x2a3551=this['locale']||'en',_0x4b812d=[];for(const _0x13f54a of _0xb9ab0c){const _0x1e523d=this['_createListItemViews'](_0x13f54a['items'],_0x2a3551);_0x4b812d['push'](new Pi(_0x2a3551,{'title':_0x13f54a['title'],'items':_0x1e523d}));}this['sectionsView']['sections']=_0x4b812d,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x4b812d),this['hasItems']=_0xb9ab0c['some'](_0x394bb6=>_0x394bb6['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x2448aa){for(const _0x3247c7 of this['sectionsView']['sections']){const _0x35f08d=_0x3247c7['getItem'](_0x2448aa);if(_0x35f08d){if(_0x3247c7['removeItem'](_0x35f08d),0x0===_0x3247c7['itemsViews']['length']){const _0x5959be=this['sectionsView']['sections']['indexOf'](_0x3247c7);-0x1!==_0x5959be&&(this['sectionsView']['sections']['splice'](_0x5959be,0x1),this['sectionsView']['items']['remove'](_0x3247c7));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x5403f5,_0x322830){for(const _0x37dfc3 of this['sectionsView']['sections']){const _0x42c3ef=_0x37dfc3['getItem'](_0x5403f5);if(_0x42c3ef){_0x42c3ef['updateTitle'](_0x322830);break;}}}['updateItemLoadingState'](_0x4711b4,_0x3b9933,_0x4bc964){for(const _0x349338 of this['sectionsView']['sections']){const _0x199961=_0x349338['getItem'](_0x4711b4);if(_0x199961){_0x199961['updateLoadingState'](_0x3b9933,_0x4bc964);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x598b78=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x598b78);}}}const Wi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class st extends _0x37abb2{static get['requires'](){return[H];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5df664){super(_0x5df664);const _0x4b5c62=this['context']['plugins']['get']('AITabs');this['_historyView']=new at(this['context']['locale'],_0x4b5c62['showResizeButton']),this['_historyView']['delegate'](...Wi)['to'](this),_0x4b5c62['view']['addTab']({'id':'history','buttonLabel':m(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':ot,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x3550c4){this['_historyView']['removeHistoryItem'](_0x3550c4);}['updateItems'](_0x2162c9){this['_historyView']['updateHistoryItemsWithCategories'](_0x2162c9);}['updateItemTitle'](_0xc17618,_0x2552af){this['_historyView']['updateItemTitle'](_0xc17618,_0x2552af);}['updateItemLoadingState'](_0xaf0e66,_0x10346c,_0x492533){this['_historyView']['updateItemLoadingState'](_0xaf0e66,_0x10346c,_0x492533);}['setLoadingSkeleton'](_0x167bea){this['_historyView']['isLoading']=_0x167bea;}['showError'](_0x20a61d){this['_historyView']['errorMessage']=_0x20a61d;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x20f8fc){this['_historyView']['isMaximized']=_0x20f8fc;}}class Ue extends Vt(){['id'];['createdAt'];constructor({id:_0x37c0c4,title:_0x45c75d,createdAt:_0x3947c3,updatedAt:_0x3778c2,pinned:_0x69dc64}){super(),this['id']=_0x37c0c4,this['createdAt']=new Date(_0x3947c3),this['set']('title',_0x45c75d),this['set']('updatedAt',_0x3778c2?new Date(_0x3778c2):null),this['set']('pinned',_0x69dc64||!0x1);}['updateTitle'](_0x4c8a6f){this['set']('title',Wt(_0x4c8a6f)),this['updatedAt']=new Date();}['updatePinned'](_0x8538a5){this['set']('pinned',_0x8538a5),this['updatedAt']=new Date();}}class ht extends Ft(){['items']=[];['connector'];['group'];constructor({connector:_0x44c699,group:_0x369266}){super(),this['connector']=_0x44c699,this['group']=_0x369266;}async['init'](){try{const _0x1299e3=this['connector']['fetchConversations'](this['group']),_0xd6765f=await _0x1299e3['getConversations']();this['loadItems'](_0xd6765f);}catch(_0x43cb00){this['fire']('error',{'error':_0x43cb00,'operation':'init'});}}['addItem'](_0x1fa664){this['items']['push'](_0x1fa664);}async['removeItem'](_0x371ef6){const _0x289d2c=this['items']['findIndex'](_0x1130fe=>_0x1130fe['id']===_0x371ef6);if(-0x1===_0x289d2c)return!0x1;try{return await this['connector']['deleteConversation'](_0x371ef6)['execute'](),this['items']['splice'](_0x289d2c,0x1),this['fire']('itemRemoved',{'itemId':_0x371ef6}),!0x0;}catch(_0x48cfc8){return this['fire']('error',{'error':_0x48cfc8,'operation':'removeItem','itemId':_0x371ef6}),!0x1;}}['getItem'](_0x43a0e9){return this['items']['find'](_0x3ea963=>_0x3ea963['id']===_0x43a0e9);}async['updateItemTitle'](_0x4175b0,_0x239718){const _0x1a337a=this['getItem'](_0x4175b0);if(!_0x1a337a)return!0x1;try{return await this['connector']['updateConversation'](_0x4175b0,{'title':_0x239718})['getResult'](),_0x1a337a['updateTitle'](_0x239718),this['fire']('itemUpdated',{'itemId':_0x4175b0,'updates':{'title':_0x239718}}),!0x0;}catch(_0x58cbe3){return this['fire']('error',{'error':_0x58cbe3,'operation':'updateItemTitle','itemId':_0x4175b0}),!0x1;}}async['updateItemPinned'](_0x255d2e,_0x34329a){const _0x3e4a23=this['getItem'](_0x255d2e);if(!_0x3e4a23)return!0x1;try{return await this['connector']['updateConversation'](_0x255d2e,{'pinned':_0x34329a})['getResult'](),_0x3e4a23['updatePinned'](_0x34329a),this['fire']('itemUpdated',{'itemId':_0x255d2e,'updates':{'pinned':_0x34329a}}),!0x0;}catch(_0x323d87){return this['fire']('error',{'error':_0x323d87,'operation':'updateItemPinned','itemId':_0x255d2e}),!0x1;}}['loadItems'](_0x39591d){try{this['items']=[],_0x39591d['map'](_0x1d2589=>{this['addItem'](new Ue(_0x1d2589));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x47e83d){this['fire']('error',{'error':_0x47e83d,'operation':'loadItems'});}}['getItems'](_0x43e179={}){const _0x554572=void 0x0!==_0x43e179['pinned']&&_0x43e179['pinned'],_0x965c48=_0x43e179['from']?new Date(_0x43e179['from']['getFullYear'](),_0x43e179['from']['getMonth'](),_0x43e179['from']['getDate']()):null,_0x5a59a7=_0x43e179['to']?new Date(_0x43e179['to']['getFullYear'](),_0x43e179['to']['getMonth'](),_0x43e179['to']['getDate']()):null;return this['items']['filter'](_0x3a3421=>{if(_0x3a3421['pinned']!==_0x554572)return!0x1;if(_0x5a59a7){const _0x37a92f=new Date(_0x3a3421['createdAt']['getFullYear'](),_0x3a3421['createdAt']['getMonth'](),_0x3a3421['createdAt']['getDate']());return _0x965c48?_0x965c48['getTime']()===_0x5a59a7['getTime']()?_0x37a92f['getTime']()===_0x965c48['getTime']():_0x37a92f<_0x5a59a7&&_0x37a92f>=_0x965c48:_0x37a92f<_0x5a59a7;}return!0x0;});}}class rt extends _0x37abb2{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[s,x,st,H];}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'](st),this['_aiChatController']=this['context']['plugins']['get'](x);const _0x5a9d23=this['context']['plugins']['get'](H);try{const _0x4b6066=this['_aiChatController']['getGroupId']();this['history']=new ht({'connector':this['_aiConnector'],'group':_0x4b6066}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x2f4b2b,_0x3ad1dd)=>{this['_setItemLoading'](_0x3ad1dd['id'],'remove'),this['_handleRemove'](_0x3ad1dd['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x19858d,_0x3463b9)=>{this['_setItemLoading'](_0x3463b9['id'],'rename'),this['_handleEditTitle'](_0x3463b9['id'],_0x3463b9['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x50f925,_0x2f979d)=>{void 0x0!==_0x2f979d['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x2f979d['itemId'],_0x2f979d['updates']['title']),void 0x0!==_0x2f979d['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x2f979d['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x2094cb,_0x2b02a4)=>{this['_aiChatController']['handleRemovedConversation'](_0x2b02a4['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x2b02a4['itemId']),this['_clearItemLoading'](_0x2b02a4['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x1e6a4a,_0x2786c4)=>{this['_handleHistoryErrorUI'](_0x2786c4['error'],_0x2786c4['operation'],_0x2786c4['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x191ca3,_0x1d1570)=>{this['_handleSelectConversation'](_0x1d1570['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x4911ae,_0x3509d5)=>{const _0x2150ea=_0x3509d5['pinned']?'pin':'unpin';this['_setItemLoading'](_0x3509d5['id'],_0x2150ea),this['_handleTogglePin'](_0x3509d5['id'],_0x3509d5['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x5a9d23['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x5a9d23['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x5a9d23,'resizedTabs',(_0x31f186,_0x42249f)=>{this['_setIsMaximized'](_0x42249f);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x5a9d23['resize']();});}catch(_0x50085d){this['_handleHistoryErrorUI'](_0x50085d,'init');}}async['_handleEditTitle'](_0x44a1e7,_0x246bfd){await this['history']['updateItemTitle'](_0x44a1e7,_0x246bfd);}async['_handleTogglePin'](_0x125d5f,_0x3b9e69){await this['history']['updateItemPinned'](_0x125d5f,_0x3b9e69);}async['_handleRemove'](_0x4b2047){await this['history']['removeItem'](_0x4b2047);}async['_handleSelectConversation'](_0x55e59c){await this['_aiChatController']['loadConversation'](_0x55e59c);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x2e1591=this['_aiChatController']['activeConversation']?.['id'],_0x558cc4=this['_getCategorizedItems']()['map'](_0x8f6238=>({'title':_0x8f6238['title'],'items':_0x8f6238['items']['map'](_0x2cd525=>({'id':_0x2cd525['id'],'title':_0x2cd525['title']||m(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x2cd525['createdAt'])['toLocaleDateString'](),'active':_0x2cd525['id']===_0x2e1591,'pinned':_0x2cd525['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x558cc4);}['_setItemLoading'](_0x192ba5,_0x147a9e){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x192ba5,_0x147a9e,!0x0);}['_clearItemLoading'](_0x1ce30c){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x1ce30c,null,!0x1);}['_handleHistoryErrorUI'](_0x3bc14c,_0x387667,_0x20745b){const _0x4b7e1b=this['_generateErrorMessage'](_0x387667,_0x20745b);this['_aiChatHistoryUi']['showError'](_0x4b7e1b),_0x20745b&&this['_clearItemLoading'](_0x20745b),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x2b5756,_0x478168){const _0xe36f34=_0x478168?this['history']['getItem'](_0x478168):null,_0x20135a=_0xe36f34?.['title']||m(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x2b5756){case'updateItemTitle':return m(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x20135a);case'updateItemPinned':{const _0x1f6bcf=m(this['context']['locale'],_0xe36f34?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return m(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x1f6bcf,_0x20135a]);}case'removeItem':return m(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x20135a);case'init':case'loadItems':return m(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return m(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x40025e=new Date(),_0x7ae72d=new Date(_0x40025e['getFullYear'](),_0x40025e['getMonth'](),_0x40025e['getDate']()),_0x30c671=new Date(_0x7ae72d);_0x30c671['setDate'](_0x30c671['getDate']()-0x1);const _0x513ada=new Date(_0x7ae72d);_0x513ada['setDate'](_0x513ada['getDate']()-0xe);const _0x429c05=this['history']['getItems']({'pinned':!0x0}),_0x34e464=this['history']['getItems']({'from':_0x7ae72d,'to':_0x7ae72d}),_0x59d966=this['history']['getItems']({'from':_0x30c671,'to':_0x30c671}),_0x55bd22=this['history']['getItems']({'from':_0x513ada,'to':_0x30c671}),_0x449c2f=this['history']['getItems']({'to':_0x513ada}),_0x2c50e9=[];return _0x429c05['length']>0x0&&_0x2c50e9['push']({'title':m(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x429c05}),_0x34e464['length']>0x0&&_0x2c50e9['push']({'title':m(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x34e464}),_0x59d966['length']>0x0&&_0x2c50e9['push']({'title':m(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x59d966}),_0x55bd22['length']>0x0&&_0x2c50e9['push']({'title':m(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x55bd22}),_0x449c2f['length']>0x0&&_0x2c50e9['push']({'title':m(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x449c2f}),_0x2c50e9;}['_setIsMaximized'](_0x3ac9e2){this['_aiChatHistoryUi']['setIsMaximized'](_0x3ac9e2);}}class I extends _0x37abb2{static get['requires'](){return[rt,st];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Fa extends _0x37abb2{static get['requires'](){return[x,o,P,I];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4c2546){super(_0x4c2546),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.initialConversation','new');}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](x)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](x)['startConversation']();}async['sendMessage']({message:_0x37eebd,attributes:_0x3f8b2e}){await this['context']['plugins']['get'](x)['sendMessage']({'message':_0x37eebd,'attributes':_0x3f8b2e});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](x)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](x)['focusPromptInput']();}['registerToolDataCallback'](_0x53b35d){this['context']['plugins']['get'](x)['_registerToolDataCallback'](_0x53b35d);}}class ks extends _0x3fc85a{['id'];constructor(_0xd462b3,_0x407e67){super(_0xd462b3);const {id:_0xfe1ef4,type:_0x4bae76,icon:_0x1e80d4}=_0x407e67;this['id']=_0xfe1ef4,this['set']({'label':_0x407e67['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x407e67['id']}}),_0x1e80d4?this['icon']=_0x1e80d4:'chat'===_0x4bae76?this['icon']=_0x50a176:'review'===_0x4bae76?this['icon']=_0xbfad04:'translate'===_0x4bae76&&(this['icon']=St);}}class mt extends _0x538d57{['listView'];constructor(_0x4dce4b,_0x66ff86){super(_0x4dce4b);const _0x59c445=_0x66ff86['map'](_0x658cd9=>{const _0x5c599a=new _0x5749b5(this['locale']),_0x26968d=new ks(this['locale'],_0x658cd9);return _0x5c599a['children']['add'](_0x26968d),_0x26968d['delegate']('execute')['to'](this),_0x5c599a;});this['listView']=new _0x1b0a54(this['locale']),this['listView']['items']['addMany'](_0x59c445),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const dt='chat-shortcuts';var Ka=function(_0x58637f){return _0x58637f['CHAT']='chat',_0x58637f['REVIEW']='review',_0x58637f['TRANSLATE']='translate',_0x58637f;}({});class Wa extends _0x37abb2{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[P];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](P),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x4077c5=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x4077c5['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x4077c5,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x1c6560=Object['values'](Ka);this['_shortcuts']['forEach'](_0xf38223=>{let _0xecfd0a=!0x0;if(_0xf38223['id']&&_0xf38223['label']&&_0x1c6560['includes'](_0xf38223['type'])?'chat'===_0xf38223['type']&&(_0xecfd0a='string'==typeof _0xf38223['prompt']):_0xecfd0a=!0x1,!_0xecfd0a)throw new _0x1500e8('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0xf38223});});}['_injectShortcuts'](){const _0x5459ca=this['context']['plugins']['get'](P);this['_shortcutsView']=new mt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x5459ca['addFeedItemCustomElement'](this['_shortcutsView']['element'],dt),this['_shortcutsView']['on']('execute',_0xef8468=>{const _0x4637a7=_0xef8468['source']['id'];this['_executeShortcut'](_0x4637a7);});}['_removeShortcuts'](){const _0x41c078=this['context']['plugins']['get'](P);_0x41c078['hasFeedItem'](dt)&&_0x41c078['removeFeedItem'](dt),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x89ea6e){const _0x1aa5c6=this['_shortcuts']['find'](_0x1dba8d=>_0x1dba8d['id']===_0x89ea6e),_0xfad76b=_0x1aa5c6['type'];'chat'===_0xfad76b?this['_runChatShortcut'](_0x1aa5c6):'review'===_0xfad76b?_0x1aa5c6['check']?this['_runReviewShortcut'](_0x1aa5c6):this['_switchTab']('reviewMode'):'translate'===_0xfad76b&&(_0x1aa5c6['language']?this['_runTranslateShortcut'](_0x1aa5c6):this['_switchTab']('translate'));}['_switchTab'](_0x59dd70){if(!this['context']['plugins']['has']('AITabs'))throw new _0x1500e8('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x59dd70});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x59dd70);}async['_runChatShortcut']({prompt:_0x2863de,draftMode:_0x257b24,useWebSearch:_0x4404e7=!0x1,useReasoning:_0x2d20cb=!0x1,model:_0x1889e3}){const _0x833461=this['context']['plugins']['get']('AIChat'),_0x2a65b4=this['context']['plugins']['get']('AIChatController'),_0x59f0a8=_0x2a65b4['activeConversation'];let _0x4fa939;_0x4fa939=_0x1889e3?await _0x59f0a8['chatModels']['getModel'](_0x1889e3):await _0x59f0a8['chatModels']['getDefault'](),_0x4fa939&&await _0x59f0a8['setModel'](_0x4fa939),_0x59f0a8['setWebSearch'](_0x4404e7),_0x59f0a8['setReasoning'](_0x2d20cb),_0x2a65b4['addCurrentDocumentToChatContext'](),_0x257b24?(this['_aiChatUI']['setPromptInputValue'](_0x2863de),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x833461['sendMessage']({'message':_0x2863de});}['_runReviewShortcut']({check:_0x2ba362,model:_0x5a0dbd,prompt:_0x37af4f,params:_0x435689}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x1500e8('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x10195b={'id':_0x2ba362,'isCustom':'custom'===_0x2ba362};_0x5a0dbd&&_0x37af4f&&(_0x10195b['args']={'model':_0x5a0dbd,'prompt':_0x37af4f}),_0x435689&&(_0x10195b['params']=_0x435689),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x10195b);}['_runTranslateShortcut']({language:_0x11a836}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x1500e8('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x11a836,'args':{'language':_0x11a836}});}}class io extends At{constructor(_0x59e2ac){super(_0x59e2ac);const _0x212241=_0x59e2ac['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x212241,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0xc596ac=this['editor']['plugins']['get']('AITabs')['view'];_0xc596ac['isVisible']=!_0xc596ac['isVisible'];}}class pt extends _0x5adfee{static get['requires'](){return[H];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x28caae=this['editor'];_0x28caae['commands']['add']('toggleAi',new io(_0x28caae)),_0x28caae['ui']['componentFactory']['add']('toggleAi',()=>{const _0xf8561d=this['_createAIUIButton'](_0x3fc85a);return _0xf8561d['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0xf8561d;}),_0x28caae['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x3b9096=this['_createAIUIButton'](_0x58fafd);return _0x3b9096['set']({'role':'menuitemcheckbox'}),_0x3b9096;});}['_createAIUIButton'](_0x5178ef){const _0x8757eb=this['editor'],_0x3bfb76=_0x8757eb['commands']['get']('toggleAi'),_0x2adc1b=new _0x5178ef(_0x8757eb['locale']);return _0x2adc1b['set']({'label':m(_0x8757eb['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x2cc560,'isToggleable':!0x0}),_0x2adc1b['bind']('isEnabled')['to'](_0x3bfb76),_0x2adc1b['bind']('isOn')['to'](_0x3bfb76,'value',_0x49caa9=>!!_0x49caa9),this['listenTo'](_0x2adc1b,'execute',()=>{_0x3bfb76['execute']();}),_0x2adc1b;}}const j=['applySuggestion','insertSuggestion','showNext','showPrevious'];class ns extends _0x538d57{['_errorView'];constructor(_0x2fe254){super(_0x2fe254),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x5138be){this['showError'](_0x5138be);}['showError'](_0x5e511d){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x5e511d,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0xbcfed5=new _0x538d57(this['locale']),_0x31d827=new _0x538d57(this['locale']);return _0x31d827['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0xbcfed5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x20b325=>!_0x20b325)]},'children':[_0x31d827]}),_0xbcfed5;}}const L=0xa;class u extends _0x37abb2{static get['requires'](){return[o];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x1508a8){const {id:_0x5a4490}=this['_currentConfig']??{};this['_currentConfig']=_0x1508a8;const {id:_0xccb37c}=this['_currentConfig'];this['isOpen']&&_0x5a4490===_0xccb37c?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x3a6c80=D(this['context'])['plugins']['get']('Dialog');_0x3a6c80['isOpen']&&this['_currentConfig']&&_0x3a6c80['id']===this['_currentConfig']['id']&&_0x3a6c80['hide']();}['_updateDialog'](){const _0x1984a6=D(this['context'])['plugins']['get']('Dialog'),{icon:_0x919d,title:_0x3ea2fe}=this['_currentConfig'];_0x1984a6['view']?.['headerView']&&(_0x1984a6['view']['headerView']['label']=_0x3ea2fe,_0x1984a6['view']['headerView']['iconView']&&_0x919d&&(_0x1984a6['view']['headerView']['iconView']['content']=_0x919d)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x1984a6['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](o)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x325903){this['context']['plugins']['get'](o)['hideFakeVisualSelection']('ai-balloon-'+_0x325903);}['_showDialog'](){const _0x2ac34f=D(this['context'])['plugins']['get']('Dialog'),{id:_0x21cf15,title:_0x4819fa,icon:_0x51bb66,class:_0x42c84e,mainView:_0x266323}=this['_currentConfig'];_0x266323['delegate'](...j)['to'](this),_0x2ac34f['show']({'title':_0x4819fa,'icon':_0x51bb66,'hasCloseButton':!0x0,'id':_0x21cf15,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x42c84e||''),'content':_0x266323,'onShow':_0x18a2c1=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x197740=this['_getSelectionElements']();_0x197740&&_0x197740[0x0]&&_0x54e791({'target':_0x197740[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x18a2c1['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x21cf15});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x21cf15}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x48ed4e,_0x1d730b){if(!_0x1d730b)return null;const _0x409f19=this['_getSelectionElements']();if(!_0x409f19||0x0===_0x409f19['length'])return{'left':Math['round'](_0x1d730b['left']+_0x1d730b['width']/0x2-_0x48ed4e['width']/0x2),'top':Math['round'](_0x1d730b['top']+_0x1d730b['height']/0x2-_0x48ed4e['height']/0x2)};const _0x35072c=Math['round'](_0x1d730b['left']+_0x1d730b['width']/0x2-_0x48ed4e['width']/0x2),_0x16162b=_0x409f19['map'](_0x1f9a02=>new _0x34633d(_0x1f9a02)),_0x55264c=_0x48ed4e['height'];return{'left':_0x35072c,'top':this['_calculateOptimalTopPosition'](_0x16162b,_0x55264c,_0x1d730b)};}['_calculateOptimalTopPosition'](_0x51a480,_0x34330b,_0x243772){const _0x4c6daa=new _0x34633d(_0x3537fe['window']),_0x242fc4=_0x51a480['map'](_0xd67ab=>_0xd67ab['getVisible']())['filter'](_0x1936a0=>_0x1936a0),_0x2f972b=_0x34633d['getBoundingRect'](_0x242fc4);if(!_0x2f972b)return Math['round'](_0x243772['top']+_0x243772['height']/0x2);const _0x5aca5e=_0x4c6daa['getIntersection'](_0x2f972b);if(!_0x5aca5e)return Math['round'](_0x243772['top']+_0x243772['height']/0x2);const _0x5df3c5=_0x243772['getVisible'](),_0x25361f=_0x5df3c5&&_0x2f972b['height']>_0x5df3c5['height'],_0x539e8a=_0x5aca5e['top'],_0x3ee431=_0x5aca5e['bottom'];if(_0x25361f){const _0x395d6a=(_0x5df3c5||_0x4c6daa)['height']/0x2-_0x34330b/0x2,_0xbda3b6=_0x539e8a-L-_0x243772['top'],_0xeb07f8=_0x243772['bottom']-_0x3ee431-L;return _0xbda3b6>=_0x34330b?Math['max'](L,_0x539e8a-_0x34330b-L):_0xeb07f8>=_0x34330b?_0x3ee431+L:Math['max'](L,_0x395d6a);}const _0x330ed8=_0x539e8a-_0x34330b,_0x4f591c=_0x243772['bottom']-_0x3ee431-L,_0x1f71b9=_0x539e8a-L-_0x243772['top'];let _0x43155d;if(_0x4f591c>=_0x34330b)_0x43155d=_0x3ee431+L;else{if(_0x1f71b9>=_0x34330b)_0x43155d=_0x330ed8-L;else _0x43155d=_0x539e8a+_0x2f972b['height']/0x2-_0x34330b/0x2;}return _0x43155d;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x5cd044=D(this['context']);this['listenTo'](_0x5cd044['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x10935a,data:{newRange:_0x11fde0}}of _0x5cd044['model']['document']['differ']['getChangedMarkers']())if(_0x10935a['startsWith'](a+':')&&(_0x11fde0&&(_0x11fde0['start']['isEqual'](_0x11fde0['end'])||'$graveyard'==_0x11fde0['root']['rootName'])||null==_0x11fde0)){const _0x4d13d4=m(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x4d13d4),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x23dead=D(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x23dead['model']['document']);}['_getSelectionElements'](){const _0x5d49c8=D(this['context']);return _0x589705(_0x5d49c8['editing'],[..._0x5d49c8['model']['markers']['getMarkersGroup']('ai-selection'),..._0x5d49c8['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class hs extends _0x1b7f91{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x59be04,_0x13220a={}){super(_0x59be04),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x13220a};const _0x3b14b9=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x3b14b9?'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'](),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']);}['toggleShowChangesEnabled'](_0x386b24){this['showChangesButton']['isEnabled']=_0x386b24;}['_setupRatingButtons'](){this['likeButton']=new _0x3fc85a(this['locale']),this['likeButton']['set']({'icon':_0x235fb2,'label':m(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x3fc85a(this['locale']),this['dislikeButton']['set']({'icon':_0x176db2,'label':m(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x3fc85a(this['locale']),this['copyButton']['set']({'icon':_0x404dc2,'label':m(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x2a76e6=new _0x1a5580();_0x2a76e6['set']({'content':_0x28d1ec}),_0x2a76e6['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'](_0x2a76e6);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x3fc85a(this['locale']),this['showChangesButton']['set']({'icon':_0x2b23b3,'label':m(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':'ck-ai-button-tertiary'}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x25a945=>_0x25a945?_0x5ce6ec:_0x2b23b3),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class B extends ns{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x334f5e,_0x18edf1){super(_0x334f5e);const _0x3bc40d=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new ts(),this['_keystrokes']=new _0x356454(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x19c87e({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x18edf1,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new es(_0x334f5e),this['_partToolbarView']=new os(_0x334f5e,_0x18edf1['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x18edf1),this['_stateView']=new as(_0x334f5e),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new hs(_0x334f5e,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new ls(_0x334f5e,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x3c223a,_0x480b1a,_0x2b7efd,_0x55a0e3)=>{let _0x4f17e2,_0x2982c4;'pending'===_0x55a0e3?(_0x4f17e2=this['_partToolbarView'],_0x2982c4=this['_stateView']):(_0x4f17e2=this['_stateView'],_0x2982c4=this['_partToolbarView']),this['_stateView']['setState'](_0x2b7efd),_0x4f17e2['isVisible']=!0x1,_0x2982c4['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x3bc40d['to']('_state',_0x1f5433=>'ck-ai-chat-balloon-main_state_'+_0x1f5433)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x18edf1);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0x398b3a){_0x398b3a?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x398b3a);}['setState'](_0x407069){this['_state']=_0x407069;}['showError'](_0x5201f7){super['showError'](_0x5201f7),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x2c11b1){super['showBlockingError'](_0x2c11b1),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x4af993){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x4af993;}['togglePartToolbarEnabled'](_0x21437d){this['_partToolbarView']['isEnabled']=_0x21437d;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x5b224f,showSuggestButton:_0x136c01}){_0x5b224f=_0x5b224f&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x136c01=_0x136c01&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x5b224f,'showSuggestButton':_0x136c01});}['_createNextButtonView'](){const _0x4a496f=new _0x3fc85a(this['locale']);return _0x4a496f['set']({'icon':_0x222cc5,'label':m(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x4a496f['on']('execute',()=>{this['fire']('showNext');}),_0x4a496f;}['_createPreviousButtonView'](){const _0x346e8f=new _0x3fc85a(this['locale']);return _0x346e8f['set']({'icon':_0x68c9f1,'label':m(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x346e8f['on']('execute',()=>{this['fire']('showPrevious');}),_0x346e8f;}}class ls extends _0x538d57{constructor(_0x45d6f3,_0x325cce){super(_0x45d6f3),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x325cce});}}class bt extends _0x5adfee{static get['requires'](){return[_0xc82d75,u];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x581bbb){super(_0x581bbb),this['set']('showDiff',!0x1);}['open'](_0x397175){const _0x5471ab=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x5471ab['plugins']['get']('AIBalloon')['open']({..._0x397175,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x397175['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x397175['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x581809){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x581809);}['setState'](_0x3ae237){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x3ae237);}['_createChatBalloonView'](){const _0x150019=this['editor'],_0x1d9a67=_0x150019['plugins']['get']('AIBalloon'),_0x50df7a=_0x150019['commands']['get']('trackChanges');let _0x51775b=_0x150019['config']['get']('ai.availableReplyActions')||[...S];_0x150019['plugins']['has']('TrackChanges')||(_0x51775b=_0x51775b['filter'](_0x57a7d0=>'insertSuggestion'!=_0x57a7d0));const _0x20c8f0=new B(_0x150019['locale'],{'availableActions':_0x51775b,'showApplyButton':!0x0,'showSuggestButton':!!_0x50df7a});return _0x20c8f0['bind']('showDiff')['to'](this),_0x20c8f0['delegate'](...V)['to'](this),_0x20c8f0['delegate']('showPrevious','showNext')['to'](this),_0x1d9a67['delegate']('dialogClosed')['to'](this),_0x20c8f0['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x20c8f0['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x20c8f0['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x50df7a&&_0x20c8f0['bind']('isTrackChangesOn')['to'](_0x50df7a,'value'),_0x20c8f0['render'](),_0x20c8f0;}['_toggleRotatorButtonsInDialogHeader'](_0x578389){const _0x1ac16e=this['editor'],_0x320a3b=_0x1ac16e['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x578389),_0x320a3b['has'](this['_chatBalloonView']['previousButtonView'])||(_0x320a3b['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x1ac16e['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x320a3b['remove'](this['_chatBalloonView']['previousButtonView']),_0x320a3b['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Ya extends _0x5adfee{static get['requires'](){return[pt,bt,jt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Ot(_0x2894dd){const {editor:_0x219987,action:_0x23d5c4,withText:_0xd71065=!0x1,withIcon:_0x226b50=!0x0,isInDropdown:_0x5c63eb=!0x0,shouldPreventFocus:_0x473f5f=!0x1}=_0x2894dd;return()=>{const _0x37c8fc=_0x219987['locale'],_0x4ad92b=new _0x3fc85a(_0x37c8fc),_0xd59c22=_0x4ad92b['bindTemplate'];_0x5c63eb&&_0x4ad92b['extendTemplate']({'on':{'mouseenter':_0xd59c22['to'](()=>{_0x473f5f&&_0x473f5f()||_0x4ad92b['focus']();})}});const _0x26e999=_0x23d5c4['icon']??_0x23d5c4['parent']?.['icon'];return _0x4ad92b['set']({'label':_0x23d5c4['displayedPrompt'],'withText':_0xd71065,'role':'menuitem','icon':_0x226b50?_0x26e999??_0x5d0a10:void 0x0,'tooltip':!_0xd71065,'class':'ck-ai-quick-actions-button','isEnabled':_0x23d5c4['isEnabled']}),_0x4ad92b['on']('execute',()=>{_0x219987['editing']['view']['focus'](),_0x219987['commands']['execute']('aiQuickAction',_0x23d5c4);}),_0x4ad92b;};}class Ks extends _0xa6313b{['arrowView'];constructor(_0x2f8df1,_0x1bad36){super(_0x2f8df1,_0x1bad36);const _0x5e47f0=this['bindTemplate'];this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':['ck-dropdown-menu-list__nested-menu__button'],'aria-haspopup':!0x0,'aria-expanded':this['bindTemplate']['to']('isOn',_0xe049d5=>String(_0xe049d5)),'data-cke-tooltip-disabled':_0x5e47f0['to']('isOn')},'on':{'mouseenter':_0x5e47f0['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x39fd9d=new _0x1a5580();return _0x39fd9d['content']=_0x41c19f,_0x39fd9d['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x39fd9d;}}class Hs extends _0x1b0a54{['_allListItems'];['_allSearchableItems'];constructor(_0x462ece,_0x35dc6f,_0x5ce85a){super(_0x462ece),this['_allListItems']=_0x35dc6f,this['_allSearchableItems']=_0x5ce85a;}['filter'](_0x2d4856){if(!_0x2d4856)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x235db5=_0x2d4856['source']['toLowerCase']()['trim'](),_0x1eb4fc=this['_allSearchableItems']['filter'](_0x399236=>(_0x399236['groupLabel']?_0x399236['label']+'\x20('+_0x399236['groupLabel']+')':_0x399236['label'])['toLowerCase']()['includes'](_0x235db5));return this['items']['clear'](),this['items']['addMany'](_0x1eb4fc['sort']((_0x4dd776,_0x183210)=>{const _0xec329b=_0x4dd776['groupLabel'],_0x9b85b5=_0x183210['groupLabel'];return _0xec329b||_0x9b85b5?_0xec329b?0x1:-0x1:0x0;})['map'](_0x340605=>_0x340605['item'])),this['_highlightQuery'](_0x235db5,_0x1eb4fc),{'resultsCount':_0x1eb4fc['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x11f916,_0x55a82d){if(!_0x11f916)return;const _0x5e0e3f=new RegExp(_0x32442b(_0x11f916),'gi');_0x55a82d['forEach'](_0x21f6fb=>{_0x21f6fb['highlightViews']&&_0x21f6fb['highlightViews']['forEach'](_0x3e74d3=>{'function'==typeof _0x3e74d3['highlightText']&&_0x3e74d3['highlightText'](_0x5e0e3f);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x4ad350=>{_0x4ad350['highlightViews']&&_0x4ad350['highlightViews']['forEach'](_0x484d23=>{'function'==typeof _0x484d23['highlightText']&&_0x484d23['highlightText'](null);});});}}const Js='menu',Xs='menuitem';class co extends _0x538d57{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x360528,_0x2fede4,_0x57e54e,_0x4be90b,_0x3111c6=!0x1){const _0x76d0e0=_0x360528['locale'];super(_0x76d0e0),this['_bodyCollection']=_0x4be90b,this['_hasSearch']=_0x3111c6;const _0x3f8db1=this['_createListItems'](_0x360528,_0x2fede4,_0x57e54e);this['optionsListView']=new Hs(_0x76d0e0,_0x3f8db1,this['_allSearchableItems']),this['optionsListView']['role']=Js,this['optionsListView']['items']['addMany'](_0x3f8db1),this['focusTracker']=new ts(),this['keystrokes']=new _0x356454(),_0x3111c6&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x3f8db1,this['focusCycler']=new _0x19c87e({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x3111c6&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x369f37=_0x3111c6&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x4f2c93(_0x369f37),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x76d0e0['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x8635d1(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':m(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':m(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x1389ef=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x1389ef);}['_createListItems'](_0x2e0ba,_0x3225d6,_0x228c4b){const _0xfc42da=new _0x4f2c93();return _0x3225d6['forEach'](_0x3c9ae8=>{if('actions'in _0x3c9ae8){const {listItem:_0x27de82}=this['_createActionGroupButton'](_0x2e0ba,_0x3c9ae8,_0x228c4b);_0xfc42da['add'](_0x27de82),_0x3c9ae8['actions']['forEach'](_0x1757a8=>{this['_createActionButton'](_0x2e0ba,_0x1757a8,_0x3c9ae8['label'],_0x3c9ae8['icon']);const {listItem:_0x55de5f,highlightViews:_0x5295de}=this['_createSearchResultActionButton'](_0x2e0ba,_0x1757a8,_0x3c9ae8['label'],_0x3c9ae8['icon']);this['_allSearchableItems']['push']({'item':_0x55de5f,'label':_0x1757a8['displayedPrompt'],'groupLabel':_0x3c9ae8['label'],'highlightViews':_0x5295de});});}else{const {listItem:_0x57c02d}=this['_createActionButton'](_0x2e0ba,_0x3c9ae8);_0xfc42da['add'](_0x57c02d);const _0x23f001=_0x57c02d['children']['first'];if(_0x23f001){const {listItem:_0x2d4c8b,highlightViews:_0x2d4b7d}=this['_createSearchResultActionButton'](_0x2e0ba,_0x3c9ae8);this['_allSearchableItems']['push']({'item':_0x2d4c8b,'label':_0x23f001['label']||'','highlightViews':_0x2d4b7d});}}}),_0xfc42da;}['_createActionButton'](_0x2abbc6,_0x421b19,_0x2b8be0,_0x181fbe){const _0x10b064=new _0x5749b5(this['locale']);if(_0x2b8be0&&_0x181fbe){const _0x3fb866=new _0x3fc85a(this['locale']),_0x3c04bc=_0x3fb866['bindTemplate'],_0xb914be=new _0xe11984();_0xb914be['text']=_0x421b19['displayedPrompt'];const _0x49a66b=new _0xe11984();_0x49a66b['text']=_0x2b8be0;const _0x4b3a3b=new _0x1a5580();_0x4b3a3b['content']=_0x181fbe,_0x4b3a3b['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x537d18=new _0x538d57(this['locale']);_0x537d18['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x2a61ff=new _0x538d57(this['locale']);return _0x2a61ff['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x3fb866['set']({'label':_0x421b19['displayedPrompt']+'\x20('+_0x2b8be0+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x3fb866['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0xb914be,_0x537d18,_0x4b3a3b,_0x49a66b,_0x2a61ff],'on':{'mouseenter':_0x3c04bc['to'](()=>{this['_isSearchFocused']()||_0x3fb866['focus']();}),'click':_0x3c04bc['to'](()=>{_0x3fb866['fire']('execute');})}}),_0x3fb866['on']('execute',()=>{_0x2abbc6['editing']['view']['focus'](),_0x2abbc6['commands']['execute']('aiQuickAction',_0x421b19);}),_0x10b064['children']['add'](_0x3fb866),{'listItem':_0x10b064,'highlightViews':[_0xb914be,_0x49a66b]};}{const _0x5b322f=new _0x1eaeda(),_0x585d6c=new _0x3fc85a(this['locale'],_0x5b322f),_0x51ea82=_0x585d6c['bindTemplate'],_0x590f57=_0x421b19['icon']??_0x421b19['parent']?.['icon'],_0x789f1b=void 0x0!==_0x421b19['icon'];return _0x585d6c['set']({'label':_0x421b19['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x789f1b?_0x590f57??_0x5d0a10:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x585d6c['extendTemplate']({'on':{'mouseenter':_0x51ea82['to'](()=>{this['_isSearchFocused']()||_0x585d6c['focus']();})}}),_0x585d6c['on']('execute',()=>{_0x2abbc6['editing']['view']['focus'](),_0x2abbc6['commands']['execute']('aiQuickAction',_0x421b19);}),_0x10b064['children']['add'](_0x585d6c),{'listItem':_0x10b064,'highlightViews':[_0x5b322f]};}}['_createSearchResultActionButton'](_0x3def68,_0x5e22f3,_0x18befc,_0x214567){return _0x18befc&&_0x214567?this['_createSearchResultGroupedActionButton'](_0x3def68,_0x5e22f3,_0x18befc,_0x214567):this['_createSearchResultIndividualActionButton'](_0x3def68,_0x5e22f3);}['_createSearchResultGroupedActionButton'](_0x5487fb,_0x2450c0,_0x4c15b3,_0x22dd65){const _0x44dda3=new _0x5749b5(this['locale']),_0x21aba7=new _0x3fc85a(this['locale']),_0x394ee7=_0x21aba7['bindTemplate'],{view:_0x1bf57b,highlightView:_0x446a93}=this['_createSearchResultGroupRow'](_0x4c15b3,_0x22dd65),{view:_0x4846b5,highlightView:_0x35c1a9}=this['_createSearchResultActionRow'](_0x2450c0['displayedPrompt']),_0xe471c0=this['_createSearchResultContentView'](_0x1bf57b,_0x4846b5);return _0x21aba7['set']({'label':_0x2450c0['displayedPrompt'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0x21aba7['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0xe471c0],'on':{'mouseenter':_0x394ee7['to'](()=>{this['_isSearchFocused']()||_0x21aba7['focus']();}),'click':_0x394ee7['to'](()=>{this['_handleSearchResultButtonClick'](_0x21aba7);})}}),this['_setupActionButtonExecution'](_0x21aba7,_0x5487fb,_0x2450c0),_0x44dda3['children']['add'](_0x21aba7),{'listItem':_0x44dda3,'highlightViews':[_0x446a93,_0x35c1a9]};}['_createSearchResultIndividualActionButton'](_0x487b31,_0x5e699f){const _0x151268=new _0x5749b5(this['locale']),_0xb1a08f=new _0x1eaeda(),_0x437677=new _0x3fc85a(this['locale'],_0xb1a08f),_0x249120=_0x437677['bindTemplate'];return _0x437677['set']({'label':_0x5e699f['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x437677['extendTemplate']({'on':{'mouseenter':_0x249120['to'](()=>{this['_isSearchFocused']()||_0x437677['focus']();})}}),this['_setupActionButtonExecution'](_0x437677,_0x487b31,_0x5e699f),_0x151268['children']['add'](_0x437677),{'listItem':_0x151268,'highlightViews':[_0xb1a08f]};}['_createSearchResultGroupRow'](_0x1f63d0,_0x12553d){const _0x10e360=new _0x538d57(this['locale']),_0x5c8569=new _0x1a5580();_0x5c8569['content']=_0x12553d,_0x5c8569['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x44d75e=new _0xe11984();return _0x44d75e['text']=_0x1f63d0,_0x10e360['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x5c8569,_0x44d75e]}),{'view':_0x10e360,'highlightView':_0x44d75e};}['_createSearchResultActionRow'](_0x4c9e2d){const _0x5a3c09=new _0x538d57(this['locale']),_0x9d8410=new _0xe11984();return _0x9d8410['text']=_0x4c9e2d,_0x5a3c09['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x9d8410]}),{'view':_0x5a3c09,'highlightView':_0x9d8410};}['_createSearchResultContentView'](_0x2aa3a2,_0x25af13){const _0x245c19=new _0x538d57(this['locale']);return _0x245c19['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x2aa3a2,_0x25af13]}),_0x245c19;}['_setupActionButtonExecution'](_0x28047c,_0x440429,_0x4fa05e){_0x28047c['on']('execute',()=>{_0x440429['editing']['view']['focus'](),_0x440429['commands']['execute']('aiQuickAction',_0x4fa05e);});}['_createActionGroupButton'](_0x1b1f3c,_0x5e3897,_0x37fb3c){const _0x41b1f9=new _0x5749b5(this['locale']),_0x36330e=new _0x1eaeda(),_0xb314c1=new Ks(this['locale'],_0x36330e),_0x39f3a6=_0xb314c1['bindTemplate'],_0x528f55=this['_getPanelKeystroke'](_0x37fb3c),_0xed0126=this['_createGroupActionsList'](_0x1b1f3c,_0x5e3897['actions'],_0x37fb3c);_0xb314c1['set']({'label':_0x5e3897['label'],'withText':!0x0,'role':Xs,'icon':_0x5e3897['icon']??_0x5d0a10,'isEnabled':_0x5e3897['actions']['some'](_0x1cd4e9=>_0x1cd4e9['isEnabled'])}),_0xb314c1['extendTemplate']({'on':{'mouseenter':_0x39f3a6['to'](()=>{this['_isSearchFocused']()||_0xb314c1['focus']();})}});const _0x14f810=new _0x51e059(this['locale']);return _0x14f810['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x39f3a6['to'](_0x4146ee=>{this['_handlePanelKeydown'](_0x4146ee,_0x528f55,_0xb314c1,_0x14f810);})}}),_0xb314c1['bind']('isOn')['to'](_0x14f810,'isVisible'),this['_bodyCollection']['add'](_0x14f810),_0x14f810['content']['add'](_0xed0126),this['_setupGroupMenuBehavior'](_0xb314c1,_0x14f810),_0x41b1f9['children']['add'](_0xb314c1),{'listItem':_0x41b1f9,'highlightView':_0x36330e};}['_createGroupActionsList'](_0x29c80c,_0x400f8,_0x57b8e9){const _0x4a639a=new _0x1b0a54(this['locale']);return _0x4a639a['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x400f8['forEach'](_0x3e3a3c=>{const _0x163473=new _0x5749b5(this['locale']),_0x42d988=Ot({'editor':_0x29c80c,'action':_0x3e3a3c,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x163473['children']['add'](_0x42d988),_0x57b8e9['focusTracker']['add'](_0x42d988),_0x4a639a['items']['add'](_0x163473);}),_0x4a639a;}['_setupGroupMenuBehavior'](_0x34653b,_0x1d45d6){const _0x4947f5=_0x34653b['bindTemplate'],_0x559e52=this['_getButtonKeystroke'](_0x34653b);_0x34653b['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x4947f5['to'](()=>{this['_showNestedPanel'](_0x1d45d6,_0x34653b);}),'mouseleave':_0x4947f5['to'](_0xfd457b=>{const _0x1ba7e4=_0xfd457b['relatedTarget'];this['_isMovingToNestedMenu'](_0x1ba7e4,_0x1d45d6)||this['_hideNestedPanel'](_0x1d45d6);}),'keydown':_0x4947f5['to'](_0x5cd96f=>{_0x5cd96f['key']==_0x559e52&&(this['_showNestedPanel'](_0x1d45d6,_0x34653b),_0x1d45d6['content']['get'](0x0)['focus']());})}}),_0x1d45d6['on']('render',()=>{_0x1d45d6['element']?.['addEventListener']('mouseleave',_0x21799f=>{const _0x5f5004=_0x21799f['relatedTarget'];_0x34653b['element']?.['contains'](_0x5f5004)||this['_isMovingToNestedMenu'](_0x5f5004,_0x1d45d6)||this['_hideNestedPanel'](_0x1d45d6);});});}['_showNestedPanel'](_0x2fbe81,_0x431584){this['_openNestedPanels']['forEach'](_0x5e2735=>{_0x5e2735!==_0x2fbe81&&_0x5e2735['isVisible']&&_0x5e2735['hide']();}),_0x2fbe81['show'](),_0x2fbe81['pin']({'positions':[_0x1a2e34['eastSouth']],'target':_0x431584['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x2fbe81);}['_hideNestedPanel'](_0x97d896){_0x97d896['hide'](),this['_openNestedPanels']['delete'](_0x97d896);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x19d13b=>_0x19d13b['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x5e2660,_0x25c71d){if(!_0x5e2660)return!0x1;if(_0x25c71d['element']?.['contains'](_0x5e2660))return!0x0;const _0x19ad6c=_0x5e2660;return _0x19ad6c['closest']&&(null!==_0x19ad6c['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x19ad6c['closest']('.ck-ai-quick-actions-group-list')||null!==_0x19ad6c['closest']('.ck-ai-quick-actions-group-button'));}['resetSearch'](){this['_searchTextView']&&this['_searchTextView']['reset']();}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}['_getPanelKeystroke'](_0x361319){return'rtl'===_0x361319['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x45784f){return'rtl'===_0x45784f['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x4cd162,_0x46933d,_0x498932,_0x463576){_0x4cd162['key']==_0x46933d&&(_0x498932['focus'](),this['_hideNestedPanel'](_0x463576));}['_handleSearchResultButtonClick'](_0x1f2a67){_0x1f2a67['fire']('execute');}}function xt(_0x2dfc30){const {editor:_0x40acab,content:_0x3cfa47,buttonDefinition:_0x1ea703,bodyCollection:_0x13a4cc,hasSearch:_0xeb693c=!0x1}=_0x2dfc30;return()=>{const _0x339f34=_0x40acab['locale'],_0x38cae7=_0x238494(_0x339f34);_0x38cae7['buttonView']['set']({'icon':_0x1ea703['icon']??_0x5d0a10,'label':_0x1ea703['label'],'tooltip':!0x0}),_0x38cae7['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x203032=new co(_0x40acab,_0x3cfa47,_0x38cae7,_0x13a4cc,_0xeb693c);if(_0x38cae7['panelView']['children']['add'](_0x203032),_0xeb693c){const _0x5ce7b7='ai-quick-actions-dropdown-selection';_0x38cae7['on']('change:isOpen',(_0x849c54,_0xbe4d40,_0x4dd328)=>{if(_0x4dd328){if(_0x40acab['plugins']['has']('AIEditing')){const _0xd04c51=_0x40acab['plugins']['get'](o),_0x4142c9=_0x40acab['model']['document']['selection'],_0x4f79ce=Array['from'](_0x4142c9['getRanges']());_0x4f79ce['length']>0x0&&_0xd04c51['showFakeVisualSelection'](_0x4f79ce,_0x5ce7b7,!0x1,!0x0);}}else _0x40acab['plugins']['has']('AIEditing')&&_0x40acab['plugins']['get'](o)['hideFakeVisualSelection'](_0x5ce7b7),_0x203032['resetSearch']();});}return _0x38cae7;};}const Ut='<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>',vt='<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>',Pt='<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 It=function(_0x371f42){return _0x371f42['CHAT']='CHAT',_0x371f42['ACTION']='ACTION',_0x371f42['REVIEW']='REVIEW',_0x371f42;}({}),$a=function(_0x1d6316){return _0x1d6316['CHAT']='AIChat',_0x1d6316['ACTION']='AIActions',_0x1d6316['REVIEW']='AIReviewMode',_0x1d6316;}({});class ki extends _0x5adfee{static get['requires'](){return[Et,s];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x570f74=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x570f74),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x141414){return function(_0xf18773){const _0x1cceab=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0xf18773['uiLanguage']),_0x289b4d=_0x1cceab||'English',_0x87f819=[{'id':'ask-ai','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Tt},{'id':'chat-commands','label':m(_0xf18773,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Tt,'actions':[{'id':'explain','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ut['replace']('%0',_0x289b4d),'type':'CHAT'},{'id':'summarize','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':vt['replace']('%0',_0x289b4d),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Pt['replace']('%0',_0x289b4d),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Ct},{'id':'continue','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':kt},{'id':'fix-grammar','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Nt},{'id':'adjust-length','label':m(_0xf18773,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':yt,'actions':[{'id':'make-shorter','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':m(_0xf18773,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_t,'actions':[{'id':'make-tone-casual','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':St,'actions':[{'id':'translate-to-english','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':m(_0xf18773,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':m(_0xf18773,'AI_QUICK_ACTIONS_OTHER'),'icon':Qt,'actions':[]}];return _0x87f819;}(_0x141414);}async['_getDefaultAndCustomActions'](){const _0xfaba8f=ki['getDefaultQuickActions'](this['editor']['locale']),_0x2f268c=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x2b32ff=[];try{_0x2b32ff=await new X({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x2b7272){const _0x513943=new _0x1500e8('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x2b7272});_0x4dee23(_0x513943['message']);}finally{const _0x45d68d=_0x2f268c['map'](_0x5f2812=>({..._0x5f2812,'icon':void 0x0}));_0xfaba8f['find'](_0x4f3f57=>'other'===_0x4f3f57['id'])['actions']['push'](..._0x45d68d),_0xfaba8f['forEach'](_0x4bf819=>{if('actions'in _0x4bf819)_0x4bf819['actions']['forEach'](_0x1a67f8=>{if(_0x1a67f8['isEnabled']=!!_0x2b32ff['find'](_0x32babb=>_0x32babb['id']===_0x1a67f8['model'])||void 0x0===_0x1a67f8['model'],!_0x1a67f8['isEnabled']){const _0xfe852e=new _0x1500e8('ai-quick-actions-unavailable-model',this,{'actionId':_0x1a67f8['id'],'modelId':_0x1a67f8['model']});_0x4dee23(_0xfe852e['message']);}});else{if(_0x4bf819['isEnabled']=!!_0x2b32ff['find'](_0x35caee=>_0x35caee['id']===_0x4bf819['model'])||void 0x0===_0x4bf819['model'],!_0x4bf819['isEnabled']){const _0x3d6960=new _0x1500e8('ai-quick-actions-unavailable-model',this,{'actionId':_0x4bf819['id'],'modelId':_0x4bf819['model']});_0x4dee23(_0x3d6960['message']);}}});}return _0xfaba8f;}['_initializeQuickActionsComponentsAndCommands'](){const _0x5e46a5=new _0x4b2ab0(this['editor']['locale']);_0x5e46a5['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x5e46a5),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x5e46a5);}['_initializeQuickActionsDropdown'](_0x247224){const _0x12e449=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x5d0a10,'label':m(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x247224,'hasSearch':_0x12e449}));}['_prepareQuickActionsDefinition'](_0x1e51bf){this['_quickActionsDefinition']=_0x1e51bf['map'](_0x14d44d=>{if('actions'in _0x14d44d){const _0x4a047f=_0x14d44d;return{..._0x4a047f,'actions':_0x4a047f['actions']['map'](_0x6d3f58=>{const {actions:_0x2bd76d,..._0x2dc4e2}=_0x4a047f;return{..._0x6d3f58,'parent':_0x2dc4e2};})['filter'](_0x9155=>this['_shouldIncludeAction'](_0x9155))};}return _0x14d44d;})['filter'](_0x49dc89=>'actions'in _0x49dc89?_0x49dc89['actions']['length']>0x0:this['_shouldIncludeAction'](_0x49dc89));}['_shouldIncludeAction'](_0x4153da){const _0x1e4bb4=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has']($a[_0x4153da['type']])&&!_0x1e4bb4['includes'](_0x4153da['id'])&&!('CHAT'===_0x4153da['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x43106b){this['_quickActionsDefinition']['forEach'](_0x3a0e21=>{if('actions'in _0x3a0e21){const _0x1e563c=xt({'editor':this['editor'],'content':_0x3a0e21['actions'],'buttonDefinition':_0x3a0e21,'bodyCollection':_0x43106b});this['editor']['ui']['componentFactory']['add'](_0x3a0e21['id'],_0x1e563c),_0x3a0e21['actions']['forEach'](_0x35ab81=>{const _0x720cb7=Ot({'editor':this['editor'],'action':_0x35ab81});this['editor']['ui']['componentFactory']['add'](_0x35ab81['id'],_0x720cb7);});}else{const _0x4d4577=Ot({'editor':this['editor'],'action':_0x3a0e21,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x3a0e21['id'],_0x4d4577);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x3f01a0=>{const _0x3123df=new _0x3c114(_0x3f01a0),_0x222c2e=m(_0x3f01a0,'AI_QUICK_ACTIONS_HEADING');_0x3123df['buttonView']['set']({'label':_0x222c2e,'icon':_0x5d0a10});const _0x447fdf=new _0x3301ef(_0x3f01a0);_0x447fdf['set']({'ariaLabel':_0x222c2e,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x50c60c=>{if('actions'in _0x50c60c){const _0x12bc92=_0x50c60c,_0x8b6ba4=new _0x4dbed9(_0x3f01a0,_0x3123df),_0xd197f4=new _0x3c114(_0x3f01a0),_0x157908=new _0x3301ef(_0x3f01a0);_0xd197f4['buttonView']['set']({'label':_0x12bc92['label'],'icon':_0x12bc92['icon']}),_0x12bc92['actions']['forEach'](_0x7fbb62=>{const _0x1ad5cd=new _0x4dbed9(_0x3f01a0,_0xd197f4),_0x5d13ea=new _0x58fafd(_0x3f01a0);_0x5d13ea['set']({'label':_0x7fbb62['displayedPrompt'],'icon':_0x7fbb62['icon'],'role':'menuitem','isEnabled':_0x7fbb62['isEnabled']}),_0x5d13ea['on']('execute',()=>{this['_executeQuickAction'](_0x7fbb62);}),_0x5d13ea['delegate']('execute')['to'](_0xd197f4),_0x1ad5cd['children']['add'](_0x5d13ea),_0x157908['items']['add'](_0x1ad5cd);}),_0xd197f4['panelView']['children']['add'](_0x157908),_0x8b6ba4['children']['add'](_0xd197f4),_0x447fdf['items']['add'](_0x8b6ba4);}else{const _0x5b1675=_0x50c60c,_0x25a7e=new _0x4dbed9(_0x3f01a0,_0x3123df),_0x5acac6=new _0x58fafd(_0x3f01a0);_0x5acac6['set']({'label':_0x5b1675['displayedPrompt'],'icon':_0x5b1675['icon'],'role':'menuitem','isEnabled':_0x5b1675['isEnabled']}),_0x5acac6['on']('execute',()=>{this['_executeQuickAction'](_0x5b1675);}),_0x5acac6['delegate']('execute')['to'](_0x3123df),_0x25a7e['children']['add'](_0x5acac6),_0x447fdf['items']['add'](_0x25a7e);}});const _0x47814b=Object['values']($a)['some'](_0x40762f=>this['editor']['plugins']['has'](_0x40762f));return _0x3123df['set']({'isEnabled':_0x47814b}),_0x3123df['panelView']['children']['add'](_0x447fdf),_0x3123df;});}['_executeQuickAction'](_0x438844){const _0x202552=this['editor'];_0x202552['editing']['view']['focus'](),_0x202552['commands']['execute']('aiQuickAction',_0x438844);const _0x2d2d0c=_0x202552['ui']['view']['menuBarView'];_0x2d2d0c&&_0x2d2d0c['close']&&_0x2d2d0c['close']();}}class Ii extends At{['execute'](_0x306775){switch(this['_expandSelectionIfCollapsed'](),_0x306775['type']){case It['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5dc0a0=m(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x1500e8('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5dc0a0});}this['_handleAIChatAction'](_0x306775);break;case It['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x43815c=m(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x1500e8('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x43815c});}this['_handleAIActionsAction'](_0x306775);break;case It['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x5a55be=m(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x1500e8('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5a55be});}this['_handleAIReviewAction'](_0x306775);}}async['_handleAIChatAction'](_0x19208e){const _0x20ed7e=this['editor']['plugins']['get']('AIChat'),_0x20fde9=this['editor']['plugins']['get']('AIChatController'),_0x591774=this['editor']['plugins']['get']('AITabs')['view'];if(_0x591774['isVisible']||(_0x591774['isVisible']=!0x0),'chat'!==_0x591774['activeTab']&&_0x591774['activateTab']('chat'),'ask-ai'===_0x19208e['id'])_0x20fde9['removeSelectionFromChatContext'](),await _0x20ed7e['addSelectionToChatContext'](),_0x20ed7e['focusPromptInput']();else await _0x20ed7e['startConversation'](),_0x20fde9['removeSelectionFromChatContext'](),await _0x20ed7e['addSelectionToChatContext'](),_0x20ed7e['focusPromptInput'](),await _0x20ed7e['sendMessage']({'message':_0x19208e['prompt']||_0x19208e['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x19208e['id']},'displayedPrompt':_0x19208e['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x3b8985=this['editor'],_0x55d303=_0x3b8985['model']['document']['selection'];if(!_0x55d303['isCollapsed'])return;const _0x4a1ee1=_0x33a8c(_0x55d303['getSelectedBlocks']())||_0x3b8985['model']['schema']['getLimitElement'](_0x55d303);_0x3b8985['model']['change'](_0x15e097=>{_0x15e097['setSelection'](_0x4a1ee1,'in');});}['_handleAIActionsActionLabel'](_0x2db0e5){return _0x2db0e5['parent']?.['label']&&'other'!==_0x2db0e5['parent']?.['id']?_0x2db0e5['parent']['label']+':\x20'+_0x2db0e5['displayedPrompt']:_0x2db0e5['displayedPrompt'];}async['_handleAIActionsAction'](_0x4dafdf){const _0x106ad3=this['editor']['plugins']['get']('AIActions'),_0x4d8864=_0x4dafdf['prompt']?{'userMessage':_0x4dafdf['prompt'],'model':_0x4dafdf['model']}:{'actionName':_0x4dafdf['actionName']||_0x4dafdf['id'],'args':_0x4dafdf['args']},_0x49f8a4=this['_handleAIActionsActionLabel'](_0x4dafdf);await _0x106ad3['executeAction'](_0x4d8864,_0x49f8a4,_0x4dafdf['icon']);}async['_handleAIReviewAction'](_0x4f7204){console['log']('handleAIReviewAction',_0x4f7204);}}class ji extends _0x5adfee{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3eedb7=this['editor'],_0xcbe3c2=new Ii(this['editor']);if(_0x3eedb7['commands']['add']('aiQuickAction',_0xcbe3c2),_0x3eedb7['plugins']['has']('AIChat')){const _0x3e7ee1=this['editor']['plugins']['get']('AIChat');_0x3eedb7['model']['document']['selection']['on']('change:range',(_0x357558,_0x2dbc44)=>{_0x2dbc44['directChange']&&_0x3e7ee1['removeSelectionFromChatContext']();});}}}class Kt extends pe{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x3d8ee4=this['documentContextContent']['children']['map'](_0x2c2dd1=>({'node':_0x2c2dd1,'id':q(_0x2c2dd1,'data-id')})),_0x5be06a=this['parsedMergedContent']['children']['map'](_0x825813=>({'node':_0x825813,'id':q(_0x825813,'data-id')||_0x3e4e8c()})),_0x170189=_0x3682e4(_0x3d8ee4,_0x5be06a,{'comparator':(_0x221df5,_0x6e62b7)=>_0x221df5['id']==_0x6e62b7['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x170189['length']&&_0x170189[_0x170189['length']-0x1]['removed'];)_0x170189['pop']();}const _0x504f45=_0x170189['map'](_0x33e545=>{const _0x135ee5=_0x33e545['added']?'new':_0x33e545['removed']?'removed':'modified';return{'node':_0x33e545['value'][0x0]['node'],'type':_0x135ee5,'id':_0x33e545['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x504f45,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x37c54d,_0x1bad0c){return _0x1bad0c;}}class h extends qt{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x34ec76){super(_0x34ec76),this['content']=_0x34ec76['content'],this['version']=_0x34ec76['version'],this['actionName']=_0x34ec76['actionName'],this['args']=_0x34ec76['args'],this['userMessage']=_0x34ec76['userMessage'],this['model']=_0x34ec76['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':Jt['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x359fc7){const _0x24508f=new Kt({'editor':this['editor'],'documentContextContent':this['content'],..._0x359fc7});return this['replies']['push'](_0x24508f),_0x24508f['delegate'](...zt)['to'](this),this['fire']('replyCreated',_0x24508f),_0x24508f;}}class Bn extends _0x1b7f91{constructor(_0x1af79e,_0x130932=!0x0,_0x3c0dd6=!0x0){super(_0x1af79e),this['set']('isEnabled',!0x1),_0x130932&&(this['applyButton']=this['_createButton'](m(_0x1af79e,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x3c0dd6&&(this['suggestButton']=this['_createButton'](m(_0x1af79e,'AI_BALLOON_SUGGEST_BUTTON'),_0x130932?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x130932,'showSuggestButton':_0x3c0dd6}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x32019a,showSuggestButton:_0x3a373f}){this['applyButton']&&(this['applyButton']['isVisible']=_0x32019a),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x3a373f);}['_createButton'](_0x3abada,_0x198248){const _0x1d7d5a=new _0x3fc85a(this['locale']);return _0x1d7d5a['set']({'label':_0x3abada,'class':_0x198248,'isVisible':!0x0,'withText':!0x0}),_0x1d7d5a;}}class yn extends _0x538d57{constructor(_0x567779){super(_0x567779),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':m(_0x567779,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0x538d57{constructor(_0x5afe87){super(_0x5afe87),this['set']('isVisible',!0x0);const _0x249b16=new De('small');_0x249b16['isVisible']=!0x0;const _0x2d8a04=new _0x538d57(this['locale']);_0x2d8a04['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[m(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x3d75f9=>!_0x3d75f9)]},'children':[_0x249b16,_0x2d8a04]});}}class v extends ns{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x595439,_0x263efd){super(_0x595439),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x263efd,this['_focusTracker']=new ts(),this['_keystrokes']=new _0x356454(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x19c87e({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x4f2c93(),this['_addContentWrapper'](_0x263efd),this['_addDisclaimerView'](),this['_addToolbar'](_0x263efd),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x263efd);});}['render'](){super['render']();for(const _0x3883af of this['_focusables'])this['_focusTracker']['add'](_0x3883af['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x26fbcb){-0x1===_0x26fbcb?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x23b2fd){this['_isLoading']=_0x23b2fd;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x378cfc){super['showError'](_0x378cfc),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x489458){super['showBlockingError'](_0x489458),this['setErrorState']();}['addMiniToolbarItem'](_0x506bcf){this['_miniToolbarView']['items']['has'](_0x506bcf)||this['_miniToolbarView']['items']['add'](_0x506bcf);}['removeMiniToolbarItem'](_0x1adaf1){this['_miniToolbarView']['items']['has'](_0x1adaf1)&&this['_miniToolbarView']['items']['remove'](_0x1adaf1);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x36a1ec,showSuggestButton:_0x59d823}){_0x36a1ec=_0x36a1ec&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x59d823=_0x59d823&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x36a1ec,'showSuggestButton':_0x59d823});}async['updateContent'](_0x548b58){await this['_streamableContentView']['update'](_0x548b58);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x5962c0){this['_contentWrapper']=new _0x538d57(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x5962c0['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x188a12,showSuggestButton:_0x2fa869}){this['_toolbarView']=new Bn(this['locale'],_0x188a12,_0x2fa869),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x5969d5,_0x457e9a,_0x1fc79f)=>!(_0x5969d5||_0x457e9a||_0x1fc79f)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x188a12,'showSuggestButton':_0x2fa869}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x3f6f99){return this['_miniToolbarView']=new hs(this['locale'],_0x3f6f99),this['_miniToolbarView']['delegate'](...V)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x14835c,_0x5499e9)=>!(_0x14835c||_0x5499e9)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Nn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new es(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x3a5e00=new _0x3fc85a(this['locale']),_0x508c4e=new _0x3fc85a(this['locale']),_0x49b694=new Ln(this['locale']),_0x4fa457=new _0x3fc85a(this['locale']);_0x3a5e00['set']({'icon':_0x49b8b4,'label':m(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x508c4e['set']({'icon':_0x41367a,'tooltip':m(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x4fa457['set']({'icon':_0x5695ec,'tooltip':m(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x3a5e00['bind']('isEnabled')['to'](this,'isBusy',_0x17b79c=>!_0x17b79c),_0x3a5e00['on']('execute',()=>{this['fire']('tryAgain');}),_0x508c4e['bind']('isEnabled')['to'](this,'isBusy',_0x521b44=>!_0x521b44),_0x508c4e['on']('execute',()=>{this['fire']('showPrevious');}),_0x4fa457['bind']('isEnabled')['to'](this,'isBusy',_0x3f5e5d=>!_0x3f5e5d),_0x4fa457['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x508c4e,this['_navigationCounter']=_0x49b694,this['_navigationNextButton']=_0x4fa457,this['_navigationTryAgainButton']=_0x3a5e00;}['updateMiniToolbarButtons'](_0x2d9568,_0x448997){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x10f9d3=_0x2d9568>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x10f9d3){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x503f22=_0x2d9568-_0x448997;this['_navigationCounter']['setInteractionCount'](_0x503f22+'/'+_0x2d9568),this['_navigationPreviousButton']['isEnabled']=_0x448997<_0x2d9568-0x1,this['_navigationNextButton']['isEnabled']=_0x448997>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0x349ce7){this['_isLoading']=_0x349ce7;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x363e81=this['_getScrollableElement']();_0x363e81&&!this['_scrollManager']&&(this['_scrollManager']=new Fe(_0x363e81));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Ln extends _0x538d57{constructor(_0x151a0a){super(_0x151a0a);const _0x1ada18=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x1ada18['to']('interactionCount')}]});}['setInteractionCount'](_0x44d009){this['set']('interactionCount',_0x44d009);}}class qi extends _0x5adfee{static get['requires'](){return[s,_0xc82d75,o,u,_0x4f58a6];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x39e525){super(_0x39e525),this['_bodyCollection']=new _0x4b2ab0(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new g();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x2b992f,_0x26afe8,_0x90302a){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x4479df,anchorData:_0x278fd8}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x2b992f,_0x4479df,_0x278fd8,_0x26afe8,_0x90302a);}}const {modelFragment:_0x3174ee,anchorData:_0x4b4d69}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x2b992f,_0x3174ee,_0x4b4d69,_0x26afe8,_0x90302a);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x5dfc73=this['editor']['plugins']['has']('TrackChanges');let _0x511c5b=this['editor']['config']['get']('ai.availableReplyActions')||[...S];_0x5dfc73||(_0x511c5b=_0x511c5b['filter'](_0x166b27=>'insertSuggestion'!=_0x166b27));const _0x181740=this['editor']['commands']['get']('trackChanges'),_0x19855f=new v(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x5dfc73,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x511c5b});return _0x19855f['bind']('isBusy')['to'](this),_0x181740&&_0x19855f['bind']('isTrackChangesOn')['to'](_0x181740,'value'),_0x19855f['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x19855f['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x19855f['on']('showNext',()=>{this['_navigateToNext']();}),_0x19855f;}['_getExecuteDataRegular'](){const _0x4b2b91=this['editor']['model']['document']['selection'];if(_0x4b2b91['isCollapsed']){const _0x121a89=_0x33a8c(_0x4b2b91['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x4b2b91);this['editor']['model']['change'](_0x133e14=>{_0x133e14['setSelection'](_0x121a89,'in');});}const _0x471e6a=_0x4b2b91['getFirstRange'](),_0xf5d73f=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x4b2b91),_0x471e6a['start'],_0x471e6a['end']);this['_copyMarkersToFragment'](_0xf5d73f,_0x4b2b91,{'isTableSelection':!0x1});const _0x58b000=_0x4b2b91['getFirstRange']()['start'],_0x7a6e71=new Map();let _0x72ddaa=_0xf5d73f;for(let _0x35a13e=0x0;_0x35a13e<_0x58b000['path']['length'];_0x35a13e++)_0x7a6e71['set'](_0x72ddaa,_0x58b000['path'][_0x35a13e]),_0x72ddaa=_0x72ddaa['getChild'](0x0);return{'modelFragment':_0xf5d73f,'anchorData':_0x7a6e71};}['_getExecuteDataInTable'](){const _0x583ab3=this['editor']['model']['document']['selection'],_0x125768=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x403164=_0x583ab3['getFirstRange']()['start']['parent']['parent'],_0x43fa1d=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x403164),this['editor']['model']['createPositionAfter'](_0x403164)),_0x21b4ff=this['_wrapWithCommonAncestors'](_0x125768,_0x43fa1d['start'],_0x43fa1d['end']);this['_copyMarkersToFragment'](_0x21b4ff,_0x583ab3,{'isTableSelection':!0x0});const _0x54b76f=_0x583ab3['getFirstRange']()['start'],_0x9a568e=new Map();let _0x50d7de=_0x21b4ff;for(let _0x96f730=0x0;_0x96f730<_0x54b76f['path']['length'];_0x96f730++)if(_0x9a568e['set'](_0x50d7de,_0x54b76f['path'][_0x96f730]),_0x96f730<_0x54b76f['path']['length']-0x1)_0x50d7de=_0x50d7de['getChild'](0x0);else{let _0x178611=_0x50d7de['nextSibling'];for(;_0x178611;)_0x9a568e['set'](_0x178611,_0x54b76f['path'][_0x96f730]),_0x178611=_0x178611['nextSibling'];}return{'modelFragment':_0x21b4ff,'anchorData':_0x9a568e};}async['_executeAction'](_0x238f9c,_0x5759dc,_0x33c3d4,_0x25f73e,_0x245d78){const _0x33dc81=this['editor']['plugins']['get'](o),_0x3b9a78=this['editor']['plugins']['get'](u),_0x3447a9=this['editor']['model']['document']['selection'],_0x45b88b=await _0x33dc81['modelToDataWithIds'](_0x5759dc),_0x278af7=this['editor']['model']['document']['version'],_0x37a82b=[..._0x3447a9['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x3b9a78['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x25f73e,'icon':_0x245d78||_0x5d0a10,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x37a82b,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x3b9a78),this['_interactionParams']={'action':_0x238f9c,'content':_0x45b88b,'version':_0x278af7,'aiBalloon':_0x3b9a78,'modelFragment':_0x5759dc,'anchorData':_0x33c3d4},this['_setupApplyListeners'](),this['listenTo'](_0x3b9a78,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x3b9a78,'dialogClosed',(_0x1b8af9,{id:_0x364df5})=>{if('aiActionsBalloon'===_0x364df5){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x19a7e8=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x8878c1=_0x19a7e8['changeGroups'][0x0];_0x8878c1&&'pending'===_0x8878c1['state']&&_0x19a7e8['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x3b9a78);}}),this['_createInteraction'](_0x45b88b,_0x278af7,_0x3b9a78,_0x238f9c);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x1d9e06,anchorData:_0x29f69a}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x1d9e06,_0x29f69a,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x1d9e06,_0x29f69a,!0x0);});}['_wrapWithCommonAncestors'](_0x50ad0f,_0x39daf8,_0x394218){const _0x27e7f3=this['editor']['model']['createRange'](_0x39daf8,_0x394218)['getCommonAncestor'](),_0x310adc=_0x27e7f3['is']('documentFragment')?[]:_0x27e7f3['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x310adc['length']){const _0x35d1cd=_0x310adc['map'](_0x381e1a=>_0x381e1a['_clone'](!0x1));for(let _0x38bf43=0x1;_0x38bf43<_0x35d1cd['length'];_0x38bf43++)_0x35d1cd[_0x38bf43-0x1]['_appendChild'](_0x35d1cd[_0x38bf43]);return _0x35d1cd[_0x35d1cd['length']-0x1]['_appendChild'](_0x50ad0f),new _0x27a70e(_0x35d1cd[0x0]);}return _0x50ad0f;}['_copyMarkersToFragment'](_0x2b8398,_0x41ab79,_0x3354c4={'isTableSelection':!0x1}){const _0x2880d4=this['editor']['model'],_0x335edb=Array['from'](_0x41ab79['getRanges']()),_0x26b9d2=_0x41ab79['getFirstRange']()['start'];for(const _0x1450b of _0x2880d4['markers']){if(_0x1450b['name']['startsWith'](a)||!_0x1450b['affectsData'])continue;const _0x32bbd5=_0x1450b['getRange']();if(!_0x335edb['some'](_0x527231=>_0x527231['containsRange'](_0x32bbd5,!0x0)))continue;const _0x49375c=this['_regularCalculateMarkerPath'](_0x32bbd5['start'],_0x26b9d2,_0x3354c4['isTableSelection']),_0x27fa5f=this['_regularCalculateMarkerPath'](_0x32bbd5['end'],_0x26b9d2,_0x3354c4['isTableSelection']),_0x8d8417=_0x2880d4['createPositionFromPath'](_0x2b8398,_0x49375c),_0xd81d5a=_0x2880d4['createPositionFromPath'](_0x2b8398,_0x27fa5f);if(!_0x8d8417['isEqual'](_0xd81d5a)){const _0x463314=_0x2880d4['createRange'](_0x8d8417,_0xd81d5a);_0x2b8398['markers']['set'](_0x1450b['name'],_0x463314);}}}['_regularCalculateMarkerPath'](_0x240e67,_0xae4702,_0x51c6d0=!0x1){const _0x43ff6a=[..._0x240e67['path']['slice']()];for(let _0x1a114f=0x0;_0x1a114f<Math['max'](_0xae4702['path']['length'],_0x240e67['path']['length']);_0x1a114f++){const _0x422aca=_0xae4702['path'][_0x1a114f]||0x0,_0x45d6ed=(_0x240e67['path'][_0x1a114f]||0x0)-_0x422aca;if(_0x43ff6a[_0x1a114f]=_0x45d6ed,0x0!==_0x45d6ed&&!_0x51c6d0)break;}return _0x43ff6a;}async['_createInteraction'](_0x26cbf3,_0x4284a8,_0x1f94ba,_0x3b08b3){const _0x4337f1=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x3b08b3,'content':_0x26cbf3,'version':_0x4284a8,'aiBalloon':_0x1f94ba,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0xad2092=new h({'connector':this['_aiConnector'],'editor':_0x4337f1,'content':_0x26cbf3,'version':_0x4284a8,..._0x3b08b3});this['_interactions']['push'](_0xad2092);const _0x58cdcb=(_0x54fe89,_0x4373e9=!0x1,_0x2656a2='streaming')=>this['_promiseQueue']['enqueue'](async _0x36c268=>{try{const _0x59854f=f({'editor':_0x4337f1,'changeGroups':_0x54fe89['changeGroups'],'documentContextContent':_0x54fe89['documentContextContent'],'showDiff':_0x4373e9,'trimUnchanged':!0x1});_0x59854f['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x59854f[0x0],'renderingStrategy':_0x2656a2,'abortSignal':_0x36c268});}catch(_0x388470){if(this['_isAbortError'](_0x388470))return;throw _0x388470;}});this['_interaction']['on']('replyCreated',(_0x275433,_0x1acf4e)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x58cdcb(_0x1acf4e)['catch'](_0x51938e=>{this['_isAbortError'](_0x51938e)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x51938e),this['_setErrorState'](_0xad2092));});}),this['_interaction']['on']('replyContentUpdated',(_0xde478b,_0x321715)=>{_0x58cdcb(_0x321715)['catch'](_0x17a3ca=>{this['_isAbortError'](_0x17a3ca)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x17a3ca),this['_setErrorState'](_0xad2092));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x34ede5){this['_isAbortError'](_0x34ede5)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x34ede5),this['_setErrorState'](_0xad2092));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x45b86d,{showDiff:_0x5a4b62})=>{try{this['_balloonShowDiff']=_0x5a4b62;const _0x304563=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x304563&&await _0x58cdcb(_0x304563,_0x5a4b62,'static');}catch(_0x545588){this['_isAbortError'](_0x545588)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x545588),this['_setErrorState'](_0xad2092));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x17d309,{reply:_0x10db66})=>{const _0x4a3b2d={'positiveCount':_0x10db66['changeGroups']['filter'](_0x54b6e2=>'accepted'===_0x54b6e2['state'])['length'],'totalCount':_0x10db66['changeGroups']['length']},_0x2a9b84=this['_interaction']['actionCallId'],_0x2b7fe7=this['_interaction']['actionName'];_0x2b7fe7?this['_aiConnector']['upsertAIActionRating'](_0x2b7fe7,_0x2a9b84,_0x4a3b2d):this['_aiConnector']['upsertCustomAIActionRating'](_0x2a9b84,_0x4a3b2d);}),this['_setLoadingState']();try{const _0x3725a2=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x3725a2;}catch(_0x4de965){if(this['_isAbortError'](_0x4de965))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0xad2092);}}['_applyChanges'](_0x58c78a,_0x59833c,_0x1f4ff2){const _0x40c6d5=this['editor'];if(_0x1f4ff2&&!_0x40c6d5['plugins']['has']('TrackChanges'))throw new _0x1500e8('ai-no-track-changes',null);const _0x10d476=this['editor']['plugins']['get'](_0x4f58a6),_0x1fbebe=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x1fbebe||!_0x1fbebe['replies']['length'])return;const _0x116641=_0x1fbebe['replies'][_0x1fbebe['replies']['length']-0x1],_0x15baf4=_0x116641['changeGroups'];_0x116641['setChangeGroupState'](0x0,'accepted');let _0x2aac6f=y({'editor':_0x40c6d5,'reply':_0x116641,'interaction':_0x1fbebe,'groups':_0x15baf4,'transform':!0x1,'documentCompare':_0x10d476,'documentCompareOptions':{'anchor':_0x40c6d5['model']['createPositionAt'](_0x58c78a,0x0),'markDeletions':_0x1f4ff2}});_0x2aac6f=this['_filterOperationsOutsideRange'](_0x2aac6f,_0x59833c);for(const _0x40d102 of _0x2aac6f)this['_anchorOperation'](_0x59833c,_0x40d102,_0x40c6d5['model']['document']['getRoot']());const _0x534689=_0x1fbebe['getDocumentContext']()['version'],_0x38e86b=_0x40c6d5['model']['document']['history']['getOperations'](_0x534689),_0x5d1dbb={'document':_0x40c6d5['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2fc34a=_0x104b8e(_0x2aac6f,_0x38e86b,_0x5d1dbb)['operationsA'];_0x40c6d5['model']['change'](_0x408fec=>{if(_0x408fec['setSelection'](_0x40c6d5['model']['document']['selection']['focus']),_0x1f4ff2)_0x40c6d5['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x2fc34a);else{for(const _0x50054e of _0x2fc34a)_0x50054e['baseVersion']=_0x40c6d5['model']['document']['version'],d(_0x40c6d5,_0x50054e),_0x408fec['batch']['addOperation'](_0x50054e),_0x40c6d5['model']['applyOperation'](_0x50054e);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x447630,_0x3a7108){return _0x447630['filter'](_0x5540d3=>{if('rename'==_0x5540d3['type']){const _0x36650d=_0x5540d3['position']['nodeAfter'];return!_0x3a7108['has'](_0x36650d);}if(_0x5540d3['type']['indexOf']('Attribute')>-0x1){const _0x420ac9=_0x5540d3['range']['start']['nodeAfter'];return!_0x3a7108['has'](_0x420ac9);}return!0x0;});}['_anchorOperation'](_0x4a459a,_0x1ccce7,_0x147ed3){const _0x49b21e=_0x1ccce7['clone']();for(const _0x4c4883 in _0x1ccce7){const _0x271cff=_0x1ccce7[_0x4c4883];_0x271cff instanceof _0x1f26a0?_0x1ccce7[_0x4c4883]=new _0x1f26a0(_0x2d1d43(_0x271cff['start']),_0x2d1d43(_0x271cff['end'])):_0x271cff instanceof _0x128f8a&&(_0x1ccce7[_0x4c4883]=_0x2d1d43(_0x271cff));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x49b21e['type'])){if(_0x49b21e['isDocumentOperation']=!0x1,_0x49b21e['baseVersion']=null,'remove'==_0x49b21e['type']){const _0x205a3e=_0x49b21e['sourcePosition'],_0x25d521=_0x49b21e['howMany'];new _0x34bf3b(_0x205a3e,_0x25d521)['_execute']();}else _0x49b21e['_execute']();}function _0x2d1d43(_0x2bf3e7){if('$graveyard'==_0x2bf3e7['root']['rootName'])return _0x2bf3e7;const _0x2404bb=[];let _0x290915=_0x2bf3e7['root'];for(let _0xd2b5f4=0x0;_0xd2b5f4<_0x2bf3e7['path']['length'];_0xd2b5f4++){const _0x17636d=_0x4a459a['get'](_0x290915)||0x0;_0x2404bb[_0xd2b5f4]=_0x2bf3e7['path'][_0xd2b5f4]+_0x17636d,_0x290915=_0x290915['getChildAtOffset'](_0x2bf3e7['path'][_0xd2b5f4]);}return new _0x128f8a(_0x147ed3,_0x2404bb,_0x2bf3e7['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x339eec,content:_0x584fb8,version:_0x387528,aiBalloon:_0x2ba1b7}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x584fb8,_0x387528,_0x2ba1b7,_0x339eec)['catch'](_0x565a2f=>{this['_isAbortError'](_0x565a2f)||console['error']('Error\x20refreshing\x20interaction:',_0x565a2f);});}['_isAbortError'](_0x17af4b){return!!_0x17af4b['message']&&_0x17af4b['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x4d8d59=this['_interactions']['length'];this['_currentInteractionIndex']<_0x4d8d59-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x36b417){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x36b417;const _0x159c95=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x159c95)return;if(_0x159c95['hasError'])return this['_setErrorState'](_0x159c95),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x159c95['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x5500fa=_0x159c95['replies'][_0x159c95['replies']['length']-0x1];if(_0x5500fa){const _0x3d8e58=this['editor'];try{const _0x5b53ec=f({'editor':_0x3d8e58,'changeGroups':_0x5500fa['changeGroups'],'documentContextContent':_0x5500fa['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0xa37528=>setTimeout(_0xa37528,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x5b53ec[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x2e44bc){this['_isAbortError'](_0x2e44bc)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x2e44bc);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x281c54){const _0x396f59=m(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x396f59),_0x281c54['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class qa extends _0x5adfee{static get['requires'](){return[ki,ji,qi];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3a4160){super(_0x3a4160),_0x3a4160['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class gr extends _0x538d57{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x5ebedd,_0x383cfc){super(_0x5ebedd),this['id']=_0x383cfc,this['set']('status','pending'),this['set']('changeId',_0x383cfc),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x3ba8f0,_0x3516b8)=>{_0x3516b8&&_0x3516b8['target']&&'A'===_0x3516b8['target']['tagName']&&_0x3516b8['preventDefault'](),this['fire']('activateChange',{'id':_0x383cfc,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x383cfc,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x383cfc,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x1f0b89=new _0x538d57(this['locale']);return _0x1f0b89['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x12bd1a=>!_0x12bd1a)]}}),_0x1f0b89;}['_createAcceptButtonView'](){const _0x5258f0=new _0x3fc85a(this['locale']);return _0x5258f0['set']({'label':m(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x5258f0['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xd7c97f=>{this['fire']('acceptChange',{'id':this['changeId']}),_0xd7c97f['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x3917d4=>'pending'!==_0x3917d4&&'accepted'!==_0x3917d4),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x566524=>'pending'===_0x566524),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x23168d=>'accepted'===_0x23168d)]}}),this['on']('change:status',(_0x542bbc,_0x149119,_0x45ced2)=>{_0x5258f0['isEnabled']='pending'===_0x45ced2,'accepted'===_0x45ced2&&(_0x5258f0['label']=m(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x5258f0['icon']=_0x1dd94c);}),_0x5258f0;}['_createDismissButtonView'](){const _0x5110a4=new _0x3fc85a(this['locale']);return _0x5110a4['set']({'label':m(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x5110a4['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3efd7d=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x3efd7d['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x2c8434=>'pending'!==_0x2c8434&&'rejected'!==_0x2c8434),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x12192d=>'pending'===_0x12192d),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x26ff3a=>'rejected'===_0x26ff3a)]}}),this['on']('change:status',(_0xd8090,_0x4cd872,_0x1a5eb9)=>{_0x5110a4['isEnabled']='pending'===_0x1a5eb9,'rejected'===_0x1a5eb9&&(_0x5110a4['label']=m(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x5110a4['icon']=_0x3b3d8d);}),_0x5110a4;}['_createInfoButtonView'](){const _0x4a5454=new _0x3fc85a(this['locale']);return _0x4a5454['set']({'label':m(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':tc,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x4a5454['bind']('isOn')['to'](this,'isInfoToggleOn',_0x5f1e61=>_0x5f1e61),_0x4a5454['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x4a5454;}['_createOutdatedButtonView'](){const _0x1a79c5=new _0x3fc85a(this['locale']);return _0x1a79c5['set']({'label':m(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x35296c,'withText':!0x0,'isEnabled':!0x1}),_0x1a79c5['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x2042fd=>'outdated'!==_0x2042fd)],'disabled':'disabled'}}),_0x1a79c5;}}class ie extends _0x51e059{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0xc66c9,_0x36369e){super(_0xc66c9),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['set']('isDiffActive',!0x1),this['content']['add'](this['_createContentView']()),_0x36369e['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x47b196){this['resultItemView']['changeId']=_0x47b196['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x47b196['contentDiffed'];}['showBalloon'](_0x1e4c6c,_0x5d9ef2,_0x10d154,_0x47e4a5,_0x59b154,_0x409048){const _0x4353e8=_0x5d9ef2();if(!_0x4353e8)return;this['updateContent'](_0x1e4c6c),this['show']();const _0x43f54d=Array['from'](_0x4353e8['getClientRects']())['reverse'](),_0x418c85=this['_getPointedRectIndexFromEvent'](_0x10d154,_0x43f54d),_0x33e325=_0x43f54d[_0x418c85??0x0];'click'===_0x47e4a5?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x5d9ef2(),_0x418c85,_0x1e4c6c['id'],_0x59b154,_0x409048)||_0x33e325})):'hover'===_0x47e4a5&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x5d9ef2(),_0x418c85,_0x1e4c6c['id'])||_0x33e325}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){_0x23d932({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x33bc4f=[this['element']];return this['_pinnedTargetElement']&&_0x33bc4f['push'](this['_pinnedTargetElement']),_0x33bc4f;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x5b1e70=new _0x538d57();return this['resultItemView']=new gr(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x5b1e70['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x5b1e70;}['_getBestRectPositionOnClick'](_0x38726d,_0x375e0a,_0x4028df,_0x4c519b,_0x5c76ee){if(!_0x38726d)return null;const _0x20e2b0=this['position']['replace']('arrow_',''),_0x110607=Array['from'](_0x38726d['getClientRects']());let _0x26c8ee,_0x37802c=_0x110607['reverse']();return void 0x0!==_0x375e0a&&this['_isPinnedRectVisible'](_0x37802c[_0x375e0a],_0x4c519b,_0x5c76ee)?(_0x26c8ee=_0x37802c[_0x375e0a],this['_pinnedRectIndex']=_0x375e0a):this['_isPinnedRectVisible'](_0x37802c[0x0],_0x4c519b,_0x5c76ee)&&void 0x0===_0x375e0a?_0x26c8ee=_0x37802c[0x0]:(_0x37802c='s'==_0x20e2b0[0x0]?[..._0x110607]['reverse']():_0x110607,_0x37802c['forEach'](_0x17ab04=>{this['_isPinnedRectVisible'](_0x17ab04,_0x4c519b,_0x5c76ee)&&(_0x26c8ee=_0x17ab04);})),this['_pinnedTargetChangeId']=_0x4028df,this['_pinnedTargetElement']=_0x38726d,_0x26c8ee||_0x38726d['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x133454,_0x53bf2a,_0x13e3fc){if(!_0x133454)return null;const _0x31509c=Array['from'](_0x133454['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x53bf2a&&this['_pinnedTargetChangeId']!==_0x13e3fc)return this['_pinnedRectIndex']=_0x53bf2a,this['_pinnedTargetElement']=_0x133454,this['_pinnedTargetChangeId']=_0x13e3fc,_0x31509c[_0x53bf2a];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x13e3fc){if(_0x133454!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x31509c[this['_pinnedRectIndex']];}return void 0x0!==_0x53bf2a&&this['_pinnedTargetChangeId']!==_0x13e3fc?(this['_pinnedRectIndex']=_0x53bf2a,this['_pinnedTargetElement']=_0x133454,this['_pinnedTargetChangeId']=_0x13e3fc,_0x31509c[_0x53bf2a]):_0x133454['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x16d48a,_0x1bb617){if(_0x16d48a)for(let _0x59a588=0x0;_0x59a588<_0x1bb617['length'];_0x59a588++){const _0x2b5108=_0x1bb617[_0x59a588];if(_0x16d48a['clientX']>=_0x2b5108['left']-0x3&&_0x16d48a['clientX']<=_0x2b5108['right']+0x3&&_0x16d48a['clientY']>=_0x2b5108['top']-0x3&&_0x16d48a['clientY']<=_0x2b5108['bottom']+0x3)return _0x59a588;}}['_isPinnedRectVisible'](_0x14db2b,_0x39c9b0,_0x4417a9){const _0x8fb9ce=new _0x34633d(_0x14db2b),_0xf7df40=_0x39c9b0||document['documentElement'],_0x2f0fc0=_0x8fb9ce['getIntersection'](_0x2a7169(_0x4417a9)),_0x56aa1e=new _0x34633d(_0xf7df40)['getIntersection'](_0x8fb9ce);return!!(_0x2f0fc0&&_0x56aa1e&&_0x8fb9ce['width']>0x0);}}const sh=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ve extends _0x37abb2{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[H];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x45a10d){super(_0x45a10d),this['_bodyCollection']=new _0x4b2ab0(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...sh)['to'](this),this['_balloonSuggestionView']=new ie(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x26480a=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x26480a);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x18b9d7){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x297014=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x18b9d7,_0x297014);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x50eba8){_0x50eba8&&('error-general'!==_0x50eba8['status']?'error-chunk'!==_0x50eba8['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x2b519c){this['_mainView']['addCheckRunResult'](_0x2b519c);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x27aca4){this['_mainView']['showGeneralReviewCoreErrorView'](_0x27aca4??m(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x3f9e83,_0x230bb3){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x3f9e83,_0x230bb3);}['setActiveStateInResults'](_0x1599b8){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0xcf527e=>{_0xcf527e['id']===_0x1599b8&&_0xcf527e['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4de126=>_0x4de126['setItemAsInactive']());}['updateChangeState'](_0x4b2979,_0x238c1b){'accepted'===_0x238c1b||'rejected'===_0x238c1b||'outdated'===_0x238c1b?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x4b2979,_0x238c1b):this['_mainView']['reviewCheckResultsView']['showResult'](_0x4b2979,_0x238c1b);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x277827,_0xd909f,_0x2eb2e0,_0x47e5dc,_0x3ced17,_0x89b0f0){this['_balloonSuggestionView']['showBalloon'](_0x277827,_0xd909f,_0x2eb2e0,_0x47e5dc,_0x3ced17,_0x89b0f0);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x36079b){const _0x4af402=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x5a91f4=>_0x5a91f4['id']===_0x36079b);return _0x4af402?_0x4af402['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class hh extends _0x538d57{constructor(_0x275f0e){super(_0x275f0e),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x1f1876=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x1f1876['if']('isVisible','ck-hidden',_0x4d1de6=>!_0x4d1de6)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x1f1876['to']('errorMessage')}]}]});}}class _e extends _0x538d57{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x24df5c,_0x112709){super(_0x24df5c),this['reviewCoreHeader']=_0x112709['header'],this['generalErrorView']=new hh(_0x24df5c),this['reviewCheckListView']=_0x112709['list'],this['reviewCheckListView']['delegate'](...sh)['to'](this),this['reviewCheckResultsView']=_0x112709['results'],this['reviewCheckResultsView']['delegate'](...sh)['to'](this),this['reviewCompletedView']=_0x112709['completed'],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','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],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),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x52f2a2){this['reviewCheckResultsView']['addResult'](_0x52f2a2),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;}['showGeneralReviewCoreErrorView'](_0x34d44a){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x34d44a;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class _r extends _0x3fc85a{constructor(_0x4157aa,_0x346073){super(_0x346073),this['set']({'label':_0x4157aa,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ie extends _0x5749b5{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x2aa6c2,_0x504454){super(_0x2aa6c2),this['_contents']=_0x504454,this['_resultViews']=new _0x4f2c93(),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 Bi(_0x2aa6c2),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 _0x782040=this['_createCombinedSkeletonLoader'](),_0x1132e5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x1132e5['if']('isLoading','ck-ai_review__check-run_loading',_0x1fb916=>_0x1fb916),_0x1132e5['if']('isResultReady','ck-ai_review__check-run_ready',_0x1731a0=>_0x1731a0),_0x1132e5['if']('isVisible','ck-hidden',_0xea1ab2=>!_0xea1ab2)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x27b79d=>_0x27b79d)]},'children':this['_resultViews']},_0x782040]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x74b542){const _0x240f7b=new gr(this['locale'],_0x74b542['id']);_0x240f7b['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x240f7b),_0x240f7b['resultResponseView']['element']['innerHTML']=_0x74b542['contentDiffed'];}['hideResult'](_0x4323a5,_0x20d7d8){if('pending'===_0x20d7d8)return;const _0x4d2abc=this['_resultViews']['find'](_0x3b18f=>_0x3b18f['id']===_0x4323a5);_0x4d2abc&&(_0x4d2abc['status']=_0x20d7d8,_0x4d2abc['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x41ca0d,_0x58b16c){if('pending'!==_0x58b16c)return;const _0x45f72b=this['_resultViews']['find'](_0x48d491=>_0x48d491['id']===_0x41ca0d);_0x45f72b&&(_0x45f72b['status']=_0x58b16c,_0x45f72b['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x5db304,_0x312ff0){this['headerTitle']=_0x5db304,this['headerSubtitle']=_0x312ff0||'';}['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 Oe(this['locale'],Be['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x43ac63=new _0x538d57(this['locale']),_0x16528b=[];for(let _0x3a84e5=0x0;_0x3a84e5<0x10;_0x3a84e5++){const _0x741eda=this['_createSkeletonLoader']();_0x741eda['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x16528b['push'](_0x741eda);}return _0x43ac63['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x3afaa0=>!_0x3afaa0)]},'children':_0x16528b}),_0x43ac63;}['_createErrorView'](){const _0x129126=new _0x538d57(this['locale']),_0x424a13=new _0x3fc85a(this['locale']),t=this['locale']['t'];return _0x129126['delegate']('retryReview')['to'](this),_0x424a13['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x424a13['on']('execute',()=>{this['fire']('retryReview');}),_0x129126['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x49b438=>!_0x49b438),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x1dba94=>'chunk'===_0x1dba94)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x3ddf63=>'chunk'===_0x3ddf63)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x3197e4=>'general'!==_0x3197e4)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x459243=>'chunk'!==_0x459243)]},'children':[{'text':m(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x424a13]}),_0x129126;}['_createCancelButtonView'](){const _0x361dd8=new _0x3fc85a(this['locale']);return _0x361dd8['set']({'label':m(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x30c4f4}),_0x361dd8['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x16735f=>_0x16735f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xf8b68b=>_0xf8b68b)]}}),_0x361dd8['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x361dd8;}['_createToggleDiffButtonView'](){const _0x58ec0c=new _0x3fc85a(this['locale']);_0x58ec0c['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x58ec0c['bind']('isEnabled')['to'](this,'isError',_0x1dad08=>!_0x1dad08),_0x58ec0c['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x54be84=>!_0x54be84),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5e6e94=>_0x5e6e94)]}});const _0x2fe8c0=m(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x3a852d=m(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x58ec0c['bind']('isOn')['to'](this,'isToggleDiffOn',_0x4e4343=>_0x4e4343),_0x58ec0c['bind']('icon')['to'](this,'isToggleDiffOn',_0x4ed9a3=>_0x4ed9a3?_0x1ef78b:_0x4d2895),_0x58ec0c['bind']('label')['to'](this,'isToggleDiffOn',_0x330af3=>_0x330af3?_0x2fe8c0:_0x3a852d),_0x58ec0c['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x58ec0c;}['_createAcceptAllButtonView'](){const _0x2d8450=new _0x3fc85a(this['locale']);return _0x2d8450['set']({'label':m(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x2d8450['bind']('isEnabled')['to'](this,'isError',_0x8bf1c0=>!_0x8bf1c0),_0x2d8450['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x56725c=>!_0x56725c),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2d6784=>_0x2d6784)]}}),_0x2d8450['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x2d8450;}['_createExitReviewButtonView'](){const _0x96c46b=new _0x3fc85a(this['locale']);return _0x96c46b['set']({'label':m(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x96c46b['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x52a88f=>!_0x52a88f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5e338d=>_0x5e338d)]}}),_0x96c46b['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x96c46b;}['_createResultHeaderView'](){const _0x5e93d1=new _0x538d57(this['locale']),_0x4cf600=this['_createTitleView']();return _0x5e93d1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x539d63=>_0x539d63)]},'children':[_0x4cf600,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x5e93d1;}['_createTitleView'](){const _0x138af4=new _0x538d57(this['locale']),_0x3ca3bb=new De();return _0x3ca3bb['bind']('isVisible')['to'](this,'isResultReady',_0x20a3cb=>!_0x20a3cb),_0x138af4['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x3ca3bb,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x34d349=>_0x34d349)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5cacce=>!_0x5cacce)]},'children':[{'text':m(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x138af4;}['_createFinishReviewButtonView'](){const _0x166945=new _r(m(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x166945['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0xe784ae=>!_0xe784ae)]}}),_0x166945['delegate']('finishReview')['to'](this),_0x166945;}}class Re extends _0x5749b5{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x593c58,_0x1766c2){super(_0x593c58),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x1766c2['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x1766c2['headerText']);const _0x25d732=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x25d732['if']('isVisible','ck-hidden',_0x3f9563=>!_0x3f9563)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x1766c2['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x50bb9e){const _0xc49142=new _r(_0x50bb9e,this['locale']);return _0xc49142['delegate']('finishReview')['to'](this),_0xc49142;}['_createResultHeaderView'](_0x15ed0b){const _0x45de27=new _0x538d57(this['locale']);return _0x45de27['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0x15ed0b}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x45de27;}}class Dr extends _0x538d57{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x5047c0,_0x3db68e){super(_0x5047c0),this['_defaultValue']=_0x3db68e['default']||(_0x3db68e['data']['length']>0x0?_0x3db68e['data'][0x0]['id']:''),this['_defaultLabel']=_0x3db68e['data']['find'](_0x1e3cde=>_0x1e3cde['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x238494(this['locale']);const _0x550ef1=this['_prepareListOptions'](_0x3db68e['data']);_0x57d60a(this['_dropdownView'],_0x550ef1,{'role':'menu','ariaLabel':_0x3db68e['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1e0c6d=>{_0x1e0c6d['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x16186b=>{this['formValue']=_0x16186b['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x16186b['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x2ac653=[]){const _0x2a9754=new _0x53af97();this['resetToDefault']();for(const _0x2cd7d6 of _0x2ac653){const _0x14b127=new _0x584377({'label':_0x2cd7d6['label'],'withText':!0x0,'role':'menuitemradio','id':_0x2cd7d6['id'],'model':_0x2cd7d6});_0x14b127['bind']('isOn')['to'](this,'formValue',_0x48e3d4=>_0x48e3d4===_0x14b127['id']);const _0x2e2bb2={'type':'button','model':_0x14b127};_0x2a9754['add'](_0x2e2bb2);}return _0x2a9754;}}class cc extends _0x5749b5{['_formItem']=null;constructor(_0x59893f,_0x221d85,_0xb9c5ce){super(_0x59893f),this['argsKey']=_0x221d85?.['argsKey'];if('dropdown'===_0x221d85['formType'])this['_formItem']=new Dr(this['locale'],_0x221d85);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x4634e6=new _0x553dac(this['locale'],{'children':[this['_formItem']],'class':[_0xb9c5ce?'ck-form__row_with-submit':'']});_0xb9c5ce&&_0x4634e6['children']['add'](_0xb9c5ce),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x4634e6]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class po extends _0x170ffb{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x45ec71){super(_0x45ec71),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x356454(),this['minRows']=po['MIN_ROWS'],this['maxRows']=po['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class rc extends _0x538d57{['focusTracker']=new ts();['keystrokes']=new _0x356454();['focusCycler'];['_focusables']=new _0x4f2c93();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x2bd465,_0x4903b2,_0x55945d=!0x1){super(_0x2bd465),this['_check']=_0x4903b2,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x4903b2['defaultModel']?_0x4903b2['defaultModel']['id']:'',this['_defaultLabel']=_0x4903b2['defaultModel']?_0x4903b2['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x449567(this['locale'],()=>new po(_0x2bd465)),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 _0x53af97(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x55945d),_0x57d60a(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x553dac(this['locale'],{'children':[this['promptInputView']]}),new _0x553dac(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x5d3ad2,_0x479b51)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x479b51()):_0x479b51();}),this['focusCycler']=new _0x19c87e({'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'](_0x2898e6=>{this['_focusables']['add'](_0x2898e6),this['focusTracker']['add'](_0x2898e6['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 _0x2d2f0a of this['_getFormValidators']()){const _0x5d88ea=_0x2d2f0a();if(_0x5d88ea)return this['promptInputView']['errorText']=_0x5d88ea,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return m(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0xe14253=new _0x3fc85a(this['locale']),t=this['locale']['t'];return _0xe14253['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0xe14253['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0xe14253;}['_createCancelButtonView'](){const _0x3be857=new _0x3fc85a(this['locale']),t=this['locale']['t'];return _0x3be857['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x3be857['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x15d458=>{_0x15d458['stopPropagation']();})}}),_0x3be857['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x3be857;}['_setModelList'](_0x110164){this['_modelSelectionDropdownItems']['clear']();const _0x27ebdf=this['_check']['models'];if(_0x110164)this['set']('modelDisplayMode','hidden');else{const _0x5ce43b=0x1===_0x27ebdf['length'];this['set']('modelDisplayMode',_0x5ce43b?'name':'selector');}if(this['resetToDefault'](),_0x27ebdf?.['length']){0x1===_0x27ebdf['length']&&this['set']('activeModelName',_0x27ebdf[0x0]['name']||_0x27ebdf[0x0]['id']);for(const _0x1380ee of _0x27ebdf){const _0x1cada1=new _0x584377({'label':_0x1380ee['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1380ee['id'],'model':_0x1380ee});_0x1cada1['bind']('isOn')['to'](this,'modelId',_0x523f2c=>_0x523f2c===_0x1380ee['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1cada1,'labelView':new ko(this['locale'],_0x1380ee)});}}}['_createModelSelectionDropdown'](){const _0x239216=_0x238494(this['locale']);return _0x239216['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x239216['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x239216['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5c4dc5=>'selector'===_0x5c4dc5),this['listenTo'](_0x239216,'execute',_0x148c77=>{this['modelId']=_0x148c77['source']['model']['id'],_0x239216['buttonView']['label']=_0x148c77['source']['label'];}),_0x239216;}['_createModelNameView'](){const _0x2befb2=new _o(this['locale']);return _0x2befb2['bind']('text')['to'](this,'activeModelName',_0xe699e5=>_0xe699e5??''),_0x2befb2['bind']('isVisible')['to'](this,'modelDisplayMode',_0x45d4fb=>'name'===_0x45d4fb),_0x2befb2;}['_createActionsFooterView'](){const _0x511efc=new _0x538d57(this['locale']);return _0x511efc['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x511efc;}}class _o extends _0x538d57{constructor(_0x567f5b){super(_0x567f5b),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x52d66f=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x52d66f['if']('isVisible','ck-hidden',_0x13f700=>!_0x13f700)]},'children':[{'text':_0x52d66f['to']('text')}]});}}class ko extends _0x3ffbe5{constructor(_0x5446cb,_0x3bb36c){super();const _0x355e3e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x355e3e['to']('style'),'id':_0x355e3e['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x355e3e['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x3bb36c['description']||'']}]}]});}}class ic extends _0x5749b5{['_formItemsCollection']=new _0x4f2c93();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x25421f,_0x7c4361,_0x14b23c,_0x579178=!0x1){super(_0x25421f),this['_hideModels']=_0x579178,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x7c4361['isParameterized']);const _0x2b164f=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x5530be=>_0x5530be),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x49db88=>_0x49db88)],'style':{'--ck-ai-review-check-list-item-index':_0x14b23c}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x7c4361['title']}]},_0x2b164f]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x7c4361['description']?[{'text':_0x7c4361['description']}]:[]}]}]},..._0x7c4361['isParameterized']?[this['_createParameterizedView'](_0x7c4361)]:[],...'custom'===_0x7c4361['id']?[this['_createCustomView'](_0x7c4361,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x7c4361['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x7c4361['id'],'args':_0x7c4361['useArgs']?_0x7c4361['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x23d932({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x1352f6=>{_0x1352f6['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x24dda7=new _0x1a5580();return _0x24dda7['content']=_0x1ee0fb,_0x24dda7['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x24dda7;}['_createParameterizedView'](_0x4a7d77){const _0x5b351b=new _0x538d57(),_0x33a177=this['_createFormView'](_0x4a7d77);return _0x5b351b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x593245=>!_0x593245)]},'children':[_0x33a177]}),_0x5b351b;}['_createFormView'](_0x46ed65){const _0x1662d8=new _0x538d57(),_0x154c3d=Array['isArray'](_0x46ed65['options'])?_0x46ed65['options']:[],_0x28ffda=new _0x3fc85a(this['locale']),t=this['locale']['t'];_0x28ffda['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x28ffda['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x7972aa=>{_0x7972aa['stopPropagation']();})}}),_0x28ffda['on']('execute',()=>{const _0x53d36c=[],_0x132687={};this['_formItemsCollection']['forEach'](_0x22e7de=>{_0x53d36c['push'](_0x22e7de['value']),_0x46ed65['useArgs']&&_0x46ed65['options']&&(_0x132687[_0x22e7de['argsKey']]=_0x22e7de['value']);}),this['fire']('runReviewCheck',{'id':_0x46ed65['id'],'params':_0x53d36c['length']?_0x53d36c:void 0x0,'args':Object['keys'](_0x132687)['length']?_0x132687:void 0x0});});const _0x5c3549=_0x154c3d['length'];return _0x154c3d['forEach']((_0x5f4823,_0x1e1320)=>{const _0x28403b=_0x1e1320===_0x5c3549-0x1;this['_formItemsCollection']['add'](new cc(this['locale'],_0x5f4823,_0x28403b?_0x28ffda:null));}),_0x1662d8['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x1662d8;}['_createCustomView'](_0x573158,_0x40d65d=!0x1){return this['_customCheckView']=new rc(this['locale'],_0x573158,_0x40d65d),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x330a61=>!_0x330a61)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0xdc68d5,_0x62d0e4,_0x47ec49)=>{_0x47ec49||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class Te extends _0x5749b5{['_checkViews'];constructor(_0xb0a8bb){super(_0xb0a8bb),this['_checkViews']=new _0x4f2c93(),this['_setupTemplate']();}['setChecks'](_0x30b78a,_0x581a59=!0x1){this['_checkViews']['clear']();for(const [_0x460e68,_0x164ea4]of _0x30b78a['entries']()){const _0xa8b801=new ic(this['locale'],_0x164ea4,_0x460e68,_0x581a59);_0xa8b801['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0xa8b801);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x54b869 of this['_checkViews'])_0x54b869 instanceof ic&&_0x54b869['resetToDefault']();}['_setupTemplate'](){const _0x2fe14e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x2fe14e['if']('isVisible','ck-hidden',_0x1032a3=>!_0x1032a3)]},'children':this['_checkViews']});}}class re extends ve{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x3afda5=this['context']['locale'],_0x3de463=new _0x2c8dbc(_0x3afda5,{'label':m(_0x3afda5,'AI_REVIEW_MODE'),'icon':_0x3867f9,'class':'ck-ai-header\x20ck-ai-header_review'});return new _e(this['context']['locale'],{'header':_0x3de463,'list':new Te(_0x3afda5),'results':new Ie(_0x3afda5,{'generalErrorText':m(_0x3afda5,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new Re(_0x3afda5,{'headerText':m(_0x3afda5,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':m(_0x3afda5,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':m(_0x3afda5,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x277ac2=this['context']['plugins']['get']('AITabs');_0x277ac2['view']['on']('activateTab',(_0x439611,_0x490a07)=>{'reviewMode'===_0x490a07?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x277ac2['view']['addTab']({'id':'reviewMode','buttonLabel':m(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x3867f9,'order':0x0,'content':this['_mainView']});}}const Lt='review-';class oe extends _0x37abb2{static get['requires'](){return[_0x4f58a6,o];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x3974d6){super(_0x3974d6),this['_domEmitter']=new(Rt())(),this['_eventEmitter']=new(Ft())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x5d2453=D(this['context']);_0x5d2453['conversion']['for']('editingDowncast')['markerToElement']({'model':Lt+'insert','view':(_0x177c1e,{writer:_0x4cb6e8})=>{const _0x13c7ba=this['_markers']['get'](_0x177c1e['markerName']),_0x43584d={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x13c7ba?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x177c1e['markerName']};return _0x4cb6e8['createUIElement']('span',_0x43584d,function(_0x2de50c){const _0xf21fe5=this['toDomElement'](_0x2de50c);return _0xf21fe5['innerHTML']=_0x13c7ba?.['content']?.['asString']||'',_0xf21fe5;});}}),_0x5d2453['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Lt+'remove-only','view':_0x19dadc=>{const _0x104965=this['_markers']['get'](_0x19dadc['markerName']),_0x441ea6=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x104965?.['id']||'')&&_0x441ea6['push']('ck-ai_review__change_active'),{'classes':_0x441ea6,'attributes':{'data-marker-id':_0x19dadc['markerName']}};}}),_0x5d2453['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Lt+'remove-context','view':_0x158270=>{const _0x114d90=this['_markers']['get'](_0x158270['markerName']),_0x426da6=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x114d90?.['id']||'')&&_0x426da6['push']('ck-ai_review__change_active'),{'classes':_0x426da6,'attributes':{'data-marker-id':_0x158270['markerName']}};}}),_0x5d2453['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Lt+'remove-text','view':_0x23bb56=>{const _0x2d5ab3=this['_markers']['get'](_0x23bb56['markerName']),_0x40311e=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x2d5ab3?.['id']||'')&&_0x40311e['push']('ck-ai_review__change_active'),{'classes':_0x40311e,'attributes':{'data-marker-id':_0x23bb56['markerName']}};}}),_0x5d2453['conversion']['for']('dataDowncast')['markerToElement']({'model':Lt+'suggestion-context','view':(_0x280b4d,{writer:_0x3b69e0})=>_0x3b69e0['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x280b4d['isOpening']?'start':'end')})}),_0x5d2453['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x1707b9,'view':Bt});const _0xa58405=_0x5d2453['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0xa58405,'mouseup',(_0x17fa7b,_0x192d7b)=>{const _0x288176=_0x192d7b['target'],_0x1bee80=this['_findMarkerElement'](_0x288176);if(!_0x1bee80)return;const _0x447cc7=_0x1bee80['getAttribute']('data-marker-id'),_0x5ae183=_0x447cc7['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x447cc7,'changeId':_0x5ae183,'markerElement':()=>this['_findMarkerElementById'](_0x447cc7),'domEvent':_0x192d7b});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0xa58405,'mouseover',(_0x20a931,_0x1509fd)=>{const _0x289bf7=_0x1509fd['target'],_0x3a1b91=_0x1509fd['relatedTarget'];let _0x47e10c=this['_findMarkerElement'](_0x289bf7);if(!_0x47e10c&&_0x3a1b91&&(_0x47e10c=this['_findMarkerElement'](_0x3a1b91)),!_0x47e10c)return;const _0x371ef3=_0x47e10c['getAttribute']('data-marker-id'),_0xbfc7fc=_0x371ef3['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0xbfc7fc,'markerElement':()=>this['_findMarkerElementById'](_0x371ef3),'domEvent':_0x1509fd});}),this['_domEmitter']['listenTo'](document,'mouseover',Ht((_0x3a09a4,_0x5f1c76)=>{const _0x99ce68=_0x5f1c76['target'];if(this['_findMarkerElement'](_0x99ce68))return;_0x99ce68['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x5d2453['model']['document']['registerPostFixer'](_0x429e3b=>this['_validateMarkers'](_0x5d2453,_0x429e3b)),_0x5d2453['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x5d2453));}['getDocumentData'](){const _0x433dea=this['context']['plugins']['get']('AIEditing'),_0x3d94de=D(this['context']),_0x472738=_0x3d94de['model'],_0x2dc99a=new _0x27a70e();for(const _0x30e8bb of _0x472738['document']['getRoot']()['getChildren']()){const _0x346f60=_0x30e8bb['_clone'](!0x0);_0x2dc99a['_appendChild'](_0x346f60);}for(const _0x558be3 of _0x472738['markers'])_0x2dc99a['markers']['set'](_0x558be3['name'],this['_changeRangeOwnerDocument'](_0x558be3['getRange']()['clone'](),_0x2dc99a));const _0x4cc2db=new Dt({'ignoreElementEnd':!0x0,'startPosition':_0x472738['createPositionAt'](_0x2dc99a,0x0)}),_0x3efddc=new Set(),_0x4b1bd7=new Map();for(const {item:_0x657f80}of _0x4cc2db){if(!_0x657f80['is']('$textProxy'))continue;const _0x38000f=_0x657f80['parent'];if(_0x38000f&&_0x38000f['is']('element')){const _0x23e67f=this['_upsertDataId'](_0x38000f,()=>_0x433dea['_nextDataId'](_0x3efddc));_0x3efddc['add'](_0x23e67f);for(const _0x541607 of _0x38000f['getChildren']())_0x541607['is']('element')&&_0x3efddc['add'](this['_upsertDataId'](_0x541607,()=>_0x433dea['_nextDataId'](_0x3efddc)));let _0x2d1465=_0x38000f;for(;_0x2d1465['parent']&&!_0x2d1465['parent']['is']('documentFragment');)_0x2d1465=_0x2d1465['parent'],_0x2d1465['hasAttribute'](_0x1707b9)&&_0x2d1465['_removeAttribute'](_0x1707b9);_0x4b1bd7['set'](_0x23e67f,{'path':_0x38000f['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x2d1465['_clone'](!0x0),_0x23e67f,_0x3d94de['data'])}),_0x4cc2db['jumpTo'](_0x472738['createPositionAfter'](_0x38000f));}}return{'content':_0x3d94de['data']['processor']['toData'](_0x3d94de['data']['toView'](_0x2dc99a)),'version':_0x3d94de['model']['document']['version'],'elements':_0x4b1bd7};}['diffContent'](_0x28f3df,_0x3eb4e7,_0x45bb5d=!0x1){const _0x59fe05=[],_0x3a0b9e=D(this['context']),_0x349dea=_0x3a0b9e['data']['parse'](_0x3eb4e7,'$documentFragment'),_0x5c5fdc=_0x3a0b9e['data']['parse'](_0x28f3df,'$documentFragment'),_0x406010=_0x3a0b9e['model']['createPositionAt'](_0x5c5fdc,0x0);if(this['_haveSingleTopLevelElement'](_0x349dea)){if(!this['_hasSameTopLevelElement'](_0x5c5fdc,_0x349dea))return _0x59fe05;}else{const _0x31882b=_0x3a0b9e['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x5c5fdc,_0x31882b)||!this['_haveOnlyInlineContent'](_0x349dea,_0x31882b))return _0x59fe05;}const _0x3e5321=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x28f3df,_0x3eb4e7,{'anchor':_0x406010,'markDeletions':!0x0})['getOperations']()['filter'](_0x124c46=>'insert'===_0x124c46['type']||'marker'===_0x124c46['type']&&_0x124c46['name']['startsWith']('$markedRemove')),_0x3fd1f9=this['_groupAdjacentOperations'](_0x3e5321),_0x533a11=[];if(_0x45bb5d){if(_0x3fd1f9['length']){const _0x9f2145=_0x3fd1f9[0x0]['operations'][0x0],_0x396abe='insert'===_0x9f2145['type']?_0x9f2145['position']:_0x9f2145['newRange']['start'],_0x1dd3cf=this['_getPositionLimitingRange'](_0x396abe,_0x3a0b9e,'inside'),_0x43d702=_0x1dd3cf?_0x349dea['getChild'](0x0)['getChildren']():_0x349dea['getChildren'](),_0x296f5a=_0x1dd3cf||_0x3a0b9e['model']['createRangeIn'](_0x5c5fdc),_0x534804=[new Mt('$markedRemove:synthetic'+_0x3e4e8c(),null,_0x296f5a,_0x3a0b9e['model']['document']['model']['markers'],!0x0,_0x3a0b9e['model']['document']['version']+0x1),new $t(_0x296f5a['end'],_0x43d702,_0x3a0b9e['model']['document']['version']+0x2)];_0x533a11['push']({'operations':_0x534804,'operationsIsolated':_0x534804,'groupOffset':0x0});}}else _0x533a11['push'](..._0x3fd1f9);let _0x513be7=0x0;return _0x3a0b9e['model']['change'](_0x4e73f7=>{for(let _0xe8bd7f=0x0;_0xe8bd7f<_0x533a11['length'];_0xe8bd7f++){const _0x29c86e=_0x533a11[_0xe8bd7f],_0xf91dc=_0x4e73f7['createDocumentFragment']();for(const _0x511aff of _0x5c5fdc['getChildren']())_0x4e73f7['append'](_0x511aff['_clone'](!0x0),_0xf91dc);for(const _0x3e296e of _0x29c86e['operationsIsolated'])if('insert'===_0x3e296e['type']){const _0x234321=_0x3e296e;_0x234321['baseVersion']=null,_0x234321['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x234321,_0xf91dc),_0x4e73f7['batch']['addOperation'](_0x3e296e),_0x3a0b9e['model']['applyOperation'](_0x3e296e);const _0x1686d8='suggestion:insertion:id:authorId:'+_0x513be7++,_0x1bbb08=_0x3a0b9e['model']['createRange'](_0x234321['position'],_0x234321['position']['getShiftedBy'](_0x234321['howMany']));_0xf91dc['markers']['set'](_0x1686d8,_0x1bbb08);}else{if('marker'===_0x3e296e['type']&&_0x3e296e['name']['startsWith']('$markedRemove')){const _0x1c6750=_0x3e296e,_0x1f289d='suggestion:deletion:id:authorId:'+_0x513be7++;this['_changeOperationOwnerDocument'](_0x1c6750,_0xf91dc),_0xf91dc['markers']['set'](_0x1f289d,_0x1c6750['newRange']);}}if(_0x45bb5d)_0x59fe05['push']({..._0x29c86e,'context':this['_createGetContentFn'](_0x5c5fdc,_0x3a0b9e['data']),'content':this['_createGetContentFn'](_0x5c5fdc,_0x3a0b9e['data'])});else{const _0x1064bd=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x29c86e['operationsIsolated'][0x0]),_0xf91dc),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x29c86e['operationsIsolated'][_0x29c86e['operationsIsolated']['length']-0x1]),_0xf91dc));_0xf91dc['markers']['set'](Lt+'suggestion-context',new _0x1f26a0(_0x1064bd['start'],_0x1064bd['end'])),_0x59fe05['push']({..._0x29c86e,'context':this['_createGetContextFn'](_0xf91dc,_0x3a0b9e['data'],{'ellipsisBefore':_0x1064bd['hasContentBefore'],'ellipsisAfter':_0x1064bd['hasContentAfter']}),'content':this['_createGetContentFn'](_0xf91dc,_0x3a0b9e['data'])});}}}),_0x59fe05;}['markChangePositionInEditorContent'](_0x2e6bec,_0x33bae3){if(!_0x2e6bec['length'])return;const _0x125d1e=_0x2e6bec[0x0]['parent']['id'],_0x58ca33=_0x33bae3['elements']['get'](_0x125d1e);if(!_0x58ca33)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x125d1e);const _0x271b66=_0x58ca33['path'],_0x4b47a8=D(this['context']),_0x480eff=_0x4b47a8['model']['document']['history']['getOperations'](_0x33bae3['version']),_0x2bf80c=[];for(const _0x35ac39 of _0x2e6bec){const _0x592f3e=_0x35ac39['operationsIsolated']['map'](_0x1ac51e=>this['_translateOperationToEditorContent'](_0x1ac51e,_0x271b66,_0x4b47a8['model']['document']['getRoots']()[0x0]));if(!_0x592f3e||!_0x592f3e['length'])continue;const _0xe636e8=_0x592f3e['every'](_0x12684e=>'marker'===_0x12684e['type']&&_0x12684e['name']['startsWith']('$markedRemove')),_0x2a4301={'document':_0x4b47a8['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x41af29=_0x104b8e(_0x592f3e,_0x480eff,_0x2a4301)['operationsA'];for(const _0x276a79 of _0x41af29)if('insert'===_0x276a79['type']){const _0x3cde27=_0x276a79,_0x1637f3=_0x3cde27['nodes'];_0x4b47a8['model']['change'](_0x3fad53=>{const _0x41a664=_0x3fad53['createDocumentFragment']();for(const _0x1b0d40 of _0x1637f3)_0x3fad53['append'](_0x1b0d40['_clone'](!0x0),_0x41a664);_0x2bf80c['push']({'start':_0x3cde27['position'],'end':_0x3cde27['position'],'type':'insert','groupId':_0x35ac39['id'],'content':{'asString':this['_createGetContentFn'](_0x41a664,_0x4b47a8['data'])(),'asFragment':_0x41a664}});});}else{if('marker'===_0x276a79['type']&&_0x276a79['name']['startsWith']('$markedRemove')){const _0x32697f=_0x276a79;let _0x4b87c0='remove-text';if(_0xe636e8){const _0x2a65c8=this['_findAdjacentContextDistance'](_0x32697f['newRange']['start'],'backward',_0x4b47a8['model']['schema']),_0x125cdb=this['_findAdjacentContextDistance'](_0x32697f['newRange']['end'],'forward',_0x4b47a8['model']['schema']);if(_0x2a65c8||_0x125cdb){const _0x2e0a9c=_0x32697f['newRange']['start']['getShiftedBy'](-_0x2a65c8),_0x7c348f=_0x32697f['newRange']['end']['getShiftedBy'](_0x125cdb);_0x2bf80c['push']({'start':_0x2e0a9c,'end':_0x7c348f,'groupId':_0x35ac39['id'],'type':'remove-context'});}else _0x4b87c0='remove-only';}_0x2bf80c['push']({'start':_0x32697f['newRange']['start'],'end':_0x32697f['newRange']['end'],'groupId':_0x35ac39['id'],'type':_0x4b87c0});}}}this['_insertMarkers'](_0x2bf80c);}['clearAllMarkers'](){const _0x4b475e=D(this['context']);_0x4b475e['model']['change'](_0x4c906f=>{for(const _0x33e3e4 of this['_markers']['keys']())_0x4b475e['model']['markers']['get'](_0x33e3e4)&&_0x4c906f['removeMarker'](_0x33e3e4);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){D(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){D(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x4665e4){const _0x2e9fa3=D(this['context']),_0x58949d=_0x2e9fa3['model'],_0x37e88a=_0x4665e4['map'](_0x4d2921=>this['_getMarkersDataForGroup'](_0x4d2921))['flat']();_0x58949d['change'](_0x4433e5=>{for(const _0x370c91 of _0x37e88a){const _0x16832d=_0x2e9fa3['model']['markers']['get'](_0x370c91['id']);if(_0x16832d){if('insert'===_0x370c91['type']){if(!_0x370c91['content'])continue;_0x58949d['insertContent'](_0x370c91['content']['asFragment']||null,_0x16832d['getRange']()['start']);}else'remove-text'!==_0x370c91['type']&&'remove-only'!==_0x370c91['type']||_0x58949d['deleteContent'](_0x58949d['createSelection'](_0x16832d['getRange']()));_0x4433e5['removeMarker'](_0x370c91['id']),this['_markers']['delete'](_0x370c91['id']);}}});}['rejectChange'](_0x1a1aca){const _0x5d3f13=D(this['context']),_0x1c1010=this['_getMarkersDataForGroup'](_0x1a1aca);_0x5d3f13['model']['change'](_0x55d315=>{for(const _0x5a6e02 of _0x1c1010)_0x55d315['removeMarker'](_0x5a6e02['id']),this['_markers']['delete'](_0x5a6e02['id']);});}['getEditor'](){return D(this['context']);}['getMarkerElementForChange'](_0x121454){const _0x58fd97=Array['from'](this['_markers']['values']())['filter'](_0x5b9cc1=>_0x5b9cc1['groupId']===_0x121454);if(!_0x58fd97['length'])return null;const _0x5a02ae=0x1===_0x58fd97['length']?_0x58fd97[0x0]:this['_sortMarkers'](_0x58fd97)[0x0],_0x1ae595=D(this['context'])['model']['markers']['get'](_0x5a02ae['id']);if(!_0x1ae595)return null;return{'modelRange':_0x1ae595['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x5a02ae['id'])};}['getContentElementForChange'](_0xc0056b){const _0x351d69=Array['from'](this['_markers']['values']())['filter'](_0x106c23=>_0x106c23['groupId']===_0xc0056b);if(!_0x351d69['length'])return null;const _0x1e89bc=0x1===_0x351d69['length']?_0x351d69[0x0]:this['_sortMarkers'](_0x351d69)[0x0],_0x297d8e=D(this['context']),_0x57d59f=_0x297d8e['model']['markers']['get'](_0x1e89bc['id']);if(!_0x57d59f)return null;const _0x527715=_0x57d59f['getRange'](),_0x11ed22=_0x297d8e['editing']['view']['getDomRoot']();if(!_0x11ed22||!_0x527715)return null;let _0x4988bb=_0x527715['start']['parent'];for(;_0x4988bb['parent']&&'$root'!==_0x4988bb['parent']['name'];)_0x4988bb=_0x4988bb['parent'];if(!_0x4988bb||!_0x4988bb['name'])return null;const _0x5a5605=_0x11ed22['querySelector']('[data-marker-id=\x22'+_0x1e89bc['id']+'\x22]');if(!_0x5a5605)return null;let _0x4aca36=null;_0x297d8e['model']['change'](_0xb16ef3=>{_0x4aca36=_0xb16ef3['createDocumentFragment'](),_0xb16ef3['append'](_0x4988bb['_clone'](!0x0),_0x4aca36);});const _0x91cd6c=_0x297d8e['data']['toView'](_0x4aca36)['getChild'](0x0);return _0x5a5605['closest'](_0x91cd6c['name']);}['reactivateMarkers'](_0x35d5ac){const _0x19cb36=this['_getMarkersDataForGroup'](_0x35d5ac);if(!_0x19cb36['length'])return;const _0x3436ac=Array['from'](this['_activeMarkers'])['sort'](),_0x39c718=Array['from'](new Set(_0x19cb36['map'](_0x433b01=>_0x433b01['id'])))['sort']();_0x3436ac['join']('|')!==_0x39c718['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x35d5ac));}['setMarkersInElementAsActive'](_0x43d5e7){const _0x3c13b0=this['_getMarkersDataForGroup'](_0x43d5e7);if(!_0x3c13b0['length'])return;const _0x5cf5d6=D(this['context']),_0x544df8=new Set(_0x3c13b0['map'](_0x16ff71=>_0x16ff71['id'])),_0x4356cb=Array['from'](_0x544df8['values']())['map'](_0x46f4e5=>_0x5cf5d6['model']['markers']['get'](_0x46f4e5))['filter'](_0x161f37=>!!_0x161f37);_0x544df8['forEach'](_0x340223=>{this['_activeMarkers']['add'](_0x340223);}),_0x5cf5d6['model']['change'](()=>{_0x4356cb['forEach'](_0x1d9db0=>{_0x5cf5d6['editing']['reconvertMarker'](_0x1d9db0);});});}['setAllMarkersAsInactive'](){const _0x4a9674=Array['from'](this['_activeMarkers']);if(!_0x4a9674['length'])return;this['_activeMarkers']['clear']();const _0x5d9201=D(this['context']),_0x19f0a1=_0x4a9674['map'](_0x4eb25b=>_0x5d9201['model']['markers']['get'](_0x4eb25b))['filter'](_0x459d3d=>!!_0x459d3d);_0x5d9201['model']['change'](()=>{_0x19f0a1['forEach'](_0x33afcc=>{_0x5d9201['editing']['reconvertMarker'](_0x33afcc);});});}['_getPositionLimitingRange'](_0x2b0e7e,_0x3e7ea6,_0x8585b3='outside'){if(!_0x2b0e7e)return null;let _0x42ea2b=_0x2b0e7e['parent'];for(;_0x42ea2b&&_0x42ea2b['parent']&&'$root'!==_0x42ea2b['parent']['name']&&!_0x3e7ea6['model']['schema']['isLimit'](_0x42ea2b)&&!_0x3e7ea6['model']['schema']['isBlock'](_0x42ea2b);)_0x42ea2b=_0x42ea2b['parent'];if(!_0x42ea2b||!_0x42ea2b['name']||'$root'===_0x42ea2b['name'])return null;let _0x1c1a37=null;return _0x3e7ea6['model']['change'](_0x2b6112=>{_0x1c1a37='inside'===_0x8585b3?_0x2b6112['createRangeIn'](_0x42ea2b):_0x2b6112['createRangeOn'](_0x42ea2b);}),_0x1c1a37;}['_validateMarkers'](_0x197d9a,_0x341423){const _0x54c8e8=Array['from'](this['_markers']['keys']()),_0x38e930=new Map();for(const _0x4994e4 of _0x54c8e8){const _0x357f1e=_0x197d9a['model']['markers']['get'](_0x4994e4);if(!_0x357f1e)continue;const _0x406f59=_0x357f1e['getStart']()['path'][0x0];_0x38e930['has'](_0x406f59)||_0x38e930['set'](_0x406f59,[]),_0x38e930['get'](_0x406f59)['push'](_0x357f1e);}const _0x8b1c23=new Set();for(const _0x39e6f6 of _0x197d9a['model']['document']['differ']['getChanges']()){let _0x180d12=-0x1,_0x2d0896=null;if('insert'===_0x39e6f6['type'])_0x2d0896=new _0x1f26a0(_0x39e6f6['position'],_0x39e6f6['position']['getShiftedBy'](_0x39e6f6['length'])),_0x180d12=_0x39e6f6['position']['path'][0x0];else{if('remove'!==_0x39e6f6['type'])continue;_0x2d0896=new _0x1f26a0(_0x39e6f6['position']),_0x180d12=_0x39e6f6['position']['path'][0x0];}const _0x1996b2=_0x38e930['get'](_0x180d12)||[];if(_0x1996b2['length']){for(const _0x261c1a of _0x1996b2)if(_0x2d0896['root']['rootName']===_0x261c1a['getRange']()['root']['rootName']&&('insert'!==_0x39e6f6['type']||!_0x2d0896['containsRange'](_0x261c1a['getRange']()))&&(_0x2d0896['isIntersecting'](_0x261c1a['getRange']())||_0x2d0896['start']['isTouching'](_0x261c1a['getRange']()['end'])||_0x2d0896['end']['isTouching'](_0x261c1a['getRange']()['start']))){const _0x4c54fe=this['_parseMarkerName'](_0x261c1a['name']);Array['from'](this['_markers']['values']())['filter'](_0xf46787=>_0xf46787['groupId']===_0x4c54fe['groupId'])['forEach'](_0xc3c1c1=>_0x8b1c23['add'](_0xc3c1c1['id']));}}}if(_0x8b1c23['size']){for(const _0x30944c of _0x8b1c23)_0x341423['removeMarker'](_0x30944c);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x2b0334){for(const {name:_0x1f336a,data:_0x13ae42}of _0x2b0334['model']['document']['differ']['getChangedMarkers']()){if(!_0x1f336a['startsWith'](Lt))continue;const _0x5418bf=_0x13ae42['oldRange'],_0x3f65c6=_0x13ae42['newRange'],_0x48a73a=_0x5418bf&&'$graveyard'===_0x5418bf['root']['rootName'],_0x321791=_0x3f65c6&&'$graveyard'===_0x3f65c6['root']['rootName'];if(_0x48a73a&&_0x321791)continue;const _0x211d43=this['_parseMarkerName'](_0x1f336a);this['_markers']['get'](_0x1f336a)&&(_0x321791||!_0x3f65c6?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x1f336a,'changeId':_0x211d43['groupId']}):_0x48a73a&&_0x3f65c6&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x1f336a,'changeId':_0x211d43['groupId']}));}}['_parseMarkerName'](_0x3a48e3){const _0x1ab25b=_0x3a48e3['split'](':'),_0x22a500=(_0x1ab25b[0x1]||'')['split']('_');return{'prefix':_0x1ab25b[0x0],'groupId':_0x22a500[0x0],'suffix':_0x22a500[0x1]};}['_translateOperationToEditorContent'](_0x2cec74,_0x4a46ec,_0x4367ea){if('insert'===_0x2cec74['type']){const _0x46bc89=_0x2cec74;return new $t(this['_changePosition'](_0x4a46ec['concat'](_0x46bc89['position']['offset']),_0x4367ea),_0x46bc89['nodes'],_0x46bc89['baseVersion']);}if('marker'===_0x2cec74['type']&&_0x2cec74['name']['startsWith']('$markedRemove')){const _0x16fc29=_0x2cec74;return new Mt(_0x16fc29['name'],_0x16fc29['oldRange'],this['_changeRange'](_0x16fc29['newRange'],_0x4a46ec['concat'](_0x16fc29['newRange']['start']['offset']),_0x4a46ec['concat'](_0x16fc29['newRange']['end']['offset']),_0x4367ea),_0x16fc29['_markers'],_0x16fc29['affectsData'],_0x16fc29['baseVersion']);}return _0x2cec74;}['_groupAdjacentOperations'](_0x45e35f){if(!_0x45e35f['length'])return[];const _0x33010e=[];let _0x5d3434=0x0,_0x42c737=0x0,_0x41dde1=[];for(let _0x420ad7=0x0;_0x420ad7<=_0x45e35f['length'];_0x420ad7++){const _0x290ffb=_0x45e35f[_0x420ad7],_0x22ecc4=_0x45e35f[_0x420ad7-0x1];!_0x290ffb||_0x22ecc4&&!this['_getOperationEnd'](_0x22ecc4)['isTouching'](this['_getOperationStart'](_0x290ffb))?(_0x33010e['push']({'operations':_0x41dde1,'operationsIsolated':_0x41dde1['map'](_0x46408c=>this['_shiftOperation'](_0x46408c['clone'](),-_0x42c737)),'groupOffset':_0x5d3434}),_0x41dde1=_0x290ffb?[_0x290ffb]:[],_0x42c737+=_0x5d3434,_0x5d3434=0x0):_0x41dde1['push'](_0x290ffb),_0x290ffb&&'insert'===_0x290ffb['type']&&(_0x5d3434+=_0x290ffb['howMany']);}return _0x33010e;}['_findAdjacentContextDistance'](_0x1e1c08,_0x998843,_0x235b9d,_0x4e7fd5=0x1){const _0x1212fe=new Dt({'startPosition':_0x1e1c08,'direction':_0x998843});let _0x11db22=0x0;for(let _0x41b7c2=0x0;_0x41b7c2<_0x4e7fd5;_0x41b7c2++){let _0x19f53c=0x0,_0x3f9104=!0x1,_0x5ab65e='forward'===_0x998843?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x113cd4}of _0x1212fe)if(_0x113cd4['is']('$textProxy')){const _0x19edc6=_0x5ab65e['exec'](_0x113cd4['data']);if(_0x19edc6&&_0x19edc6['length']){if(_0x19f53c+='forward'===_0x998843?_0x19edc6['index']+_0x19edc6[0x0]['length']:_0x113cd4['data']['length']-_0x19edc6['index'],_0x19edc6[0x0]['length']!==_0x113cd4['data']['length'])break;_0x3f9104=!0x0,_0x5ab65e='forward'===_0x998843?/^\w+/:/\w+$/;}else{if(_0x3f9104)break;_0x19f53c+=_0x113cd4['offsetSize'];}}else{if(_0x113cd4['is']('element')){_0x235b9d['isInline'](_0x113cd4)&&!_0x3f9104&&(_0x19f53c+=0x1);break;}}_0x11db22+=_0x19f53c,_0x1212fe['jumpTo'](_0x1e1c08['getShiftedBy']('forward'===_0x998843?_0x11db22:-_0x11db22));}return _0x11db22;}['_getChangeContext'](_0x527c2d,_0x15dbff){const _0x3b6691=D(this['context'])['model']['schema'],_0x331f10=this['_findAdjacentContextDistance'](_0x527c2d,'backward',_0x3b6691,0x6),_0x257205=this['_findAdjacentContextDistance'](_0x15dbff,'forward',_0x3b6691,0x6),_0x33cf3e=_0x527c2d['getShiftedBy'](-_0x331f10),_0xf5499e=_0x15dbff['getShiftedBy'](_0x257205);return{'start':_0x33cf3e,'end':_0xf5499e,'hasContentBefore':!_0x33cf3e['isAtStart'],'hasContentAfter':!_0xf5499e['isAtEnd']};}['_insertMarkers'](_0x51ed5a){const _0x4efdb1=this['context']['plugins']['get']('AIEditing'),_0x2824f8=new Set();D(this['context'])['model']['change'](_0xbbb5f6=>{for(const _0x5e792b of _0x51ed5a){const _0x3cbb48=''+Lt+_0x5e792b['type']+':'+_0x5e792b['groupId']+'_'+_0x4efdb1['_nextDataId'](_0x2824f8);this['_markers']['set'](_0x3cbb48,{'id':_0x3cbb48,'groupId':_0x5e792b['groupId'],'type':_0x5e792b['type'],'content':_0x5e792b['content']}),_0xbbb5f6['addMarker'](_0x3cbb48,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xbbb5f6['createRange'](_0x5e792b['start'],_0x5e792b['end'])});}});}['_createGetContextFn'](_0x5c1bd4,_0x4dffe5,_0x232336){let _0x2285b6='';return()=>{if(!_0x2285b6){const _0x3bb9d7=_0x4dffe5['toView'](_0x5c1bd4,{'showSuggestionHighlights':!0x0});let _0x43688=_0x3bb9d7['getChild'](0x0);if(_0x43688['is']('containerElement')||(_0x43688=_0x3bb9d7),!_0x43688)return'';let _0x520607=!0x1;const _0x35dd6d=[];for(const _0x5168c1 of _0x43688['getChildren']())_0x5168c1['is']('element','span')&&_0x5168c1['hasClass']('ck-ai_review-marker_context-end')&&(_0x520607=!0x1),_0x520607&&_0x35dd6d['push'](_0x5168c1),_0x5168c1['is']('element','span')&&_0x5168c1['hasClass']('ck-ai_review-marker_context-start')&&(_0x520607=!0x0);_0x43688['_removeChildren'](0x0,_0x43688['childCount']),_0x232336?.['ellipsisBefore']&&_0x43688['_appendChild']('…'),_0x43688['_appendChild'](_0x35dd6d),_0x232336?.['ellipsisAfter']&&_0x43688['_appendChild']('…');const _0x348a50=_0x4dffe5['htmlProcessor']['domConverter']['viewToDom'](_0x3bb9d7),_0x46748f=_0x4dffe5['htmlProcessor']['htmlWriter']['getHtml'](_0x348a50);_0x2285b6=_0x46748f;}return _0x2285b6;};}['_createGetContentFn'](_0xdad0a5,_0x381dd6){let _0x467eec='';return()=>(_0x467eec||(_0x467eec=_0x381dd6['stringify'](_0xdad0a5,{'showSuggestionHighlights':!0x0})),_0x467eec);}['_createGetContentUsingDataIdFn'](_0x745aa7,_0x28eefa,_0x5c06f6){let _0x1ac9e0='';return()=>{if(!_0x1ac9e0){const _0x49c72c=_0x5c06f6['toView'](new _0x27a70e(_0x745aa7)),_0x532d49=_0x5c06f6['htmlProcessor']['domConverter']['viewToDom'](_0x49c72c)['querySelector']('[data-id=\x22'+_0x28eefa+'\x22]');_0x1ac9e0=_0x532d49?.['outerHTML']||'';}return _0x1ac9e0;};}['_findMarkerElement'](_0x1829a5,_0xf6f0e7=0x5){let _0x37313d=_0x1829a5,_0x190a7a=null;for(let _0x1ee6a7=0x0;_0x1ee6a7<_0xf6f0e7&&_0x37313d;_0x1ee6a7++){if(!_0x37313d['className']){_0x37313d=_0x37313d['parentElement'];continue;}if(!(''+_0x37313d['className'])['includes']('ck-ai_review-marker_')){_0x37313d=_0x37313d['parentElement'];continue;}if(!_0x37313d['getAttribute']('data-marker-id'))break;_0x190a7a=_0x37313d;break;}return _0x190a7a;}['_findMarkerElementById'](_0x4cf754){const _0x5f4273=D(this['context']),_0x2f7479=_0x5f4273['model']['markers']['get'](_0x4cf754);return _0x2f7479?Gt(_0x5f4273['editing'],_0x2f7479):null;}['_getMarkersDataForGroup'](_0x5e88f6){return Array['from'](this['_markers']['values']())['filter'](_0x4f26a7=>_0x4f26a7['groupId']===_0x5e88f6);}['_getOperationStart'](_0x2007e8){return'insert'===_0x2007e8['type']?_0x2007e8['position']:_0x2007e8['newRange']['start'];}['_getOperationEnd'](_0xfd2b25,_0x3bb7e2=!0x1){return'insert'===_0xfd2b25['type']?_0x3bb7e2?_0xfd2b25['position']:_0xfd2b25['position']['getShiftedBy'](_0xfd2b25['howMany']):_0xfd2b25['newRange']['end'];}['_shiftOperation'](_0x81ce73,_0x1960d9){return'insert'===_0x81ce73['type']?_0x81ce73['position']=_0x81ce73['position']['getShiftedBy'](_0x1960d9):'marker'===_0x81ce73['type']&&_0x81ce73['newRange']&&(_0x81ce73['newRange']=new _0x1f26a0(_0x81ce73['newRange']['start']['getShiftedBy'](_0x1960d9),_0x81ce73['newRange']['end']['getShiftedBy'](_0x1960d9))),_0x81ce73;}['_changeOperationOwnerDocument'](_0x800670,_0x3a3923){'insert'===_0x800670['type']?_0x800670['position']=this['_changePositionOwnerDocument'](_0x800670['position'],_0x3a3923):'marker'===_0x800670['type']&&_0x800670['newRange']&&(_0x800670['newRange']=this['_changeRangeOwnerDocument'](_0x800670['newRange'],_0x3a3923));}['_changePositionOwnerDocument'](_0x34f563,_0x2e9e1c){return new _0x128f8a(_0x2e9e1c,_0x34f563['path']);}['_changeRangeOwnerDocument'](_0x2782cc,_0x48851a){return new _0x1f26a0(this['_changePositionOwnerDocument'](_0x2782cc['start'],_0x48851a),this['_changePositionOwnerDocument'](_0x2782cc['end'],_0x48851a));}['_changePosition'](_0x196a99,_0x466a1b){return new _0x128f8a(_0x466a1b,[..._0x196a99]);}['_changeRange'](_0x3f3974,_0x284e6a,_0x6086a8,_0x55efb2){return new _0x1f26a0(this['_changePosition'](_0x284e6a,_0x55efb2),this['_changePosition'](_0x6086a8,_0x55efb2));}['_sortMarkers'](_0x2dbf52){const _0x221851=_0x15e584=>{switch(_0x15e584){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x2dbf52['sort']((_0x2fb576,_0x9efb59)=>_0x221851(_0x2fb576['type'])-_0x221851(_0x9efb59['type']));}['_hasSameTopLevelElement'](_0x1c661d,_0x5f0992){const _0x249f93=_0x1c661d['getChild'](0x0),_0x549880=_0x5f0992['getChild'](0x0);return!(!_0x249f93||!_0x549880)&&((!_0x249f93['is']('element')||!_0x549880['is']('element')||_0x249f93['name']===_0x549880['name'])&&!(_0x249f93['is']('element')&&!_0x549880['is']('element')||!_0x249f93['is']('element')&&_0x549880['is']('element')));}['_haveSingleTopLevelElement'](_0x3e2484){return 0x1===_0x3e2484['childCount'];}['_haveOnlyInlineContent'](_0x2b2e8e,_0x4376b1){for(const _0x23c81d of _0x2b2e8e['getChildren']())if(_0x23c81d['is']('element')&&!_0x4376b1['isInline'](_0x23c81d))return!0x1;return!0x0;}['_upsertDataId'](_0x491035,_0x3b9748){let _0x82099a=_0x491035['getAttribute'](_0x1707b9);return _0x82099a||(_0x82099a=_0x3b9748(),_0x491035['_setAttribute'](_0x1707b9,_0x82099a)),_0x82099a;}}class th extends Ft(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x45fff4,contentNew:_0x32e86c,contentInitial:_0x167077,documentVersion:_0x24515d}){super(),this['id']=_0x45fff4,this['contentNew']=_0x32e86c,this['contentInitial']=_0x167077,this['documentVersion']=_0x24515d;}}class eh extends Vt(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x5ae127,_0x5d69e2,_0x33ae25){super(),this['id']=_0x5ae127,this['parent']=_0x33ae25,this['_data']=_0x5d69e2,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 ih extends Vt(){['id']=_0x3e4e8c();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x21fe12,_0x2b2798,_0x33f728,_0x3161cc,_0x2a54b4){super(),this['_sourceCheck']=_0x2b2798,this['_documentData']=_0x21fe12,this['_aiConnector']=_0x33f728,this['_reviewParams']=_0x3161cc,this['_reviewArgs']=_0x2a54b4,this['on']('change:status',(_0x5e04f8,_0x15d4a6,_0x29737f)=>{'aborted'==_0x29737f&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x29737f,'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'](_0xe3a1c=>'pending'===_0xe3a1c['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x2fd1bf){this['_documentData']=_0x2fd1bf;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x4a3103=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x29f916 of _0x4a3103)'unmodified'!==_0x29f916['data']['operation']&&('error'!==_0x29f916['data']['operation']?'review-metadata'!==_0x29f916['event']?this['_addReviewCheckResult'](_0x29f916['data']['dataId'],_0x29f916['data']['textDelta']):this['callId']=_0x29f916['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x2e2809){this['_currentError']=_0x2e2809,_0x2e2809 instanceof Error&&_0x2e2809['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'](_0x429a3d,_0x10c118){const _0x30d67d=this['_results']['get'](_0x429a3d);if(!_0x30d67d)return;if(0x0===_0x10c118['length'])return;const _0x5c1ac1=[];_0x10c118['forEach']((_0x951a78,_0x4649cd)=>{const _0x55de15=new eh(_0x30d67d['id']+'-'+_0x4649cd,_0x951a78,_0x30d67d);_0x55de15['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x55de15,'status':_0x55de15['status']});}),_0x55de15['on']('change:isActivated',()=>{_0x55de15['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x55de15}):this['fire']('reviewCheckResultDeactivated',{'change':_0x55de15});}),this['_changes']['push'](_0x55de15),_0x5c1ac1['push'](_0x55de15);}),this['fire']('reviewCheckResultReady',{'changes':_0x5c1ac1,'result':_0x30d67d,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x1a9d83){const _0x39c6c4=this['_changes']['find'](_0x400e1c=>_0x400e1c['id']===_0x1a9d83);return!(!_0x39c6c4||'pending'!==_0x39c6c4['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x3d7b6f=>!0x0===_0x3d7b6f['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x4bd2fc=>'pending'===_0x4bd2fc['status']);}['getChangeById'](_0x58ee4a){return this['_changes']['find'](_0xffc3a4=>_0xffc3a4['id']===_0x58ee4a);}['markAllChangesAsAccepted'](){for(const _0x2f0c38 of this['_changes'])'pending'===_0x2f0c38['status']&&(_0x2f0c38['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0xa7375b){const _0x510a26=this['_changes']['find'](_0x599975=>_0x599975['id']===_0xa7375b);_0x510a26&&'pending'===_0x510a26['status']&&(_0x510a26['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x17cb93){const _0x15e340=this['_changes']['find'](_0x3e04d2=>_0x3e04d2['id']===_0x17cb93);_0x15e340&&'pending'===_0x15e340['status']&&(_0x15e340['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x1edade){const _0xef22b1=this['_changes']['find'](_0x3a288b=>_0x3a288b['id']===_0x1edade);_0xef22b1&&'pending'===_0xef22b1['status']&&(_0xef22b1['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x11fe05){const _0x3bddb2=this['_changes']['find'](_0x3d9b4f=>_0x3d9b4f['id']===_0x11fe05);_0x3bddb2&&'outdated'===_0x3bddb2['status']&&(_0x3bddb2['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x3ea796){this['_changes']['filter'](_0x51cf11=>_0x51cf11['isActivated']&&_0x51cf11['id']!==_0x3ea796)['forEach'](_0x3867f5=>{_0x3867f5['isActivated']=!0x1;});const _0x34f130=this['_changes']['find'](_0x5a62b5=>_0x5a62b5['id']===_0x3ea796);_0x34f130&&'pending'===_0x34f130['status']&&(_0x34f130['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x3be05c=>_0x3be05c['isActivated'])['forEach'](_0x1a9342=>{_0x1a9342['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x23e123){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0xb2dd2e;if(_0x23e123){const _0x61c87a=this['_changes']['find'](_0x168c1b=>_0x168c1b['id']===_0x23e123);if(_0x61c87a&&_0x61c87a['isRated'])return;_0x61c87a&&(_0xb2dd2e=_0x61c87a['parent']['id'],_0x61c87a['isRated']=!0x0);}const _0x2fc301={'positiveCount':this['_changes']['filter'](_0xa75150=>'accepted'===_0xa75150['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x2fc301,this['callId'],_0xb2dd2e);}['_addReviewCheckResult'](_0x5bf391,_0x2fb133){const _0x1908d2=this['_documentData']['elements']['get'](_0x5bf391);if(!_0x1908d2)return;const _0x4ca5fc=_0x1908d2['getContent']();if(_0x4ca5fc===_0x2fb133)return;const _0xccb161=new th({'id':_0x5bf391,'contentInitial':_0x4ca5fc,'contentNew':_0x2fb133,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0xccb161['id'],_0xccb161),this['fire']('reviewCheckResultAdded',{'result':_0xccb161,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0xcf2179=>'pending'===_0xcf2179['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x436c31=>'pending'===_0x436c31['status'])['length']&&(this['status']='finished'));}}class Ri extends ih{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0xb81162=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x3f9bfc=0x0;_0x3f9bfc<this['_reviewParams']['length'];_0x3f9bfc++){if(!this['_reviewParams'][_0x3f9bfc]||!this['_sourceCheck']['options'][_0x3f9bfc])continue;const _0x129146=this['_sourceCheck']['options'][_0x3f9bfc],_0x677f70=_0x129146['data']?.['find'](_0x45d2e8=>_0x45d2e8['id']===this['_reviewParams'][_0x3f9bfc]);_0x677f70&&_0xb81162['push'](_0x677f70['label']);}return _0xb81162['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x712347,_0x3e6a1c,_0x37d801){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x3e6a1c,_0x712347,_0x37d801);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ae extends _0x37abb2{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[s];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0xeba0e7,_0x44501c)=>{const _0x1b46e5=this['_aiReviewCheckList']['getCheckById'](_0x44501c['id']);if(_0x1b46e5){this['_onReviewCheckRun'](_0x44501c),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x44501c,_0x1b46e5),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x2f69a0,_0x4b9e49)=>{switch(_0x4b9e49['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x4b9e49);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x1500e8('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x1500e8('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x4b9e49['status']&&'error-chunk'!==_0x4b9e49['status']&&'error-general'!==_0x4b9e49['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x3be31d,_0x55faee)=>{if(!this['_currentReviewCheckRun'])throw new _0x1500e8('ai-review-mode-no-current-check-run',this);const _0x7cf818=this['_diffContent'](_0x55faee['result']['contentInitial'],_0x55faee['result']['contentNew']);_0x55faee['source']['addResultChanges'](_0x55faee['result']['id'],_0x7cf818);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x4cc9d6,_0x15f5cb)=>{for(const _0x176f8d of _0x15f5cb['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x176f8d);this['_markChangePositionInEditorContent'](_0x15f5cb['changes'],_0x15f5cb['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x4f13f5,_0x5b0a72)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x5b0a72['change']['id'],_0x5b0a72['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x4d49ff,_0x8c8335)=>{this['_onReviewCheckResultActivated'](_0x8c8335);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x4cdedf){_0x4cdedf instanceof Error&&_0x4cdedf['message']['includes']('ai-request-aborted')||(_0x4cdedf instanceof _0x1500e8?this['_logError'](_0x4cdedf):this['_logError'](new _0x1500e8('ai-review-mode-check-run-failed',this,void 0x0,_0x4cdedf)));}}else this['_logError'](new _0x1500e8('ai-review-mode-source-check-not-found',this,{'checkId':_0x44501c['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0xd7000e=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0xd7000e['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0xd7000e['map'](_0x236ae6=>_0x236ae6['id']));const _0x28ffe2=this['_currentReviewCheckRun'];_0x28ffe2['markAllChangesAsAccepted'](),_0x28ffe2['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x19451b,_0x5a91b5)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5a91b5['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x5a91b5['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x5a91b5['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5a91b5['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x5b4f2e,_0x5a962d)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5a962d['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x5a962d['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x5a962d['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5a962d['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x4ca3a8,_0x4db62f)=>{this['_onActivateChange'](_0x4db62f);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x30e73d,_0x39e4aa)=>{this['_onDeactivateChange'](_0x39e4aa);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x45da08,_0x32ae5b)=>{this['_onChangeMarkerClicked'](_0x45da08,_0x32ae5b);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x395986,_0x359604)=>{this['_onChangeMarkerHovered'](_0x395986,_0x359604);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x468382,_0x5921fd)=>{this['_onChangeMarkerRemoved'](_0x468382,_0x5921fd);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x408f28,_0x1a54cf)=>{this['_onChangeMarkerRestored'](_0x408f28,_0x1a54cf);});}['_createReviewCheckRun'](_0x72e234,_0x3c4f7c){return new Ri(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3c4f7c,this['_aiConnector'],_0x72e234['params'],_0x72e234['args']);}['_onChangeMarkerRemoved'](_0x4208d1,_0x1c71b5){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x1c71b5['changeId']);}['_onChangeMarkerRestored'](_0x112f4b,_0x159930){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x159930['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x3613f5=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x3613f5&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x414353=this['_aiReviewCoreEditing']['getEditor']();_0x414353&&_0x414353['editing']['view']['change'](_0xf72d08=>{const _0x57466e=_0x414353['editing']['view']['document']['getRoot']();_0xf72d08['removeClass']('ck-ai_review-diff',_0x57466e),_0xf72d08['removeClass']('ck-ai_review-highlights',_0x57466e),_0xf72d08['removeClass']('ck-ai-translate-mode-content',_0x57466e);});}['_getTranslationWithDefault'](_0x183e80,_0x2d7d02){const _0x470e45=m(this['context']['locale'],_0x183e80);return _0x470e45===_0x183e80?_0x2d7d02:_0x470e45;}['_logError'](_0x64a0c3,_0x4de998=!0x1){_0x4dee23(_0x64a0c3['message']),_0x4de998||(_0x64a0c3['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x1889b0){if('content'===this['_changeActivationSource']){const _0x383061=this['_aiReviewCoreUi']['getChangeElement'](_0x1889b0);_0x383061&&_0x917d7b(_0x383061['closest']('.ck-ai_review__check-run-result')||_0x383061);}else{if('panel'===this['_changeActivationSource']){const _0x564997=this['_getChangeContentElement'](_0x1889b0);if(!_0x564997)return;_0x54e791({'target':_0x564997,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const he=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'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':'tone','commandId':'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'}]}]}];class Zs{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x3a7f92){this['id']=_0x3a7f92['id'],this['commandId']=_0x3a7f92['commandId'],this['title']=_0x3a7f92['title'],this['description']=_0x3a7f92['description'],this['isParameterized']=_0x3a7f92['isParameterized'],this['useArgs']=_0x3a7f92['useArgs'],this['options']=_0x3a7f92['options'],this['args']=_0x3a7f92['args'];}}class vo extends Vt(){['_checks']=[];['setupChecks'](_0x396436){this['_checks']=_0x396436['map'](_0x5454b6=>new Zs(_0x5454b6));}get['checks'](){return this['_checks'];}['getCheckById'](_0x3932aa){return this['checks']['find'](_0x28518c=>_0x28518c['id']===_0x3932aa);}['removeCheckById'](_0x190b16){this['_checks']=this['_checks']['filter'](_0x37650c=>_0x37650c['id']!==_0x190b16);}}class me extends Zs{['_models']=[];['_defaultModel']=null;constructor(_0x4e5722,_0x2daa7b,_0x4c8d5e){super(_0x4e5722),this['_models']=_0x2daa7b,this['_defaultModel']=_0x4c8d5e;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class de extends Zs{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x5b0e19,_0x1f4851,_0x3eaaef){super(_0x5b0e19),this['prompt']=_0x5b0e19['prompt'],this['model']=_0x5b0e19['model'],this['model']?this['_defaultModel']=_0x1f4851['find'](_0x2b1758=>_0x2b1758['id']===this['model'])||null:this['_defaultModel']=_0x3eaaef;}get['defaultModel'](){return this['_defaultModel'];}}class ce extends vo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x52b819,_0x406fe8,_0x3add80){super(),this['_allModels']=_0x52b819,this['_recommendedModels']=_0x406fe8,this['_defaultModel']=_0x3add80;}['setupChecks'](_0x4233b6){this['_checks']=_0x4233b6['map'](_0x22cb7d=>!0x0===_0x22cb7d['isExtra']?new de(_0x22cb7d,this['_allModels'],this['_defaultModel']):'custom'===_0x22cb7d['id']?new me(_0x22cb7d,this['_recommendedModels'],this['_defaultModel']):new Zs(_0x22cb7d));}}class le extends ih{['_prompt'];['_model'];constructor(_0x1219da,_0x5ed890,_0x5e2f2f,_0x1f9966,_0xf0f645){super(_0x5e2f2f,_0x1f9966,_0xf0f645),this['_prompt']=_0x1219da,this['_model']=_0x5ed890;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x2cad4a,_0x36040a,_0x3c1627){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x36040a,_0x2cad4a,_0x3c1627);}}class ue extends le{get['subTitle'](){return'';}set['prompt'](_0x3f0654){this['_prompt']=_0x3f0654;}set['model'](_0x1400c3){this['_model']=_0x1400c3;}}class se extends ae{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x4500c3){super(_0x4500c3),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',he['map'](_0x1aa33f=>_0x1aa33f['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x19afe0,_0x2b2141)=>{this['_isDiffOn']=_0x2b2141['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x5cb924,_0x1fb2e5){return _0x5cb924['isCustom']?new le(_0x5cb924['args']['prompt'],_0x5cb924['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x1fb2e5,this['_aiConnector']):_0x1fb2e5['isExtra']?new ue(_0x1fb2e5['prompt'],_0x1fb2e5['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x1fb2e5,this['_aiConnector']):new Ri(this['_aiReviewCoreEditing']['getDocumentData'](),_0x1fb2e5,this['_aiConnector'],_0x5cb924['params'],_0x5cb924['args']);}['_onReviewCheckResultActivated'](_0x2178a4){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x2178a4['change']['id']),this['_scrollToChange'](_0x2178a4['change']['id']);const _0x2a4863=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x2178a4['change']['id']);if(!_0x2a4863)return;const _0xad4c4f=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2178a4['change'],()=>_0x2a4863['getElement'](),void 0x0,'click',_0xad4c4f?.['editing']?.['view']?.['getDomRoot'](),_0xad4c4f?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x2178a4['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x36da1){this['_currentReviewCheckRun']&&'click'===_0x36da1['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x36da1['id']));}['_onDeactivateChange'](_0x1dbdee){this['_currentReviewCheckRun']&&'balloon'===_0x1dbdee['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x75c709,_0x168ce4){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x168ce4['changeId']);const _0x12d47e=this['_currentReviewCheckRun']['getChangeById'](_0x168ce4['changeId']);if(!_0x12d47e)return;const _0x1bff25=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x12d47e,_0x168ce4['markerElement'],_0x168ce4['domEvent'],'click',_0x1bff25?.['editing']?.['view']?.['getDomRoot'](),_0x1bff25?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0xddb0ae,_0x344c8f){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x36cafb=this['_currentReviewCheckRun']['getChangeById'](_0x344c8f['changeId']);if(!_0x36cafb)return;const _0x43c939=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x36cafb,_0x344c8f['markerElement'],_0x344c8f['domEvent'],'hover',_0x43c939?.['editing']?.['view']?.['getDomRoot'](),_0x43c939?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x1b7430){const _0x4b483a=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1b7430);return _0x4b483a?_0x4b483a['getElement']():null;}['_markChangePositionInEditorContent'](_0x280d1b,_0x22be86){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x280d1b,_0x22be86);}['_diffContent'](_0x31ebf1,_0x3d9ed2){return this['_aiReviewCoreEditing']['diffContent'](_0x31ebf1,_0x3d9ed2);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x426970){const _0x4686c0=this['_aiReviewCoreEditing']['getEditor']();_0x426970?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x4686c0&&_0x4686c0['editing']['view']['change'](_0x54b8ef=>{const _0xac4c6=_0x4686c0['editing']['view']['document']['getRoot']();for(const _0x4c81cf of _0xac4c6['getClassNames']())_0x4c81cf['startsWith']('ck-ai_review-')&&_0x54b8ef['removeClass'](_0x4c81cf,_0xac4c6);_0x54b8ef['addClass'](_0x426970?'ck-ai_review-diff':'ck-ai_review-highlights',_0xac4c6);});}async['_getChecksList'](){const _0x52d96a=[...he,...this['_getExtraChecks']()],_0xccdbaf=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0xccdbaf,_0x52d96a);let _0x5e79ce=_0x52d96a;this['_hasDefaultAvailableCommands']||(_0x5e79ce=_0xccdbaf['map'](_0x139494=>_0x52d96a['find'](_0x5f13e9=>_0x5f13e9['id']===_0x139494))['filter'](_0x1cf44f=>!!_0x1cf44f)),_0x5e79ce=_0x5e79ce['map'](_0x1551df=>_0x1551df['isExtra']?_0x1551df:this['_translateReviewCheck'](_0x1551df));const _0x15e263=_0x5e79ce['some'](_0x2759bc=>_0x2759bc['isExtra']||'custom'===_0x2759bc['id']);let _0x37973b=[],_0x4f41cd=[],_0x22e14e=null;if(_0x15e263){const _0x5e702a=await this['_getModels']();_0x37973b=_0x5e702a['all'],_0x4f41cd=_0x5e702a['recommended'],_0x22e14e=_0x5e702a['default'];}const _0x58eaa3=new ce(_0x37973b,_0x4f41cd,_0x22e14e);return _0x58eaa3['setupChecks'](_0x5e79ce),_0x15e263&&this['_filterChecksWithMissingModel'](_0x58eaa3),_0x58eaa3;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x73f81f=>({'id':_0x73f81f['id'],'commandId':_0x73f81f['id'],'title':_0x73f81f['label'],'description':_0x73f81f['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x73f81f['prompt'],'model':_0x73f81f['model']}));}['_logErrorForNonExistentChecks'](_0xfffe99,_0x195499){const _0x5778be=_0xfffe99['filter'](_0x57d378=>!_0x195499['some'](_0x83d5c=>_0x83d5c['id']===_0x57d378));_0x5778be['length']&&this['_logError'](new _0x1500e8('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x5778be['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x59370c=new X({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x59370c['getAll'](),'recommended':await _0x59370c['getAvailableModels'](),'default':await _0x59370c['getDefault']()};}catch(_0x3fe374){return this['_logError'](new _0x1500e8('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x3fe374)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x14a686){const _0xa1a0ee='AI_REVIEW_CHECK_'+_0x14a686['id']['toUpperCase']()['replaceAll']('-','_'),_0x1ddff0={..._0x14a686,'title':this['_getTranslationWithDefault'](_0xa1a0ee+'_TITLE',_0x14a686['title']),'description':this['_getTranslationWithDefault'](_0xa1a0ee+'_DESCRIPTION',_0x14a686['description'])};return _0x14a686['options']&&(_0x1ddff0['options']=_0x14a686['options']['map'](_0x1d929e=>({..._0x1d929e,'label':this['_getTranslationWithDefault'](_0xa1a0ee+'_OPTIONS_LABEL',_0x1d929e['label']||''),'data':_0x1d929e['data']?_0x1d929e['data']['map'](_0x3853ac=>({..._0x3853ac,'label':this['_getTranslationWithDefault'](_0xa1a0ee+'_OPTIONS_DATA_'+_0x3853ac['id']['toUpperCase'](),_0x3853ac['label'])})):void 0x0}))),_0x1ddff0;}['_filterChecksWithMissingModel'](_0x52307f){const _0x28bae8=[];_0x52307f['checks']['forEach'](_0x3de80e=>{(_0x3de80e instanceof de&&!_0x3de80e['defaultModel']||_0x3de80e instanceof me&&!_0x3de80e['models']['length'])&&_0x28bae8['push'](_0x3de80e['id']);}),_0x28bae8['length']&&_0x28bae8['forEach'](_0x1b8927=>{_0x52307f['removeCheckById'](_0x1b8927),this['_logError'](new _0x1500e8('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x1b8927}),!0x0);});}}class Qa extends _0x37abb2{static get['requires'](){return[se,re,oe];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class jr extends Zs{get['apiId'](){return'translate';}}class ge extends vo{['setupChecks'](_0x213bce){this['_checks']=_0x213bce['map'](_0x1699f8=>new jr(_0x1699f8));}}class Ce extends Ri{['_title'];constructor(_0x124771,_0x53820b,_0x530e85,_0x449387,_0x18a5e3,_0x3c1531){super(_0x124771,_0x53820b,_0x530e85,_0x18a5e3,_0x3c1531),this['_title']=_0x449387;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ae{static get['pluginName'](){return'AITranslateController';}constructor(_0x5efbcb){super(_0x5efbcb),this['context']['config']['define']('ai.translate.languages',[{'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'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x3a89bf,_0x186119){return new Ce(this['_aiReviewCoreEditing']['getDocumentData'](),_0x186119,this['_aiConnector'],m(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x3a89bf['params'],_0x3a89bf['args']);}['_onReviewCheckResultActivated'](_0x3d15e5){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x3d15e5['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x3d15e5['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x4fadcc){this['_currentReviewCheckRun']&&('hover'===_0x4fadcc['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x4fadcc['id'])),'click'===_0x4fadcc['uiInteraction']&&this['_scrollToChange'](_0x4fadcc['id']));}['_onDeactivateChange'](_0x1b5711){this['_currentReviewCheckRun']&&'panel'===_0x1b5711['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x399196,_0x23eee5){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x23eee5['changeId']),this['_scrollToChange'](_0x23eee5['changeId']));}['_onChangeMarkerHovered'](_0x226a89,_0xc4249c){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0xc4249c['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0xc4249c['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x445f1a){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x445f1a);}['_markChangePositionInEditorContent'](_0x8f84d5,_0x556ab8){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x8f84d5,_0x556ab8);}['_diffContent'](_0x2078e0,_0x16dd11){return this['_aiReviewCoreEditing']['diffContent'](_0x2078e0,_0x16dd11,!0x0);}['_onReviewCheckRun'](){const _0x2f7c46=this['_aiReviewCoreEditing']['getEditor']();_0x2f7c46&&_0x2f7c46['editing']['view']['change'](_0x42ae52=>{const _0x509825=_0x2f7c46['editing']['view']['document']['getRoot']();for(const _0x5d9a0e of _0x509825['getClassNames']())(_0x5d9a0e['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x5d9a0e)&&_0x42ae52['removeClass'](_0x5d9a0e,_0x509825);_0x42ae52['addClass']('ck-ai-translate-mode-content',_0x509825);});}async['_getChecksList'](){const _0xe6d05e=[],_0x2a86a9=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x6aa41 of _0x2a86a9)_0xe6d05e['push']({'title':_0x6aa41['label'],'id':_0x6aa41['id'],'commandId':_0x6aa41['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x6aa41['id']}});const _0x299e8f=new ge();return _0x299e8f['setupChecks'](this['_translateChecks'](_0xe6d05e)),_0x299e8f;}['_translateChecks'](_0x48b083){return _0x48b083['map'](_0x2ab767=>{const _0x24c678='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x2ab767['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x2ab767,'title':this['_getTranslationWithDefault'](_0x24c678,_0x2ab767['title'])};});}}class Ae extends Ie{constructor(_0x32d17a,_0x47f928){super(_0x32d17a,_0x47f928),this['on']('set:isLoading',(_0x7c94d8,_0x49e9a8,_0x37e18f)=>{_0x37e18f&&(this['headerTitle']=m(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x26e96d,_0x563864,_0x5841cd)=>{_0x5841cd&&(this['headerTitle']=m(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0xaa2ca2=super['_createAcceptAllButtonView']();return _0xaa2ca2['set']('label',m(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0xaa2ca2;}['_createExitReviewButtonView'](){const _0x5bddb1=super['_createExitReviewButtonView']();return _0x5bddb1['set']('label',m(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x5bddb1;}}class Le extends Te{['_setupTemplate'](){const _0x5e3fb6=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x5e3fb6['if']('isVisible','ck-hidden',_0x58ea6d=>!_0x58ea6d)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':m(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':m(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x5e3fb6['if']('isVisible','ck-hidden',_0x44b5ab=>!_0x44b5ab)]},'children':this['_checkViews']}]});}}class tr extends ve{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x1cc111=this['context']['locale'],_0x47ce5f=new _0x2c8dbc(_0x1cc111,{'label':m(_0x1cc111,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x1dbdc4,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x43f6af=new _e(_0x1cc111,{'header':_0x47ce5f,'list':new Le(_0x1cc111),'results':new Ae(_0x1cc111,{'generalErrorText':m(_0x1cc111,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new Re(_0x1cc111,{'headerText':m(_0x1cc111,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':m(_0x1cc111,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':m(_0x1cc111,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x43f6af['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x43f6af;}['registerTab'](){const _0x174462=this['context']['plugins']['get']('AITabs');_0x174462['view']['on']('activateTab',(_0x2e9275,_0x592bdd)=>{'translate'===_0x592bdd?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x174462['view']['addTab']({'id':'translate','buttonLabel':m(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x1dbdc4,'order':0x0,'content':this['_mainView']});}}class Xa extends _0x37abb2{static get['requires'](){return[rr,tr,oe];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{qi as AIActions,hi as AIAdapter,qn as AIAssistant,ee as AIAssistantUI,u as AIBalloon,Fa as AIChat,x as AIChatController,I as AIChatHistory,rt as AIChatHistoryController,st as AIChatHistoryUI,Wa as AIChatShortcuts,P as AIChatUI,s as AIConnector,o as AIEditing,Ya as AIEditorIntegration,It as AIQuickActionType,qa as AIQuickActions,ki as AIQuickActionsUI,er as AIRequestError,Zs as AIReviewCheck,th as AIReviewCheckResult,ih as AIReviewCheckRun,Qa as AIReviewMode,ae as AIReviewModeController,oe as AIReviewModeEditing,re as AIReviewModeUI,H as AITabs,qe as AITextAdapter,pt as AIToggleButtonUI,Xa as AITranslate,rr as AITranslateController,tr as AITranslateUI,zn as AWSTextAdapter,Xn as OpenAITextAdapter,di as ShowAIAssistantCommand,io as ToggleAICommand,Cs as createResizeButton,Qn as getDefaultAICommands};
23
+ import{Plugin as _0x421ea3,Command as Lt,ContextPlugin as _0x42547c,Editor as _0x5a617c}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x23e442,IconCheck as _0x1d6803,IconError as _0x445bb1,IconSubmit as _0x3601db,IconAIHistory as Nt,IconMagicWand as _0x29cf39,IconRobotPencil as _0x14051d,IconMaximize as _0x1b806c,IconMinimize as _0x385526,IconShowChangesOn as _0x4f8065,IconShowChangesOff as _0x69657c,IconDocument as _0x1a3b82,IconBoxWithCross as _0x28d854,IconBoxWithCheck as _0x98814a,IconBoxWithMarker as _0x29865d,IconInfo as tc,IconLoupe as _0x56c043,IconCancel as _0x254810,IconStop as _0x1cd249,IconAIChat as Et,IconPlus as _0x4c97e0,IconPin as _0x2f071c,IconThreeHorizontalDots as _0x2c4360,IconChevronDown as _0xe3deeb,IconChevronUp as _0x3970c2,IconOutdated as _0x54e109,IconEye as _0x4ebd0a,IconEyeCrossedOut as _0x182b81,IconChevronRight as _0x59c457,IconAIReview as _0x9be02c,IconAITranslate as _0x51d188}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x2ced3c,CKEditorError as _0xec7a4c,ObservableMixin as ts,global as _0xa06698,isVisible as _0x15cbc7,Rect as _0x2d2067,Collection as _0x395174,FocusTracker as _0x264c5d,KeystrokeHandler as _0x299178,first as _0x314279,logWarning as _0x56fb9a,logError as _0x4f2fe2,toArray as _0x38c9c4,EmitterMixin as _0x186953,scrollViewportToShowTarget as _0x527ffd,scrollAncestorsToShowTarget as _0x121c65,ResizeObserver as _0xa2d87b,_isMotionReduced as mt,getConstrainedViewportRect as _0x59e546,DomEmitterMixin as _0x4450a8}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0xcb5503,ButtonView as _0x129639,View as _0x52fd2c,SpinnerView as _0x12e180,IconView as _0x3d6008,AutocompleteView as _0x2585ad,ListView as _0x53ea61,ListItemGroupView as _0x1fbc33,ListItemView as _0x27d63c,ButtonLabelView as _0x3e41bf,FocusCycler as _0x471d76,createLabeledTextarea as _0xf21d21,Dialog as _0x52f20e,createDropdown as _0x3837b3,addMenuToDropdown as _0x40128f,MenuBarMenuView as _0x2e0497,MenuBarMenuListItemButtonView as _0xa33d94,DialogViewPosition as _0x57ebef,MenuBarMenuListView as _0x47f1f1,MenuBarMenuListItemView as _0x311641,BodyCollection as _0x26c387,BalloonPanelView as _0xc6701d,clickOutsideHandler as _0x27e637,addListToDropdown as _0x1f30e0,UIModel as _0x1612c4,submitHandler as _0x126cc1,LabeledFieldView as _0x13eaa4,createLabeledInputText as th,FormHeaderView as _0x3d4bc4,HighlightedTextView as _0x3ec926,ViewCollection as _0x45b6fa,FileDialogButtonView as _0x2d4ba3,InputTextView as _0x17f0eb,SearchTextView as _0x15a37a,ListItemButtonView as _0x1841ad,ButtonLabelWithHighlightView as _0x5afd59,DropdownMenuPanelPositioningFunctions as _0x668f3b,BalloonToolbar as te,FormRowView as _0x5db09f,TextareaView as _0x1a6812}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x373c5a,ClipboardMarkersUtils as _0x4853ad}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x53f11f,ViewDataTransfer as _0x576d68,ViewUpcastWriter as _0xf69bec,Matcher as _0x5ac785,_DetachOperation as lt,_insertIntoModelNodeList as _0x204d60,_removeFromModelNodeList as to,ModelRange as dt,transformOperationSets as kt,ViewDowncastWriter as Dt,ModelDocumentFragment as bt,ModelPosition as vt,ModelTreeWalker as _0x2ce1de,MarkerOperation as _0xe48208,InsertOperation as _0xa5baad}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x253ee4,escape as _0x1f62ac,escapeRegExp as _0x18bda3,debounce as _0x1327d9}from'es-toolkit/compat';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x4dbd64}from'htmlparser2';import{isTag as _0x203949,findOne as gt,getParent as _0x56d841,findAll as _0x222394,removeElement as _0x59f194,replaceElement as _0x50696c,prepend as _0x563c61,prependChild as _0x3737ce,appendChild as _0x4a9d0f,append as _0x5e3b7e,find as _0x37a7c8,isComment as _0x20a1c2,getChildren as _0x5e68c9,textContent as _0x78b08c}from'domutils';import _0x182c8b from'dom-serializer';import{Document as _t,Element as _0x2578d3,Text as _0x459c0a,cloneNode as _0x4d57d2,isDocument as _0x2b4893,isText as _0x48e3bc,NodeWithChildren as _0x6c3ec1}from'domhandler';import{MarkdownGfmMdToHtml as _0x4319a7}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x331f1a,DocumentCompare as ot,DATA_ID_MODEL_ATTRIBUTE as nt,ConfirmMixin as _0x5072a0,LateFocusDropdownButtonView as _0x435fbc,getAllMarkersDomElementsSorted as _0x123e33,SuggestionsConversion as zt,DATA_ID_VIEW_ATTRIBUTE as _0x80f6b4,getMarkerDomElement as _0x189b8b}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x3924f4}from'es-toolkit';import _0x457fab from'morphdom';import{IconWeb as _0x2ffb5e,IconClose as _0x4ef101,IconDocument as _0x4e4106,IconSelection as _0x524a1e,IconFileUpload as _0x25e079,IconLink as _0x49a141,IconBulb as _0x481126,IconAI as _0x23ccd3,IconPreviousArrow as _0x6e207c,IconCheck as _0x53c10a,IconDocumentOutline as _0x59d455,IconPaperClip as _0x4dc24b,IconBrowseFiles as _0x2e92c7,IconDropdownArrow as _0x3ff01c,IconAIChat as _0x526982,IconAIReview as _0x36f03e,IconAITranslate as Vt,IconAIAskAI as _0x1a8e11,IconThumbUp as _0x58f257,IconThumbDown as _0xe2a8fb,IconCopy as _0xb3df13,IconShowChangesOff as _0x12da34,IconShowChangesOn as _0x1bfe1c,IconAIQuickActions as yt,IconAIChatCommands as Gt,IconAIImproveWriting as Bt,IconAIContinueWriting as Ft,IconAIGrammarCheck as Wt,IconAIAdjustLength as Kt,IconAIChangeTone as Yt,IconAIOther as Jt,IconRefresh as _0x2ddaff,IconNextArrow as _0x1be2df}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x5dbbe5}from'diff';const x='_ungrouppedCommands';function o(_0x10f0e6,_0x41d2af){const _0x109943=(0x0,_0x41d2af['t'])('Other');return _0x10f0e6['length']?'groupId'in _0x10f0e6[0x0]?_0x10f0e6:[{'groupId':x,'groupLabel':_0x109943,'order':0x1/0x0,'commands':_0x10f0e6}]:[{'groupId':x,'groupLabel':_0x109943,'order':0x1/0x0,'commands':[]}];}const Kn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x421ea3{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x5d357a}=this,_0x591b48=['ck-fake-ai-selection'];_0x5d357a['config']['get']('ai.assistant.useTheme')&&_0x591b48['push']('ck-ai-assistant-ui_theme'),_0x5d357a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x591b48,'priority':0xc}}),_0x5d357a['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x28e65a,{writer:_0x410772})=>{if(!_0x28e65a['markerRange']['isCollapsed'])return null;const _0x56ef45=_0x410772['createUIElement']('span');return _0x410772['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x56ef45),_0x56ef45;}});}['afterInit'](){!async function(_0x357ba6){const _0x1708b4=_0x496fd1([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]),_0x358169=0x3dffc4e1,_0xfbff7=0x3df84249^_0x358169,_0xe3131a=window[_0x496fd1([0x44,0x61,0x74,0x65])][_0x496fd1([0x6e,0x6f,0x77])](),_0x16bcd6=_0x357ba6[_0x496fd1([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x407af3=new window[(_0x496fd1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x184d5e=>{_0x16bcd6[_0x496fd1([0x6f,0x6e,0x63,0x65])](_0x496fd1([0x72,0x65,0x61,0x64,0x79]),_0x184d5e);}),_0x47a7f7={[_0x496fd1([0x6b,0x74,0x79])]:_0x496fd1([0x45,0x43]),[_0x496fd1([0x75,0x73,0x65])]:_0x496fd1([0x73,0x69,0x67]),[_0x496fd1([0x63,0x72,0x76])]:_0x496fd1([0x50,0x2d,0x32,0x35,0x36]),[_0x496fd1([0x78])]:_0x496fd1([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]),[_0x496fd1([0x79])]:_0x496fd1([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]),[_0x496fd1([0x61,0x6c,0x67])]:_0x496fd1([0x45,0x53,0x32,0x35,0x36])},_0x21d7f6=_0x16bcd6[_0x496fd1([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x496fd1([0x67,0x65,0x74])](_0x496fd1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x48fb3a(){let _0x518209,_0x41618e=null,_0x4b3cb3=null;try{if(_0x21d7f6==_0x496fd1([0x47,0x50,0x4c]))return _0x496fd1([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x518209=_0xcf7248(),!_0x518209)return _0x496fd1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x518209[_0x496fd1([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x4b3cb3=_0x5bd477(_0x518209[_0x496fd1([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x518209[_0x496fd1([0x6a,0x74,0x69])])),await _0x2d936f()?_0xee9992()?_0x765738()?_0x496fd1([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x30cc9()?(_0x518209[_0x496fd1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x496fd1([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x41618e=_0x5bfccd(_0x496fd1([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x3a6513()):_0x496fd1([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x496fd1([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x496fd1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x496fd1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x765738(){const _0x257612=[_0x496fd1([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x496fd1([0x74,0x72,0x69,0x61,0x6c])][_0x496fd1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x518209[_0x496fd1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0xe3131a/0x3e8:0xe10*_0xfbff7;return _0x518209[_0x496fd1([0x65,0x78,0x70])]<_0x257612;}function _0xee9992(){const _0x44190e=_0x518209[_0x496fd1([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x44190e&&(!!_0x44190e[_0x496fd1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x496fd1([0x2a]))||!!_0x44190e[_0x496fd1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x496fd1([0x41,0x49])));}function _0x30cc9(){const _0x202284=_0x518209[_0x496fd1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x202284||0x0==_0x202284[_0x496fd1([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x3a4669}=new URL(window[_0x496fd1([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x202284[_0x496fd1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3a4669))return!0x0;const _0x593ab3=_0x3a4669[_0x496fd1([0x73,0x70,0x6c,0x69,0x74])](_0x496fd1([0x2e]));return _0x202284[_0x496fd1([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x18148b=>_0x18148b[_0x496fd1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x496fd1([0x2a])))[_0x496fd1([0x6d,0x61,0x70])](_0x835e06=>_0x835e06[_0x496fd1([0x73,0x70,0x6c,0x69,0x74])](_0x496fd1([0x2e])))[_0x496fd1([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x15d134=>_0x15d134[_0x496fd1([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x593ab3[_0x496fd1([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x496fd1([0x6d,0x61,0x70])](_0x2f5815=>Array(_0x593ab3[_0x496fd1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x2f5815[_0x496fd1([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x496fd1([0x66,0x69,0x6c,0x6c])](_0x2f5815[0x0]===_0x496fd1([0x2a])?_0x496fd1([0x2a]):'')[_0x496fd1([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x2f5815))[_0x496fd1([0x73,0x6f,0x6d,0x65])](_0x1eddc0=>_0x593ab3[_0x496fd1([0x65,0x76,0x65,0x72,0x79])]((_0x1e534d,_0x251ff9)=>_0x1eddc0[_0x251ff9]===_0x1e534d||_0x1eddc0[_0x251ff9]===_0x496fd1([0x2a])));}function _0x3a6513(){return _0x41618e&&_0x4b3cb3?new window[(_0x496fd1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x57402a,_0x1ad7b0)=>{_0x41618e[_0x496fd1([0x74,0x68,0x65,0x6e])](_0x57402a,_0x1ad7b0),_0x4b3cb3[_0x496fd1([0x74,0x68,0x65,0x6e])](_0x2d8f4f=>{_0x2d8f4f!=_0x496fd1([0x56,0x61,0x6c,0x69,0x64])&&_0x57402a(_0x2d8f4f);},_0x1ad7b0);}):_0x41618e||_0x4b3cb3||_0x496fd1([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5bd477(_0x1031b2,_0x1d7373){return new window[(_0x496fd1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x56b207=>{if(_0x5c5583())return _0x56b207(_0x496fd1([0x56,0x61,0x6c,0x69,0x64]));_0x39731c(),_0x16bcd6[_0x496fd1([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x496fd1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1d6d96=!0x1;const _0x1296e9=_0x2ced3c();function _0x3785bb(_0x383446){return!!_0x383446&&(typeof _0x383446===_0x496fd1([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x383446===_0x496fd1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x383446[_0x496fd1([0x74,0x68,0x65,0x6e])]===_0x496fd1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x383446[_0x496fd1([0x63,0x61,0x74,0x63,0x68])]===_0x496fd1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2e1f1b(_0x3c3b17){_0x25550e(_0x3c3b17)[_0x496fd1([0x74,0x68,0x65,0x6e])](_0x2819b5=>{if(!_0x2819b5||_0x2819b5[_0x496fd1([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x496fd1([0x6f,0x6b]))return _0x496fd1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x4fd143(_0x20981d(_0x1296e9+_0x1d7373))!=_0x2819b5[_0x496fd1([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x496fd1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x496fd1([0x56,0x61,0x6c,0x69,0x64]);})[_0x496fd1([0x74,0x68,0x65,0x6e])](_0x1a0d63=>(_0x409e96(),_0x1a0d63),()=>{const _0x25fc21=_0x582955();return null==_0x25fc21?(_0x409e96(),_0x496fd1([0x56,0x61,0x6c,0x69,0x64])):_0x496fd1(_0xe3131a-_0x25fc21>(0x19f340e1^_0x358169)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x496fd1([0x74,0x68,0x65,0x6e])](_0x56b207)[_0x496fd1([0x63,0x61,0x74,0x63,0x68])](()=>{_0x56b207(_0x496fd1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x156346=0x3dc92a61^_0x358169;function _0x409e96(){const _0x50dc3b=_0x496fd1([0x6c,0x6c,0x63,0x74,0x2d])+_0x4fd143(_0x20981d(_0x1031b2)),_0x160331=_0x4b1c48(_0x4fd143(window[_0x496fd1([0x4d,0x61,0x74,0x68])][_0x496fd1([0x63,0x65,0x69,0x6c])](_0xe3131a/_0x156346)));window[_0x496fd1([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x496fd1([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x50dc3b,_0x160331);}function _0x582955(){const _0x54e27c=_0x496fd1([0x6c,0x6c,0x63,0x74,0x2d])+_0x4fd143(_0x20981d(_0x1031b2)),_0x29c05f=window[_0x496fd1([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x496fd1([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x54e27c);return _0x29c05f?window[_0x496fd1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4b1c48(_0x29c05f),0x10)*_0x156346:null;}function _0x25550e(_0x31993c){return new window[(_0x496fd1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5ef9ce,_0x56e5a5)=>{_0x31993c[_0x496fd1([0x74,0x68,0x65,0x6e])](_0x5ef9ce,_0x56e5a5),window[_0x496fd1([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x56e5a5,0x3dfe1021^_0x358169);});}}_0x16bcd6[_0x496fd1([0x6f,0x6e])](_0x496fd1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x12e91c,_0x15a981)=>{if(_0x15a981[0x0]!=_0x1031b2)return _0x56b207(_0x496fd1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x15a981[0x1]={..._0x15a981[0x1],[_0x496fd1([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x1296e9};},{[_0x496fd1([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x496fd1([0x68,0x69,0x67,0x68])}),_0x16bcd6[_0x496fd1([0x6f,0x6e])](_0x496fd1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x11267e=>{_0x3785bb(_0x11267e[_0x496fd1([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1d6d96=!0x0,_0x2e1f1b(_0x11267e[_0x496fd1([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x496fd1([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x496fd1([0x6c,0x6f,0x77])}),_0x407af3[_0x496fd1([0x74,0x68,0x65,0x6e])](()=>{_0x1d6d96||_0x56b207(_0x496fd1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5c5583(){return _0x16bcd6[_0x496fd1([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x496fd1([0x76,0x69,0x65,0x77])][_0x496fd1([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x496fd1([0x61,0x75,0x74,0x6f]);}function _0x39731c(){_0x16bcd6[_0x496fd1([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x496fd1([0x76,0x69,0x65,0x77])][_0x496fd1([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x496fd1([0x61,0x75,0x74,0x6f]);}}function _0x5bfccd(_0x4320ea){const _0x492fb9=[new window[(_0x496fd1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5ef3f8=>setTimeout(_0x5ef3f8,0x3df6fa2d^_0x358169)),_0x407af3[_0x496fd1([0x74,0x68,0x65,0x6e])](()=>new window[(_0x496fd1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x53fd7f=>{let _0x2459d4=0x0;_0x16bcd6[_0x496fd1([0x6d,0x6f,0x64,0x65,0x6c])][_0x496fd1([0x6f,0x6e])](_0x496fd1([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x97d377,_0x599513)=>{_0x599513[0x0][_0x496fd1([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x2459d4++,_0x2459d4==(0x3dffc109^_0x358169)&&(_0x53fd7f(),_0x97d377[_0x496fd1([0x6f,0x66,0x66])]());});}))];return window[_0x496fd1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x496fd1([0x72,0x61,0x63,0x65])](_0x492fb9)[_0x496fd1([0x74,0x68,0x65,0x6e])](()=>_0x4320ea);}async function _0x367718(){await _0x407af3,_0x16bcd6[_0x496fd1([0x6d,0x6f,0x64,0x65,0x6c])][_0x496fd1([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x28f03b,_0x16bcd6[_0x496fd1([0x6d,0x6f,0x64,0x65,0x6c])][_0x496fd1([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x28f03b,_0x16bcd6[_0x496fd1([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x496fd1([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x4c4a87(_0x33d5d0){const _0x194e4c=_0x4b6839();_0x16bcd6[_0x194e4c]=_0x496fd1([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x33d5d0,_0x33d5d0!=_0x496fd1([0x56,0x61,0x6c,0x69,0x64])&&_0x367718();}function _0x4b6839(){const _0x16a3d4=window[_0x496fd1([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x496fd1([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x496fd1([0x6e,0x6f,0x77])]())[_0x496fd1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x496fd1([0x2e]),'');let _0x3739cd=_0x496fd1([0x6e]);for(let _0x829ffd=0x0;_0x829ffd<_0x16a3d4[_0x496fd1([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x829ffd+=0x2){let _0x263dba=window[_0x496fd1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x16a3d4[_0x496fd1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x829ffd,_0x829ffd+0x2));_0x263dba>=_0x1708b4[_0x496fd1([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x263dba-=_0x1708b4[_0x496fd1([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x3739cd+=_0x1708b4[_0x263dba];}return _0x3739cd;}function _0xcf7248(){const _0x13e5c7=_0x21d7f6[_0x496fd1([0x73,0x70,0x6c,0x69,0x74])](_0x496fd1([0x2e]));if(0x3!=_0x13e5c7[_0x496fd1([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x22a8e9(_0x13e5c7[0x1]);function _0x22a8e9(_0x5f384e){const _0x1dc9a6=_0xc37f0c(_0x5f384e);return _0x1dc9a6&&_0x50ee76()?_0x1dc9a6:null;function _0x50ee76(){const _0x3d6231=_0x1dc9a6[_0x496fd1([0x6a,0x74,0x69])],_0x3140a4=window[_0x496fd1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3d6231[_0x496fd1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3d6231[_0x496fd1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x318558={..._0x1dc9a6,[_0x496fd1([0x6a,0x74,0x69])]:_0x3d6231[_0x496fd1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3d6231[_0x496fd1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x318558[_0x496fd1([0x76,0x63])],_0x20981d(_0x318558)==_0x3140a4;}}}async function _0x2d936f(){let _0x405744=!0x0;try{const _0x2717a4=_0x21d7f6[_0x496fd1([0x73,0x70,0x6c,0x69,0x74])](_0x496fd1([0x2e])),[_0x137aca,_0x1213ad,_0x59c80a]=_0x2717a4;return _0xb78959(_0x137aca),await _0x1c612e(_0x137aca,_0x1213ad,_0x59c80a),_0x405744;}catch{return!0x1;}function _0xb78959(_0x38576c){const _0x4547e5=_0xc37f0c(_0x38576c);_0x4547e5&&_0x4547e5[_0x496fd1([0x61,0x6c,0x67])]==_0x496fd1([0x45,0x53,0x32,0x35,0x36])||(_0x405744=!0x1);}async function _0x1c612e(_0x3cd5a1,_0x166a5f,_0x2e5c8c){const _0x285fff=window[_0x496fd1([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x496fd1([0x66,0x72,0x6f,0x6d])](_0x364948(_0x2e5c8c),_0x47a35b=>_0x47a35b[_0x496fd1([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x44624f=new window[(_0x496fd1([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x496fd1([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3cd5a1+_0x496fd1([0x2e])+_0x166a5f),_0x3cb0a2=window[_0x496fd1([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x496fd1([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x3cb0a2)return;const _0x2891ac=await _0x3cb0a2[_0x496fd1([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x496fd1([0x6a,0x77,0x6b]),_0x47a7f7,{[_0x496fd1([0x6e,0x61,0x6d,0x65])]:_0x496fd1([0x45,0x43,0x44,0x53,0x41]),[_0x496fd1([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x496fd1([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x496fd1([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x3cb0a2[_0x496fd1([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x496fd1([0x6e,0x61,0x6d,0x65])]:_0x496fd1([0x45,0x43,0x44,0x53,0x41]),[_0x496fd1([0x68,0x61,0x73,0x68])]:{[_0x496fd1([0x6e,0x61,0x6d,0x65])]:_0x496fd1([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2891ac,_0x285fff,_0x44624f)||(_0x405744=!0x1);}}function _0xc37f0c(_0x2a929b){return _0x2a929b[_0x496fd1([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x496fd1([0x65,0x79]))?JSON[_0x496fd1([0x70,0x61,0x72,0x73,0x65])](_0x364948(_0x2a929b)):null;}function _0x364948(_0x2e3e28){return window[_0x496fd1([0x61,0x74,0x6f,0x62])](_0x2e3e28[_0x496fd1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x496fd1([0x2b]))[_0x496fd1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x496fd1([0x2f])));}function _0x20981d(_0x3b1201){let _0xd6a8d8=0x1505;function _0x1463ab(_0x553bed){for(let _0x4957ba=0x0;_0x4957ba<_0x553bed[_0x496fd1([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4957ba++){const _0x15874c=_0x553bed[_0x496fd1([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x4957ba);_0xd6a8d8=(_0xd6a8d8<<0x5)+_0xd6a8d8+_0x15874c,_0xd6a8d8&=_0xd6a8d8;}}function _0x49af02(_0x26b145){Array[_0x496fd1([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x26b145)?_0x26b145[_0x496fd1([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x49af02):_0x26b145&&typeof _0x26b145==_0x496fd1([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x496fd1([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x26b145)[_0x496fd1([0x73,0x6f,0x72,0x74])]()[_0x496fd1([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x364e97,_0xd03d73])=>{_0x1463ab(_0x364e97),_0x49af02(_0xd03d73);}):_0x1463ab(window[_0x496fd1([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x26b145));}return _0x49af02(_0x3b1201),_0xd6a8d8>>>0x0;}function _0x4fd143(_0x21b90d){return _0x21b90d[_0x496fd1([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x496fd1([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x496fd1([0x30]));}function _0x4b1c48(_0x49de0c){return _0x49de0c[_0x496fd1([0x73,0x70,0x6c,0x69,0x74])]('')[_0x496fd1([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x496fd1([0x6a,0x6f,0x69,0x6e])]('');}function _0x28f03b(){}function _0x496fd1(_0x3b118d){return _0x3b118d['map'](_0x517796=>String['fromCharCode'](_0x517796))['join']('');}_0x4c4a87(await _0x48fb3a());}(this);}['showFakeVisualSelection'](){const _0x511cff=this['editor']['model'];_0x511cff['change'](_0x16d13f=>{const _0x23b70e=_0x511cff['document']['selection']['getRanges']();let _0x2b123e=0x0;for(const _0x5674c2 of _0x23b70e){const _0x52a7ac=f+':'+_0x2b123e;if(_0x511cff['markers']['has'](_0x52a7ac))_0x16d13f['updateMarker'](_0x52a7ac,{'range':_0x5674c2});else{if(_0x5674c2['start']['isAtEnd']){const _0x36e831=_0x5674c2['start']['getLastMatchingPosition'](({item:_0x29e2bd})=>!_0x511cff['schema']['isContent'](_0x29e2bd),{'boundaries':_0x5674c2});_0x16d13f['addMarker'](_0x52a7ac,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x16d13f['createRange'](_0x36e831,_0x5674c2['end'])});}else _0x16d13f['addMarker'](_0x52a7ac,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5674c2});}_0x2b123e++;}});}['hideFakeVisualSelection'](){const _0x1639ff=this['editor']['model'],_0x3df47f=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x3df47f['length']&&_0x1639ff['change'](_0x1c50a8=>{_0x3df47f['forEach'](_0x216af5=>{_0x1c50a8['removeMarker'](_0x216af5);});});}['insertContent'](_0x38c7f1,_0xb02692){const _0x5ce243=this['_getAISelection'](),_0x80ed47=_0xb02692||_0x5ce243['getFirstRange']();this['editor']['model']['canEditAt'](_0x80ed47)&&this['editor']['model']['change'](_0x546464=>{this['hideFakeVisualSelection'](),_0xb02692||this['_resetContentOfSelectedTableCells'](_0x546464,_0x5ce243),this['_pasteHTMLUsingClipboard']({'insertAt':_0x80ed47,'writer':_0x546464,'html':_0x38c7f1});});}['insertContentBelow'](_0x1f18da){const {model:_0x151341}=this['editor'],_0x673b21=this['_getAISelection']();_0x151341['change'](()=>{const _0x3d4a86=this['_prepareTableInsertBelowPosition'](_0x1f18da,_0x673b21)||this['_getDefaultInsertBelowPosition'](_0x673b21);this['insertContent'](_0x1f18da,_0x3d4a86);});}['_getAISelection'](){const _0x5203c3=this['editor']['model'],_0x3c903b=Array['from'](_0x5203c3['markers']['getMarkersGroup'](f))['map'](_0x3d1142=>_0x3d1142['getRange']());return _0x5203c3['createSelection'](_0x3c903b);}['_pasteHTMLUsingClipboard']({writer:_0x1d31e9,html:_0x23643f,insertAt:_0x56d3a3}){const {view:_0x145640}=this['editor']['editing'],_0x3dde2f=this['editor']['plugins']['get'](_0x373c5a),_0x4b1ae0=new Kn();_0x4b1ae0['setData']('text/html',_0x23643f);const _0x101ccc=new ClipboardEvent('paste',{'clipboardData':_0x4b1ae0}),_0x30d457=new _0x53f11f(_0x145640,_0x101ccc,{'dataTransfer':new _0x576d68(_0x4b1ae0)});_0x1d31e9['setSelection'](_0x56d3a3);const _0x4d73d1=(_0x5b0f97,_0x5cfddc)=>{_0x5cfddc['resultRange']&&_0x1d31e9['setSelection'](_0x5cfddc['resultRange']);};_0x3dde2f['once']('contentInsertion',_0x4d73d1,{'priority':'lowest'}),_0x145640['document']['fire']('paste',_0x30d457),_0x3dde2f['off']('contentInsertion',_0x4d73d1);}['_getDefaultInsertBelowPosition'](_0xb33614){const {model:_0x2f785c}=this['editor'],_0x431e65=Array['from'](_0xb33614['getSelectedBlocks']());return _0x431e65['length']?_0x2f785c['createPositionAfter'](_0x431e65['pop']()):_0xb33614['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x15dcbe,_0x96f41f){const {model:_0x534400,plugins:_0xccdbb6}=this['editor'];if(_0xccdbb6['has']('TableUtils')){const _0x22a247=_0xccdbb6['get']('TableUtils')['getSelectedTableCells'](_0x96f41f);if(_0x22a247['length']){const _0x236be8=this['_getTableRowCountFromContent'](_0x15dcbe),_0x1e77bb=this['_createEmptyTableRows'](_0x22a247,_0x236be8);return _0x534400['createPositionAt'](_0x1e77bb,0x0);}}return null;}['_getTableRowCountFromContent'](_0x16bfa2){const _0x417116=this['editor']['plugins']['get']('TableUtils'),_0x494c3d=this['editor']['data']['parse'](_0x16bfa2),_0x5ba899=Array['from'](_0x494c3d['getChildren']())['filter'](_0x44fa22=>_0x44fa22['is']('element','table'));let _0x50b3cf=0x0;return _0x5ba899['forEach'](_0x274a6b=>{_0x50b3cf+=_0x417116['getRows'](_0x274a6b);}),_0x50b3cf;}['_createEmptyTableRows'](_0x51328b,_0x6c0282){const _0xaa252d=this['editor']['plugins']['get']('TableUtils'),_0x58e402=_0xaa252d['getRowIndexes'](_0x51328b),_0x7a4459=_0xaa252d['getColumnIndexes'](_0x51328b),_0x28c35e=_0x58e402['last']+0x1,_0x588bcf=_0x7a4459['first'],_0x164084=_0x51328b[0x0]['findAncestor']('table');for(let _0x273e64=0x0;_0x273e64<_0x6c0282;_0x273e64++)_0xaa252d['insertRows'](_0x164084,{'at':_0x28c35e});return _0x164084['getChild'](_0x28c35e)['getChild'](_0x588bcf);}['_resetContentOfSelectedTableCells'](_0x48dd0d,_0x42c5cb){const {plugins:_0x5ed495}=this['editor'],{model:_0x464782}=_0x48dd0d;if(!_0x5ed495['has']('TableUtils'))return;_0x5ed495['get']('TableUtils')['getSelectedTableCells'](_0x42c5cb)['length']&&_0x464782['deleteContent'](_0x42c5cb);}}class K extends _0x421ea3{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0xec7a4c('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x576b38){super(_0x576b38),this['name']='AIRequestError';}}function Wn(_0x4d0a56,_0x4df434,_0x4b128d){const t=_0x4d0a56['t'];switch(_0x4df434){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',_0x4b128d);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4b128d);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'},_0x4b128d);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_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x4df434;}}class E extends Lt{['_commandDefinitions'];constructor(_0x51507c,_0x30fe91){super(_0x51507c),this['_commandDefinitions']=_0x30fe91,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x235c92,_0x2e4783,_0x11daed)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x11daed));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x14eb07,_0x957ee8,_0x171a67)=>{this['enabledCommandsIds']=_0x171a67?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x5c52e6=this['editor']['model'];this['_hasContext']=function(_0x1eaa03){const _0x572866=_0x1eaa03['document']['selection'];return _0x572866['isCollapsed']?0x0!==[..._0x572866['getSelectedBlocks']()]['length']&&![..._0x572866['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x1eaa03['hasContent'](_0x572866['getFirstRange']());}(_0x5c52e6);const _0x240cc5=_0x5c52e6['document']['selection'],_0x548797=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x432730 of _0x240cc5['getRanges']())for(const _0x18855a of _0x432730['getItems']())if(_0x18855a['is']('element')&&_0x548797['includes'](_0x18855a['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x38b9bd='',_0x4b5cba='',_0x55887e='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x38b9bd,_0x4b5cba,_0x55887e);}}function ns(_0x48b6fe,_0x1cc4cc){const _0x559b7b=new Set();for(const _0x2cdabc of _0x48b6fe['values']())(_0x1cc4cc||!0x1===_0x2cdabc['requiresContent'])&&_0x559b7b['add'](_0x2cdabc['id']);return Array['from'](_0x559b7b);}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(_0x330fc4,_0x361222,_0x5dc74c){super(),this['editor']=_0x330fc4,this['textAdapter']=_0x361222,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x5dc74c,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x244430,_0x1b9ef7,_0x5c2346)=>{this['view']['value']=this['_sanitizeHTML'](_0x5c2346);}),this['listenTo'](this['view'],'submitPrompt',(_0x1e26d3,_0x2a68ca)=>{const _0x56ae88=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x2a68ca,_0x56ae88,'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:_0x5b335a,query:_0x4ab12c,htmlContent:_0x1b0a7d,label:_0x3baa71,mainActionLabel:_0x5da7f0}){this['view']['prompt']=_0x3baa71,this['view']['mainAction']=_0x5da7f0,this['initialContext']=_0x1b0a7d,_0x4ab12c&&(this['view']['isRendered']?this['_handleQuery'](_0x4ab12c,_0x1b0a7d,_0x5b335a,_0x3baa71):this['view']['once']('render',()=>{this['_handleQuery'](_0x4ab12c,_0x1b0a7d,_0x5b335a,_0x3baa71);}));}['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'](_0x5903,_0x213d0c,_0x458821,_0x1d5c9d){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x213d0c,this['previousQuery']=_0x5903,this['previousLabel']=_0x1d5c9d||_0x5903,this['previousActionId']=_0x458821,new Promise(_0x505cfa=>{this['textAdapter']['makeRequest']({'query':_0x5903,'context':_0x213d0c,'onData':_0xc4b1e6=>{this['currentResponse']=_0xc4b1e6,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x458821})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x34ba36=>{_0x34ba36 instanceof er?this['view']['handleError'](_0x34ba36['message']):this['view']['handleError'](),_0x505cfa();})['finally'](()=>{this['stopProcessing'](),_0x505cfa();});});}['_parseAndNormalizeContent'](_0x4b2a47,_0x23df11=!0x1){const _0x829297=hs['exec'](_0x4b2a47);_0x4b2a47=_0x829297?_0x4b2a47['substring'](_0x829297[0x1]['length']):_0x4b2a47['length']<0x64&&!_0x23df11?'':this['_stripMarkdownSyntax'](_0x4b2a47);const _0x2b8db8=this['_domParser']['parseFromString'](_0x4b2a47,'text/html');if(_0x829297){const _0x16b2c1=Array['from'](_0x2b8db8['body']['childNodes']);_0x16b2c1['reverse']();for(const _0xaa851d of _0x16b2c1){if(_0xaa851d['nodeType']==Node['ELEMENT_NODE'])break;_0xaa851d['remove']();}}const _0x2fca72=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2b8db8['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x2fca72);const _0x55aa8c=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x5d25cc=this['editor']['data']['toModel'](_0x2fca72);return _0x55aa8c||_0x5d25cc['markers']['clear'](),this['editor']['data']['stringify'](_0x5d25cc);}['_normalizeResponseHeadings'](_0x46b743){const _0xae96ef=new _0xf69bec(this['editor']['editing']['view']['document']),_0x1dfef=new _0x5ac785({'name':/^h[1-5]$/}),_0x3be8b4=[];let _0x578641=!0x1;for(const _0x5ccb7b of _0x46b743)_0x5ccb7b['is']('element')&&_0x1dfef['match'](_0x5ccb7b)&&(_0x3be8b4['push'](_0x5ccb7b),'h1'==_0x5ccb7b['name']&&(_0x578641=!0x0));if(_0x578641){for(const _0x219476 of _0x3be8b4)_0xae96ef['rename']('h'+(parseInt(_0x219476['name'][0x1])+0x1),_0x219476);}}['_isH1TagSupportEnabled'](){const {data:_0x3fddba,editing:_0x72b2e7}=this['editor'],_0x328515=_0x3fddba['htmlProcessor']['toView']('<h1></h1>'),_0x11fa02=_0x3fddba['toView'](_0x3fddba['toModel'](_0x328515));return!!_0x72b2e7['view']['domConverter']['viewToDom'](_0x11fa02)['querySelector']('h1');}['_sanitizeHTML'](_0x1b2f6f){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x1b2f6f),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0xfb6aa2){const _0x1c38cc=_0xfb6aa2['trim']();return _0x1c38cc['startsWith']('```html')?_0x1c38cc['endsWith']('```')?_0x1c38cc['substring'](0x7,_0x1c38cc['length']-0x3):_0x1c38cc['substring'](0x7):_0xfb6aa2;}}const _={'REPLACE':'replace','INSERT':'insert'};class Pr extends _0xcb5503{constructor(_0x17292a){super(_0x17292a),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xd23f01=>Wn(_0x17292a,'AI_'+_0xd23f01['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Wn(_0x17292a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Wn(_0x17292a,'Try\x20again')),this['stopButton']=this['_createButton'](Wn(_0x17292a,'Stop'));const _0x3e9545=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3e9545['if']('isVisible','ck-hidden',_0x49dea3=>!_0x49dea3)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x4f6121,_0x532bbe){const _0xaa9435=new _0x129639(this['locale']);return _0xaa9435['set']({'label':_0x4f6121,'class':_0x532bbe||'','isVisible':!0x0,'withText':!0x0}),_0xaa9435;}}class Vr extends _0x52fd2c{['contentFieldView'];['copyButtonView'];constructor(_0x41f8c8,_0x1f0b5e=''){super(_0x41f8c8),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x13def3=this['bindTemplate'];this['contentFieldView']=new Yn(_0x41f8c8,_0x1f0b5e),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x13def3['if']('isVisible','ck-hidden',_0x3a91e6=>!_0x3a91e6)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x13def3['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 _0x382b91=!0x1;this['on']('change:value',(_0x16113d,_0x38c876,_0x10ed4a)=>{const _0x21b575=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x10ed4a),this['isProcessing']&&_0x21b575&&!_0x382b91&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x27876d,_0x22764a,_0x1db852)=>{_0x382b91=!0x1,_0x1db852?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x382b91=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x382b91=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1e972d=this['locale'],_0xc98b4b=new _0x129639(this['locale']),_0x4f1e2e='ck-ai-form__copy-button';return _0xc98b4b['set']({'label':Wn(_0x1e972d,'Copy'),'icon':_0x23e442,'class':_0x4f1e2e,'tooltip':!0x0}),_0xc98b4b['bind']('isVisible')['to'](this,'value',_0x2e3f5c=>!!_0x2e3f5c),_0xc98b4b['bind']('isEnabled')['to'](this,'isProcessing',_0x5ef7ef=>!_0x5ef7ef),_0xc98b4b['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0xc98b4b['icon']=_0x1d6803,_0xc98b4b['class']=_0x4f1e2e+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0xc98b4b['icon']=_0x23e442,_0xc98b4b['class']=_0x4f1e2e;},0x3e8);}),_0xc98b4b;}['_copyHTMLToClipboard'](_0x4d86e3){const {window:_0x2e1128,document:_0x5d4448}=_0xa06698;if(_0x2e1128['ClipboardItem']){const {Blob:_0x21f1fe,ClipboardItem:_0x33ba0f}=_0x2e1128,_0x3ae5b7=[new _0x33ba0f({'text/html':new _0x21f1fe([_0x4d86e3['innerHTML']],{'type':'text/html'}),'text/plain':new _0x21f1fe([_0x4d86e3['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x3ae5b7);}else{const _0x3c1c03=_0x5d4448['createElement']('div');_0x3c1c03['style']['position']='absolute',_0x3c1c03['style']['left']='-9999px',_0x3c1c03['innerHTML']='<span>[</span>'+_0x4d86e3['innerHTML']+'<span>]</span>',_0x5d4448['body']['appendChild'](_0x3c1c03);const _0x3481d9=_0x5d4448['createRange']();_0x3481d9['setStartAfter'](_0x3c1c03['firstElementChild']),_0x3481d9['setEndBefore'](_0x3c1c03['lastElementChild']);const _0x1f5a0f=_0x2e1128['getSelection']();_0x1f5a0f['removeAllRanges'](),_0x1f5a0f['addRange'](_0x3481d9),_0x5d4448['execCommand']('copy'),_0x3c1c03['remove']();}}}class Yn extends _0x52fd2c{constructor(_0x13c006,_0x4d150c=''){super(_0x13c006),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x4d150c,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x56b4f0){this['element']['innerHTML']=_0x56b4f0;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x2315f5=new _0x52fd2c(),_0x3b39e9=this['locale'],_0x44ad16=new _0x12e180();return _0x44ad16['isVisible']=!0x0,_0x2315f5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x44ad16,{'text':Wn(_0x3b39e9,'AI\x20is\x20writing...')}]}),_0x2315f5['render'](),_0x2315f5;}}class Cr extends _0x52fd2c{constructor(_0x3bc36f,_0x77b350=''){super(_0x3bc36f);const _0x14fc9a=new _0x3d6008(),_0x5ca41d=this['bindTemplate'];this['set']('text',_0x77b350),_0x14fc9a['content']=_0x445bb1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x14fc9a,{'text':_0x5ca41d['to']('text')}]});}}class Hr extends _0x2585ad{['submitButtonView'];['showHistoryButtonView'];constructor(_0xca249e,_0x4349a5){super(_0xca249e,_0x4349a5),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',(_0x2f5fff,_0x1566bb)=>{_0x2f5fff['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1566bb());});}['_createSubmitButton'](){const _0x54be1b=new _0x129639(this['locale']),_0x349a0d=this['locale'];return _0x54be1b['set']({'icon':_0x3601db,'label':Wn(_0x349a0d,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x54be1b['on']('execute',()=>{this['submit']();}),_0x54be1b['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x437620,_0x47cbc9)=>!_0x437620&&_0x47cbc9),_0x54be1b;}['_createShowHistoryButton'](){const _0x5560b5=new _0x129639(this['locale']),_0x5b410e=this['resultsView'],_0x488b77=this['locale'];_0x5560b5['set']({'label':Wn(_0x488b77,'History'),'withText':!0x1,'icon':Nt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x5560b5['bind']('isOn')['to'](_0x5b410e,'isVisible'),_0x5560b5['bind']('isEnabled')['to'](this,'isEnabled'),_0x5560b5['on']('execute',()=>{_0x5b410e['isVisible']=!_0x5b410e['isVisible'],_0x5b410e['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x3d0a9c=()=>{_0xa06698['window']['requestAnimationFrame'](()=>{if(_0x15cbc7(this['element'])){const _0x2c43d1=new _0x2d2067(this['queryView']['fieldView']['element']),_0x4b55f5=_0x2c43d1['width'],_0x8bdda6='rtl'===_0x488b77['uiLanguageDirection']?'left':'right';_0x2c43d1['excludeScrollbarsAndBorders'](),_0x5560b5['element']['style'][_0x8bdda6]=_0x4b55f5-_0x2c43d1['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x3d0a9c),this['on']('render',_0x3d0a9c),_0x5560b5;}['submit'](){const _0x49c4c6=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x49c4c6);}['focus'](_0x6f08f3){-0x1===_0x6f08f3?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Br extends _0x53ea61{['historyGroupView'];['clearHistoryButton'];constructor(_0x163ea3){super(_0x163ea3),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x1fbc33(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Wn(_0x163ea3,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4df48d=0x0;for(const _0x344ad3 of this['items'])_0x4df48d+=_0x344ad3['items']['length'];return{'resultsCount':_0x4df48d,'totalItemsCount':_0x4df48d};}['_createClearHistoryButton'](){const _0x38b228=this['locale'],_0x40cd24=new _0x129639(this['locale']);return _0x40cd24['set']({'label':'('+Wn(_0x38b228,'Clear')+')','withText':!0x0}),_0x40cd24['on']('execute',()=>this['fire']('clearHistory')),_0x40cd24;}}class Tr extends _0x27d63c{constructor(_0xa31fa7){super();const _0x3d8a3e=new _0x3e41bf(),_0x4f1250=new _0x129639(this['locale'],_0x3d8a3e);this['children']['add'](_0x4f1250),_0x4f1250['set']({'label':_0xa31fa7['prompt'],'withText':!0x0}),_0x4f1250['on']('execute',()=>{this['fire']('execute',{'value':_0x253ee4(_0xa31fa7['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class qr extends _0x395174{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x3ba8c0,_0x4350b5)=>{const _0x1d5cee=go(_0x4350b5['prompt']);for(const _0x27c283 of this)if(_0x27c283!=_0x4350b5&&go(_0x27c283['prompt'])===_0x1d5cee){this['remove'](_0x27c283);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x24e92f=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x24e92f));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x4cef2e=>_0x4cef2e)));}}function go(_0x3a2c72){return _0x3a2c72['toLowerCase']()['trim']();}class k extends _0x52fd2c{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x33d756,_0x3f313a,_0x1768fb=''){super(_0x33d756),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 qr(),this['errorView']=new Cr(_0x33d756),this['contentArea']=new Vr(_0x33d756,_0x1768fb),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 _0x264c5d(),this['keystrokes']=new _0x299178(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x471d76({'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 _0x1b731e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x3f313a],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x1b731e['if']('isError','ck-hidden',_0x15ce4d=>!_0x15ce4d)]},'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'](_0x10e312=0x1){-0x1===_0x10e312?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 _0x4be0d7=this['locale'],_0x38f8e7=new Hr(_0x4be0d7,{'queryView':{'label':Wn(_0x4be0d7,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0xf21d21,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Wn(_0x4be0d7,'Empty\x20history'),'secondary':Wn(_0x4be0d7,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x38f8e7['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2a45dd,_0xf62d79)=>_0x2a45dd&&!_0xf62d79),this['listenTo'](_0x38f8e7,'submit',(_0x56bbae,_0x3e1cbf)=>{this['prompt']=_0x3e1cbf;const _0x8f7c13=_0x1f62ac(_0x3e1cbf);this['fire']('submitPrompt',_0x8f7c13),_0x3e1cbf['trim']()&&this['_promptHistory']['add']({'prompt':_0x8f7c13},0x0);},{'priority':'high'}),_0x38f8e7;}['_createHistoryView'](){const _0x4279d6=new Br(this['locale']);return _0x4279d6['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Tr),_0x4279d6['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x4279d6;}['_createToolbar'](){const _0x591393=new Pr(this['locale']);return _0x591393['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x37b996,_0x15cbde,_0x255571)=>_0x37b996&&!_0x15cbde&&!!_0x255571),_0x591393['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x591393['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4344a0,_0x5f10a8,_0x43bfdf)=>_0x4344a0&&!_0x5f10a8&&!!_0x43bfdf),_0x591393['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x591393['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x42d32b,_0x2a6ac8)=>_0x42d32b&&!_0x2a6ac8),_0x591393['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x591393['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x591393['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x591393;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3b2852=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Wn(_0x3b2852,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x16eedf){const _0x17b892=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x16eedf||Wn(_0x17b892,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x421ea3{['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[_0x4853ad,a,K,_0x52f20e];}constructor(_0x5ad957){super(_0x5ad957),_0x5ad957['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x5ad957['config']['define']('ai.assistant.contentAreaCssClass',''),_0x5ad957['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x5ad957['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x20ccab}=this;this['_aiAdapter']=_0x20ccab['plugins']['get'](K),this['_dialog']=_0x20ccab['plugins']['get'](_0x52f20e),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0xe43eb4=new E(_0x20ccab,Array['from'](this['_commandDefinitions']['values']()));_0x20ccab['commands']['add']('showAIAssistant',_0xe43eb4),_0x20ccab['ui']['componentFactory']['add']('aiCommands',_0x30f1d2=>{const _0x4f534c=_0x3837b3(_0x30f1d2);return _0x4f534c['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4f534c['buttonView']['set']({'label':Wn(_0x30f1d2,'AI\x20Commands'),'icon':_0x29cf39,'tooltip':!0x0}),_0x4f534c['on']('execute',_0x1b1009=>this['_onExecute'](_0x1b1009['source']['id'])),_0x40128f(_0x4f534c,_0x20ccab['ui']['view']['body'],function(_0x38c5e7){const _0x152948=o(_0x38c5e7['config']['get']('ai.assistant.commands'),_0x38c5e7['locale']),_0x3ea936=B(_0x38c5e7,_0x152948)['filter'](_0x2dfa1c=>_0x2dfa1c['commands']['length']);if(0x1===_0x3ea936['length'])return B(_0x38c5e7,_0x3ea936[0x0]['commands'])['map'](_0x3217fa=>({'id':_0x3217fa['id'],'label':_0x3217fa['label']}));return _0x3ea936['map'](_0x4b38c8=>{const {groupId:_0x58445c,groupLabel:_0xc9e142,commands:_0x81ad26}=_0x4b38c8,_0xe4443=B(_0x38c5e7,_0x81ad26)['map'](_0x37cc42=>({'id':_0x37cc42['id'],'label':_0x37cc42['label']}));return{'id':_0x58445c,'menu':_0xc9e142||_0x58445c,'children':_0xe4443};});}(_0x20ccab),{'ariaLabel':Wn(_0x30f1d2,'AI\x20Commands')}),_0x4f534c['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0xe43eb4['on']('change:enabledCommandsIds',_0x5c1268),_0x4f534c['menuView']['once']('render',_0x5c1268),_0x4f534c;function _0x5c1268(){_0x4f534c['isEnabled']=_0xe43eb4['enabledCommandsIds']['length']>0x0;for(const _0x5313b6 of _0x4f534c['menuView']['buttons'])_0x5313b6['isEnabled']=_0xe43eb4['enabledCommandsIds']['includes'](_0x5313b6['id']);}}),_0x20ccab['ui']['componentFactory']['add']('menuBar:aiCommands',_0x49b65b=>{const _0x3b0ad4=new _0x2e0497(_0x49b65b);_0x3b0ad4['buttonView']['set']({'label':Wn(_0x49b65b,'AI\x20Commands'),'icon':_0x29cf39}),_0x3b0ad4['bind']('isEnabled')['to'](_0xe43eb4,'enabledCommandsIds',_0x38c1e1=>_0x38c1e1['length']>0x0);const _0x5b6d8b=o(_0x20ccab['config']['get']('ai.assistant.commands'),_0x49b65b);return this['_populateMenuBarMenu'](_0xe43eb4,_0x3b0ad4,_0x5b6d8b,_0x2acca3=>this['_onExecute'](_0x2acca3)),_0x3b0ad4;}),_0x20ccab['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1d482a=this['_createAIAssistantUIButton'](_0x129639);return _0x1d482a['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1d482a;}),_0x20ccab['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4b4f63=this['_createAIAssistantUIButton'](_0xa33d94);return _0x4b4f63['set']({'role':'menuitemcheckbox'}),_0x4b4f63;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x22a7fb=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x458a04;for(const _0x3552fb in _0x22a7fb){const _0x449128=_0x3552fb,_0x365c13=_0x22a7fb[_0x449128];if('aiLicenseKeyValid'==_0x365c13||'aiLicenseKeyInvalid'==_0x365c13||'aiLicenseKeyExpired'==_0x365c13||'aiLicenseKeyDomainLimit'==_0x365c13||'aiLicenseKeyNotAllowed'==_0x365c13||'aiLicenseKeyEvaluationLimit'==_0x365c13||'aiLicenseKeyUsageLimit'==_0x365c13){delete _0x22a7fb[_0x449128],_0x458a04=_0x365c13,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x458a04&&_0x22a7fb['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x458a04&&_0x22a7fb['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x458a04&&_0x22a7fb['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x458a04&&_0x22a7fb['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x458a04&&_0x22a7fb['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x458a04&&_0x22a7fb['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0xcf1fd9='',_0x4eec35='',_0x44f3bf='custom'){const _0x3a8227=this['editor'],_0x561ebd=_0x3a8227['editing']['view'],_0x5d797a=_0x3a8227['plugins']['get'](a),_0x5cebef=_0x3a8227['plugins']['get'](_0x4853ad);_0x5d797a['showFakeVisualSelection']();const _0x49150c=new w(),_0x232a20=new ClipboardEvent('copy',{'clipboardData':_0x49150c}),_0x53f902=new _0x576d68(_0x49150c),_0x3164ce=new _0x53f11f(_0x561ebd,_0x232a20,{'dataTransfer':_0x53f902});_0x5cebef['_forceMarkersCopy']('comment',()=>{_0x561ebd['document']['fire']('copy',_0x3164ce);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x3a8227,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x38a9d5=_0x53f902['getData']('text/html');const _0xbcb118=_0x3a8227['model']['document']['selection'],_0x3ec468=Array['from'](_0xbcb118['getRanges']());0x1===_0x3ec468['length']&&_0x3ec468[0x0]['isFlat']&&!_0xbcb118['getSelectedElement']()&&''!==_0x38a9d5['replace'](/&nbsp;/g,'')['trim']()&&(_0x38a9d5='<p>'+_0x38a9d5+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x44f3bf,'query':_0xcf1fd9,'htmlContent':_0x38a9d5,'label':_0x4eec35,'mainActionLabel':_[_0x3a8227['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x14051d,'title':Wn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x57ebef['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5d797a['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x37214a=new Map(),_0x5ed902=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x1c349d of _0x5ed902)for(const _0xa04b1e of _0x1c349d['commands'])_0x37214a['set'](_0xa04b1e['id'],{..._0xa04b1e,'groupId':_0x1c349d['groupId'],'groupLabel':_0x1c349d['groupLabel']||_0x1c349d['groupId']});return _0x37214a;}['_createAIAssistantUIButton'](_0x320f39){const _0x89ce60=this['editor'],_0x54bb53=_0x89ce60['commands']['get']('showAIAssistant'),_0x364777=new _0x320f39(_0x89ce60['locale']);return _0x364777['set']({'label':Wn(_0x89ce60['locale'],'AI\x20Assistant'),'icon':_0x14051d,'isToggleable':!0x0}),_0x364777['bind']('isEnabled')['to'](_0x54bb53),_0x364777['bind']('isOn')['to'](this['_dialog'],'id',_0x12a993=>'aiAssistant'===_0x12a993),this['listenTo'](_0x364777,'execute',()=>{_0x364777['isOn']?this['hideUI']():_0x54bb53['execute']();}),_0x364777;}['_initView'](){const _0x386799=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',()=>{_0x386799['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x386799['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x470d24,ui:{ariaLiveAnnouncer:_0x3a781b}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x3b91c4,_0x1fb029,_0x4aa0f6)=>{const _0x5e7cf1=this['_aiAssistantController']['currentContext'];_0x4aa0f6?_0x3a781b['announce'](Wn(_0x470d24,'AI\x20is\x20writing')):_0x5e7cf1&&_0x3a781b['announce'](Wn(_0x470d24,'Generated\x20content:\x20%0',_0x5e7cf1),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x4080fb,_0x4fc6ea,_0x412c52)=>{if(_0x412c52){const _0x4ff95f=this['_formView']['errorView']['text'];_0x3a781b['announce'](Wn(_0x470d24,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4ff95f));}});}['_onExecute'](_0x362663){const _0xffe0b4=this['_commandDefinitions']['get'](_0x362663),_0x1e6927=this['editor'],_0xc00757=_0x1e6927['model']['document']['selection'],_0x5346a9=_0x1e6927['commands']['get']('showAIAssistant'),_0x16da01=_0x1e6927['plugins']['get'](a),_0x52886a=''+(_0xffe0b4['groupId']!==x?_0xffe0b4['groupLabel']+':\x20':'')+_0xffe0b4['label'];if(!0x1!==_0xffe0b4['requiresContent']&&_0xc00757['isCollapsed']){const _0x49c663=_0x314279(_0xc00757['getSelectedBlocks']())||_0x1e6927['model']['schema']['getLimitElement'](_0xc00757);_0x1e6927['model']['change'](_0x5bfa45=>{_0x5bfa45['setSelection'](_0x49c663,'in');});}_0x16da01['showFakeVisualSelection'](),_0x5346a9['execute'](_0xffe0b4['prompt'],_0x52886a,'command:'+_0x362663);}['_populateMenuBarMenu'](_0x38645a,_0x18485f,_0x327456,_0x149ee2){const _0x365091=this['editor'],_0x28a9bd=_0x365091['locale'],_0x2cce2a=new _0x47f1f1(_0x28a9bd),_0x2b38d8=B(_0x365091,_0x327456)['filter'](_0x4fbbbb=>_0x4fbbbb['commands']['length']);0x1===_0x2b38d8['length']?this['_getMenuBarGroupButtons']({'command':_0x38645a,'commands':_0x2b38d8[0x0]['commands'],'parentMenuView':_0x18485f,'onExecute':_0x149ee2})['forEach'](_0x1fcf54=>_0x2cce2a['items']['add'](_0x1fcf54)):_0x2b38d8['forEach'](({groupId:_0x75511d,groupLabel:_0xf45e8c,commands:_0x2747f2})=>{const _0x52b3b2=new _0x311641(_0x28a9bd,_0x18485f),_0x2f834a=new _0x2e0497(_0x28a9bd),_0x64d4c0=new _0x47f1f1(_0x28a9bd),_0x305b9e=this['_getMenuBarGroupButtons']({'command':_0x38645a,'commands':_0x2747f2,'parentMenuView':_0x2f834a,'onExecute':_0x149ee2});_0x2f834a['buttonView']['set']({'label':_0xf45e8c||_0x75511d}),_0x2f834a['delegate']('execute')['to'](_0x18485f),_0x64d4c0['items']['addMany'](_0x305b9e),_0x2f834a['panelView']['children']['add'](_0x64d4c0),_0x52b3b2['children']['add'](_0x2f834a),_0x2cce2a['items']['add'](_0x52b3b2);}),_0x18485f['panelView']['children']['add'](_0x2cce2a);}['_getMenuBarGroupButtons']({command:_0x5e17cc,commands:_0xf24f49,parentMenuView:_0x1fd3d0,onExecute:_0x42c4bc}){const _0x31c459=this['editor'],_0x27cf79=_0x31c459['locale'];return B(_0x31c459,_0xf24f49)['map'](_0x3d98d2=>{const _0x3a0622=new _0x311641(_0x27cf79,_0x1fd3d0),_0x18a307=new _0xa33d94(_0x27cf79);return _0x18a307['set']({'label':_0x3d98d2['label']}),_0x18a307['delegate']('execute')['to'](_0x1fd3d0),_0x18a307['on']('execute',()=>_0x42c4bc(_0x3d98d2['id'])),_0x18a307['bind']('isEnabled')['to'](_0x5e17cc,'enabledCommandsIds',_0x55983f=>_0x55983f['includes'](_0x3d98d2['id'])),_0x3a0622['children']['add'](_0x18a307),_0x3a0622;});}}function U(_0x5ddada,_0x3cb4e7){return void 0x0!==_0x5ddada['order']&&void 0x0===_0x3cb4e7['order']?0x1:void 0x0===_0x5ddada['order']&&void 0x0!==_0x3cb4e7['order']?-0x1:void 0x0!==_0x5ddada['order']&&void 0x0!==_0x3cb4e7['order']?_0x5ddada['order']-_0x3cb4e7['order']:0x0;}function B(_0x33a5c4,_0x4e59cc){_0x4e59cc['sort'](U);const _0x376896={},_0x5da4c8=[];for(const _0x2f73da of _0x4e59cc)if(void 0x0!==_0x2f73da['order']){if(_0x2f73da['order']in _0x376896)throw new _0xec7a4c('ai-commands-config-order-collision',_0x33a5c4,{'conflictingDefinitions':[_0x2f73da,_0x376896[_0x2f73da['order']]]});_0x376896[_0x2f73da['order']]=_0x2f73da,_0x5da4c8['splice'](_0x2f73da['order'],0x0,_0x2f73da);}else _0x5da4c8['push'](_0x2f73da);return _0x5da4c8;}class $n extends _0x421ea3{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2ac434){super(_0x2ac434);const _0x2ce7ce=_0x2ac434['config'],_0x2dfc26=_0x2ac434['locale'];_0x2ce7ce['define']('ai.assistant.preserveComments',!0x0),_0x2ce7ce['define']('ai.assistant.commands',qn(_0x2dfc26)),_0x2ce7ce['define']('ai.assistant.extraCommandGroups',[]),_0x2ce7ce['define']('ai.assistant.removeCommands',[]);let _0x70ff9e=o(_0x2ce7ce['get']('ai.assistant.commands'),_0x2dfc26);const _0x1aeb58=_0x2ce7ce['get']('ai.assistant.extraCommandGroups'),_0x5190a5=_0x2ce7ce['get']('ai.assistant.removeCommands');_0x1aeb58['forEach'](_0x16f8e2=>{const _0x4171cf=_0x70ff9e['find'](_0x1930da=>_0x1930da['groupId']===_0x16f8e2['groupId']);_0x4171cf?_0x4171cf['commands']=_0x4171cf['commands']['concat'](_0x16f8e2['commands']):_0x70ff9e['push'](_0x16f8e2);}),_0x70ff9e=_0x70ff9e['filter'](_0x4c6ee9=>!_0x5190a5['includes'](_0x4c6ee9['groupId'])),_0x70ff9e['forEach'](_0x462092=>{_0x462092['commands']=_0x462092['commands']['filter'](_0x454942=>!_0x5190a5['includes'](_0x454942['id']));}),_0x2ce7ce['set']('ai.assistant.commands',_0x70ff9e);}}function qn(_0x1fa241){return[{'groupId':'editOrReview','groupLabel':Wn(_0x1fa241,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Wn(_0x1fa241,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Wn(_0x1fa241,'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':Wn(_0x1fa241,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Wn(_0x1fa241,'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':Wn(_0x1fa241,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Wn(_0x1fa241,'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':Wn(_0x1fa241,'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':Wn(_0x1fa241,'Change\x20tone'),'commands':[{'id':'professional','label':Wn(_0x1fa241,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Wn(_0x1fa241,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Wn(_0x1fa241,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Wn(_0x1fa241,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Wn(_0x1fa241,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Wn(_0x1fa241,'Change\x20style'),'commands':[{'id':'business','label':Wn(_0x1fa241,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Wn(_0x1fa241,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Wn(_0x1fa241,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Wn(_0x1fa241,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Wn(_0x1fa241,'Translate'),'commands':[{'id':'translateEnglish','label':Wn(_0x1fa241,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Wn(_0x1fa241,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Wn(_0x1fa241,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Wn(_0x1fa241,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Wn(_0x1fa241,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Wn(_0x1fa241,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Wn(_0x1fa241,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Wn(_0x1fa241,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ar extends _0x421ea3{['abortController'];static get['requires'](){return[K];}constructor(_0x3d8d52){super(_0x3d8d52),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x207b56){return this['sendRequest'](_0x207b56)['catch'](_0x2605e2=>{if(_0x2605e2 instanceof er)return Promise['reject'](_0x2605e2);if('AbortError'==_0x2605e2['name'])return Promise['resolve']();throw console['error'](_0x2605e2),new _0xec7a4c('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x270ff2,_0x20619b){const _0x52d568=this['editor']['locale'],_0x5bda53={'Content-Type':'application/json'};if('object'==typeof _0x270ff2)Object['assign'](_0x5bda53,_0x270ff2);else{if(_0x270ff2)try{const _0x498d21=await _0x270ff2(_0x20619b);Object['assign'](_0x5bda53,_0x498d21);}catch{return Promise['reject'](new er(Wn(_0x52d568,'AI_ERROR_GET_HEADERS')));}}return _0x5bda53;}async['_prepareRequestParameters'](_0x495e13,_0x316325){const _0xb42a71=this['editor']['locale'];if('object'==typeof _0x495e13)return _0x495e13;try{return await _0x495e13(_0x316325);}catch{return Promise['reject'](new er(Wn(_0xb42a71,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends ar{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x1f35f7){super(_0x1f35f7),_0x1f35f7['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x1f35f7['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x1f35f7['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x1f35f7['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x1f35f7['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x1f35f7['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x49e96c,context:_0x435831,onData:_0x9cc7e1,actionId:_0xbc497f}){const _0x2458d0=this['editor']['locale'],_0x25b983=await this['prepareMessages'](_0x49e96c,_0x435831,_0xbc497f),_0x597c84=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xbc497f),_0x5e60cc=await this['_prepareRequestParameters'](this['_requestParameters'],_0xbc497f),_0x3c34c1={'messages':_0x25b983,..._0x5e60cc},_0x3d021c={'method':'POST','headers':_0x597c84,'body':JSON['stringify'](_0x3c34c1),'signal':this['abortController']['signal']},_0x5cba74=await fetch(this['_apiUrl'],_0x3d021c);if(_0x5cba74['ok'])return _0x5e60cc['stream']?await this['_readStreamableResponse'](_0x5cba74,_0x9cc7e1):await this['_readStaticResponse'](_0x5cba74,_0x9cc7e1),Promise['resolve']();{const _0x4c262f=await _0x5cba74['text']();return _0x4c262f['includes']('context_length_exceeded')?Promise['reject'](new er(Wn(_0x2458d0,'AI_ERROR_CONTEXT_LENGTH'))):_0x4c262f['includes']('Moderation')?Promise['reject'](new er(Wn(_0x2458d0,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x4c262f));}}async['prepareMessages'](_0x31cf9c,_0x39fd46,_0x4c144d){let _0x207a03,_0xe11d29;return _0x39fd46?(_0x207a03='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.',_0xe11d29='Instruction:\x0a'+_0x31cf9c+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x39fd46):(_0x207a03='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.',_0xe11d29=_0x31cf9c),[{'role':'system','content':_0x207a03},{'role':'user','content':_0xe11d29}];}async['_readStreamableResponse'](_0x11909b,_0x53e55f){const _0x1c0ed5=_0x11909b['body']['getReader'](),_0x493dbd=new TextDecoder();let _0x26b876='',_0x2ca811='',_0x4fd315='',_0x57aa6b=!0x1;for(;!_0x57aa6b;){const {done:_0x30d3b6,value:_0x205294}=await _0x1c0ed5['read'](),_0x51a70a=_0x26b876+_0x493dbd['decode'](_0x205294);let _0x3be451='';_0x57aa6b=_0x30d3b6;try{_0x3be451=this['_cleanUpData'](_0x51a70a),_0x26b876='';}catch{_0x26b876=_0x51a70a;continue;}_0x2ca811+=_0x3be451,!_0x57aa6b&&this['_isBufferIncomplete'](_0x2ca811)||_0x2ca811&&(_0x4fd315+=_0x2ca811,_0x2ca811='',_0x53e55f(_0x4fd315));}return Promise['resolve']();}async['_readStaticResponse'](_0x529511,_0x26bd0b){return _0x26bd0b((await _0x529511['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x10fe69){const _0xe474be=_0x10fe69['split']('<')['length']!==_0x10fe69['split']('>')['length'],_0x4789d3=_0x10fe69['length']<0x1e;return _0xe474be&&_0x4789d3;}['_cleanUpData'](_0x3261df){return _0x3261df['split'](/\n(?![^{]*\})/g)['map'](_0x51bcab=>_0x51bcab['replace']('data:\x20',''))['filter'](_0x298e51=>_0x298e51&&_0x298e51['length']>0x0&&'[DONE]'!==_0x298e51)['map'](_0x6890a7=>{const {choices:_0x331171}=JSON['parse'](_0x6890a7);if(_0x331171[0x0]?.['delta']?.['content'])return _0x331171[0x0]['delta']['content'];})['filter'](_0xe7f676=>_0xe7f676)['join']('');}}class Xn extends ar{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),_0x56fb9a('ai-aws-adapter-not-supported');}async['sendRequest'](_0x47275b){throw _0x4f2fe2('ai-aws-adapter-not-supported'),new er(Wn(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ia extends _0x129639{constructor(_0x4a177f,_0x28b8eb={}){super(_0x4a177f),this['isToggleable']=!0x0,this['set']('side',_0x28b8eb['side']||'top');const _0x1c3e45=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x38c9c4(_0x28b8eb['class']||[]),_0x1c3e45['to']('side',_0x38ada8=>'ck-tab-button_'+_0x38ada8),_0x1c3e45['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x52fd2c{['children'];constructor(_0x5be02e,_0x22af2e={}){super(_0x5be02e);const _0x2efde3=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x38c9c4(_0x22af2e['class']||[]),_0x2efde3['to']('class'),_0x2efde3['if']('isVisible','ck-hidden',_0x637657=>!_0x637657)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x52fd2c{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x17984d,_0x5337f8={}){super(_0x17984d),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x5337f8['side']||'top'),this['set']('isMaximized',!0x1);const _0x100726=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x38c9c4(_0x5337f8['class']||[]),_0x100726['to']('side',_0x8e2340=>'ck-tabs_'+_0x8e2340),_0x100726['to']('class'),_0x100726['to']('isMaximized',_0x2f6797=>_0x2f6797?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x100726['to']('side',_0x4f4256=>'ck-tabs__buttons-container_'+_0x4f4256)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x100726['to']('side',_0x365d26=>'ck-tabs__panels-container_'+_0x365d26)]},'children':this['panelViews']},..._0x38c9c4(_0x5337f8['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0xa58792){const _0x3ec28e=this['_tabs']['get'](_0xa58792);return _0x3ec28e||null;}['addTab'](_0x3c19eb){const _0x215719=this['_setupButton']({'id':_0x3c19eb['id'],'label':_0x3c19eb['buttonLabel'],'icon':_0x3c19eb['buttonIcon'],'order':_0x3c19eb['order']}),_0xc9afcb=new ea(this['locale']);return _0xc9afcb['render'](),_0x3c19eb['content']&&_0xc9afcb['children']['add'](_0x3c19eb['content']),this['panelViews']['add'](_0xc9afcb),this['_tabs']['set'](_0x3c19eb['id'],{'button':_0x215719,'panel':_0xc9afcb,'order':void 0x0!==_0x3c19eb['order']?_0x3c19eb['order']:null}),this['fire']('addTab:'+_0x3c19eb['id'],{'id':_0x3c19eb['id'],'button':_0x215719,'panel':_0xc9afcb}),null===this['activeTab']?this['activateTab'](_0x3c19eb['id']):this['_hidePanel'](_0x3c19eb['id']),{'button':_0x215719,'panel':_0xc9afcb};}['activateTab'](_0x236eea){if(null!==_0x236eea&&!this['getTab'](_0x236eea))throw new _0xec7a4c('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x236eea});this['activeTab']!==_0x236eea&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x236eea,_0x236eea&&this['_showPanel'](_0x236eea),this['fire']('activateTab:'+_0x236eea,_0x236eea));}['showTab'](_0x4cd413){if(!this['getTab'](_0x4cd413))throw new _0xec7a4c('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4cd413});this['_showPanel'](_0x4cd413),this['_showButton'](_0x4cd413),this['fire']('show:'+_0x4cd413,_0x4cd413);}['hideTab'](_0x4b7b0b){if(!this['getTab'](_0x4b7b0b))throw new _0xec7a4c('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4b7b0b});const _0x495e94=this['activeTab'];this['_hidePanel'](_0x4b7b0b),this['_hideButton'](_0x4b7b0b);const _0x1d791c=this['getTabIds']();_0x495e94===_0x4b7b0b&&_0x1d791c['length']>0x1&&this['activateTab'](_0x1d791c['find'](_0x1273d4=>_0x1273d4!==_0x4b7b0b)),this['fire']('hide:'+_0x4b7b0b,_0x4b7b0b);}['_getPanel'](_0x3a5187){const _0xf87ab=this['_tabs']['get'](_0x3a5187);return _0xf87ab?_0xf87ab['panel']:null;}['_showPanel'](_0x1a7cbd){null!==this['activeTab']&&this['activeTab']!==_0x1a7cbd||this['_getPanel'](_0x1a7cbd)['show']();}['_hidePanel'](_0x454070){const _0x205d6f=this['_getPanel'](_0x454070);_0x205d6f['isVisible']&&(this['activeTab']===_0x454070&&(this['activeTab']=null),_0x205d6f['hide']());}['_getButton'](_0x3d63c0){const _0x2166db=this['_tabs']['get'](_0x3d63c0);return _0x2166db?_0x2166db['button']:null;}['_showButton'](_0x2fdd6f){this['_getButton'](_0x2fdd6f)['show']();}['_hideButton'](_0x2fed2b){this['_getButton'](_0x2fed2b)['hide']();}['_setupButton'](_0x1ff641){const _0x20d10e=new ia(this['locale'],{'side':this['side']}),_0x2571fc=this['buttonViews'];if(_0x20d10e['set']({'label':_0x1ff641['label'],'icon':_0x1ff641['icon'],'tooltip':!0x0,'withText':!0x0}),_0x20d10e['bind']('isOn')['to'](this,'activeTab',_0x2c2170=>_0x2c2170===_0x1ff641['id']),_0x20d10e['bind']('side')['to'](this,'side'),_0x1ff641['order']){const _0x1ac25b=[...this['_tabs']]['reduce']((_0x5ba1dc,_0x2b2f70)=>{const _0x276d00=_0x2b2f70[0x0],{order:_0x1e6305}=_0x2b2f70[0x1];return!_0x1e6305||_0x1e6305>_0x1ff641['order']?_0x5ba1dc:_0x1e6305>=_0x5ba1dc['order']?{'id':_0x276d00,'order':_0x1e6305}:_0x5ba1dc;},{'id':'','order':0x0}),_0x18925d=_0x2571fc['getIndex'](this['_getButton'](_0x1ac25b['id']));_0x2571fc['add'](_0x20d10e,_0x18925d+0x1);}else _0x2571fc['add'](_0x20d10e);return _0x20d10e['on']('execute',()=>{this['activateTab'](_0x1ff641['id']);}),_0x20d10e;}}const oi=['overlay','sidebar','custom'],hi=['left','right'];class si extends ss{constructor(_0x4d076a,_0x176d3a={}){super(_0x4d076a,_0x176d3a),this['set']('type',_0x176d3a['type']||'sidebar'),this['set']('side',_0x176d3a['side']||'right'),this['set']('isVisible',_0x176d3a['visibleByDefault']??!0x0);const _0x2129b6=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x2129b6['if']('type','ck-ai-tabs__overlay',_0x1e43ab=>'overlay'===_0x1e43ab),_0x2129b6['if']('type','ck-ai-tabs__sidebar',_0x547cb1=>'sidebar'===_0x547cb1),_0x2129b6['if']('isVisible','ck-hidden',_0x23ff4=>!_0x23ff4)]}}),this['buttonViews']['on']('add',(_0xc99613,_0x37bfad)=>{_0x37bfad['set']('withText',!0x1);});}}class it extends _0x42547c{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3cc176){super(_0x3cc176);const _0x150024=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x150024)throw new _0xec7a4c('ai-tabs-configuration-not-found');if(void 0x0!==_0x150024['showResizeButton']&&(this['showResizeButton']=_0x150024['showResizeButton']),'sidebar'!==_0x150024['type']&&'overlay'!==_0x150024['type']||_0x150024['side']&&(this['side']=_0x150024['side']),'sidebar'===_0x150024['type']){if(this['container']=_0x150024['element'],this['set']('type','sidebar'),!this['container'])throw new _0xec7a4c('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x150024['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new si(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x150024['visibleByDefault']||_0x150024['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 _0x5a617c&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0xc279b6){if(_0xc279b6&&this['type']!==_0xc279b6){if(!oi['includes'](_0xc279b6))throw new _0xec7a4c('ai-tabs-unsupported-ui-type');this['type']=_0xc279b6;}}['switchSide'](_0x39e12a){if(_0x39e12a&&this['side']!==_0x39e12a){if(!hi['includes'](_0x39e12a))throw new _0xec7a4c('ai-tabs-unsupported-ui-side');this['side']=_0x39e12a;}}['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 tt extends _0x42547c{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4edb4d){super(_0x4edb4d),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 _0x172014=this['context']['plugins']['get']('CloudServices');if(!_0x172014['token'])throw new _0xec7a4c('ai-missing-token',this);this['_token']=_0x172014['token'];}['startConversation'](_0xf82fa,_0x137f92){const _0x4dc16d=this['_sendApiRequest']('/conversations','POST',{'id':_0xf82fa,'group':_0x137f92});return{'getConversation':async()=>(await _0x4dc16d['request'])['json'](),'abortController':_0x4dc16d['abortController']};}['queryAssistant']({message:_0x4b3a92,conversationId:_0x2c2db2,parts:_0x3c17ce,capabilities:_0x52548a,model:_0x149fa9,attributes:_0x3a228d}){const _0x356c06={'prompt':_0x4b3a92,'content':_0x3c17ce,'model':_0x149fa9,..._0x52548a&&{'capabilities':_0x52548a},..._0x3a228d&&{'attributes':_0x3a228d}},_0x182bb4=this['_sendApiRequest']('/conversations/'+_0x2c2db2+'/messages','POST',_0x356c06);return{'getStream':async()=>{const _0xc8929b=(await _0x182bb4['request'])['body'];return this['_getStreamReader'](_0xc8929b);},'abortController':_0x182bb4['abortController']};}['executeCustomAction']({content:_0x163f24,message:_0x3401df,model:_0x54ef26,outputFormat:_0x267e15}){const _0x23683d={'content':[{'type':'text','content':_0x163f24}],'prompt':_0x3401df,'model':_0x54ef26,'outputFormat':_0x267e15},_0x40563c=this['_sendApiRequest']('/actions/custom/calls','POST',_0x23683d);return{'getStream':async()=>{const _0x5975e0=(await _0x40563c['request'])['body'];return this['_getStreamReader'](_0x5975e0);},'abortController':_0x40563c['abortController']};}['executeAction']({actionName:_0x1ea539,content:_0x3fd1be,args:_0x7c971d}){const _0x384c0b={'content':[{'type':'text','content':_0x3fd1be}],'args':_0x7c971d},_0x1fb3e4=this['_sendApiRequest']('/actions/system/'+_0x1ea539+'/calls','POST',_0x384c0b);return{'getStream':async()=>{const _0x33d43d=(await _0x1fb3e4['request'])['body'];return this['_getStreamReader'](_0x33d43d);},'abortController':_0x1fb3e4['abortController']};}['uploadFile'](_0x10d7c7,_0x4692c5,_0x435a97){const _0x5aa823=new FormData();_0x5aa823['append']('file',_0x4692c5,_0x4692c5['name']),_0x435a97&&_0x5aa823['append']('attributes',JSON['stringify'](_0x435a97));const _0x4b0ecc=this['_sendApiRequest']('/conversations/'+_0x10d7c7+'/files','POST',_0x5aa823);return{'getId':async()=>(await _0x4b0ecc['request'])['json'](),'abortController':_0x4b0ecc['abortController']};}['fetchDocument'](_0x485a8a,_0x5a5032){const _0x2f586f=this['_sendApiRequest']('/conversations/'+_0x485a8a+'/documents/'+_0x5a5032,'GET');return{'getDocument':async()=>(await _0x2f586f['request'])['json'](),'abortController':_0x2f586f['abortController']};}['uploadDocument'](_0x4a7fed,_0x43c280,_0x2bc358){const _0x534d85={'content':_0x43c280};_0x2bc358&&(_0x534d85['attributes']=_0x2bc358);const _0x35c9fc=this['_sendApiRequest']('/conversations/'+_0x4a7fed+'/documents','POST',_0x534d85);return{'getId':async()=>(await _0x35c9fc['request'])['json'](),'abortController':_0x35c9fc['abortController']};}['fetchConversations'](_0x45d449,_0x284da6={}){const _0xefd610=new URLSearchParams();_0xefd610['append']('group',_0x45d449),_0xefd610['append']('excludeEmpty',!0x1!==_0x284da6['excludeEmpty']?'true':'false'),_0xefd610['append']('limit',_0x284da6['limit']?_0x284da6['limit']['toString']():'100'),_0xefd610['append']('sortBy',_0x284da6['sortBy']?_0x284da6['sortBy']:'createdAt'),_0xefd610['append']('order',_0x284da6['order']?_0x284da6['order']:'desc');const _0x3820cd=this['_sendApiRequest']('/conversations?'+_0xefd610['toString'](),'GET');return{'getConversations':async()=>{const _0x537c1d=await _0x3820cd['request'];return(await _0x537c1d['json']())['items'];},'abortController':_0x3820cd['abortController']};}['deleteConversation'](_0x37da38){const _0x482f8b=this['_sendApiRequest']('/conversations/'+_0x37da38,'DELETE');return{'execute':async()=>{await _0x482f8b['request'];},'abortController':_0x482f8b['abortController']};}['updateConversation'](_0x466442,_0x44726d){const _0xb6d748=this['_sendApiRequest']('/conversations/'+_0x466442,'PATCH',_0x44726d);return{'getResult':async()=>(await _0xb6d748['request'],_0x44726d),'abortController':_0xb6d748['abortController']};}['fetchConversation'](_0x3dbf96){const _0x19bfe2=this['_sendApiRequest']('/conversations/'+_0x3dbf96,'GET');return{'getConversation':async()=>(await _0x19bfe2['request'])['json'](),'abortController':_0x19bfe2['abortController']};}['fetchConversationMessages'](_0x4266a2){const _0xab5a3e=this['_sendApiRequest']('/conversations/'+_0x4266a2+'/messages','GET');return{'getMessages':async()=>{const _0x27633a=await _0xab5a3e['request'];return(await _0x27633a['json']())['items'];},'abortController':_0xab5a3e['abortController']};}['uploadUrl'](_0x5df1f4,_0x2946bb,_0x559285){const _0x54b9a2=this['_sendApiRequest']('/conversations/'+_0x5df1f4+'/web-resources','POST',{'url':_0x2946bb,'attributes':_0x559285});return{'getId':async()=>(await _0x54b9a2['request'])['json'](),'abortController':_0x54b9a2['abortController']};}['getModels'](_0x53db63='en'){const _0x2d9931=new URLSearchParams();_0x2d9931['append']('language',_0x53db63);const _0x55277b='/models/1?'+_0x2d9931['toString'](),_0x30fccb=this['_sendApiRequest'](_0x55277b,'GET');return{'list':async()=>await(await _0x30fccb['request'])['json'](),'abortController':_0x30fccb['abortController']};}['deleteFile'](_0x1c820d,_0x413943){const _0x359e87=this['_sendApiRequest']('/conversations/'+_0x1c820d+'/files/'+_0x413943,'DELETE');return{'execute':async()=>{await _0x359e87['request'];},'abortController':_0x359e87['abortController']};}['deleteDocument'](_0x5b8027,_0x16136c){const _0x37353f=this['_sendApiRequest']('/conversations/'+_0x5b8027+'/documents/'+_0x16136c,'DELETE');return{'execute':async()=>{await _0x37353f['request'];},'abortController':_0x37353f['abortController']};}['deleteWebResource'](_0x2b770b,_0x52311a){const _0x32ddd5=this['_sendApiRequest']('/conversations/'+_0x2b770b+'/web-resources/'+_0x52311a,'DELETE');return{'execute':async()=>{await _0x32ddd5['request'];},'abortController':_0x32ddd5['abortController']};}['callSystemReview']({reviewName:_0x592a3f,content:_0x40c917,args:_0x51f37c}){const _0x14721b=this['_sendApiRequest']('/reviews/system/'+_0x592a3f+'/calls','POST',{'content':[{'type':'text','content':_0x40c917}],'args':_0x51f37c});return{'getStream':async()=>{const _0x453026=(await _0x14721b['request'])['body'];return this['_getStreamReader'](_0x453026);},'abortController':_0x14721b['abortController']};}['callCustomReview']({content:_0x1ee055,prompt:_0x18dbac,model:_0x94e0e2}){const _0x1cefd5=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x1ee055}],'prompt':_0x18dbac,'model':_0x94e0e2});return{'getStream':async()=>{const _0x289ecd=(await _0x1cefd5['request'])['body'];return this['_getStreamReader'](_0x289ecd);},'abortController':_0x1cefd5['abortController']};}['upsertAIChatRating'](_0x188ce1,_0x2a8b79,_0x46e9da){const _0x59b7c6=this['_sendApiRequest']('/conversations/'+_0x188ce1+'/messages/'+_0x2a8b79+'/ratings','PUT',{'positiveCount':_0x46e9da['positiveCount'],'totalCount':_0x46e9da['totalCount'],'modificationId':_0x46e9da['modificationId']});return{'execute':async()=>{await _0x59b7c6['request'];},'abortController':_0x59b7c6['abortController']};}['upsertAIActionRating'](_0xf79a7d,_0x4ff4c9,_0x274c48){const _0x1789bc=this['_sendApiRequest']('/actions/system/'+_0xf79a7d+'/calls/'+_0x4ff4c9+'/ratings','PUT',{'positiveCount':_0x274c48['positiveCount'],'totalCount':_0x274c48['totalCount']});return{'execute':async()=>{await _0x1789bc['request'];},'abortController':_0x1789bc['abortController']};}['upsertCustomAIActionRating'](_0x24e5a6,_0x295eb2){const _0x590ba6=this['_sendApiRequest']('/actions/custom/calls/'+_0x24e5a6+'/ratings','PUT',{'positiveCount':_0x295eb2['positiveCount'],'totalCount':_0x295eb2['totalCount']});return{'execute':async()=>{await _0x590ba6['request'];},'abortController':_0x590ba6['abortController']};}['upsertAIReviewRating'](_0x3dbe90,_0x474344,_0x1f653a,_0x22006b){const _0x27a717=this['_sendApiRequest']('/reviews/system/'+_0x3dbe90+'/calls/'+_0x474344+'/ratings','PUT',{'positiveCount':_0x1f653a['positiveCount'],'totalCount':_0x1f653a['totalCount'],'dataId':_0x22006b});return{'execute':async()=>{await _0x27a717['request'];},'abortController':_0x27a717['abortController']};}['upsertCustomAIReviewRating'](_0x1c8e3b,_0x2e08be,_0x2f82ef){const _0x12e731=this['_sendApiRequest']('/reviews/custom/calls/'+_0x1c8e3b+'/ratings','PUT',{'positiveCount':_0x2e08be['positiveCount'],'totalCount':_0x2e08be['totalCount'],'dataId':_0x2f82ef});return{'execute':async()=>{await _0x12e731['request'];},'abortController':_0x12e731['abortController']};}['_sendApiRequest'](_0x3ee757,_0x56cc96,_0x22b756){const _0x1a5c84=new AbortController(),_0x4b34d7=_0x22b756 instanceof FormData,_0x50d88b={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x22b756&&!_0x4b34d7&&(_0x50d88b['Content-Type']='application/json');const _0x38b396={'method':_0x56cc96,'headers':_0x50d88b,'signal':_0x1a5c84['signal']};return _0x22b756&&(_0x38b396['body']=_0x4b34d7?_0x22b756:JSON['stringify'](_0x22b756)),{'request':fetch(''+this['_apiUrl']+_0x3ee757,_0x38b396)['catch'](_0x25e394=>{this['_handleError'](_0x25e394);})['then'](_0x25c4d6=>_0x25c4d6['ok']?_0x25c4d6:_0x25c4d6['json']()['then'](_0x61622a=>{throw{'url':this['_apiUrl'],'path':_0x3ee757,'method':_0x56cc96,'body':_0x22b756,'status':(_0x25c4d6||{})['status'],'statusText':(_0x25c4d6||{})['statusText'],'code':_0x61622a['code'],'message':_0x61622a['message'],'traceId':_0x61622a['traceId']};})),'abortController':_0x1a5c84};}async*['_getStreamReader'](_0xce494d){const _0x5659da=[],_0x49a338=_0xce494d['getReader'](),_0x36fb63=$t({'onError':_0xf01aea=>{this['_handleError'](_0xf01aea);},'onEvent':_0x15c815=>{_0x15c815['data']=JSON['parse'](_0x15c815['data']),_0x5659da['push'](_0x15c815);}});try{let _0x76721b=!0x1;for(;!_0x76721b;){const {done:_0x579fcf,value:_0xd762f6}=await _0x49a338['read']();_0x579fcf&&(_0x76721b=!0x0),_0x36fb63['feed'](this['_decoder']['decode'](_0xd762f6,{'stream':!0x0})),yield*_0x5659da,_0x5659da['length']=0x0;}}catch(_0x183152){this['_handleError'](_0x183152);}finally{_0x49a338['releaseLock'](),_0x36fb63['reset']();}}['_handleError'](_0x3fd958){if(_0x3fd958 instanceof _0xec7a4c)throw _0x3fd958;if(_0x3fd958 instanceof Error&&'AbortError'===_0x3fd958['name'])throw new _0xec7a4c('ai-request-aborted',this,{'originalError':_0x3fd958});throw new _0xec7a4c('ai-request-failed',this,{'originalError':_0x3fd958});}}function i(_0x59f2a4,_0x192483,_0x28e73d){const t=_0x59f2a4['t'];switch(_0x192483){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'},_0x28e73d);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_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});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_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});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\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});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_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\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.'},_0x28e73d);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.'},_0x28e73d);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_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});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.'},_0x28e73d);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_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});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_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x28e73d);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x28e73d);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x28e73d);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.'},_0x28e73d);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.'},_0x28e73d);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.'},_0x28e73d);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.'},_0x28e73d);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'},_0x28e73d);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_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','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_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});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.'},_0x28e73d);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_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_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_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});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'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x192483;}}function Hs(_0x57e642,_0x7dae26){const _0x54be81=new _0x129639(_0x57e642),_0x2c776c=i(_0x57e642,'AI_TABS_LABEL_MINIMIZE'),_0x48471e=i(_0x57e642,'AI_TABS_LABEL_MAXIMIZE');return _0x54be81['set']({'withText':!0x1,'icon':_0x1b806c,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x54be81['bind']('label')['to'](_0x7dae26,'isMaximized',_0x1249c8=>_0x1249c8?_0x2c776c:_0x48471e),_0x54be81['bind']('icon')['to'](_0x7dae26,'isMaximized',_0x1d1cf0=>_0x1d1cf0?_0x385526:_0x1b806c),_0x54be81['bind']('isOn')['to'](_0x7dae26,'isMaximized'),_0x54be81['on']('execute',()=>{_0x7dae26['fire']('resizeTabs');}),_0x54be81;}function Ri(_0x15f11){return _0x4dbd64(_0x15f11);}function pt(_0x12fd89){return _0x182c8b(_0x12fd89);}function It(_0x1b9e67,_0x148abb,_0xab5cb4){const _0x53e5ac=null!==_0x148abb?_0x3c6da3=>_0x3c6da3['attribs'][_0x1b9e67]===_0x148abb:_0x9052b6=>Boolean(_0x9052b6['attribs'][_0x1b9e67]);return gt(_0xe6432e=>_0x203949(_0xe6432e)&&_0x53e5ac(_0xe6432e),_0xab5cb4);}function Wi(_0x194e10,_0x70d584,_0x5a9ff2){const _0x2a03dd=null!==_0x70d584?_0xf44392=>_0xf44392['attribs'][_0x194e10]===_0x70d584:_0x2fc817=>Boolean(_0x2fc817['attribs'][_0x194e10]);return _0x222394(_0x476fc9=>_0x203949(_0x476fc9)&&_0x2a03dd(_0x476fc9),_0x5a9ff2);}function ut(_0x2824b1,_0x179e7a){return _0x2824b1&&_0x203949(_0x2824b1)?_0x2824b1['attribs'][_0x179e7a]:null;}function Qi(_0x312c1d,_0x5c82e2,_0x3dc3d7){_0x203949(_0x312c1d)&&(null===_0x3dc3d7?delete _0x312c1d['attribs'][_0x5c82e2]:_0x312c1d['attribs'][_0x5c82e2]=_0x3dc3d7);}function qi(_0x387e28,_0x3b279a,_0x161ec5){const _0x2be4af=_0x3b279a['cloneNode'](!0x0);'beforebegin'===_0x161ec5?_0x563c61(_0x387e28,_0x2be4af):'afterbegin'===_0x161ec5?_0x3737ce(_0x387e28,_0x2be4af):'beforeend'===_0x161ec5?_0x4a9d0f(_0x387e28,_0x2be4af):'afterend'===_0x161ec5&&_0x5e3b7e(_0x387e28,_0x2be4af);}function Gi(_0x698a14){const _0x5d29e7=[];let _0x32665e=_0x698a14;for(;_0x32665e;)_0x32665e=_0x56d841(_0x32665e),_0x32665e&&_0x5d29e7['push'](_0x32665e);return _0x5d29e7;}function zn(_0x2c0a8f){return _0x2c0a8f['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Zi(_0x8d51a3){let _0x38c2da=0x0;for(;_0x8d51a3['parentNode'];)_0x8d51a3=_0x8d51a3['parentNode'],_0x38c2da++;return _0x38c2da;}function Ns(_0x176a22){const _0x59ed85=[];let _0x289c90=_0x176a22['nextSibling'];for(;_0x289c90;)_0x59ed85['push'](_0x289c90),_0x289c90=_0x289c90['nextSibling'];_0x59ed85['forEach'](_0x156c69=>{_0x59f194(_0x156c69);});}class Ui extends/* #__PURE__ -- @preserve */
25
+ ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x4319a7();}['convertMarkdownToHTML'](_0x57248c){const _0x1ee156=this['_m2html']['parse'](_0x57248c);return this['parseAndNormalizeHTML'](_0x1ee156);}['parseAndNormalizeHTML'](_0xe00d4e){return this['_parseHTML'](_0xe00d4e);}['_parseHTML'](_0x24ab54){const _0x4c6422=Ri('<dummy>'+_0x24ab54['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x4c6422['children']=_0x4c6422['children'][0x0]['children'],_0x4c6422;}}class vi extends/* #__PURE__ -- @preserve */
26
+ ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x59934b){super(),this['_generateUid']=_0x59934b||_0x2ced3c;}['merge'](_0x535ae7,_0x4ae3c0,_0x48c7f3){const _0x38d9d0=_0x535ae7['cloneNode'](!0x0);if(0x0===_0x4ae3c0['childNodes']['length']){const _0x272f1e=[];return Wi('data-id','new-element',_0x38d9d0)['forEach'](_0x2340ac=>{const _0x2f1d8a=this['_generateUid']();Qi(_0x2340ac,'data-id',_0x2f1d8a),_0x272f1e['push'](_0x2f1d8a);}),this['_removeSpecialComments'](_0x38d9d0),{'parsedContent':_0x38d9d0,'newNodeIds':_0x272f1e,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x48c7f3&&_0x48c7f3['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x38d9d0),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Wi('data-id',null,_0x4ae3c0)['map'](_0x13f7df=>ut(_0x13f7df,'data-id'))['filter'](_0x2814dc=>!!_0x2814dc));let _0x1a4d30=-0x1,_0x2fa7b6=!0x1;const _0x349f8b=_0x38d9d0['childNodes'],_0x5b96ec=Array['from'](_0x349f8b)['filter'](_0x44f0de=>!(0x3===_0x44f0de['nodeType']&&''===pt(_0x44f0de)['trim']())),_0x47527a=_0x5b96ec['length'];for(let _0x753f0d=0x0;_0x753f0d<_0x47527a;_0x753f0d++){const _0x125288=_0x5b96ec[_0x753f0d],_0x4dbb45=_0x5b96ec[_0x753f0d+0x1];if(this['_isNewNode'](_0x125288)){if(-0x1===_0x1a4d30&&(_0x1a4d30=_0x753f0d),this['_markWrappedElements'](_0x125288),!this['_isNewNode'](_0x4dbb45)){const [_0x5d07c8,_0x43f785]=this['_findReferenceNode'](_0x125288,_0x2fa7b6,_0x4ae3c0);if(_0x5d07c8){const _0x1c7d32=Array['from'](_0x5b96ec)['slice'](_0x1a4d30,_0x753f0d+0x1);this['_insertNodes'](_0x5d07c8,_0x1c7d32,_0x43f785),_0x1a4d30=-0x1;}}}else{if(this['_isExistingContentComment'](_0x125288))_0x2fa7b6=!0x0;else{if(this['_isExistingNode'](_0x125288)){const _0x2bc151=ut(_0x125288,'data-id');if(_0x2bc151&&this['_existingDataIds']['has'](_0x2bc151)){const _0x19b97d=It('data-id',_0x2bc151,_0x4ae3c0);this['_replaceNode'](_0x19b97d,_0x125288);}if(this['_touchedNodesState']['removedIds']['includes'](_0x2bc151)){const _0x3138f6=this['_touchedNodesState']['removedIds']['indexOf'](_0x2bc151);this['_touchedNodesState']['removedIds']['splice'](_0x3138f6,0x1);}}else{if(this['_isDelNode'](_0x125288)){const _0x418f08=ut(_0x125288,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x418f08)||this['_storeDeletedElementIds'](_0x125288);}}}}}for(const _0x2af756 of this['_touchedNodesState']['removedIds']){const _0x5f020b=It('data-id',_0x2af756,_0x4ae3c0);if(_0x5f020b){if(_0x48c7f3&&_0x48c7f3['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x2af756;const _0x5298ab=_0x48c7f3['replaceRemovedWith']['cloneNode'](!0x0);Qi(_0x5298ab,'data-id',_0x2af756),Qi(_0x5298ab,'data-removed','true'),_0x50696c(_0x5f020b,_0x5298ab);}else _0x59f194(_0x5f020b);}}if(Wi('data-wrapped-id',null,_0x4ae3c0)['forEach'](_0x3687aa=>{const _0x5af770=It('data-id',ut(_0x3687aa,'data-wrapped-id'),_0x4ae3c0);var _0x1efecd,_0x3bf235;_0x5af770&&(_0x3bf235=_0x3687aa,_0x59f194(_0x1efecd=_0x5af770),_0x50696c(_0x3bf235,_0x1efecd));}),Wi('data-id','new-element',_0x4ae3c0)['forEach'](_0xadc9db=>{const _0x438375=this['_getUid'](_0xadc9db);Qi(_0xadc9db,'data-id',_0x438375),this['_touchedNodesState']['newIds']['push'](_0x438375);}),this['_removeSpecialComments'](_0x4ae3c0),_0x48c7f3&&_0x48c7f3['markUnstableElements']&&this['_markUnstableElements'](_0x4ae3c0,_0x48c7f3['markUnstableElementsDepth']||0x0),_0x48c7f3&&_0x48c7f3['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x43e130=It('data-id',this['_touchedNodesState']['lastTouchedId'],_0x4ae3c0);for(;_0x43e130;)Ns(_0x43e130),_0x43e130=_0x43e130['parentNode'];}return{'parsedContent':_0x4ae3c0,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x2694df,_0x4829a8,_0x163281){for(const _0x19bb12 of _0x4829a8){const _0x4bc85d=this['_getUid'](_0x19bb12);Qi(_0x19bb12,'data-id',_0x4bc85d),this['_touchedNodesState']['newIds']['push'](_0x4bc85d),this['_touchedNodesState']['lastTouchedId']=_0x4bc85d;}const _0x36355b='afterbegin'===_0x163281||'afterend'===_0x163281?_0x4829a8['reverse']():_0x4829a8;for(const _0x26f779 of _0x36355b)qi(_0x2694df,_0x26f779,_0x163281);}['_replaceNode'](_0xd7617b,_0x243eba){if(!_0xd7617b)return;if(_0x5f2de=_0x243eba,zn(pt(_0xd7617b))===zn(pt(_0x5f2de)))return;var _0x5f2de;const _0x30c0c1=this['_getUid'](_0xd7617b);Qi(_0x243eba,'data-id',_0x30c0c1),this['_touchedNodesState']['modifiedIds']['push'](_0x30c0c1),this['_touchedNodesState']['lastTouchedId']=_0x30c0c1,_0x50696c(_0xd7617b,_0x243eba['cloneNode'](!0x0));}['_findReferenceNode'](_0x16b910,_0x543986,_0x4aebe9){const _0x2d4e0b=this['_findPrevElementWithDataId'](_0x16b910,!0x1);if(_0x2d4e0b){const _0x512cd5=this['_getNodeDataId'](_0x2d4e0b),_0x222ab0=It('data-id',_0x512cd5,_0x4aebe9);if(_0x222ab0)return[_0x222ab0,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x512cd5);}const _0x46f61b=this['_findNextElementWithDataId'](_0x16b910,!0x1);if(_0x46f61b){const _0x27b4fb=this['_getNodeDataId'](_0x46f61b),_0x8608cd=It('data-id',_0x27b4fb,_0x4aebe9);if(_0x8608cd)return[_0x8608cd,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x27b4fb);}return _0x543986?_0x16b910['nextSibling']?this['_findFallbackReferenceNode'](_0x16b910,_0x4aebe9):[_0x4aebe9['childNodes'][_0x4aebe9['childNodes']['length']-0x1],'afterend']:[_0x4aebe9['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x216217,_0x3d0250){const _0x23f6be=[],_0x382b0f=this['_findPrevElementWithDataId'](_0x216217,!0x0);if(_0x382b0f){const _0x28e5fe=It('data-id',this['_getNodeDataId'](_0x382b0f),_0x3d0250);_0x28e5fe&&_0x23f6be['push']([_0x28e5fe,'afterend']);}const _0x30d1f3=this['_findNextElementWithDataId'](_0x216217,!0x0);if(_0x30d1f3){const _0x20b8b2=It('data-id',this['_getNodeDataId'](_0x30d1f3),_0x3d0250);_0x20b8b2&&_0x23f6be['push']([_0x20b8b2,'beforebegin']);}if(_0x23f6be['length']>0x1)return Zi(_0x23f6be[0x0][0x0])<=Zi(_0x23f6be[0x1][0x0])?_0x23f6be[0x0]:_0x23f6be[0x1];return 0x1===_0x23f6be['length']?_0x23f6be[0x0]:[_0x3d0250['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x32658f,_0x3a000d){let _0x2e2993=_0x32658f['nextSibling'],_0x1c4d39=null,_0x5da006=!0x1;for(;_0x2e2993;){if(_0x20a1c2(_0x2e2993)){if(this['_isDelNode'](_0x2e2993)&&(_0x1c4d39=_0x2e2993),this['_isExistingContentComment'](_0x2e2993)&&_0x3a000d&&!_0x5da006){_0x5da006=!0x0,_0x2e2993=_0x2e2993['nextSibling'];continue;}break;}const _0x19cedc=ut(_0x2e2993,'data-id');if(_0x19cedc&&'new-element'!==_0x19cedc&&this['_existingDataIds']['has'](_0x19cedc)){_0x1c4d39=_0x2e2993;break;}_0x2e2993=_0x2e2993['nextSibling'];}return _0x1c4d39;}['_findPrevElementWithDataId'](_0x43a332,_0x5e31a0){let _0x204fef=_0x43a332['previousSibling'],_0x4f2436=null,_0xbddcda=!0x1;for(;_0x204fef;){if(_0x20a1c2(_0x204fef)){if(this['_isDelNode'](_0x204fef)&&(_0x4f2436=_0x204fef),this['_isExistingContentComment'](_0x204fef)&&_0x5e31a0&&!_0xbddcda){_0xbddcda=!0x0,_0x204fef=_0x204fef['previousSibling'];continue;}break;}const _0x140b31=ut(_0x204fef,'data-id');if(_0x140b31&&'new-element'!==_0x140b31&&this['_existingDataIds']['has'](_0x140b31)){_0x4f2436=_0x204fef;break;}_0x204fef=_0x204fef['previousSibling'];}return _0x4f2436;}['_markWrappedElements'](_0x5a7eac){_0x203949(_0x5a7eac)&&Wi('data-id',null,_0x5a7eac)['forEach'](_0x5a8c35=>{this['_isExistingNode'](_0x5a8c35)&&!this['_hasWrappedParent'](_0x5a8c35)&&(Qi(_0x5a8c35,'data-wrapped-id',ut(_0x5a8c35,'data-id')),Qi(_0x5a8c35,'data-id',null));});}['_getNodeDataId'](_0x37e67f){if(!_0x37e67f)return null;if(_0x203949(_0x37e67f))return ut(_0x37e67f,'data-id');if(_0x20a1c2(_0x37e67f)){const _0x48eb14=pt(_0x37e67f)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x48eb14&&_0x48eb14[0x1])return _0x48eb14[0x1];}return null;}['_storeDeletedElementIds'](_0x265683){if(_0x20a1c2(_0x265683)){const _0x3d13a9=pt(_0x265683)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x3d13a9&&_0x3d13a9[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x3d13a9[0x1]);}}['_getUid'](_0x105f12){return this['_isExistingNode'](_0x105f12)?ut(_0x105f12,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x43b4fd){(function(_0x51be69){return _0x37a7c8(_0x41f7e4=>_0x20a1c2(_0x41f7e4),_0x51be69,!0x0,0x1/0x0);}(_0x43b4fd)['filter'](_0x47138b=>this['_isDelNode'](_0x47138b)||this['_isExistingContentComment'](_0x47138b))['forEach'](_0x3f173d=>{_0x59f194(_0x3f173d);}));}['_markLastTagElementUnstable'](_0x2a8197){const _0x85835c=_0x2a8197['childNodes'],_0x4d0f0d=_0x85835c[_0x85835c['length']-0x1];_0x4d0f0d&&_0x203949(_0x4d0f0d)&&Qi(_0x4d0f0d,'data-unstable','true');}['_markUnstableElements'](_0x528866,_0x5d1c31){const _0x2bf8a5=It('data-unstable','true',_0x528866);if(!_0x2bf8a5)return;const _0x5e59da=Gi(_0x2bf8a5)['slice'](0x0,-0x1),_0x2f3b8f=_0x5e59da['length'];let _0x368074=_0x2bf8a5;if(_0x2f3b8f>_0x5d1c31){let _0x8db24=_0x2f3b8f,_0x4fa886=null;for(;_0x8db24>_0x5d1c31&&_0x8db24>=0x0;)_0x8db24--,_0x4fa886=_0x5e59da[_0x8db24];_0x4fa886&&(_0x368074=_0x4fa886,Qi(_0x2bf8a5,'data-unstable',null),Qi(_0x4fa886,'data-unstable','true'));}else{if(_0x2f3b8f<_0x5d1c31){let _0x5d62c9=_0x2f3b8f,_0x48a1c0=_0x2bf8a5;for(;_0x5d62c9<_0x5d1c31;){const _0x40d69b=_0x48a1c0['childNodes']['filter'](_0x3e13d9=>_0x203949(_0x3e13d9));if(0x0===_0x40d69b['length'])break;_0x5d62c9++,_0x48a1c0=_0x40d69b[_0x40d69b['length']-0x1];}_0x48a1c0&&(_0x368074=_0x48a1c0,Qi(_0x2bf8a5,'data-unstable',null),Qi(_0x48a1c0,'data-unstable','true'));}}let _0x74f9b0=_0x368074;for(;_0x74f9b0;){for(;_0x74f9b0['nextSibling'];)_0x74f9b0=_0x74f9b0['nextSibling'],_0x203949(_0x74f9b0)&&Qi(_0x74f9b0,'data-unstable','true');_0x74f9b0=_0x74f9b0['parentNode'];}}['_isNewNode'](_0x1805d2){return Boolean('new-element'===ut(_0x1805d2,'data-id'));}['_isExistingNode'](_0x39efc2){return Boolean((ut(_0x39efc2,'data-id')||'')['length']>0x0&&'new-element'!==ut(_0x39efc2,'data-id'));}['_isDelNode'](_0xadd9e){return!!_0xadd9e&&Boolean(_0x20a1c2(_0xadd9e)&&pt(_0xadd9e)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x2314f3){let _0x3c257d=_0x2314f3['parentNode'];for(;_0x3c257d;){if(ut(_0x3c257d,'data-wrapped-id'))return!0x0;_0x3c257d=_0x3c257d['parentNode'];}return!0x1;}['_isExistingContentComment'](_0xe5259e){return Boolean(_0x20a1c2(_0xe5259e)&&pt(_0xe5259e)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function wt({editor:_0x23b991,changeGroups:_0x2f0290,documentContextContent:_0x381729,showDiff:_0x37d37f,trimUnchanged:_0x193e62=!0x0}){return _0x2f0290['map'](_0x12a8dd=>{const _0x301d75=new _t([]),_0x303280=new _t([]);for(const _0x1ceb0f of _0x12a8dd['changes'])if(_0x37d37f&&'removed'==_0x1ceb0f['type']||_0x303280['children']['push'](_0x1ceb0f['node']['cloneNode'](!0x0)),'new'!=_0x1ceb0f['type']&&(_0x37d37f||'removed'!=_0x1ceb0f['type'])){const _0x476b86=gt(_0x3d47e8=>ut(_0x3d47e8,'data-id')==_0x1ceb0f['id'],_0x381729,!0x0);_0x476b86&&_0x301d75['children']['push'](_0x476b86['cloneNode'](!0x0));}const {content:_0x5de041,hasChanges:_0x3efd80}=function(_0x16bda6,_0x96fa35,_0x3bd781,_0x4ef1fb,_0x333273=!0x0){const _0x2819db=_0x16bda6['plugins']['get']('DocumentCompare'),_0x38eac7=pt(_0x96fa35),_0x258be5=pt(_0x3bd781),_0x219243=_0x16bda6['data']['parse'](_0x38eac7,'$root'),_0x50c6ca=_0x16bda6['model']['createPositionAt'](_0x219243,0x0),_0x35db3b=_0x2819db['getDiff'](_0x38eac7,_0x258be5,{'anchor':_0x50c6ca,'markDeletions':_0x4ef1fb}),_0x386d54=_0x35db3b['getOperations']();if(0x0==_0x386d54['length'])return{'content':_0x96fa35['cloneNode'](!0x0),'hasChanges':!0x1};_0x4ef1fb?function(_0x518284,_0x41cce6,_0x3056c1){if(0x0==_0x518284['length'])return;const _0x103496=_0x3056c1['plugins']['get']('DocumentCompare'),_0x426e25=_0x3056c1['plugins']['get']('SuggestionsConversion');_0x3056c1['model']['change'](_0x1ba8c1=>{const _0x5ace87=new Set();for(let _0x28f6d0=0x0;_0x28f6d0<_0x518284['length'];_0x28f6d0++){const _0x256a94=_0x518284[_0x28f6d0];if(_0x256a94['baseVersion']=null,_0x256a94['isDocumentOperation']=!0x1,_0x103496['isMarkedRemoveOperation'](_0x256a94)){const _0x3d183b=_0x331f1a(_0x256a94['newRange'],_0x3056c1['model']),_0x50042b='suggestion:deletion:'+_0x2ced3c()+':$aiSuggestion';_0x41cce6['markers']['set'](_0x50042b,_0x3d183b);}else switch(_0x256a94['type']){case'rename':{if(_0x256a94['oldName']==_0x256a94['newName'])break;_0x1ba8c1['batch']['addOperation'](_0x256a94),_0x3056c1['model']['applyOperation'](_0x256a94);const _0x9f8fd='$elementName',_0x2d4ca1=_0x256a94['position'],_0x516d21=_0x3056c1['model']['createRange'](_0x2d4ca1,_0x3056c1['model']['createPositionAt'](_0x2d4ca1['nodeAfter'],'end')),_0x371ea1='suggestion:attribute:'+_0x9f8fd+':'+_0x2ced3c()+':$aiSuggestion';_0x41cce6['markers']['set'](_0x371ea1,_0x516d21);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x256a94['oldValue']==_0x256a94['newValue'])break;_0x1ba8c1['batch']['addOperation'](_0x256a94),_0x3056c1['model']['applyOperation'](_0x256a94);const _0x2a2ba4=_0x256a94['key'];if(!_0x426e25['isRegisteredAttribute'](_0x2a2ba4))break;const _0x313c32=_0x331f1a(_0x256a94['range'],_0x3056c1['model']),_0x5c9c35='suggestion:attribute:'+_0x2a2ba4+':'+_0x2ced3c()+':$aiSuggestion';_0x41cce6['markers']['set'](_0x5c9c35,_0x313c32);break;}case'insert':{_0x1ba8c1['batch']['addOperation'](_0x256a94),_0x3056c1['model']['applyOperation'](_0x256a94);if(_0x518284[_0x28f6d0+0x1]&&'move'==_0x518284[_0x28f6d0+0x1]['type']){no(_0x41cce6,_0x256a94);break;}const _0x24363e=_0x256a94['position'],_0x3fab52=_0x256a94['howMany'],_0xa7dc46=_0x331f1a(_0x3056c1['model']['createRange'](_0x24363e,_0x24363e['getShiftedBy'](_0x3fab52)),_0x3056c1['model']),_0x128acf='suggestion:insertion:'+_0x2ced3c()+':$aiSuggestion';_0x41cce6['markers']['set'](_0x128acf,_0xa7dc46);break;}case'split':{_0x1ba8c1['batch']['addOperation'](_0x256a94),_0x3056c1['model']['applyOperation'](_0x256a94);const _0x24bddd=_0x256a94['splitPosition'],_0x5b42a4=_0x256a94['moveTargetPosition'],_0x238830=_0x3056c1['model']['createRange'](_0x24bddd,_0x5b42a4),_0x5cca02='suggestion:insertion:'+_0x2ced3c()+':$aiSuggestion';_0x41cce6['markers']['set'](_0x5cca02,_0x238830);break;}case'move':{_0x1ba8c1['batch']['addOperation'](_0x256a94),_0x3056c1['model']['applyOperation'](_0x256a94),_0x518284[_0x28f6d0-0x1]&&'insert'==_0x518284[_0x28f6d0-0x1]['type']&&no(_0x41cce6,_0x256a94);const _0x8e1820=_0x256a94['getMovedRangeStart'](),_0xe39a0f=_0x256a94['howMany'];for(let _0x24fb86=0x0;_0x24fb86<_0xe39a0f;_0x24fb86++){const _0x239bd7=_0x8e1820['getShiftedBy'](_0x24fb86)['nodeAfter'];_0x5ace87['add'](_0x239bd7);}break;}case'remove':{const _0x1957c=_0x256a94['sourcePosition'],_0x4c2f6b=_0x256a94['howMany'],_0xb6ee02=new lt(_0x1957c,_0x4c2f6b);_0x1ba8c1['batch']['addOperation'](_0xb6ee02),_0x3056c1['model']['applyOperation'](_0xb6ee02);break;}}}for(const _0x104eca of _0x5ace87){const _0x183b33=_0x3056c1['model']['createRangeOn'](_0x104eca),_0x17613f='suggestion:formatBlock:$fakeWrap:'+_0x2ced3c()+':$aiSuggestion';_0x41cce6['markers']['set'](_0x17613f,_0x331f1a(_0x183b33,_0x3056c1['model']));}});}(_0x386d54,_0x219243,_0x16bda6):_0x16bda6['model']['change'](_0x2f35bd=>{for(const _0x11f695 of _0x386d54)if('remove'==_0x11f695['type']){const _0x2083a4=_0x11f695['sourcePosition'],_0x39d08a=_0x11f695['howMany'],_0x2bb990=new lt(_0x2083a4,_0x39d08a);_0x2f35bd['batch']['addOperation'](_0x2bb990),_0x16bda6['model']['applyOperation'](_0x2bb990);}else{if('marker'==_0x11f695['type']){const _0x2ec0a0=_0x11f695['name'],_0x583637=_0x11f695['newRange'];null!==_0x583637?_0x219243['markers']['set'](_0x2ec0a0,_0x583637):_0x219243['markers']['delete'](_0x2ec0a0);}else _0x11f695['baseVersion']=null,_0x11f695['isDocumentOperation']=!0x1,_0x2f35bd['batch']['addOperation'](_0x11f695),_0x16bda6['model']['applyOperation'](_0x11f695);}});if(_0x333273){const _0x562672=ct(_0x16bda6,_0x386d54,_0x219243);ht(_0x16bda6['model'],_0x562672),function(_0x25c6d8,_0x8cbe09){const _0x499a9c=_0x8cbe09['getFirstRange']()['start'];let _0xb4cbf=_0x8cbe09['getFirstRange']()['end'];const _0x5ddf58=_0x499a9c['root'];(_0xb4cbf['textNode']||_0xb4cbf['nodeAfter']&&_0xb4cbf['nodeAfter']['is']('$text'))&&(_0x204d60(_0xb4cbf,'...'),_0xb4cbf=_0xb4cbf['getShiftedBy'](0x3)),(_0x499a9c['textNode']||_0x499a9c['nodeBefore']&&_0x499a9c['nodeBefore']['is']('$text'))&&(_0x204d60(_0x499a9c,'...'),function(_0x1f3967,_0x1eb221,_0x1bb314){for(let [_0x3958d8,_0x3fa646]of _0x1f3967['markers']){const _0x26e02c=_0x3fa646['_getTransformedByInsertion'](_0x1eb221,_0x1bb314,!0x1);_0x3fa646=_0x26e02c[0x0],_0x1f3967['markers']['set'](_0x3958d8,_0x3fa646);}}(_0x5ddf58,_0x499a9c,0x3),_0x499a9c['parent']==_0xb4cbf['parent']&&(_0xb4cbf=_0xb4cbf['getShiftedBy'](0x3)));const _0x44b209=_0x25c6d8['createRange'](_0x25c6d8['createPositionAt'](_0x5ddf58,0x0),_0x499a9c),_0x22cc28=_0x25c6d8['createRange'](_0xb4cbf,_0x25c6d8['createPositionAt'](_0x5ddf58,'end')),_0x3f027f=[..._0x44b209['getMinimalFlatRanges'](),..._0x22cc28['getMinimalFlatRanges']()];_0x3f027f['reverse']();for(const _0x42d6f8 of _0x3f027f)to(_0x42d6f8),Jn(_0x5ddf58,_0x42d6f8);}(_0x16bda6['model'],_0x562672);}const _0x9c6616=_0x16bda6['data']['stringify'](_0x219243,{'showSuggestionHighlights':!0x0});return{'content':Ri(_0x9c6616),'hasChanges':!0x0};}(_0x23b991,_0x301d75,_0x303280,_0x37d37f,_0x193e62);return{'type':_0x12a8dd['changes'][0x0]['type'],'index':_0x12a8dd['index'],'content':_0x5de041,'hasChanges':_0x3efd80};});}function no(_0x436e5f,_0x2ca5f3){for(const [_0x59b60a,_0x32d059]of _0x436e5f['markers']){const _0x1c2965=dt['_createFromRanges'](_0x32d059['getTransformedByOperation'](_0x2ca5f3));_0x436e5f['markers']['set'](_0x59b60a,_0x1c2965);}}function ct(_0x48eff0,_0x45a7fd,_0x4a975f){const _0x13a74b=_0x48eff0['plugins']['get']('DocumentCompare');let _0x19655e=_0x48eff0['model']['createPositionAt'](_0x4a975f,Number['POSITIVE_INFINITY']),_0x302403=_0x48eff0['model']['createPositionAt'](_0x4a975f,0x0);for(const _0x4e1dac of _0x45a7fd){let _0x54fd9e,_0x42313c;if(_0x13a74b['isMarkedRemoveOperation'](_0x4e1dac))_0x54fd9e=_0x4e1dac['newRange']['start'],_0x42313c=_0x4e1dac['newRange']['end'];else switch(_0x19655e=_0x19655e['getTransformedByOperation'](_0x4e1dac),_0x302403=_0x302403['getTransformedByOperation'](_0x4e1dac),_0x4e1dac['type']){case'rename':_0x54fd9e=_0x4e1dac['position'],_0x42313c=_0x54fd9e['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x54fd9e=_0x4e1dac['range']['start'],_0x42313c=_0x4e1dac['range']['end'];break;case'insert':_0x54fd9e=_0x4e1dac['position'],_0x42313c=_0x54fd9e['getShiftedBy'](_0x4e1dac['howMany']);break;case'split':_0x54fd9e=_0x4e1dac['splitPosition'],_0x42313c=_0x4e1dac['moveTargetPosition'];break;case'merge':{const _0x32d1b3=_0x4e1dac['targetPosition']['path']['slice'](0x0,-0x1);_0x54fd9e=_0x48eff0['model']['createPositionFromPath'](_0x4a975f,_0x32d1b3),_0x42313c=_0x54fd9e['getShiftedBy'](0x1);break;}case'remove':{const _0x1fe2f6=_0x4e1dac['howMany'],_0x39ea06=_0x4e1dac['sourcePosition']['_getTransformedByInsertion'](_0x4e1dac['targetPosition'],_0x1fe2f6),_0x277499=_0x4e1dac['getMovedRangeStart']();'remove'==_0x4e1dac['type']?(_0x54fd9e=_0x39ea06,_0x42313c=_0x39ea06):(_0x54fd9e=_0x277499,_0x42313c=_0x277499['getShiftedBy'](_0x1fe2f6));break;}}_0x54fd9e&&_0x54fd9e['isBefore'](_0x19655e)&&(_0x19655e=_0x54fd9e['clone'](),_0x19655e['stickiness']='toNone'),_0x42313c&&_0x42313c['isAfter'](_0x302403)&&(_0x302403=_0x42313c['clone'](),_0x302403['stickiness']='toNone');}return _0x48eff0['model']['createSelection'](_0x48eff0['model']['createRange'](_0x19655e,_0x302403));}function ht(_0x2d1819,_0x32b3f4){ro(_0x2d1819,_0x32b3f4,'forward');const _0xc7bd5=_0x32b3f4['getFirstRange']();_0x32b3f4['setTo']([]),_0x32b3f4['setTo'](_0xc7bd5,{'backward':!0x0}),ro(_0x2d1819,_0x32b3f4,'backward');}function ro(_0x22b3ea,_0x17a111,_0x56b66b){let _0x1cb7b9=0x14;for(;_0x1cb7b9;){_0x22b3ea['modifySelection'](_0x17a111,{'unit':'word','direction':_0x56b66b}),_0x1cb7b9--;const _0xadc1a8=_0x17a111['focus']['forward'==_0x56b66b?'nodeBefore':'nodeAfter'];if(_0xadc1a8&&_0xadc1a8['is']('element')&&_0x22b3ea['schema']['isBlock'](_0xadc1a8)&&_0x22b3ea['schema']['isObject'](_0xadc1a8))break;}}function Jn(_0x185819,_0x16f3f1){for(const [_0x5ca8ab,_0x520d76]of _0x185819['markers']){const _0x117d05=_0x520d76['_getTransformedByDeletion'](_0x16f3f1['start'],_0x16f3f1['end']['offset']-_0x16f3f1['start']['offset']);null!=_0x117d05?_0x185819['markers']['set'](_0x5ca8ab,_0x117d05):_0x185819['markers']['delete'](_0x5ca8ab);}}class di extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _t([]);['parsedMergedContent']=new _t([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x3810ca,content:_0xe99cda='',isDone:_0x525f94=!0x1,interactionId:_0x42d270,areActionsDisabled:_0x498270,documentContextContent:_0x317dda,editor:_0x5e0fb9,id:_0xa69aa}){super(),this['id']=_0xa69aa||_0x2ced3c(),this['interactionId']=_0x42d270,this['type']=_0x3810ca,this['areActionsDisabled']=!!_0x498270,this['editor']=_0x5e0fb9,this['aiResponseParser']=new Ui(),this['aiResponseApplier']=new vi(),this['documentContextContent']=Ri(_0x317dda||''),this['set']('isDone',_0x525f94),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0xe99cda);}['appendContent'](_0x3b9ccd){this['set']('content',this['content']+_0x3b9ccd);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x1404ab,_0x5ee174){this['changeGroups'][_0x1404ab]['state']=_0x5ee174,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x1404ab,'state':_0x5ee174});}['getContentParts']({showDiff:_0x4a088a,groupIndex:_0x28eb3d}){if(!this['editor'])throw new _0xec7a4c('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x327ee0=this['_getCachedContentParts'](_0x4a088a,_0x28eb3d);if(_0x327ee0)return _0x327ee0;let _0x52a2f2=[];if(void 0x0===_0x28eb3d)_0x52a2f2=this['changeGroups'];else{const _0xf9d291=this['changeGroups']['find'](({index:_0x38eee7})=>_0x38eee7===_0x28eb3d);if(!_0xf9d291)throw new _0xec7a4c('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x28eb3d});_0x52a2f2=[_0xf9d291];}const _0x4331ae=wt({'editor':this['editor'],'showDiff':_0x4a088a,'changeGroups':_0x52a2f2,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x4a088a,_0x4331ae),_0x4331ae;}['_getCachedContentParts'](_0x4c98c2,_0x469f75){const _0x36c916=_0x4c98c2?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x36c916]['length'])return null;const _0x1cb1ef=this['cachedSuggestionContentParts'][_0x36c916];if(void 0x0===_0x469f75)return _0x1cb1ef['length']>0x0&&_0x1cb1ef['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x4c98c2,null),null):_0x3924f4(_0x1cb1ef);{const _0x4a37d1=_0x1cb1ef['find'](({index:_0x5b207d})=>_0x5b207d===_0x469f75);if(_0x4a37d1)return[_0x3924f4(_0x4a37d1)];}return null;}['_setCachedContentParts'](_0x42d0b7,_0x1c28b3){const _0x1fc64a=_0x42d0b7?'withDiff':'withoutDiff';_0x1c28b3?_0x1c28b3['forEach'](_0xb35f2d=>{const _0x47edb9=this['cachedSuggestionContentParts'][_0x1fc64a],_0x4222a5=_0x47edb9['find'](({index:_0x1fecec})=>_0x1fecec===_0xb35f2d['index']);if(_0x4222a5){const _0x2d8026=_0x47edb9['indexOf'](_0x4222a5);_0x47edb9['splice'](_0x2d8026,0x1,_0xb35f2d);}else _0x47edb9['push'](_0xb35f2d);}):this['cachedSuggestionContentParts'][_0x1fc64a]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x4800b6=this['changeGroups'];this['updateChangeGroups']();const _0x5609e7=this['_getDifferentChangeGroups'](_0x4800b6,this['changeGroups']);(_0x5609e7['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x5609e7),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x2a4b9e,_0x49af13){const _0x24c605=[];for(const _0x1bdd1f of _0x49af13){const _0x356e0f=_0x2a4b9e[_0x1bdd1f['index']];_0x356e0f?_0x356e0f['changes']['length']!==_0x1bdd1f['changes']['length']?_0x24c605['push'](_0x1bdd1f):_0x356e0f['changes']['forEach']((_0x1c8c97,_0x4b5a4a)=>{const _0x6c98ed=_0x1bdd1f['changes'][_0x4b5a4a];_0x1c8c97['id']!==_0x6c98ed['id']&&_0x24c605['push'](_0x1bdd1f);}):_0x24c605['push'](_0x1bdd1f);}return _0x24c605;}['updateChangeGroups'](){const _0x27728f=new _0x2578d3('p',{},[new _0x2578d3('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x459c0a(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x585212=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x27728f,'cutAfterLastChange':!this['isDone']});if(!_0x585212['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x585212['parsedContent'];let _0x5e7257=[];if(_0x222394(_0x58c2b8=>{const _0x10557a=ut(_0x58c2b8,'data-id');if(!_0x10557a||!_0x46da03(_0x10557a))return!0x1;const _0x1fbe2b=[_0x58c2b8,...Gi(_0x58c2b8)]['at'](-0x2);if(_0x58c2b8!=_0x1fbe2b){const _0x3587b8=ut(_0x1fbe2b,'data-id');_0x46da03(_0x3587b8)||(_0x5e7257['push']({'node':_0x1fbe2b,'id':_0x3587b8,'type':'modified'}),_0x585212['modifiedNodeIds']['push'](_0x3587b8));}else _0x585212['modifiedNodeIds']['includes'](_0x10557a)?_0x5e7257['push']({'node':_0x58c2b8,'type':'modified','id':_0x10557a}):_0x585212['newNodeIds']['includes'](_0x10557a)?_0x5e7257['push']({'node':_0x58c2b8,'type':'new','id':_0x10557a,'anchorId':ut(_0x58c2b8['previousSibling'],'data-id')}):_0x5e7257['push']({'node':_0x58c2b8,'type':'removed','id':_0x10557a});return!0x0;},this['parsedMergedContent']),_0x5e7257=_0x5e7257['filter'](({node:_0x3cb264})=>[...Gi(_0x3cb264),_0x3cb264]['every'](_0x262868=>!ut(_0x262868,'data-unstable'))),0x0==_0x5e7257['length'])return;const _0xea6561=[[_0x5e7257[0x0]]];for(let _0x298b32=0x1;_0x298b32<_0x5e7257['length'];_0x298b32++){const _0x4385b1=_0xea6561[_0xea6561['length']-0x1],_0x4bfc98=_0x4385b1[_0x4385b1['length']-0x1];_0x5e7257[_0x298b32]['node']['previousSibling']==_0x4bfc98['node']&&'modified'!=_0x5e7257[_0x298b32]['type']&&'modified'!=_0x4bfc98['type']?_0x4385b1['push'](_0x5e7257[_0x298b32]):_0xea6561['push']([_0x5e7257[_0x298b32]]);}for(const _0x554cf5 of _0xea6561){const _0x41841a=_0x554cf5[0x0],_0x38d8a6=_0x554cf5[_0x554cf5['length']-0x1],_0x1309c4=_0x5c663d(_0x41841a['node']['previousSibling']);_0x1309c4&&_0x554cf5['unshift'](_0x1309c4);const _0x5bda01=_0x5c663d(_0x38d8a6['node']['nextSibling']);_0x5bda01&&_0x554cf5['push'](_0x5bda01);}function _0x46da03(_0xda6127){return _0x585212['modifiedNodeIds']['includes'](_0xda6127)||_0x585212['newNodeIds']['includes'](_0xda6127)||_0x585212['removedNodeIds']['includes'](_0xda6127);}function _0x5c663d(_0x29bed2){if(_0x29bed2&&ut(_0x29bed2,'data-id')&&!ut(_0x29bed2,'data-unstable')){const _0x459e43=ut(_0x29bed2,'data-id');if(!_0x46da03(_0x459e43))return{'node':_0x29bed2,'type':'context','id':_0x459e43};}return null;}this['changeGroups']=_0xea6561['map']((_0x58f85a,_0x16adcf)=>({'changes':_0x58f85a,'state':'pending','index':_0x16adcf}));}}const We=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class os extends _0x186953(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x55a4a1,editor:_0x1168b5}){super(),this['id']=_0x2ced3c(),this['connector']=_0x55a4a1,this['isStopped']=!0x0,this['editor']=_0x1168b5;}async['start'](){const _0x1ed02b=[];let _0x4d83d5,_0x2e8e17,_0x2a8973;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x12de2e=await this['currentRequest']['getStream']();for await(const _0x4f419c of _0x12de2e){if(this['isStopped'])return;if('error'==_0x4f419c['event'])return void this['fire']('error',{'error':new _0xec7a4c('ai-chat-interaction-error',this)});switch(_0x4f419c['event']){case'message-metadata':this['messageId']=_0x4f419c['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x4f419c['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x4f419c['data']['conversationTitle'],!0x0);break;case'source':_0x1ed02b['push'](_0x4f419c['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x4d83d5='modification-delta'==_0x4f419c['event']?'modification':'text',_0x2e8e17='modification-delta'==_0x4f419c['event']?_0x4f419c['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x4d83d5&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x4d83d5,'interactionId':this['id'],'id':_0x2e8e17}),'modification'==_0x4d83d5&&(this['currentReply']['sources']=_0x1ed02b['splice'](0x0))),this['currentReply']['appendContent'](_0x4f419c['data']['textDelta']);break;case'mcp-tool-result':_0x2a8973=JSON['parse'](_0x4f419c['data']['result']),this['_handleToolResultData']({'toolName':_0x4f419c['data']['toolName'],'data':_0x2a8973['data'],'attributes':_0x2a8973['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x4f419c['data']['toolName'],'data':_0x4f419c['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x1ed02b['length']>0x0&&(this['currentReply']['sources']=_0x1ed02b['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x2c79bb){return this['replies']['find'](_0x18db64=>_0x18db64['id']===_0x2c79bb);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x5ddfd4=>_0x5ddfd4['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x39b696){const _0x5819f6=new di({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x39b696});return this['replies']['push'](_0x5819f6),_0x5819f6['delegate'](...We)['to'](this),this['fire']('replyCreated',_0x5819f6),_0x5819f6;}['setConversationTitle'](_0x2c7bcc,_0x2b5ae3=!0x1){this['fire']('setConversationTitle',_0x2c7bcc,_0x2b5ae3);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x4b9722){this['fire']('toolDataReceived',{'type':'result','toolName':_0x4b9722['toolName'],'data':structuredClone(_0x4b9722['data']||{}),'attributes':structuredClone(_0x4b9722['attributes']||{})},this);}['_handleToolNotificationData'](_0x1300d0){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x1300d0['toolName'],'data':structuredClone(_0x1300d0['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Fe=function(_0x132f15){return _0x132f15['TOOL']='mcp-tool-context',_0x132f15['FILE']='file',_0x132f15['DOCUMENT']='document',_0x132f15['URL']='web-resource',_0x132f15['TEXT']='text',_0x132f15['SELECTION']='selection',_0x132f15;}({}),Oe=function(_0x3adfdb){return _0x3adfdb['TEXT']='text',_0x3adfdb['MARKDOWN']='markdown',_0x3adfdb['HTML']='html',_0x3adfdb;}({});const Ne=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),Ue=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class ze extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x561f87,config:_0x4006c3,ownerId:_0x1af683}){super(),this['_connector']=_0x561f87,this['_config']=_0x4006c3,this['_ownerId']=_0x1af683;}['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'](_0x4633ab){const _0xa95412=await this['_createContextItemFromContent'](_0x4633ab);return this['_addToConversationContextItem'](_0xa95412),'current-document'===_0xa95412['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0xa95412;}async['_createContextItemFromContent'](_0x430121){if(_0x430121['type']===Fe['DOCUMENT']){const _0x969906=await this['_connector']['fetchDocument'](this['_ownerId'],_0x430121['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x430121['type'],'content':_0x969906['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x969906['attributes']?.['version'],'sessionId':_0x969906['attributes']?.['sessionId']};}if(_0x430121['type']===Fe['TOOL'])return{'id':_0x430121['id'],'uiId':_0x430121['id'],'label':_0x430121['data']?.['label']||_0x430121['id'],'type':Fe['TOOL'],'mcpServerName':_0x430121['mcpServerName'],'toolName':_0x430121['toolName'],'data':_0x430121['data']||{}};return{'id':_0x430121['id'],'uiId':_0x430121['id'],'label':_0x430121['attributes']?.['label']||_0x430121['name']||_0x430121['url']||_0x430121['id'],'type':_0x430121['type'],..._0x430121?.['attributes']?.['resourceId']?{'resourceId':_0x430121['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x54a941){const _0x5655bf=this['_pendingContextItems']['get'](_0x54a941);_0x5655bf?.['isReadOnly']||this['_removeContextItem'](_0x54a941);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x2aa5e7 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x2aa5e7['uiId']);const _0x5a51b7=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x5a51b7&&this['_addContextItem']({..._0x5a51b7,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x2673f2){for(const _0x5a5b07 of _0x2673f2['values']())this['_addToConversationContextItem'](_0x5a5b07);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'](_0x59d842){return Array['from'](_0x59d842['values']())['map'](_0x5f0cc2=>this['_mapContextItemToRequestData'](_0x5f0cc2))['filter'](_0x1f895e=>null!==_0x1f895e);}async['addFilesToContext'](_0x237d91,_0x3f4870,_0x42d637=Fe['FILE']){const _0x305115='files-'+_0x2ced3c();this['_startUploadOperation'](_0x305115);try{await Promise['all'](_0x237d91['map'](async _0x22e602=>{const _0x349330='file-'+_0x2ced3c(),_0x499279=_0x1f62ac(_0x22e602['name']);try{this['_addContextItem']({'type':_0x42d637,'label':_0x3f4870?.['label']||_0x499279,'uiId':_0x349330,'resourceId':_0x3f4870?.['resourceId']},!0x0);const _0x165273=this['_connector']['uploadFile'](this['_ownerId'],_0x22e602,_0x3f4870);this['_ongoingUploads']['set'](_0x349330,_0x165273['abortController']);const {id:_0x424ade}=await _0x165273['getId']();this['_ongoingUploads']['delete'](_0x349330),this['_finishContextItemLoading']({'type':_0x42d637,'id':_0x424ade,'label':_0x3f4870?.['label']||_0x499279,'uiId':_0x349330,'resourceId':_0x3f4870?.['resourceId']},!0x1);}catch(_0x434cd5){this['_ongoingUploads']['delete'](_0x349330);if(!(_0x434cd5 instanceof _0xec7a4c&&_0x434cd5['message']['startsWith']('ai-request-aborted'))){const _0x332b61=Ne['get'](_0x434cd5['code'])||'ai-chat-file-upload-failed',_0x48432b=new _0xec7a4c(_0x332b61,null,{'fileName':_0x499279,..._0x434cd5});_0x48432b['stack']=_0x434cd5['stack'],this['fire']('error',{'error':_0x48432b});}this['_removeContextItem'](_0x349330);}}));}finally{this['_finishUploadOperation'](_0x305115);}}['addCurrentDocumentToContext'](_0x4087b1){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x50d75c={'type':Fe['DOCUMENT'],'uiId':'current-document','label':_0x4087b1,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x50d75c);}async['updateCurrentDocument'](_0xcc8426,_0x49f2f8,_0x3a7756,_0x582ccb){const _0x359d09=this['_pendingContextItems']['get']('current-document');if(_0x359d09&&_0xcc8426){_0x359d09['selection']=_0x582ccb?_0x582ccb['map'](_0x2e2d7=>({'start':_0x2e2d7['start'],'end':_0x2e2d7['end']})):[];try{if(_0x359d09['version']===_0x49f2f8)return;const {id:_0x22230f}=await this['_connector']['uploadDocument'](this['_ownerId'],_0xcc8426,{'version':_0x49f2f8,'sessionId':_0x3a7756})['getId']();_0x359d09['id']=_0x22230f,_0x359d09['content']=_0xcc8426,_0x359d09['version']=_0x49f2f8,_0x359d09['sessionId']=_0x3a7756;}catch(_0x58b994){const _0x13c18d=new _0xec7a4c('ai-chat-document-upload-failed',null);_0x13c18d['stack']=_0x58b994['stack'],this['fire']('error',{'error':_0x13c18d});}}}['addSelectionToContext'](_0x2bc219){this['_addContextItem']({'type':Fe['SELECTION'],'label':_0x2bc219,'uiId':'selection','content':_0x2bc219});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x153bb6,_0x4f58aa){const _0x29b2a6='url-'+_0x2ced3c();this['_startUploadOperation'](_0x29b2a6);const _0x3e6f7f='url-'+_0x2ced3c();try{this['_addContextItem']({'type':Fe['URL'],'label':_0x4f58aa?.['label']||_0x153bb6,'uiId':_0x3e6f7f,'resourceId':_0x4f58aa?.['resourceId']},!0x0);const _0x95a2af=this['_connector']['uploadUrl'](this['_ownerId'],_0x153bb6,_0x4f58aa);this['_ongoingUploads']['set'](_0x3e6f7f,_0x95a2af['abortController']);const {id:_0x2f89b8}=await _0x95a2af['getId']();this['_ongoingUploads']['delete'](_0x3e6f7f),this['_finishContextItemLoading']({'type':Fe['URL'],'id':_0x2f89b8,'label':_0x4f58aa?.['label']||_0x153bb6,'uiId':_0x3e6f7f,'resourceId':_0x4f58aa?.['resourceId']},!0x1);}catch(_0xd3f578){this['_ongoingUploads']['delete'](_0x3e6f7f),(_0xd3f578['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0xec7a4c('ai-chat-url-upload-failed',this,{'url':_0x153bb6,'originalError':_0xd3f578}),'url':_0x153bb6}),this['_removeContextItem'](_0x3e6f7f));}finally{this['_finishUploadOperation'](_0x29b2a6);}}['addToolItemToContext'](_0x485e9e){_0x485e9e['id']=_0x485e9e['id']??_0x2ced3c()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x485e9e['uiId'],_0x485e9e),this['fire']('contextItemAdded',{'contextItem':_0x485e9e,'isLoading':!0x1});}async['loadSourceResources'](_0x2eb815,_0x3928c5,_0x57dd61){const _0x2ac688=this['_addContextOptionsState']['sources']['find'](_0x30fac4=>_0x30fac4['id']===_0x2eb815);if(!_0x2ac688)return this['fire']('error',{'error':new _0xec7a4c('ai-chat-source-not-found',this,{'sourceId':_0x2eb815}),'sourceId':_0x2eb815}),[];try{const _0xbe5e57=(await _0x2ac688['getResources'](_0x3928c5))['map'](_0x38696e=>{const _0x21cd9b=this['_isResourceInContext'](_0x38696e['id']);return{..._0x38696e,'isInContext':_0x21cd9b};});return _0x2ac688['resources']=_0xbe5e57,this['fire']('sourceResourcesLoaded',{'sourceId':_0x2eb815,'source':_0x2ac688,'resources':_0xbe5e57,'uid':_0x57dd61}),_0xbe5e57;}catch(_0x3227bb){return this['fire']('error',{'error':new _0xec7a4c('ai-chat-source-resources-load-failed',this,{'sourceId':_0x2eb815,'originalError':_0x3227bb}),'sourceId':_0x2eb815,'sourceLabel':_0x2ac688['label']}),[];}}async['addResourceToContext'](_0x4c0d40,_0x1b5604){if(this['_isResourceInContext'](_0x1b5604['id']))return;let _0x521523=_0x1b5604['data'];if(!_0x521523&&_0x4c0d40['getData'])try{_0x521523=await _0x4c0d40['getData'](_0x1b5604['id']);}catch(_0x28eff7){return void this['fire']('error',{'error':new _0xec7a4c('ai-chat-resource-load-failed',this,{'resourceId':_0x1b5604['id'],'sourceId':_0x4c0d40['id'],'originalError':_0x28eff7}),'resourceId':_0x1b5604['id'],'sourceId':_0x4c0d40['id']});}if(_0x521523)switch(_0x1b5604['type']){case Fe['URL']:if('string'!=typeof _0x521523)return void this['fire']('error',{'error':new _0xec7a4c('ai-chat-context-invalid-data',this,{'resourceId':_0x1b5604['id'],'sourceId':_0x4c0d40['id'],'expectedType':'string','actualType':typeof _0x521523}),'resourceId':_0x1b5604['id'],'sourceId':_0x4c0d40['id']});await this['addUrlToContext'](_0x521523,{'label':_0x1b5604['label'],'resourceId':_0x1b5604['id']});break;case Fe['FILE']:if(!(_0x521523 instanceof File))return void this['fire']('error',{'error':new _0xec7a4c('ai-chat-context-invalid-data',this,{'resourceId':_0x1b5604['id'],'sourceId':_0x4c0d40['id'],'expectedType':'File','actualType':typeof _0x521523}),'resourceId':_0x1b5604['id'],'sourceId':_0x4c0d40['id']});await this['addFilesToContext']([_0x521523],{'label':_0x1b5604['label'],'resourceId':_0x1b5604['id']});break;case Fe['TEXT']:if('object'!=typeof _0x521523||!('content'in _0x521523)||!('type'in _0x521523))return void this['fire']('error',{'error':new _0xec7a4c('ai-chat-context-invalid-data',this,{'resourceId':_0x1b5604['id'],'sourceId':_0x4c0d40['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x521523}),'resourceId':_0x1b5604['id'],'sourceId':_0x4c0d40['id']});_0x521523=ze['_convertTextResourceToFile'](_0x521523,_0x1b5604['label']),await this['addFilesToContext']([_0x521523],{'label':_0x1b5604['label'],'resourceId':_0x1b5604['id']},Fe['TEXT']);break;case Fe['TOOL']:break;default:this['fire']('error',{'error':new _0xec7a4c('ai-chat-context-unsupported-type',this,{'resourceId':_0x1b5604['id'],'sourceId':_0x4c0d40['id'],'resourceType':_0x1b5604['type']}),'resourceId':_0x1b5604['id'],'sourceId':_0x4c0d40['id']});}else this['fire']('error',{'error':new _0xec7a4c('ai-chat-resource-no-data',this,{'resourceId':_0x1b5604['id'],'sourceId':_0x4c0d40['id']}),'resourceId':_0x1b5604['id'],'sourceId':_0x4c0d40['id']});}static['_convertTextResourceToFile'](_0x539992,_0x41e845){switch(_0x539992['type']){case Oe['MARKDOWN']:return new File([_0x539992['content']],_0x41e845,{'type':'text/markdown'});case Oe['HTML']:return new File([_0x539992['content']],_0x41e845,{'type':'text/html'});default:return new File([_0x539992['content']],_0x41e845,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x517efd){switch(_0x517efd['type']){case Fe['FILE']:return{'type':Fe['FILE'],'id':_0x517efd['id']};case Fe['URL']:return{'type':Fe['URL'],'id':_0x517efd['id']};case Fe['DOCUMENT']:return{'type':Fe['DOCUMENT'],'id':_0x517efd['id'],..._0x517efd['selection']?.['length']&&{'selection':_0x517efd['selection']}};case Fe['TEXT']:return{'type':Fe['FILE'],'id':_0x517efd['id']};case Fe['TOOL']:{const _0x25265c=_0x517efd;return{'type':Fe['TOOL'],'mcpServerName':_0x25265c['mcpServerName'],'toolName':_0x25265c['toolName'],'data':_0x25265c['data'],'id':_0x25265c['id']};}default:return null;}}['_addContextItem'](_0x574841,_0x17eedf=!0x1){if(this['_pendingContextItems']['set'](_0x574841['uiId'],_0x574841),_0x574841['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x574841,'isLoading':_0x17eedf}),'current-document'===_0x574841['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x574841['resourceId']){const _0x4e3a4a=this['_findSourceIdsByResourceId'](_0x574841['resourceId']);_0x4e3a4a&&_0x4e3a4a['forEach'](_0x5ef1d8=>{this['_updateResourceInContextState'](_0x5ef1d8,_0x574841['resourceId'],!0x0);});}}['_removeContextItem'](_0x2c6c8e){const _0x3399d8=this['_pendingContextItems']['get'](_0x2c6c8e),_0x2ec07b=this['_ongoingUploads']['get'](_0x2c6c8e);if(_0x2ec07b&&(_0x2ec07b['abort'](),this['_ongoingUploads']['delete'](_0x2c6c8e)),_0x3399d8?.['resourceId']){const _0xb6d2aa=this['_findSourceIdsByResourceId'](_0x3399d8['resourceId']);_0xb6d2aa&&_0xb6d2aa['forEach'](_0x118a24=>{this['_updateResourceInContextState'](_0x118a24,_0x3399d8['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x2c6c8e),this['fire']('contextItemRemoved',{'uiId':_0x2c6c8e,'type':_0x3399d8?.['type']}),'current-document'===_0x2c6c8e&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x3ac7e1,_0x7e5429){if(this['_pendingContextItems']['has'](_0x3ac7e1['uiId'])&&(this['_pendingContextItems']['set'](_0x3ac7e1['uiId'],_0x3ac7e1),this['fire']('contextItemLoadingEnded',{'contextItem':_0x3ac7e1,'isLoading':_0x7e5429}),_0x3ac7e1['resourceId'])){const _0x18cff1=this['_findSourceIdsByResourceId'](_0x3ac7e1['resourceId']);_0x18cff1&&_0x18cff1['forEach'](_0x33decf=>{this['_updateResourceInContextState'](_0x33decf,_0x3ac7e1['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x46b3d7){this['_conversationContextItems']['set'](_0x46b3d7['uiId'],_0x46b3d7);}['_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'](),'customItems':this['_config']?.['customItems']?.['map'](_0x4dbbb5=>({..._0x4dbbb5,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x3712d8=>({..._0x3712d8,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x2a9a01=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x2a9a01,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x1bab24){for(const _0x330c7f of this['_pendingContextItems']['values']())if(_0x330c7f['resourceId']===_0x1bab24)return!0x0;for(const _0x50b26f of this['_conversationContextItems']['values']())if(_0x50b26f['resourceId']===_0x1bab24)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x44a394){const _0x4d088e=[];for(const _0x4f109d of this['_addContextOptionsState']['sources']){_0x4f109d['resources']['find'](_0x3b91fe=>_0x3b91fe['id']===_0x44a394)&&_0x4d088e['push'](_0x4f109d['id']);}return 0x0===_0x4d088e['length']?null:_0x4d088e;}['_updateResourceInContextState'](_0x496725,_0x24b105,_0x30ce2f){const _0x605487=this['_addContextOptionsState']['sources']['find'](_0x1327ac=>_0x1327ac['id']===_0x496725);if(!_0x605487)return;const _0x18a794=_0x605487['resources']['find'](_0x863df3=>_0x863df3['id']===_0x24b105);_0x18a794&&(_0x18a794['isInContext']=_0x30ce2f,this['fire']('resourceStateChanged',{'sourceId':_0x496725,'resourceId':_0x24b105,'isInContext':_0x30ce2f}));}['_startUploadOperation'](_0x4cfa8e){this['_ongoingUploadOperations']['set'](_0x4cfa8e,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x5bf75b){this['_ongoingUploadOperations']['delete'](_0x5bf75b),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Je=['capabilitiesUpdated'];class He extends _0x186953(){['_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'](_0x3410cc){const _0x30ceb5={};return _0x3410cc&&_0x3410cc['isWebSearchEnabled']&&(_0x30ceb5['webSearch']={}),_0x3410cc&&_0x3410cc['isReasoningEnabled']&&(_0x30ceb5['reasoning']={}),_0x30ceb5;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x19ba3d){_0x19ba3d!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x19ba3d,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x4b13b5){_0x4b13b5!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x4b13b5,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class qe extends os{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x397eb6){super(_0x397eb6),this['conversationId']=_0x397eb6['conversationId'],this['contextItems']=_0x397eb6['contextItems'],this['capabilities']=_0x397eb6['capabilities'],this['userMessage']=_0x397eb6['userMessage'],this['model']=_0x397eb6['model'],this['attributes']=_0x397eb6['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':ze['mapContextItemsToRequestData'](this['contextItems']),'capabilities':He['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class st extends _0x186953(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x579c46){super(),this['options']=_0x579c46,this['connector']=_0x579c46['connector'],this['chatModels']=_0x579c46['chatModels'],this['id']=_0x579c46['conversationId'],this['isFromHistory']=_0x579c46['isFromHistory'];}async['init'](_0x5443dc){try{this['chatContext']=new ze({'connector':this['connector'],'config':_0x5443dc,'ownerId':this['id']}),this['chatContext']['delegate'](...Ue)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new He(),this['chatCapabilities']['delegate'](...Je)['to'](this),this['chatCapabilities']['init']();const _0x11ec76=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x11ec76});const _0x5d4f79=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x5d4f79&&await this['setModel'](_0x5d4f79);}catch(_0x4c5436){const _0x14e1b4=new _0xec7a4c('ai-chat-conversation-init-failed',null,{'message':_0x4c5436['message']||_0x4c5436});_0x14e1b4['stack']=_0x4c5436['stack'],this['fire']('error',{'error':_0x14e1b4});}}async['start'](){if(this['isStarted'])throw new _0xec7a4c('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0xec7a4c('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x47bbcb}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x47bbcb,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x1cbb29){const _0x2c6167=new _0xec7a4c('ai-chat-conversation-start-failed',null,{'message':_0x1cbb29['message'],'conversationId':this['id']});throw _0x2c6167['stack']=_0x1cbb29['stack'],this['fire']('error',{'error':_0x2c6167}),_0x2c6167;}}async['load'](_0x49f5f0,_0x4b3496){try{const _0x2cf864=await this['connector']['fetchConversation'](_0x49f5f0)['getConversation'](),_0x16eec8=await this['connector']['fetchConversationMessages'](_0x49f5f0)['getMessages'](),_0x39707e=_0x16eec8[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x2cf864['id'],'title'in _0x2cf864?this['fire']('setConversationTitle',_0x2cf864['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x4ba656=(await this['chatModels']['getAll']())['find'](_0x194c90=>_0x194c90['id']['toLowerCase']()===_0x39707e['toLowerCase']());return this['selectedModel']=_0x4ba656,this['fire']('modelSelected',{'selectedModel':_0x4ba656,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x16eec8,_0x4b3496,_0x39707e),this['currentInteraction']=void 0x0,this;}catch(_0x41bb3a){const _0x5856a3=new _0xec7a4c('ai-chat-conversation-init-from-id-failed',null,{'message':_0x41bb3a['message'],'conversationId':_0x49f5f0});throw _0x5856a3['stack']=_0x41bb3a['stack'],this['fire']('error',{'error':_0x5856a3}),_0x5856a3;}}async['_processMessagesToInteractions'](_0x50c6e2,_0x4df697,_0x31c1e0){let _0x2534e0;for(const _0x3e4b72 of _0x50c6e2)if('user'===_0x3e4b72['role']){const _0x25b0b0=await this['_extractContextItems'](_0x3e4b72),_0x256c02={'isReasoningEnabled':Object['hasOwn'](_0x3e4b72['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x3e4b72['capabilities'],'webSearch')};_0x2534e0=this['createInteraction']({'userMessage':_0x3e4b72['prompt'],'contextItems':_0x25b0b0,'capabilities':_0x256c02,'modelId':_0x31c1e0,'attributes':_0x3e4b72['attributes']}),this['currentInteraction']=_0x2534e0,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x3e4b72['role']&&_0x2534e0){const _0x18c484=[];for(const _0x3afc90 of _0x3e4b72['content'])switch(_0x3afc90['type']){case'text':case'modification':{const _0x53f718=_0x2534e0['getDocumentContext']()?.['sessionId']!==_0x4df697;_0x2534e0['currentReply']=_0x2534e0['createReply']({'type':_0x3afc90['type'],'isDone':!0x0,'interactionId':_0x2534e0['id'],'areActionsDisabled':_0x53f718}),_0x2534e0['currentReply']['appendContent'](_0x3afc90['content']),_0x18c484['length']>0x0&&(_0x2534e0['currentReply']['sources']=_0x18c484['splice'](0x0));break;}case'url':_0x18c484['push'](_0x3afc90);break;case'mcp-tool-result':{const {data:_0x2c3d32,attributes:_0x544709}=JSON['parse'](_0x3afc90['content']);_0x2534e0['_handleToolResultData']({'toolName':_0x3afc90['toolName'],'data':_0x2c3d32,'attributes':_0x544709});break;}}}}}async['_extractContextItems'](_0x2b8230){const _0x3be816=new Map();if(!_0x2b8230['content'])return _0x3be816;for(const _0x56bb47 of _0x2b8230['content']){const _0x5a2601=await this['chatContext']['populateFromMessage'](_0x56bb47);_0x5a2601&&_0x3be816['set'](_0x5a2601['id'],_0x5a2601);}return _0x3be816;}async['handleUserInteraction']({userMessage:_0x4d6433,attributes:_0x41d855}){if(!this['isStarted'])throw new _0xec7a4c('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0xec7a4c('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x4c1df4=this['chatContext']['getPendingContextItems'](),_0x222d7a=this['chatCapabilities']['getCapabilitiesConfig'](),_0x3c528e=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x4d6433,'contextItems':_0x4c1df4,'capabilities':_0x222d7a,'modelId':_0x3c528e,'attributes':_0x41d855}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x28fad3){if(_0x28fad3 instanceof _0xec7a4c)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x28fad3});else{const _0x3c6997=Ne['get'](_0x28fad3['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0xec7a4c(_0x3c6997,null,{'error':_0x28fad3})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x178718,contextItems:_0x3461a3,capabilities:_0x3726fa,modelId:_0x2facf1,attributes:_0x1ce360}){const _0x291518=new qe({'userMessage':_0x178718,'contextItems':_0x3461a3,'capabilities':_0x3726fa,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x2facf1,'attributes':_0x1ce360});return _0x291518['delegate'](...We)['to'](this),this['interactions']['push'](_0x291518),this['fire']('interactionCreated',_0x291518),_0x291518;}['getInteraction'](_0x37c4f1){return this['interactions']['find'](_0x11b33f=>_0x11b33f['id']===_0x37c4f1);}['removeInteraction'](_0x253b49){const _0x429c7c=this['getInteraction'](_0x253b49);_0x429c7c&&(_0x429c7c['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x429c7c),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x2728e3){this['chatContext']['addCurrentDocumentToContext'](_0x2728e3);}async['updateCurrentDocumentInContext']({content:_0x1f926c,version:_0x58e620,sessionId:_0x5d26e2,selections:_0x4ff8da}){await this['chatContext']['updateCurrentDocument'](_0x1f926c,_0x58e620,_0x5d26e2,_0x4ff8da);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x263057){this['chatContext']['addSelectionToContext'](_0x263057);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x409ad1){this['chatContext']['addFilesToContext'](_0x409ad1);}['addUrlToContext'](_0x1453a3){this['chatContext']['addUrlToContext'](_0x1453a3);}['addToolItemToContext'](_0x1bb012){this['chatContext']['addToolItemToContext'](_0x1bb012);}['addResourceToContext'](_0x21e73b,_0x2dbc92){this['chatContext']['addResourceToContext'](_0x21e73b,_0x2dbc92);}['loadSourceResources'](_0x7ed8e1,_0x2509a1,_0x10c101){return this['chatContext']['loadSourceResources'](_0x7ed8e1,_0x2509a1,_0x10c101);}['removeFromContext'](_0x2e4947){this['chatContext']['removeFromContext'](_0x2e4947);}['setWebSearch'](_0x28f207){this['chatCapabilities']['setWebSearch'](_0x28f207);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x595c66){this['chatCapabilities']['setReasoning'](_0x595c66);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x3d0bfe){_0x3d0bfe?!0x1===await this['chatModels']['isAvailable'](_0x3d0bfe)&&(_0x56fb9a('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x3d0bfe}),_0x3d0bfe=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x56fb9a('ai-chat-conversation-set-model-null',{'conversation':this}),_0x3d0bfe=(await this['chatModels']['getAvailableModels']())[0x0]),_0x3d0bfe['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x3d0bfe,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x3d0bfe}));}}class et extends _0x186953(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0xd93656,config:_0x4de985,locale:_0x37c1f5}){super(),this['_connector']=_0xd93656,this['_config']=_0x4de985,this['_locale']=_0x37c1f5;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()),this['_modelsRequest'];}async['getAvailableModels'](){const _0x3e17c0=await this['getAll']();let _0x297e41;return _0x297e41=this['_availableModels']?this['_filterModels'](_0x3e17c0,this['_availableModels']):_0x3e17c0['filter'](_0x5c9d66=>_0x5c9d66['recommended']),_0x297e41;}async['getModel'](_0x54f763){const _0x42d48a=await this['getAll']();if(!_0x42d48a['length'])return null;if(_0x54f763){const _0x330e69=this['_getModelById'](_0x42d48a,_0x54f763);if(_0x330e69)return _0x330e69;_0x56fb9a('ai-chat-model-id-unrecognized',{'modelId':_0x54f763,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0xbe5b3f=await this['getAvailableModels']();if(!_0xbe5b3f['length'])return null;if(this['_defaultModelId']){const _0xe9f7ee=this['_getModelById'](_0xbe5b3f,this['_defaultModelId']);if(_0xe9f7ee)return _0xe9f7ee;_0x56fb9a('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0xbe5b3f[0x0]['id']});}return _0xbe5b3f[0x0];}async['isAvailable'](_0x13b477){return(await this['getAvailableModels']())['some'](_0x1a03e9=>_0x1a03e9['name']===_0x13b477['name']&&_0x1a03e9['provider']===_0x13b477['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x53f6a3=this['_locale']['uiLanguage']||'en',_0x1d8a29=this['_connector']['getModels'](_0x53f6a3),_0x457a1c=await _0x1d8a29['list']();this['_modelList']=_0x457a1c['items']['map'](_0x3b1535=>Mi(_0x3b1535)?{..._0x3b1535,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x3b1535);}catch(_0x4dcd81){throw _0x4f2fe2('ai-models-unable-to-retrieve',{'error':_0x4dcd81}),_0x4dcd81;}return[...this['_modelList']];}['_filterModels'](_0x5a40fd,_0xe87318){let _0x172147;if(_0xe87318){_0x172147=[];const _0x3505fd=new Set(),_0x3126e2='string'==typeof _0xe87318?[_0xe87318['toLocaleLowerCase']()]:_0xe87318['map'](_0x2bfb6e=>_0x2bfb6e['toLocaleLowerCase']());for(const _0x3411f2 of _0x3126e2)for(const _0x31b673 of _0x5a40fd)!_0x3505fd['has'](_0x31b673['id'])&&this['_isMatchingFilter'](_0x31b673,_0x3411f2)&&(_0x172147['push'](_0x31b673),_0x3505fd['add'](_0x31b673['id']));}else _0x172147=_0x5a40fd;return _0x172147;}['_isMatchingFilter'](_0x3e0d2b,_0x1083cf){const _0x5a744b=_0x3e0d2b['id']['toLocaleLowerCase'](),_0x13f428=_0x3e0d2b['name']['toLocaleLowerCase'](),_0x18dae2=_0x3e0d2b['provider']['toLocaleLowerCase']();return _0x5a744b===_0x1083cf||_0x13f428===_0x1083cf||Mi(_0x3e0d2b)&&'auto'===_0x1083cf||_0x18dae2===_0x1083cf||_0x5a744b['startsWith'](_0x1083cf);}['_getModelById'](_0x29bbe2,_0x5f4b46){return _0x29bbe2['find'](_0x4e2586=>Mi(_0x4e2586)&&'auto'===_0x5f4b46?_0x4e2586:_0x4e2586['id']===_0x5f4b46)||null;}}function Mi(_0x22b3a2){return _0x22b3a2['id']['startsWith']('agent');}function T(_0x4e97f3){if(_0x4e97f3 instanceof _0x5a617c)return _0x4e97f3;if(_0x4e97f3?.['editors']&&_0x4e97f3['editors']['get'](0x0))return _0x4e97f3['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.'),_0x4e97f3['editors']['get'](0x0);throw new _0xec7a4c('ai-get-editor-from-context-no-editor');}function at({editor:_0x55cd2f,interaction:_0x10a51d,reply:_0x524a0a,groups:_0x3db77c,transform:_0x5453da,documentCompare:_0x812022,documentCompareOptions:_0x1a12f7}){const _0x447764=_0x10a51d['getDocumentContext']();if(!_0x447764)return[];const _0x46dcb5=_0x447764['content'],_0x3fa095=_0x447764['version'],_0x4d04cd=_0x524a0a['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x4a47ed}of _0x3db77c){const _0x8a3e51=_0x4a47ed['filter'](_0x3c75b3=>'new'!=_0x3c75b3['type'])['map'](_0x4d7c45=>It('data-id',_0x4d7c45['id'],_0x4d04cd)),_0x2953d0=_0x4a47ed['filter'](_0x449f9e=>'removed'!=_0x449f9e['type'])['map'](_0x494d45=>_0x494d45['node']['cloneNode'](!0x0));let _0x1f0a74=null;if(_0x8a3e51['length']){_0x1f0a74=_0x8a3e51[0x0]['previousSibling'];for(let _0x34f089=0x0;_0x34f089<_0x8a3e51['length'];_0x34f089++)_0x59f194(_0x8a3e51[_0x34f089]);}if(_0x2953d0['length']){_0x1f0a74||(_0x4a47ed[0x0]['anchorId']?_0x1f0a74=It('data-id',_0x4a47ed[0x0]['anchorId'],_0x4d04cd):(_0x1f0a74=_0x2953d0['shift'](),_0x3737ce(_0x4d04cd,_0x1f0a74)));for(let _0x3ceb77=0x0;_0x3ceb77<_0x2953d0['length'];_0x3ceb77++)_0x5e3b7e(_0x1f0a74,_0x2953d0[_0x3ceb77]),_0x1f0a74=_0x2953d0[_0x3ceb77];}}const _0x3c49cc=pt(_0x4d04cd),_0x3ec289=_0x812022['getDiff'](_0x46dcb5,_0x3c49cc,_0x1a12f7)['getOperations']();if(_0x5453da){const _0x145f75=_0x55cd2f['model']['document']['history']['getOperations'](_0x3fa095),_0x4bc482={'document':_0x55cd2f['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return kt(_0x3ec289,_0x145f75,_0x4bc482)['operationsA'];}return _0x3ec289;}function rt(_0x525628,_0x96111a){if('marker'!=_0x96111a['type'])return;const _0x498a28=_0x525628['model']['markers']['get'](_0x96111a['name']);_0x498a28&&(_0x96111a['oldRange']=_0x498a28['getRange']());}class q extends _0x42547c{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[tt,ot];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x26c387(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new et({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x549541=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x5c9930,_0x54f73b)=>{this['_handleUIUserMessage']({'userMessage':_0x54f73b});}),this['listenTo'](_0x549541,'resizedTabs',(_0x55c9be,_0x23f8c5)=>{this['_setIsMaximized'](_0x23f8c5);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x549541['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x2b9c11,_0x502eef)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x502eef));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x313f00,_0x115cd6)=>{this['activeConversation']?.['addUrlToContext'](_0x115cd6);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x33400d,_0xb9e763)=>{_0xb9e763['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x4f967d,_0x3d9201)=>{this['activeConversation']?.['addResourceToContext'](_0x3d9201['source'],_0x3d9201['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x564484,_0x5e6547)=>{this['_removeFromContext'](_0x5e6547);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x356798,_0x2abe57)=>{this['activeConversation']?.['loadSourceResources'](_0x2abe57['sourceId'],_0x2abe57['query'],_0x2abe57['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x5a63fe,_0x10a367)=>{this['activeConversation']?.['setModel'](_0x10a367);}),this['listenTo'](this['_aiChatUi'],'like',(_0x5c4674,{replyId:_0x2f1485})=>{console['log']('Liked\x20response',_0x2f1485);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x1d2019,{replyId:_0x3f7544})=>{console['log']('Disliked\x20response',_0x3f7544);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x3309fd,_0x5af5d1)=>{this['_insertSuggestion'](_0x5af5d1);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x1267bf,{replyId:_0x3390c6,partIndex:_0x4ef2d0})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x3390c6,_0x4ef2d0);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x225f9a,{replyId:_0x19c798,partIndex:_0x2e4a53})=>{const _0x277f34=this['_getDocumentRangeForReplyChanges'](_0x19c798,_0x2e4a53);_0x277f34&&'$graveyard'!=_0x277f34['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x277f34['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x374e2a,_0x5805ce)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x5805ce);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x2d7b00,{replyId:_0x7d7bf5,showDiff:_0x2967e7})=>{const {reply:_0x58e5dd}=this['getInteractionAndReplyById'](_0x7d7bf5),_0x12400b=_0x58e5dd['getContentParts']({'showDiff':_0x2967e7});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x58e5dd['id'],'parts':_0x12400b,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x41118f,{replyId:_0x3946f4,partIndex:_0x2015fb})=>{this['_rejectSuggestion']({'replyId':_0x3946f4,'partIndex':_0x2015fb}),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon'),this['set']('_aiChatBalloonShowDiff',!0x1),this['_aiChatBalloon']['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](this['_aiChatBalloon'],'toggleSuggestionDisplayMode',()=>{const {replyId:_0x22aa29,partIndex:_0x179062}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x2f06e4}=this['getInteractionAndReplyById'](_0x22aa29),_0x18c84e=_0x2f06e4['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x179062});this['_aiChatBalloon']['updateContent']({'part':_0x18c84e[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x3dd183,partIndex:_0x462f0a}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x3dd183,'partIndex':_0x462f0a}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x526979,partIndex:_0x500982}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x526979,'partIndex':_0x500982}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x3c226d,partIndex:_0x347685}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x3c226d,'partIndex':_0x347685}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x2defad,partIndex:_0x4fbcf6}=this['_currentPreviewedChangeGroup'],_0x10e14c=this['_getPresentableSiblingContentPartIndex'](_0x2defad,_0x4fbcf6,'next');null!==_0x10e14c&&this['_openBalloonFor'](_0x2defad,_0x10e14c);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x219259,partIndex:_0x27c5e4}=this['_currentPreviewedChangeGroup'],_0x2c9f9b=this['_getPresentableSiblingContentPartIndex'](_0x219259,_0x27c5e4,'previous');null!==_0x2c9f9b&&this['_openBalloonFor'](_0x219259,_0x2c9f9b);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x32b517,{id:_0x56a6b7})=>{if('aiChatBalloon'!==_0x56a6b7)return;const {replyId:_0x5c3c3b,partIndex:_0x231e4d}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x5c3c3b,'index':_0x231e4d,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0x5a617c?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2409f7,_0x30a650)=>{_0x30a650['on']('ready',()=>{this['_integrateEditor'](_0x30a650);});});const _0x461c37=this['context']['config']['get']('ai.chat.initialConversation');let _0x293b05=_0x461c37;if('lastCreated'!=_0x461c37||(_0x293b05=await this['_getLastCreatedConversationId'](),_0x293b05))return'new'==_0x293b05?this['_startConversationSafely']():this['loadConversation'](_0x293b05);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0xf02521){const _0x49f933=T(this['context']);if(!_0x49f933['plugins']['has']('TrackChanges'))throw new _0xec7a4c('ai-no-track-changes',null);const _0x3b2abf=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x3a7bd7,interaction:_0xb8e6fe}=this['getInteractionAndReplyById'](_0xf02521['replyId']),_0x31bd33=this['_getDocumentRangeForReplyChanges'](_0xf02521['replyId'],_0xf02521['partIndex']),_0x17fa6b=void 0x0!==_0xf02521['partIndex']?[_0x3a7bd7['changeGroups'][_0xf02521['partIndex']]]:_0x3a7bd7['changeGroups']['filter'](_0x5ca9bf=>'pending'==_0x5ca9bf['state']),_0x52affe=_0x17fa6b['map'](_0x1d3ac8=>_0x3a7bd7['changeGroups']['indexOf'](_0x1d3ac8));if(!_0x31bd33||'$graveyard'==_0x31bd33['range']['root']['rootName'])return void _0x52affe['forEach'](_0x4a6cd4=>_0x3a7bd7['setChangeGroupState'](_0x4a6cd4,'outdated'));_0x52affe['forEach'](_0x346ab9=>_0x3a7bd7['setChangeGroupState'](_0x346ab9,'accepted'));const _0x238e59=at({'editor':_0x49f933,'reply':_0x3a7bd7,'interaction':_0xb8e6fe,'groups':_0x17fa6b,'transform':!0x0,'documentCompare':_0x3b2abf,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x50d170;_0x31bd33&&this['_scrollToSuggestionRange'](_0x31bd33['range']),_0x49f933['model']['change'](_0x32b461=>{_0x50d170=_0x32b461['batch'],_0x49f933['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x238e59),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x50d170,{'interactionId':_0xb8e6fe['id'],'replyId':_0x3a7bd7['id'],'indexes':_0x52affe['slice']()}),this['_updateRatings'](_0x3a7bd7);}['_applySuggestion'](_0x455d73){const _0x49210a=T(this['context']),_0x2794b8=this['context']['plugins']['get'](ot),{reply:_0x5b2bbe,interaction:_0x7888f4}=this['getInteractionAndReplyById'](_0x455d73['replyId']),_0x16aff1=this['_getDocumentRangeForReplyChanges'](_0x455d73['replyId'],_0x455d73['partIndex']),_0x422d52=void 0x0!==_0x455d73['partIndex']?[_0x5b2bbe['changeGroups'][_0x455d73['partIndex']]]:_0x5b2bbe['changeGroups']['filter'](_0x5b2c87=>'pending'==_0x5b2c87['state']),_0x29380f=_0x422d52['map'](_0x119ae3=>_0x5b2bbe['changeGroups']['indexOf'](_0x119ae3));if(!_0x16aff1||'$graveyard'==_0x16aff1['range']['root']['rootName'])return void _0x29380f['forEach'](_0x4e8f34=>_0x5b2bbe['setChangeGroupState'](_0x4e8f34,'outdated'));_0x29380f['forEach'](_0x574201=>_0x5b2bbe['setChangeGroupState'](_0x574201,'accepted'));const _0x43d22a=at({'editor':_0x49210a,'reply':_0x5b2bbe,'interaction':_0x7888f4,'groups':_0x422d52,'transform':!0x0,'documentCompare':_0x2794b8,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x52af0e;_0x16aff1&&this['_scrollToSuggestionRange'](_0x16aff1['range']),_0x49210a['model']['change'](_0x2c7846=>{_0x52af0e=_0x2c7846['batch'];for(const _0x3164d2 of _0x43d22a)_0x3164d2['baseVersion']=_0x49210a['model']['document']['version'],rt(_0x49210a,_0x3164d2),_0x2c7846['batch']['addOperation'](_0x3164d2),_0x49210a['model']['applyOperation'](_0x3164d2);}),this['_batchToChanges']['set'](_0x52af0e,{'interactionId':_0x7888f4['id'],'replyId':_0x5b2bbe['id'],'indexes':_0x29380f['slice']()}),this['_updateRatings'](_0x5b2bbe);}['_rejectSuggestion'](_0x5e7945){const {reply:_0x5663e5}=this['getInteractionAndReplyById'](_0x5e7945['replyId']);_0x5663e5['setChangeGroupState'](_0x5e7945['partIndex'],'rejected');}['_openBalloonFor'](_0x2b086b,_0x114a35){if(!this['_aiChatBalloon'])return;const {reply:_0x7520bf}=this['getInteractionAndReplyById'](_0x2b086b),_0x255972=_0x7520bf['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x1cbd92,_0x30da8f;if(void 0x0!==_0x114a35?(_0x30da8f=_0x255972['find'](_0x133083=>_0x133083['index']==_0x114a35),_0x1cbd92=_0x30da8f?.['index']):(_0x30da8f=_0x255972[0x0],_0x1cbd92=_0x30da8f['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x2b086b&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x1cbd92)return;const _0x329c55=this['_getUserPresentableContentPartDocumentRange'](_0x2b086b,_0x7520bf,_0x30da8f);if(!_0x329c55)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x2b086b,'partIndex':_0x1cbd92},this['_scrollToSuggestionRange'](_0x329c55,!0x0);const _0x159c2b=this['_getPresentableSiblingContentPartIndex'](_0x2b086b,_0x1cbd92,'next');this['_aiChatBalloon']['updateContent']({'part':_0x30da8f,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x1cbd92,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x1cbd92+0x1)['toString']()),'showRotator':null!==_0x159c2b,'ranges':[_0x329c55],'areActionsDisabled':_0x7520bf['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x2b086b,_0x1cbd92),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x2b086b,'index':_0x1cbd92,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x5d1e94,_0x1ba6c2,_0x484f5c){const {reply:_0x5152ca}=this['getInteractionAndReplyById'](_0x5d1e94),_0x302808=_0x5152ca['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x302808['length'])return null;const _0x7b3682=_0x302808['findIndex'](_0x2445d5=>_0x2445d5['index']==_0x1ba6c2),_0x46a955='next'==_0x484f5c?0x1:-0x1;let _0x202145=_0x302808['at']((_0x7b3682+_0x46a955)%_0x302808['length'])['index'],_0x373f17=_0x302808[_0x202145];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x5d1e94,_0x5152ca,_0x373f17);){if(_0x202145=_0x302808['at']((_0x202145+_0x46a955)%_0x302808['length'])['index'],_0x202145===_0x7b3682)return null;_0x373f17=_0x302808[_0x202145];}return _0x202145;}['_getUserPresentableContentPartDocumentRange'](_0xa3b895,_0x57d0be,_0x32949f){const _0x48b81a=_0x57d0be['changeGroups'];if(!_0x32949f['hasChanges'])return null;const _0x25eb62=_0x48b81a['find'](_0x55e80a=>_0x55e80a['index']==_0x32949f['index']);if('pending'!==_0x25eb62?.['state'])return null;const _0x5984a5=this['_getDocumentRangeForReplyChanges'](_0xa3b895,_0x32949f['index']);if(!_0x5984a5)return null;const {range:_0x51038e,currentIndex:_0x167dec}=_0x5984a5;return'$graveyard'==_0x51038e['root']['rootName']?(_0x57d0be['setChangeGroupState'](_0x167dec,'outdated'),null):_0x5984a5['range'];}['_getDocumentRangeForReplyChanges'](_0x295de7,_0x219aa0){const _0x3095da=T(this['context']),{reply:_0x321ef8,interaction:_0x477246}=this['getInteractionAndReplyById'](_0x295de7),_0xd865d4=_0x321ef8['changeGroups']['filter'](_0x383e4a=>'pending'==_0x383e4a['state']),_0x1ec098=_0xd865d4['map'](_0x5d3096=>_0x321ef8['changeGroups']['indexOf'](_0x5d3096));void 0x0===_0x219aa0&&(_0x219aa0=_0x1ec098[0x0]);const _0x3a1a61=_0x1ec098['indexOf'](_0x219aa0);if(-0x1==_0x3a1a61)return null;const _0x5de7d4=_0xd865d4[_0x3a1a61],_0x139e4f=new _t([]),_0x2c1c7b=new _t([]);for(const _0x3468f4 of _0x5de7d4['changes'])if('removed'!=_0x3468f4['type']&&_0x2c1c7b['children']['push'](_0x3468f4['node']['cloneNode'](!0x0)),'new'!=_0x3468f4['type']){const _0x15b160=gt(_0x30f3c6=>ut(_0x30f3c6,'data-id')==_0x3468f4['id'],_0x321ef8['documentContextContent'],!0x0);_0x139e4f['children']['push'](_0x15b160['cloneNode'](!0x0));}if(0x0==_0x139e4f['children']['length']){if(_0x5de7d4['changes'][0x0]['anchorId']){const _0x49343f=It('data-id',_0x5de7d4['changes'][0x0]['anchorId'],_0x321ef8['documentContextContent']);_0x139e4f['children']['unshift'](_0x49343f['cloneNode'](!0x0)),_0x2c1c7b['children']['unshift'](_0x49343f['cloneNode'](!0x0)),_0x49343f['nextSibling']&&(_0x139e4f['children']['push'](_0x49343f['nextSibling']['cloneNode'](!0x0)),_0x2c1c7b['children']['push'](_0x49343f['nextSibling']['cloneNode'](!0x0)));}else{const _0x20b98d=_0x321ef8['documentContextContent']['children'][0x0];if(!_0x20b98d)return null;_0x139e4f['children']['push'](_0x20b98d['cloneNode'](!0x0)),_0x2c1c7b['children']['push'](_0x20b98d['cloneNode'](!0x0));}}const _0x3c9548=_0x477246['getDocumentContext'](),_0x2db568=_0x3095da['data']['parse'](_0x3c9548['content']),_0x207f06=pt(_0x139e4f),_0x5e0a9c=_0x3095da['data']['parse'](_0x207f06),_0x579765=_0x3095da['data']['parse'](_0x207f06),_0x41a4cc=_0x3095da['model']['createPositionAt'](_0x5e0a9c,0x0),_0x5bf829=pt(_0x2c1c7b),_0x265452={'anchor':_0x41a4cc,'markDeletions':!0x1},_0x38b596=_0x3095da['plugins']['get'](ot)['getDiff'](_0x207f06,_0x5bf829,_0x265452)['getOperations']();if(!_0x38b596['length'])return null;_0x3095da['model']['change'](_0x3179c6=>{for(const _0xb6043b of _0x38b596)if('remove'==_0xb6043b['type']){const _0x38ab1b=_0xb6043b['sourcePosition'],_0x49772e=_0xb6043b['howMany'],_0x49b92c=new lt(_0x38ab1b,_0x49772e);_0x3179c6['batch']['addOperation'](_0x49b92c),_0x3095da['model']['applyOperation'](_0x49b92c);}else'marker'!==_0xb6043b['type']&&(_0xb6043b['baseVersion']=null,_0xb6043b['isDocumentOperation']=!0x1,_0x3179c6['batch']['addOperation'](_0xb6043b),_0x3095da['model']['applyOperation'](_0xb6043b));});const _0x147b07=ct(_0x3095da,_0x38b596,_0x5e0a9c);ht(_0x3095da['model'],_0x147b07);const _0x427513=_0x147b07['getFirstRange']()['start']['path']['slice'](),_0x2bcdaa=_0x147b07['getFirstRange']()['end']['path']['slice'](),_0x503604=[];let _0x49d231=_0x5e0a9c,_0x367b1f=_0x579765;for(let _0x4a5805=0x0;_0x4a5805<_0x2bcdaa['length'];_0x4a5805++){const _0x5bde09=_0x49d231['maxOffset']-_0x2bcdaa[_0x4a5805];_0x503604[_0x4a5805]=_0x367b1f['maxOffset']-_0x5bde09,_0x49d231=_0x49d231['getChildAtOffset'](_0x2bcdaa[_0x4a5805]),_0x367b1f=_0x367b1f['getChildAtOffset'](_0x503604[_0x4a5805]);}const _0x10e608=_0x3095da['model']['createRange'](_0x3095da['model']['createPositionFromPath'](_0x579765,_0x427513),_0x3095da['model']['createPositionFromPath'](_0x579765,_0x503604)),_0xab9a49=_0x579765['getChild'](0x0)['getAttribute'](nt),_0x2d6478=Array['from'](_0x2db568['getChildren']())['find'](_0x317665=>_0x317665['getAttribute'](nt)==_0xab9a49)['getPath'](),_0x3e557f=_0x10e608['start']['path']['slice'](),_0x229cbe=_0x10e608['end']['path']['slice']();_0x3e557f[0x0]=_0x2d6478[0x0]+_0x3e557f[0x0],_0x229cbe[0x0]=_0x2d6478[0x0]+_0x229cbe[0x0];let _0x36b33f=_0x3095da['model']['createRange'](_0x3095da['model']['createPositionFromPath'](_0x3095da['model']['document']['getRoot'](),_0x3e557f),_0x3095da['model']['createPositionFromPath'](_0x3095da['model']['document']['getRoot'](),_0x229cbe));const _0x36bfff=_0x3095da['model']['document']['history']['getOperations'](_0x3c9548['version']);for(const _0x4ac497 of _0x36bfff)_0x36b33f=dt['_createFromRanges'](_0x36b33f['getTransformedByOperation'](_0x4ac497));return{'range':_0x36b33f,'currentIndex':_0x219aa0};}['_integrateEditor'](_0x2e50f3){if(!_0x2e50f3['plugins']['has']('Undo'))return;const _0x2db1d6=_0x2e50f3['commands']['get']('undo'),_0x39ba27=_0x2e50f3['commands']['get']('redo');this['listenTo'](_0x2db1d6,'revert',(_0xbc22c8,_0x599dca,_0x1ff3ae)=>{const _0x43d1ec=this['_batchToChanges']['get'](_0x599dca);if(!_0x43d1ec)return;const _0x38c494=this['activeConversation']['getInteraction'](_0x43d1ec['interactionId'])['getReply'](_0x43d1ec['replyId']);_0x43d1ec['indexes']['forEach'](_0x3be36b=>_0x38c494['setChangeGroupState'](_0x3be36b,'pending')),this['_batchToChanges']['delete'](_0x599dca),this['_batchToChanges']['set'](_0x1ff3ae,_0x43d1ec);}),this['listenTo'](_0x39ba27,'revert',(_0xf8ff57,_0x3a75b2,_0x3088b3)=>{const _0x1d8d94=this['_batchToChanges']['get'](_0x3a75b2);if(!_0x1d8d94)return;const _0x564fc2=this['activeConversation']['getInteraction'](_0x1d8d94['interactionId'])['getReply'](_0x1d8d94['replyId']);_0x1d8d94['indexes']['forEach'](_0x5bf4ef=>_0x564fc2['setChangeGroupState'](_0x5bf4ef,'accepted')),this['_batchToChanges']['delete'](_0x3a75b2),this['_batchToChanges']['set'](_0x3088b3,_0x1d8d94);});}async['loadConversation'](_0x1cda8c){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](it)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x1cda8c)['getConversation'](),await this['_startConversationSafely'](_0x1cda8c),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x1cda8c,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x1ed779){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x1cda8c}),this['_logError'](new _0xec7a4c('ai-chat-conversation-not-found',this,{'error':_0x1ed779}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x5969b7=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x241db3=await _0x5969b7['getConversations']();return _0x241db3['length']?_0x241db3[0x0]['id']:'new';}catch(_0x281f03){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x2ced3c()}),this['_logError'](new _0xec7a4c('ai-chat-conversation-init-failed',this,{'error':_0x281f03})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x4dcce1){this['activeConversation']['id']===_0x4dcce1&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x338d56=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x338d56),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x3f4765,attributes:_0x5a7c82}){await this['_handleUIUserMessage']({'userMessage':_0x3f4765,'attributes':_0x5a7c82});}['getGroupId'](){const _0x91d976=this['context']['config']['get']('collaboration.channelId');if(!_0x91d976)throw new _0xec7a4c('ai-chat-missing-channel-id',this);return _0x91d976;}async['_startConversationSafely'](_0x16bb9a){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x16bb9a);}catch(_0x315a31){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x16bb9a||_0x2ced3c()}),console['error'](_0x315a31),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x5152f8){let _0x4de641;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x5152f8||!this['activeConversation']?_0x4de641=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x4de641=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x2a1c4a=this['getGroupId'](),_0x2b0246=_0x5152f8||_0x2ced3c();this['activeConversation']=new st({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x4de641,'conversationId':_0x2b0246,'group':_0x2a1c4a,'getEditor':()=>T(this['context']),'isFromHistory':!!_0x5152f8}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x3b129c,_0x508b21)=>{this['_aiChatUi']['createConversation'](_0x508b21),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x5152f8||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x34ef90,_0x2cbd7f)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x2cbd7f['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x58fc44,_0x51cec6)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x51cec6);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x2038fd=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x2038fd);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x1ac043=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x1ac043);}),this['activeConversation']['on']('webSearchFinished',(_0x24bab8,_0x370f6a)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x370f6a,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x2ff841,_0x24a07e)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x24a07e,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x44c905,_0xb24c25)=>{this['_aiChatUi']['removeFeedInteraction'](_0xb24c25['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x45c01d,_0x2a0d0d,_0x4ddbbc)=>{this['updateConversationTitle'](_0x2a0d0d,_0x4ddbbc);}),this['activeConversation']['on']('replyCreated',(_0x31f540,_0x360b0d)=>{'text'===_0x360b0d['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x360b0d):this['_aiChatUi']['addFeedItemAISuggestion'](_0x360b0d);}),this['activeConversation']['on']('replyContentUpdated',async(_0x45c9c2,_0x41d136)=>{await this['_updateReplyContent']({'reply':_0x41d136});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0xd47b4,{reply:_0x12caf6,index:_0x3f9807,state:_0x179c01})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x12caf6['id'],'index':_0x3f9807,'state':_0x179c01}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x12caf6['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x3f9807&&this['_aiChatBalloon']?.['setState'](_0x179c01);}),this['activeConversation']['on']('contextItemAdded',(_0x428ef7,_0x3aa61d)=>{if(this['_aiChatUi']['addContextItem'](_0x3aa61d['contextItem'],_0x3aa61d['isLoading']),'selection'===_0x3aa61d['contextItem']['type']){const _0x292fb1=[...T(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x292fb1,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x160216,_0x1fcc77)=>{this['_aiChatUi']['removeContextItem'](_0x1fcc77['uiId']),'current-document'==_0x1fcc77['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x1fcc77['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x2d1545,_0x5a1343)=>{this['_aiChatUi']['setContextItemLoading'](_0x5a1343['contextItem']['uiId'],_0x5a1343['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x4143f8,_0x48b21e)=>{this['_aiChatUi']['setConversationContext'](_0x48b21e['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x5c636f,_0x1cb137)=>{this['_aiChatUi']['setAddContextOptions'](_0x1cb137['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0xf9fe8d,_0x5bbc5e)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x5bbc5e['sourceId'],_0x5bbc5e['source'],_0x5bbc5e['resources'],_0x5bbc5e['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x7ff1c7,_0x1fca01)=>{this['_aiChatUi']['updateResourceState'](_0x1fca01['sourceId'],_0x1fca01['resourceId'],_0x1fca01['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x587ab6,_0x1655b9)=>{this['_aiChatUi']['updateCapabilities'](_0x1655b9);}),this['activeConversation']['on']('modelSelected',async(_0x328933,_0x3e667e)=>{const _0x26d51e=(await this['_aiChatModels']['getAll']())['find'](_0x3e63f5=>_0x3e63f5['id']===_0x3e667e['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x26d51e,_0x3e667e['isDisabled']);}),this['activeConversation']['on']('error',(_0x3cf485,{error:_0x13ec19,interactionId:_0xd382fb,fileName:_0x4aac59,url:_0x28db9f,sourceId:_0x2e7ce1,sourceLabel:_0x55de12})=>{const _0x28b963=_0xd382fb?_0xd382fb+':'+_0x2ced3c():_0x2ced3c();_0x13ec19['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x28b963}):_0x13ec19['message']['startsWith']('ai-chat-conversation-init-failed')||_0x13ec19['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x28b963}),this['_logError'](_0x13ec19)):_0x13ec19['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x4aac59),'id':_0x28b963}):_0x13ec19['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x28db9f),'id':_0x28b963}):_0x13ec19['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x28b963}):_0x13ec19['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x28b963}):_0x13ec19['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x2e7ce1&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x2e7ce1),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x55de12||'source'),'id':_0x28b963}),this['_logError'](_0x13ec19)):_0x13ec19['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x28b963}),this['_logError'](_0x13ec19)):_0x13ec19['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x28b963}),this['_logError'](_0x13ec19)):_0x13ec19['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x28b963}),this['_logError'](_0x13ec19)):_0x13ec19['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x28b963}),this['_logError'](_0x13ec19)):_0x13ec19['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x28b963}),this['_logError'](_0x13ec19)):_0x13ec19['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x28b963}),this['_logError'](_0x13ec19)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x28b963}),this['_logError'](_0x13ec19));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x5152f8||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x25d9ce,attributes:_0x13fa23}){if(!this['activeConversation'])throw new _0xec7a4c('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x52f3b4=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x52f3b4);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x25d9ce,'attributes':_0x13fa23});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x10b4cf){this['_aiChatUi']['setIsMaximized'](_0x10b4cf);}['_logError'](_0x36833d){_0x4f2fe2(_0x36833d['message']);}['_removeFromContext'](_0x596bcc){this['activeConversation']?.['removeFromContext'](_0x596bcc);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x2fc685){const [_0x1f810b,_0x5440a4]=_0x2fc685['split'](':'),_0x449766=this['activeConversation']['getInteraction'](_0x1f810b),_0x429cd5=_0x449766['getReply'](_0x5440a4);return{'interaction':_0x449766,'reply':_0x429cd5};}['_scrollToSuggestionRange'](_0x352078,_0x2d6d25=!0x1){const _0x4c698b=T(this['context']),_0x32469f={'target':_0x4c698b['editing']['view']['domConverter']['viewRangeToDom'](_0x4c698b['editing']['mapper']['toViewRange'](_0x352078)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x2d6d25};_0x2d6d25&&(_0x32469f['alignToTop']=!0x0),_0x527ffd(_0x32469f);}['updateConversationTitle'](_0xa3eba9,_0x9d8f30=!0x1){this['_aiChatUi']['setConversationTitle'](_0xa3eba9||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x9d8f30);}async['_updateReplyContent']({reply:_0x56bb1f,renderingStrategy:_0x2f027c}){const {id:_0x51186c,interactionId:_0xb49ccc,isDone:_0x1deac6,type:_0x2a921b,parsedContent:_0x40afa9}=_0x56bb1f,_0x3a5684=_0xb49ccc+':'+_0x51186c;if('modification'===_0x2a921b){const _0x162105=_0x56bb1f['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3a5684,'parts':_0x162105,'renderingStrategy':_0x2f027c,'isDone':_0x1deac6});}else'text'===_0x2a921b&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x3a5684,'parsedContent':_0x40afa9,'renderingStrategy':_0x2f027c,'isDone':_0x1deac6});_0x1deac6&&_0x56bb1f['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x3a5684,_0x56bb1f['sources']);}async['_stopLastInteraction'](){const _0x230e2d=this['activeConversation']?.['lastInteraction'];_0x230e2d&&(_0x230e2d['stop'](),this['_aiChatUi']['stopInteraction'](_0x230e2d));}async['_flushLastInteractionUI'](){const _0x173cd2=this['activeConversation']?.['lastInteraction'];if(_0x173cd2){for await(const _0x4dfdf0 of _0x173cd2['replies'])await this['_updateReplyContent']({'reply':_0x4dfdf0,'renderingStrategy':'static'});}}['_updateRatings'](_0x34d086){const _0x379e38={'positiveCount':_0x34d086['changeGroups']['filter'](_0x42dc6b=>'accepted'===_0x42dc6b['state'])['length'],'totalCount':_0x34d086['changeGroups']['length'],'modificationId':_0x34d086['id']},_0x3ae046=this['activeConversation']['getInteraction'](_0x34d086['interactionId'])['messageId'];_0x3ae046&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x3ae046,_0x379e38);}['_registerToolDataCallback'](_0x38437f){let _0x5258ff=null,_0x39b82f=null;this['on']('toolDataReceived',(_0x3af573,_0x1ddf33,_0x4b66f2)=>{_0x4b66f2['id']!==_0x5258ff&&(_0x5258ff=_0x4b66f2['id'],_0x39b82f=this['_getAIChatInteractionAPI'](_0x4b66f2)),_0x38437f(_0x1ddf33,_0x39b82f);});}['_getAIChatInteractionAPI'](_0x4d941d){const _0x37c0ee=this['_aiChatUi'],_0x139e24=()=>{_0x4d941d['resetWebSearchState'](),_0x4d941d['resetReasoningState'](),_0x37c0ee['clearLoadingMessage']();},_0x52b2cd=()=>{_0x4d941d['currentReply']&&(_0x4d941d['currentReply']['done'](),_0x4d941d['currentReply']=void 0x0);};return{'insertTextReply':(_0x582463,_0x4cbd6f)=>{_0x52b2cd(),_0x139e24();const _0x2ed4d8=_0x4d941d['currentReply']=_0x4d941d['createReply']({'type':'text','interactionId':_0x4d941d['id'],'content':_0x582463,'id':_0x4cbd6f||_0x2ced3c()});return _0x52b2cd(),_0x2ed4d8;},'insertCustomElement':async(_0x37051f,_0x398895)=>(_0x52b2cd(),_0x139e24(),_0x37c0ee['addFeedItemCustomElement'](_0x37051f,_0x398895||_0x2ced3c())),'setLoadingMessage':_0x25212e=>{_0x37c0ee['setLoadingMessage'](_0x25212e);},'clearLoadingMessage':()=>{_0x37c0ee['clearLoadingMessage']();}};}}const R='ai-selection';class D extends _0x42547c{constructor(_0x17137d){super(_0x17137d),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_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 _0x45a596=T(this['context']),_0x4787a9=_0x45a596['plugins']['has']('RealTimeCollaborationClient')&&_0x45a596['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x4787a9||_0x2ced3c();}return this['_sessionId'];}async['getDocumentData'](){const _0x3557af=T(this['context']),_0x3e33af=_0x3557af['model'],_0x380127=_0x3557af['data']['toView'](_0x3e33af['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x27ef3b=new Dt(_0x3557af['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x380127,_0x27ef3b);let _0x373af2=await this['_getDocumentDataStringFromView'](_0x380127);const _0x3121e6=this['_getMarkersInDocumentOrder'](),_0x27647f=[];for(const _0x4d4ad2 of _0x3121e6){const _0xc64a06='<'+_0x4d4ad2['name']+':start></'+_0x4d4ad2['name']+':start>',_0x4bc1d0=_0x373af2['indexOf'](_0xc64a06);_0x373af2=_0x373af2['substring'](0x0,_0x4bc1d0)+_0x373af2['substring'](_0x4bc1d0+_0xc64a06['length']);const _0x3f0f02='<'+_0x4d4ad2['name']+':end></'+_0x4d4ad2['name']+':end>',_0x526347=_0x373af2['indexOf'](_0x3f0f02);_0x373af2=_0x373af2['substring'](0x0,_0x526347)+_0x373af2['substring'](_0x526347+_0x3f0f02['length']),_0x27647f['push']({'markerName':_0x4d4ad2['name'],'start':_0x4bc1d0,'end':_0x526347,'htmlFragment':_0x373af2['substring'](_0x4bc1d0,_0x526347)});}return{'content':_0x373af2,'version':_0x3557af['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x27647f};}async['afterInit'](){this['context']instanceof _0x5a617c?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0xea8992,_0x5cf0f4)=>{_0x5cf0f4['on']('ready',()=>{this['_integrateEditor'](_0x5cf0f4);});});}['_setOutputDataProcessor'](_0x5573f0){this['_outputDataProcessor']=_0x5573f0;}async['_getDocumentDataStringFromView'](_0x301986){let _0x420866;const _0x2b1b0c=T(this['context']);if(this['_outputDataProcessor']){const _0x168163=_0x2b1b0c['data']['processor']['domConverter']['viewToDom'](_0x301986),_0x4ceef9=await this['_outputDataProcessor'](_0x168163);_0x420866=_0x2b1b0c['data']['processor']['htmlWriter']['getHtml'](_0x4ceef9);}else _0x420866=_0x2b1b0c['data']['processor']['toData'](_0x301986);return _0x420866;}['_integrateEditor'](_0x556f6c){_0x556f6c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':R,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x556f6c['conversion']['for']('dataDowncast')['markerToElement']({'model':R,'view':(_0x5bed2a,{writer:_0x4677db,options:_0x49143d})=>_0x49143d['convertAiChatSelectionMarker']?_0x4677db['createUIElement'](_0x5bed2a['markerName']+':'+(_0x5bed2a['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x163a0e,_0x60a343,_0x2c1745=!0x1,_0x4b5693=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x4b5693)return!0x1;const _0x27be8c=T(this['context'])['model'];return _0x27be8c['change'](_0x1c2329=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x60a343,this['_displayedFakeSelectionLocked']=_0x2c1745;let _0x1d0770=0x0;for(let _0x237ae2 of _0x163a0e){const _0x376537=R+':'+_0x1d0770;if(_0x237ae2['start']['isAtEnd']){const _0x12bc69=_0x237ae2['start']['getLastMatchingPosition'](({item:_0x404f38})=>!_0x27be8c['schema']['isContent'](_0x404f38),{'boundaries':_0x237ae2});_0x237ae2=_0x1c2329['createRange'](_0x12bc69,_0x237ae2['end']);}_0x1c2329['addMarker'](_0x376537,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x237ae2}),_0x1d0770++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x8c1689){if(this['_displayedFakeSelectionId']!=_0x8c1689)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x20b936=T(this['context']),_0x4e888d=_0x20b936['model']['markers']['getMarkersGroup'](R);return _0x20b936['model']['change'](_0x4e3374=>{for(const _0x39c4f9 of _0x4e888d)_0x4e3374['removeMarker'](_0x39c4f9);}),!0x0;}async['modelToDataWithIds'](_0x16872e){const _0x3b7921=T(this['context']),_0x13ef34=_0x3b7921['data']['toView'](_0x16872e),_0x14680f=new Dt(_0x3b7921['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x13ef34,_0x14680f),this['_getDocumentDataStringFromView'](_0x13ef34);}['_setDataIdsOnChildren'](_0x175dd0,_0x220fca){let _0x211d5d=!0x1;const _0x580c16=new Set();for(const _0x5c5492 of _0x175dd0['getChildren']()){const _0x59f6cc=_0x5c5492['is']('emptyElement')||_0x5c5492['is']('containerElement');if(!_0x5c5492['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x5c5492,_0x220fca)||_0x59f6cc)&&(_0x220fca['setAttribute']('data-id',this['_nextDataId'](_0x580c16),_0x5c5492),_0x211d5d=!0x0);}return _0x211d5d;}['_nextDataId'](_0x31c607){let _0x2af173;do{_0x2af173='';for(let _0x18447e=0x0;_0x18447e<0x4;_0x18447e++)_0x2af173+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x31c607['has'](_0x2af173));return _0x31c607['add'](_0x2af173),_0x2af173;}['getSelectionText'](){const {model:_0x234e27}=T(this['context']),_0x5c3db5=_0x234e27['document']['selection'],_0x1ff795=[];for(const _0x1c37ca of _0x5c3db5['getRanges']())for(const _0x4dbe0e of _0x1c37ca['getItems']())_0x4dbe0e['is']('$textProxy')?_0x1ff795['push'](_0x4dbe0e['data']):_0x4dbe0e['is']('element')&&_0x1ff795['length']>0x0&&'\x20'!==_0x1ff795[_0x1ff795['length']-0x1]&&_0x1ff795['push']('\x20');return _0x1ff795['length']?'\x22'+_0x1ff795['join']('')['trim']()+'\x22':i(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x5eab19=T(this['context'])['model'];return Array['from'](_0x5eab19['markers']['getMarkersGroup'](R))['sort']((_0x21954f,_0x3111b3)=>_0x21954f['getStart']()['isBefore'](_0x3111b3['getStart']())?-0x1:_0x21954f['getStart']()['isAfter'](_0x3111b3['getStart']())?0x1:0x0);}}const W=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Rt=[...W,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x8afe05){this['options']={'delay':_0x8afe05['delay']??0x14,'textNodeStyle':_0x8afe05['textNodeStyle'],'onStreamUpdate':_0x8afe05['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x1f1623,targetElement:_0x4e3968,abortSignal:_0x58f4fe}){this['isStreaming']&&this['stop'](),_0x58f4fe?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x4d57d2(_0x1f1623,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x376702=0x0;_0x376702<this['currentIndex'];_0x376702++)this['nodesList'][_0x376702]['shouldBeStreamed']=!0x0;do{const _0x20e811=Date['now'](),_0x39661b=this['nodesList'][this['currentIndex']],_0xa7581f=_0x20e811-this['lastUpdateTime'];if(_0x39661b){_0x39661b['shouldBeStreamed']=!0x0;let _0xef7aa9=_0x39661b['parent'];for(;_0xef7aa9;)_0xef7aa9['shouldBeStreamed']=!0x0,_0xef7aa9=_0xef7aa9['parent'];}if(_0xa7581f<this['options']['delay'])try{const {promise:_0x5317c9,abortController:_0x11ba8d}=Us(this['options']['delay']-_0xa7581f);this['timeoutAbortController']=_0x11ba8d,await _0x5317c9;}catch(_0x55b122){return;}_0x457fab(_0x4e3968,'<'+_0x4e3968['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x4e3968['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x1f49a8}){Array['from'](_0x1f49a8['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x27fdf5=>{_0x27fdf5['replaceWith'](_0x27fdf5['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x4f44ce){let _0x56eb2d='';if(function(_0x162786){return _0x2b4893(_0x162786);}(_0x4f44ce)){for(const _0x35e069 of _0x4f44ce['children'])_0x56eb2d+=this['renderNode'](_0x35e069);}else{if(Ls(_0x4f44ce)){if(!_0x4f44ce['shouldBeStreamed'])return'';const _0x12f54a=_0x4f44ce,_0x783433=Object['entries'](_0x12f54a['attribs'])['map'](([_0x2b3839,_0x567bfb])=>_0x2b3839+'=\x22'+_0x567bfb+'\x22')['join']('\x20');_0x56eb2d+='<'+_0x12f54a['tagName']+(_0x783433?'\x20'+_0x783433:'')+'>';for(const _0x45e2f6 of _0x5e68c9(_0x12f54a))_0x56eb2d+=this['renderNode'](_0x45e2f6);_0x56eb2d+='</'+_0x12f54a['tagName']+'>';}else{if(!Ds(_0x4f44ce))return'';if(!_0x4f44ce['shouldBeStreamed'])return'';!function(_0xad0d52){if(!_0xad0d52['parent']||!Ls(_0xad0d52['parent']))return!0x1;if(!Ts['includes'](_0xad0d52['parent']['tagName']))return!0x1;return!_0x78b08c(_0xad0d52)['match'](/^\s*[<>]\s*$/);}(_0x4f44ce)?_0x56eb2d+=_0x182c8b(_0x4f44ce):_0x56eb2d+=_0x182c8b(new _0x2578d3('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x4f44ce]));}}return _0x56eb2d;}['getParsedDocumentNodeList'](){const _0x2579c0=[];return function(_0x28a07d,_0xed7c3c){const _0x577196=_0x1c4f53=>{if(_0xed7c3c(_0x1c4f53),_0x1c4f53 instanceof _0x6c3ec1)for(let _0x202a75=0x0;_0x202a75<_0x1c4f53['children']['length'];_0x202a75++){const _0x5af6a0=_0x1c4f53['children'][_0x202a75];_0x577196(_0x5af6a0);}};for(let _0x1d4e1f=0x0;_0x1d4e1f<_0x28a07d['children']['length'];_0x1d4e1f++)_0x577196(_0x28a07d['children'][_0x1d4e1f]);}(this['document'],_0x1e630b=>{if(Ds(_0x1e630b)){const _0x56f1c3=this['splitTextNodeIntoWordNodes'](_0x1e630b);_0x56f1c3['length']&&_0x2579c0['push'](..._0x56f1c3);}_0x1e630b['isWordSplitSource']||_0x1e630b['isWordSplitResult']||_0x2579c0['push'](_0x1e630b);}),_0x2579c0;}['splitTextNodeIntoWordNodes'](_0x3e2122){if(_0x3e2122['isWordSplitSource']||_0x3e2122['isWordSplitResult'])return[];const _0x42d3ae=_0x78b08c(_0x3e2122)['match'](/(?:\s*\S+\s*)/g),_0x58709e=[];if(_0x42d3ae&&_0x42d3ae['length']>0x1){for(const _0x4e58b6 of _0x42d3ae){const _0x13abaa=new _0x459c0a(_0x4e58b6);_0x13abaa['isWordSplitResult']=!0x0,_0x563c61(_0x3e2122,_0x13abaa),_0x58709e['push'](_0x13abaa);}_0x3e2122['isWordSplitSource']=!0x0,_0x59f194(_0x3e2122);}return _0x58709e;}}const Ts=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Ds(_0x2d2da0){return _0x48e3bc(_0x2d2da0);}function Ls(_0x23dbd0){return _0x203949(_0x23dbd0);}function Us(_0x9dbf71){const _0x3a3523=new AbortController();return{'promise':new Promise((_0x5ec71f,_0x179248)=>{const _0x190c5f=setTimeout(_0x5ec71f,_0x9dbf71);_0x3a3523['signal']['addEventListener']('abort',()=>{clearTimeout(_0x190c5f),_0x179248();});}),'abortController':_0x3a3523};}class Fr extends _0x52fd2c{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x313754){super();const _0x721fd=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']=_0x313754,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x721fd['if']('isDone','ck-ai-chat__feed__item_done'),_0x721fd['if']('isVisible','ck-hidden',_0x3c4512=>!_0x3c4512),'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'](_0x3594c7=>{_0x3594c7['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x2a4738,_0x11c166,_0x47e104){await this['htmlStreamer']['stream']({'document':_0x2a4738,'targetElement':_0x11c166,'abortSignal':_0x47e104});}}class oa extends _0x52fd2c{['showChangesToggleView'];constructor(_0x1678da,_0x45115a){super(_0x1678da),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Zn(_0x1678da),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x1678da,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x45115a['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x2f776a=>_0x2f776a?_0x4f8065:_0x69657c),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x232b14=new _0x3d6008();_0x232b14['content']=_0x1a3b82,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x45115a['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x232b14,{'tag':'span','children':[i(_0x1678da,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Zn extends _0x129639{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Or={'accepted':_0x98814a,'rejected':_0x28d854,'outdated':_0x28d854};class ps extends _0x52fd2c{['stateIconView'];constructor(_0x495b98){super(_0x495b98);const _0x34ab7b=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new Wr(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x34ab7b['to']('state',_0x35e160=>'ck-ai-suggestion__content-part-state_'+_0x35e160),_0x34ab7b['if']('isVisible','ck-hidden',_0x29610e=>!_0x29610e)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x34ab7b['to']('state',_0x21d9b2=>{switch(_0x21d9b2){case'accepted':return i(_0x495b98,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0x495b98,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0x495b98,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x20eaf7){this['state']=_0x20eaf7;}}class Wr extends _0x3d6008{constructor(){super(),this['set']('state','accepted'),this['content']=Or[this['state']],this['on']('change:state',()=>{this['content']=Or[this['state']];});}}class us extends _0xcb5503{['_applyButton'];['_suggestButton'];constructor(_0x33a30d,_0x42e80f,_0x52d445){super(_0x33a30d);const _0xaeefbe=Boolean(_0x52d445);this['set']('isEnabled',!_0xaeefbe),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x5bc313=[];if(_0xaeefbe){const _0x37cc54=new _0x129639(_0x33a30d);_0x37cc54['set']({'label':i(_0x33a30d,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc}),_0x5bc313['push'](_0x37cc54);}else{_0x42e80f['includes']('applySuggestion')&&(this['_applyButton']=new _0x129639(_0x33a30d),this['_applyButton']['set']({'label':i(_0x33a30d,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x98814a}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x5bc313['push'](this['_applyButton'])),_0x42e80f['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x129639(_0x33a30d),this['_suggestButton']['set']({'label':i(_0x33a30d,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x29865d}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x5bc313['push'](this['_suggestButton']));const _0x4704c5=new _0x129639(_0x33a30d);_0x4704c5['set']({'label':i(_0x33a30d,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x28d854}),_0x4704c5['bind']('isEnabled')['to'](this),_0x4704c5['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x5bc313['push'](_0x4704c5);}this['items']['addMany'](_0x5bc313);const _0x133e6a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x133e6a['if']('isVisible','ck-hidden',_0x4339ca=>!_0x4339ca)]}});}['setButtonsVisibility']({showApplyButton:_0xcff806,showSuggestButton:_0x517a30}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0xcff806),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x517a30);}}class vn extends _0x52fd2c{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x46b9e3,{part:_0xf94e32,uiIndex:_0x2af18c,availableActions:_0x2ebb6e,areActionsDisabled:_0x67d303}){super(_0x46b9e3),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new us(_0x46b9e3,_0x2ebb6e,_0x67d303),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0xf94e32['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0xf94e32['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0xf94e32['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new ps(_0x46b9e3),this['titleLabelView']=new Sn(_0x46b9e3,_0x2af18c),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],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',(_0x5b47a8,_0x42ebce,_0x2363cd,_0x3664f0)=>{'pending'===_0x3664f0?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x2363cd?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x2363cd),this['children']['add'](this['stateView']));});}}class Sn extends _0x52fd2c{constructor(_0x18fc1b,_0xae02ee){super(_0x18fc1b),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x18fc1b,'AI_SUGGESTION_CONTENT_PART_TITLE',_0xae02ee['toString']())]});}}class cs extends _0x52fd2c{['htmlStreamer'];constructor(_0x24d3a6){super(_0x24d3a6),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x3ad938,renderingStrategy:_0x1f21db,abortSignal:_0x498a69}){'streaming'===_0x1f21db?await this['htmlStreamer']['stream']({'document':_0x3ad938['content'],'targetElement':this['element'],'abortSignal':_0x498a69}):this['element']['innerHTML']=pt(_0x3ad938['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x52fd2c{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x49233b,{part:_0x2af5ca,uiIndex:_0x7d6bf3,areActionsDisabled:_0x57cf29,availableActions:_0x155c31}){super(_0x49233b);const _0x6ac8cc=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x27c440=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x57cf29;};this['on']('change:state',_0x27c440),this['on']('change:isDone',_0x27c440),_0x27c440(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0x49233b,{'part':_0x2af5ca,'uiIndex':_0x7d6bf3,'availableActions':_0x155c31,'areActionsDisabled':_0x57cf29}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...W)['to'](this),this['_streamableContentView']=new cs(_0x49233b),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x6ac8cc['to']('state',_0x1ff829=>'ck-ai-suggestion__body__content-part_'+_0x1ff829),_0x6ac8cc['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x6ac8cc['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x6ac8cc['if']('isVisible','ck-hidden',_0xb7f6b0=>!_0xb7f6b0)]},'children':this['_children'],'on':{'mouseenter':_0x6ac8cc['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x2af5ca['index']});}),'mouseleave':_0x6ac8cc['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x2af5ca['index']});}),'click':_0x6ac8cc['to'](_0x564431=>{const _0x3666dd=_0x564431['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x3666dd)&&this['fire']('showChangeInText',{'index':_0x2af5ca['index']});})}});}async['updateContent']({part:_0x151843,renderingStrategy:_0x538ed3,showUnchangedParts:_0x32674e=!0x1,abortSignal:_0x23f361}){this['partDefinition']=_0x151843,this['isVisible']=this['partDefinition']['hasChanges']||_0x32674e,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x151843,'renderingStrategy':_0x538ed3,'abortSignal':_0x23f361});}['markAsDone'](){this['isDone']=!0x0;}}class St extends _0x186953(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x153d3f){const _0x3a6620=this['createTask'](_0x153d3f);return this['queue']['push'](_0x3a6620),this['_processQueue'](),_0x3a6620['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(_0xf9d0e5=>{this['once']('_queueEmpty',()=>{_0xf9d0e5();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x17e325=this['queue']['shift']();try{await _0x17e325['callback'](this['_abortController']['signal']),_0x17e325['resolve']();}catch(_0x5cc75b){_0x17e325['reject'](_0x5cc75b);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x1627cb){let _0x240e5b,_0x209dad;const _0x5a126d=new Promise((_0x32ae7f,_0x278af2)=>{_0x240e5b=_0x32ae7f,_0x209dad=_0x278af2;});return{'callback':_0x1627cb,'resolve':_0x240e5b,'reject':_0x209dad,'completePromise':_0x5a126d};}}class Ke extends Fr{constructor(_0x194b99){super(_0x194b99),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x194b99['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x119215){this['element']['innerHTML']=_0x119215;}}const J=['applySuggestion','insertSuggestion'];class ra extends _0x52fd2c{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x407481,_0x125781=[...J],_0xdd4f12){super(_0x407481);const _0x391dff=this['bindTemplate'],_0x1918e5=Boolean(_0xdd4f12);if(this['set']('isEnabled',!_0x1918e5),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x1918e5){const _0x5ed2e8=new _0x129639(_0x407481);_0x5ed2e8['set']({'label':i(_0x407481,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc});const _0x2f40b0=new _0x52fd2c(_0x407481);_0x2f40b0['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x407481,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x5ed2e8]}]}),this['children']['add'](_0x2f40b0);}else this['_applyChangesButton']=new _0x129639(_0x407481),this['_applyChangesButton']['set']({'label':i(_0x407481,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x125781['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x129639(_0x407481),this['_insertSuggestionsButton']['set']({'label':i(_0x407481,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x125781['includes']('insertSuggestion'),'class':'ck-ai-button-secondary'}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x5b8f96=>{_0x5b8f96['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x391dff['if']('isVisible','ck-hidden',_0x97daec=>!_0x97daec)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x41897a){this['isVisible']=_0x41897a;}['_switchButtonLabelsPlurality'](_0x4498d9){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x4498d9?(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sr extends _0x52fd2c{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x4d8c6d,_0x13149b){super(_0x4d8c6d),this['bodyCollection']=_0x13149b,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',_0x4087b7=>!_0x4087b7)]},'children':this['children']});const _0x515596=new _0x52fd2c(this['locale']),_0x3ec181=new _0x3d6008();_0x3ec181['content']=_0x2ffb5e,_0x515596['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x3ec181,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x515596),this['_setupBalloonPanel'](_0x4d8c6d);}['addSource'](_0x51708){this['children']['add'](new zr(this['locale'],_0x51708,this['balloonPanelView']));}['_setupBalloonPanel'](_0x2e7ce4){this['balloonPanelView']=new _0xc6701d(_0x2e7ce4),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class zr extends _0x129639{['balloonPanelView'];['source'];constructor(_0x4a1be1,_0x2f0ef9,_0x107fb8){super(_0x4a1be1),this['source']=_0x2f0ef9,this['balloonPanelView']=_0x107fb8,this['set']({'label':_0x2f0ef9['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x4ae477=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x4ae477['to'](()=>{window['open'](_0x2f0ef9['url'],'_blank');}),'mouseenter':_0x4ae477['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x4ae477['to'](()=>{this['_hideTooltip']();})}}),_0x2f0ef9['favicon']){const _0x390b6d=new _0x52fd2c(_0x4a1be1);_0x390b6d['setTemplate']({'tag':'img','attributes':{'src':_0x2f0ef9['favicon']||_0x2ffb5e,'alt':_0x2f0ef9['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x390b6d);}else this['set']('icon',_0x2ffb5e);}['_createTooltipContentView'](_0x14d245,_0xb1543e){const _0x606406=new _0x52fd2c(_0x14d245),_0xe1ca17=[];let _0xf21456;_0xb1543e?.['favicon']?(_0xf21456=new _0x52fd2c(_0x14d245),_0xf21456['setTemplate']({'tag':'img','attributes':{'src':_0xb1543e['favicon'],'alt':_0xb1543e['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0xf21456=new _0x3d6008(),_0xf21456['content']=_0x2ffb5e,_0xf21456['extendTemplate']({'attributes':{'alt':_0xb1543e['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0xe1ca17['push'](_0xf21456);const _0x590bb0=new _0x52fd2c(_0x14d245);_0x590bb0['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0xb1543e['url']},'children':[{'text':new URL(_0xb1543e['url'])?.['hostname']}]}),_0xe1ca17['push'](_0x590bb0);const _0x15e2aa=new _0x52fd2c(_0x14d245);_0x15e2aa['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0xe1ca17});const _0x27bc45=new _0x52fd2c(_0x14d245);return _0x27bc45['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0xb1543e['title']['length']>0x190?_0xb1543e['title']['substring'](0x0,0x190)+'...':_0xb1543e['title']}]}),_0x606406['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x15e2aa,_0x27bc45]}),_0x606406;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0xc6701d['defaultPositions']['northArrowSouth'],_0xc6701d['defaultPositions']['northArrowSouthWest'],_0xc6701d['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x29cfa0=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x29cfa0);}}class ca extends _0x52fd2c{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x384bfb,_0x54b292){super(_0x384bfb);const {areActionsDisabled:_0x3ce35c,showUnchangedParts:_0x9b46a0,availableActions:_0x23b9d9}=_0x54b292;this['_areActionsDisabled']=_0x3ce35c,this['_showUnchangedParts']=_0x9b46a0,this['_availableActions']=_0x23b9d9,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new St(),this['_emptyPartsWarningView']=new Ke({'id':'empty-parts-warning','initialContent':i(_0x384bfb,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x384bfb,_0x54b292['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x54b292['bodyCollection']),_0x54b292['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...W)['to'](this),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'],this['_actionsView'],this['_sourcesView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x9e32fc,renderingStrategy:_0x555676,abortSignal:_0x4fd4ed}){this['_children']['length']?_0x9e32fc['forEach'](_0x15f1b4=>{const _0x3d378b=this['_cachedContentParts']['findIndex'](_0x13d1c3=>_0x13d1c3['index']==_0x15f1b4['index']);-0x1===_0x3d378b?this['_cachedContentParts']['push'](_0x15f1b4):this['_cachedContentParts'][_0x3d378b]=_0x15f1b4;}):this['_cachedContentParts']=_0x9e32fc;const _0x3f6096=this['_showUnchangedParts']?_0x9e32fc:_0x9e32fc['filter'](_0x401e40=>_0x401e40['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x3f6096['length']>0x1);for(const _0x2883fd of _0x3f6096)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x4e58c2=>{let _0x34422d=this['getPartView'](_0x2883fd['index']);_0x34422d||(_0x34422d=new na(this['locale'],{'part':_0x2883fd,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x34422d['delegate'](...W)['to'](this),this['_children']['add'](_0x34422d),this['hasPendingParts']=!0x0),await _0x34422d['updateContent']({'part':_0x2883fd,'renderingStrategy':_0x555676,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x4e58c2}),_0x34422d['markAsDone']();});return _0x4fd4ed?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x357248,_0x46b945){const _0x4d8ab4=this['getPartView'](_0x357248);_0x4d8ab4&&(_0x4d8ab4['state']=_0x46b945),this['hasPendingParts']='pending'==_0x46b945||Array['from'](this['_children'])['some'](_0x65c1d9=>'pending'==_0x65c1d9['state']);}['setPartActive'](_0x183fe1,_0x5ecd0c){if(!0x1===_0x183fe1){for(const _0x1936d0 of this['_children'])_0x1936d0['isActive']=!0x1;}else{const _0x4d8f2a=this['getPartView'](_0x183fe1);_0x4d8f2a&&(_0x4d8f2a['isActive']=_0x5ecd0c);}}['updateSources'](_0x2274de){_0x2274de['forEach'](_0x47aabb=>this['_sourcesView']['addSource'](_0x47aabb)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x329ebf){return this['_children']['find'](_0x451d4e=>_0x451d4e['partDefinition']['index']==_0x329ebf)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x28d679=!this['_cachedContentParts']['find'](({hasChanges:_0x19b0be})=>_0x19b0be),_0x2da29a=!!this['_cachedContentParts']['find'](({hasChanges:_0x415f52})=>!_0x415f52);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x2da29a,_0x28d679?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x1a1f20=>_0x1a1f20['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x2d10fd=>_0x2d10fd['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0x52fd2c{['bodyView'];['children'];['headerView'];constructor(_0x2f1753,_0x58826d,_0x5bf621){super(_0x2f1753);const {showDiff:_0x34d238,areActionsDisabled:_0x377442,showUnchangedParts:_0x1488ca,availableActions:_0x5eb0e3}=_0x58826d;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x2f1753,{'showDiff':_0x34d238}),this['headerView']['on']('toggleShowChanges',(_0x34129f,_0x3ce925)=>{this['areChangesVisible']=_0x3ce925['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x3ce925['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0x2f1753,{'areActionsDisabled':_0x377442,'showUnchangedParts':!!_0x1488ca,'availableActions':_0x5eb0e3,'bodyCollection':_0x5bf621}),this['bodyView']['delegate'](...W)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x4282b6){await this['bodyView']['updateContentParts'](_0x4282b6);}['updateSources'](_0x4d260f){this['bodyView']['updateSources'](_0x4d260f);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Pe extends Fr{['containerView'];constructor(_0xe2f92a,_0x4427a6,_0x4b46a9){super(_0x4427a6),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0xe2f92a,{'showDiff':_0x4427a6['showDiff'],'areActionsDisabled':_0x4427a6['areActionsDisabled'],'availableActions':_0x4427a6['availableActions']},_0x4b46a9),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x2d4a6f,_0x38fcc7)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x38fcc7['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),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',(_0x6d5954,{index:_0x3c5621})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x3c5621});}),this['containerView']['on']('applySuggestion',(_0x245fae,{index:_0x16c2f4}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x16c2f4});}),this['containerView']['on']('insertSuggestion',(_0x421663,{index:_0x3c4cf3}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3c4cf3});}),this['containerView']['on']('rejectSuggestion',(_0x564f0f,{index:_0x4278fa})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4278fa});}),this['containerView']['on']('mouseOverSuggestion',(_0x1c8a6c,{index:_0x2936b2})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2936b2});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x149e73,{index:_0x1796e6})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1796e6});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x3efc24){await this['containerView']['updateContent'](_0x3efc24);}['updatePartState'](_0x83f929,_0x196c0c){this['containerView']['bodyView']['updatePartState'](_0x83f929,_0x196c0c);}['setPartActive'](_0x557709,_0x278637){!0x1===_0x557709?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x557709,_0x278637);}['updateSources'](_0x3eaf2d){this['containerView']['updateSources'](_0x3eaf2d);}['getPartView'](_0x318dc6){return this['containerView']['bodyView']['getPartView'](_0x318dc6);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Be extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x1c978d,_0x2bd531,_0x249b45){super(_0x2bd531),this['_bodyCollection']=_0x249b45,this['locale']=_0x1c978d,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x52fd2c(),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':Ri(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x3f92fa,renderingStrategy:_0x39dfd5,abortSignal:_0x3fb4ea}){'streaming'===_0x39dfd5?await this['streamIntoElement'](_0x3f92fa,this['replyContainer']['element'],_0x3fb4ea):this['replyContainer']['element']['innerHTML']=_0x182c8b(_0x3f92fa);}['updateSources'](_0x2e4cb9){const _0xe1ee86=new Sr(this['locale'],this['_bodyCollection']);_0xe1ee86['children']['addMany'](_0x2e4cb9['map'](_0x4cc6a2=>new zr(this['locale'],_0x4cc6a2,_0xe1ee86['balloonPanelView']))),_0xe1ee86['isVisible']=!0x0,this['children']['add'](_0xe1ee86);}}class Ze extends _0x12e180{constructor(_0x47e0a7=void 0x0){super();const _0x597418=_0x47e0a7?'ck-ai-spinner_'+_0x47e0a7:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x597418]}});}}const xn={'file':_0x25e079,'document':_0x4e4106,'web-resource':_0x49a141,'text':_0x25e079,'selection':_0x524a1e,'mcp-tool-context':_0x4e4106},Yr='ck-ai-chat-context-chip',$r='ck-ai-chat-context-chip_wide',Qr='ck-ai-chat-context-chip_document',Xr='ck-ai-chat-context-chip__label',Zr='ck-ai-chat-context-chip__type-icon',la='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class vo extends _0x129639{constructor(_0x12ce0b,_0x494d18,_0x5470e5,_0x432cae,_0x485ca4=!0x1){super(_0x12ce0b),this['_isAnimationOnEnterEnabled']=_0x432cae,this['_initializeProperties'](_0x494d18,_0x5470e5,_0x485ca4),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'](_0x1e21ae,_0x1aed68,_0x1929a4){this['set']('label',_0x1e21ae['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x1e21ae['type']),this['set']('id',_0x1e21ae['uiId']),this['set']('readonly',_0x1aed68),this['set']('isLoading',_0x1929a4);}['_setupTemplate'](){const _0x4114da=this['_createIconView'](),_0x4a9955=this['_createRemoveButton'](),_0x25e530=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x25e530),'children':this['_createTemplateChildren'](_0x4114da,_0x4a9955,_0x25e530)});}['_createTemplateAttributes'](_0x1cabdb){return{'class':[Yr,_0x1cabdb['if']('itemType',Qr,_0x13a760=>'document'==_0x13a760),_0x1cabdb['if']('itemType',$r,_0x3c545b=>'selection'==_0x3c545b)],'data-cke-tooltip-text':_0x1cabdb['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':la};}['_createTemplateChildren'](_0x13453b,_0x5bdb61,_0x56e1dd){const _0x193834=this['_createLabelElement'](_0x56e1dd),_0x1af40a=this['_createLoaderIcon']();return this['readonly']?[_0x13453b,_0x193834]:[_0x13453b,_0x1af40a,_0x193834,_0x5bdb61];}['_createLabelElement'](_0x2ebac5){return{'tag':'span','attributes':{'class':Xr},'children':[{'text':_0x2ebac5['to']('label')}]};}['_createRemoveButton'](){const _0x198c98=new _0x129639(this['locale']);return _0x198c98['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x4ef101}),this['_setupRemoveButtonEvent'](_0x198c98),_0x198c98;}['_setupRemoveButtonEvent'](_0x5e6887){_0x5e6887['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x586446=this['bindTemplate'],_0x5bdf66=new _0x3d6008();return _0x5bdf66['content']=xn[this['itemType']],_0x5bdf66['extendTemplate']({'attributes':{'class':[Zr,_0x586446['if']('isLoading','ck-hidden',_0x4278b7=>_0x4278b7)]}}),_0x5bdf66;}['_handleAnimationEndOnce'](_0x2aee58,_0x1baecc){if(!_0x2aee58)return;const _0x31ce4c=()=>{_0x1baecc(),_0x2aee58['removeEventListener']('animationend',_0x31ce4c),_0x2aee58['removeEventListener']('webkitAnimationEnd',_0x31ce4c);};_0x2aee58['addEventListener']('animationend',_0x31ce4c),_0x2aee58['addEventListener']('webkitAnimationEnd',_0x31ce4c);}['_createLoaderIcon'](){const _0x241fcb=new Ze('small');return _0x241fcb['bind']('isVisible')['to'](this,'isLoading',_0x1dff20=>_0x1dff20),_0x241fcb;}}function In(_0x3f5adc){if(!_0x3f5adc)return _0x3f5adc;if(_0x3f5adc['length']<=0x78)return _0x3f5adc;const _0x1855b9=_0x3f5adc['slice'](0x0,0x78),_0x34ea36=_0x1855b9['lastIndexOf']('\x20');return(_0x34ea36>0x0?_0x1855b9['slice'](0x0,_0x34ea36):_0x1855b9)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Io{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x1cfafd,_0x11fc98,_0x27881b,_0x4f1e88,_0x1449d8){this['_locale']=_0x1cfafd,this['_visibleChips']=_0x11fc98,this['_config']={...hn,..._0x27881b,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x27881b['cssClasses']}},this['_overflowChips']=new _0x395174(),this['_bodyCollection']=_0x4f1e88,this['_parentView']=_0x1449d8||null;}['setContainerElement'](_0x2a337e){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x2a337e,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 _0x20e2a4=[...this['_visibleChips'],...this['_overflowChips']],_0x41024a=this['_createCalculationContainer'](),_0x334c02=this['_calculateOverflowInContainer'](_0x41024a,_0x20e2a4),_0x44c70c=_0x41024a['_ancestorsToRestore'];_0x44c70c&&this['_restoreAncestorVisibility'](_0x44c70c),_0x41024a['remove'](),this['_applyOverflowResults'](_0x20e2a4,_0x334c02);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x27e637({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x3dee8e=new _0x129639(this['_locale']);_0x3dee8e['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x4bc301=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x4bc301['push'](this['_config']['cssClasses']['controlsButton']),_0x3dee8e['extendTemplate']({'attributes':{'class':_0x4bc301}}),_0x3dee8e;}['_createShowMoreBalloonPanelView'](){const _0x366f5d=new _0xc6701d(this['_locale']);return _0x366f5d['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x366f5d),_0x366f5d;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x5b071b=>{_0x5b071b['disableAnimationOnEnter']();});const _0x39752c=new _0x52fd2c(this['_locale']);_0x39752c['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x39752c);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x5d4637=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x5d4637?'':'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'](_0x1d2b8a){const _0x1ff565=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2a5fda=this['_containerElement']?.['classList'];if(_0x2a5fda){const _0x4eff05=_0x2a5fda[0x0]||'',_0x3ebadb=_0x1d2b8a['querySelector']('.'+_0x4eff05),_0x220ba8=_0x1d2b8a['querySelector'](_0x1ff565);return _0x3ebadb||_0x220ba8||_0x1d2b8a;}return _0x1d2b8a['querySelector'](_0x1ff565)||_0x1d2b8a;}['_calculateContainerWidth'](){const _0x4d0910=this['_parentView']?.['element']||this['_containerElement'];if(!_0x4d0910)return an;const _0x28190d=window['getComputedStyle'](_0x4d0910)['width'];if('auto'===_0x28190d||'0px'===_0x28190d||!_0x28190d){const _0x4538ff=_0x4d0910['parentElement'];if(_0x4538ff){const _0x482041=window['getComputedStyle'](_0x4538ff);return'auto'!==_0x482041['width']?_0x482041['width']:an;}return an;}return _0x28190d;}['_applyCalculationStyles'](_0x4cc8c2,_0x15c72c){this['_config']['cssClasses']['calculationContainer']&&_0x4cc8c2['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x4cc8c2['style']['width']=_0x15c72c,_0x4cc8c2['style']['position']='absolute',_0x4cc8c2['style']['top']='-9999px',_0x4cc8c2['style']['left']='-9999px',_0x4cc8c2['style']['opacity']='0',_0x4cc8c2['style']['pointerEvents']='none',_0x4cc8c2['style']['zIndex']='-1',_0x4cc8c2['style']['visibility']='visible\x20!important',_0x4cc8c2['style']['display']='block\x20!important',_0x4cc8c2['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0xa15a36){_0xa15a36['forEach'](({element:_0x2767e8,originalDisplay:_0x2ad955,originalVisibility:_0x12dede})=>{_0x2767e8['style']['display']=_0x2ad955,_0x2767e8['style']['visibility']=_0x12dede;});}['_makeAncestorsVisible'](_0x46b98d){const _0x13ba9b=[];let _0x3b566b=_0x46b98d;for(;_0x3b566b&&_0x3b566b!==document['body'];){const _0x18406f=window['getComputedStyle'](_0x3b566b);'none'!==_0x18406f['display']&&'hidden'!==_0x18406f['visibility']||(_0x13ba9b['push']({'element':_0x3b566b,'originalDisplay':_0x3b566b['style']['display'],'originalVisibility':_0x3b566b['style']['visibility']}),_0x3b566b['style']['display']='block',_0x3b566b['style']['visibility']='visible'),_0x3b566b=_0x3b566b['parentElement'];}return _0x13ba9b;}['_createContainerElements'](){let _0x1f3d81,_0x47f03a;return this['_parentView']?.['element']?(_0x1f3d81=this['_parentView']['element']['cloneNode'](!0x0),_0x47f03a=this['_findTargetContainer'](_0x1f3d81)):(_0x1f3d81=document['createElement']('div'),_0x47f03a=_0x1f3d81),{'calculationContainer':_0x1f3d81,'targetContainer':_0x47f03a};}['_createCalculationContainer'](){const {calculationContainer:_0x291af3,targetContainer:_0x3f660a}=this['_createContainerElements'](),_0x45c82b=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x291af3,_0x45c82b);const _0x531567=this['_parentView']?.['element']||this['_containerElement'],_0x2eeed5=_0x531567?.['parentElement'];_0x2eeed5?_0x2eeed5['appendChild'](_0x291af3):document['body']['appendChild'](_0x291af3),_0x291af3['_targetContainer']=_0x3f660a;const _0x1179c9=this['_makeAncestorsVisible'](_0x2eeed5||null);return _0x291af3['offsetWidth'],_0x291af3['_ancestorsToRestore']=_0x1179c9,_0x291af3;}['_calculateOverflowInContainer'](_0x4a000e,_0x496865){const _0x347a2c=_0x4a000e['_targetContainer']||_0x4a000e,_0x577923=[],{rowCount:_0x1cb8fe}=this['_renderChipsAndCountRows'](_0x347a2c,_0x496865);if(_0x1cb8fe<=this['_config']['maxVisibleRows'])return _0x577923;const _0x566f1a=_0x496865['slice']();for(;_0x566f1a['length']>0x0;){if(this['_testButtonFit'](_0x4a000e,_0x347a2c,_0x566f1a)){const _0xab6ca6=_0x496865['filter'](_0x35728c=>!_0x566f1a['includes'](_0x35728c));_0x577923['push'](..._0xab6ca6);break;}if(!_0x566f1a['pop']())break;}return _0x577923;}['_renderChipsAndCountRows'](_0x460e33,_0x40c010){_0x460e33['innerHTML']='',_0x40c010['forEach'](_0x285ac0=>{if(_0x285ac0['element']){const _0x4ae2e9=_0x285ac0['element']['cloneNode'](!0x0);_0x460e33['appendChild'](_0x4ae2e9);}}),_0x460e33['offsetWidth'];const _0x3aee55=_0x460e33['children'],_0x53ecd6=[];return Array['from'](_0x3aee55)['forEach'](_0xe1b1c1=>{const _0x115e5a=_0xe1b1c1['getBoundingClientRect']()['top'];_0x53ecd6['some'](_0xc6758b=>Math['abs'](_0xc6758b-_0x115e5a)<this['_config']['rowDetectionTolerance'])||_0x53ecd6['push'](_0x115e5a);}),{'rowCount':_0x53ecd6['length']};}['_createMockButton'](){const _0x2d92ad=document['createElement']('button');return _0x2d92ad['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x2d92ad['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x2d92ad['textContent']='+\x201',_0x2d92ad;}['_testButtonFit'](_0x22d482,_0xc5e89d,_0x65f240){this['_renderChipsAndCountRows'](_0xc5e89d,_0x65f240);const _0x5bce54=this['_createMockButton']();_0x22d482['appendChild'](_0x5bce54),_0x22d482['offsetWidth'];const _0x1cbe76=[..._0xc5e89d['children'],_0x5bce54],_0x4cc7b1=[];_0x1cbe76['forEach'](_0x537b6d=>{const _0x570b4c=_0x537b6d['getBoundingClientRect']()['top'];_0x4cc7b1['some'](_0x7e74f=>Math['abs'](_0x7e74f-_0x570b4c)<this['_config']['rowDetectionTolerance'])||_0x4cc7b1['push'](_0x570b4c);});const _0x367012=_0x4cc7b1['length'];return _0x5bce54['remove'](),_0x367012<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x29a989,_0x10fec7){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x29a989['forEach'](_0xf474a4=>{_0x10fec7['includes'](_0xf474a4)?this['_overflowChips']['add'](_0xf474a4):this['_visibleChips']['add'](_0xf474a4);});}['_updateOverflowUI'](_0x16da51){if(_0x16da51>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x16da51>0x0&&this['_showMoreButtonView']){const _0x3f5eeb=''+this['_config']['showMoreLabelPrefix']+(_0x16da51<0x63?_0x16da51:'99');this['_showMoreButtonView']['label']=_0x3f5eeb;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x313324,_0x3fc730){this['_distributeChips'](_0x313324,_0x3fc730),this['_updateOverflowUI'](_0x3fc730['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x1e422f=>{_0x1e422f[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 _0x1ae6dd=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x1ae6dd['width']||0x0===_0x1ae6dd['height'])return!0x1;const _0x51c835=window['innerHeight']||document['documentElement']['clientHeight'],_0x4e2085=window['innerWidth']||document['documentElement']['clientWidth'],_0x3db45c=0xc8;return _0x1ae6dd['bottom']>=-0xc8&&_0x1ae6dd['top']<=_0x51c835+_0x3db45c&&_0x1ae6dd['right']>=-0xc8&&_0x1ae6dd['left']<=_0x4e2085+_0x3db45c;}}const ua='ck-ai-chat__feed__context-chips',da='ck-ai-chat-context-chips-wrapper',_a='ck-ai-chat-context-chips-wrapper-balloon',Aa='ck-ai-chat-controls-button',ga='ck-ai-chat-controls_context_show-more-button',Ia='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x52fd2c{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x59f08b,_0x580198,_0x294ab5){super(_0x59f08b),this['_bodyCollection']=_0x294ab5,this['_createContextChips'](_0x580198);const _0xa935fb={'cssClasses':{'showMoreButton':ga,'showMoreBalloon':Ia,'overflowContainer':_a,'controlsButton':Aa}};this['_overflowManager']=new Io(_0x59f08b,this['_contextChips'],_0xa935fb,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[ua,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':da},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x4f3180=this['element']['querySelector']('.'+da);_0x4f3180&&(this['_overflowManager']['setContainerElement'](_0x4f3180),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x22926b){for(const _0x3663cf of _0x22926b){const _0x5ae286=new vo(this['locale'],_0x3663cf,!0x0,!0x1);this['_contextChips']['add'](_0x5ae286);}}}class Ge extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x640576,_0x4eaa78,_0x143ada){super(_0x4eaa78),this['_locale']=_0x640576,this['_bodyCollection']=_0x143ada,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 _h(this['_locale'],this['options']['contextItems']['filter'](_0x116bee=>!_0x116bee['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x52fd2c(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 Ct extends Fr{['capabilities'];constructor(_0x2df23c,_0x20ded4){super(_0x20ded4);const {isWebSearchEnabled:_0x34d88a,isReasoningEnabled:_0x16e74a}=_0x20ded4['capabilities'],_0x3507ef=[];let _0x13f500='';_0x34d88a&&_0x16e74a?(_0x13f500=i(_0x2df23c,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x3507ef['push'](aa(_0x2ffb5e)),_0x3507ef['push'](aa(_0x481126))):_0x34d88a?(_0x13f500=i(_0x2df23c,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x3507ef['push'](aa(_0x2ffb5e))):_0x16e74a&&(_0x13f500=i(_0x2df23c,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x3507ef['push'](aa(_0x481126))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x13f500?'':'ck-hidden']}});const _0x485c13=new _0x52fd2c();_0x485c13['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x3507ef,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x13f500]}]}),this['children']['add'](_0x485c13),this['capabilities']=_0x20ded4['capabilities'];}}function aa(_0x7f9c4d){const _0x180fb3=new _0x3d6008();return _0x180fb3['content']=_0x7f9c4d,_0x180fb3;}const Fs=['wheel','touchstart','pointerdown','keydown'],qs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Qe{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x798731){this['element']=_0x798731,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x33335c of Fs){const _0x5f94e3='keydown'!==_0x33335c;this['element']['addEventListener'](_0x33335c,this['_onUserEvent']['bind'](this),{'passive':_0x5f94e3,'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'](_0x585178){if(this['isRunning']){if('keydown'===_0x585178['type']){const _0x2488e7=_0x585178['key'];if(!qs['includes'](_0x2488e7))return;}_0x585178 instanceof WheelEvent?_0x585178['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x241c4b,scrollHeight:_0x247956,clientHeight:_0x371987}=this['element'];return _0x247956-_0x241c4b-_0x371987<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Xe extends _0x52fd2c{constructor(_0x204cbd,_0x950ae1){super(_0x204cbd),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x950ae1)});}['_createSkeletonItems'](_0x2175c1){const _0x534107=['ck','ck-ai-skeleton__item'];return _0x2175c1['map'](_0x35a531=>{let _0xe480a5='';switch(_0x35a531['attributes']['align']){case'right':_0xe480a5='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0xe480a5='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0xe480a5='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x35a531['tag'],'attributes':{'class':[..._0x534107,_0x35a531['attributes']['class']?_0x35a531['attributes']['class']:''],'style':'width:\x20'+_0x35a531['attributes']['width']+';\x20height:\x20'+_0x35a531['attributes']['height']+';'+_0xe480a5}};});}}const Ye={'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(_0x380906,_0x1cbe07,_0x78043f,_0x22b0ea){return new Array(_0x380906)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x1cbe07,'height':_0x78043f,'align':_0x22b0ea}}));}class ai extends Fr{constructor(_0x2d6f35){super(_0x2d6f35),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class mi extends _0x52fd2c{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x359fed,_0x2daabf){super(_0x359fed),this['_bodyCollection']=_0x2daabf,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Rt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Qe(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x10d346,_0x45d036){let _0x1599b1;return'ai-reply'===_0x10d346?_0x1599b1=new Be(this['locale'],_0x45d036,this['_bodyCollection']):'ai-suggestion-reply'===_0x10d346?(_0x1599b1=new Pe(this['locale'],_0x45d036,this['_bodyCollection']),_0x1599b1['bind']('isTrackChangesOn')['to'](this)):_0x1599b1='user-message'===_0x10d346?new Ge(this['locale'],_0x45d036,this['_bodyCollection']):'interaction-header'===_0x10d346?new Ct(this['locale'],_0x45d036):'custom-element'===_0x10d346?new ai(_0x45d036):new Ke(_0x45d036),this['children']['add'](_0x1599b1),_0x1599b1;}async['updateReplyItem']({id:_0x36bb17,parsedContent:_0x20ccfd,renderingStrategy:_0x45334b,abortSignal:_0x1c1262}){const _0x1f55e8=this['getItemById'](_0x36bb17);if(!(_0x1f55e8 instanceof Be))throw new _0xec7a4c('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x1f55e8,'id':_0x36bb17,'parsedContent':_0x20ccfd});await _0x1f55e8['updateContent']({'parsedContent':_0x20ccfd,'renderingStrategy':_0x45334b,'abortSignal':_0x1c1262});}async['updateWebSources'](_0x2e8b29,_0x457b23){const _0x508aa2=this['getItemById'](_0x2e8b29);if(_0x508aa2 instanceof Pe)_0x508aa2['updateSources'](_0x457b23);else{if(!(_0x508aa2 instanceof Be))throw new _0xec7a4c('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x508aa2,'id':_0x2e8b29,'sources':_0x457b23});_0x508aa2['updateSources'](_0x457b23);}}async['updateSuggestionItem']({id:_0x8d466,parts:_0x1b8a87,renderingStrategy:_0x18f98f,abortSignal:_0x4e1de0}){const _0xfcd098=this['getItemById'](_0x8d466);if(!(_0xfcd098 instanceof Pe))throw new _0xec7a4c('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0xfcd098,'id':_0x8d466,'parts':_0x1b8a87});await _0xfcd098['updateContent']({'parts':_0x1b8a87,'renderingStrategy':_0x18f98f,'abortSignal':_0x4e1de0});}['updateSuggestionPartState']({id:_0x2d4eb2,index:_0x5d20f8,state:_0x13ef2c}){const _0x5b95a4=this['getItemById'](_0x2d4eb2);if(!(_0x5b95a4 instanceof Pe))throw new _0xec7a4c('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x2d4eb2});_0x5b95a4['updatePartState'](_0x5d20f8,_0x13ef2c);}['setSuggestionPartActive']({id:_0x3f58b0,index:_0x449928,isActive:_0x2e21ce}){const _0x24ef33=this['getItemById'](_0x3f58b0);if(!(_0x24ef33 instanceof Pe))throw new _0xec7a4c('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x3f58b0});this['children']['filter'](_0x4b2103=>_0x4b2103 instanceof Pe)['forEach'](_0x3c3542=>{_0x3c3542['setPartActive'](!0x1);}),_0x24ef33['setPartActive'](_0x449928,_0x2e21ce);}['markItemAsDone'](_0x2cab18){this['getItemById'](_0x2cab18)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x1b15ad=>_0x1b15ad['options']['id']);}['removeItem'](_0x353159){this['children']['remove'](this['getItemById'](_0x353159));}['hasItem'](_0x158df6){return!!this['children']['find'](_0x188077=>_0x188077['options']['id']['includes'](_0x158df6));}['scrollToSuggestion'](_0x1dcc41,_0x3b1ffd){const _0x375cc4=this['getItemById'](_0x1dcc41);if(!(_0x375cc4 instanceof Pe))return void _0x56fb9a('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x1dcc41,'partIndex':_0x3b1ffd});const _0x963bd7=_0x375cc4['getPartView'](_0x3b1ffd);_0x963bd7?_0x121c65(_0x963bd7['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0x56fb9a('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x1dcc41,'partIndex':_0x3b1ffd});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x5acd39=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x5acd39,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x44712f=new Xe(this['locale'],Ye['aiFeed']);return _0x44712f['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x20d9bf=>!_0x20d9bf)]}}),_0x44712f;}['_createFeedItems'](){const _0x517656=new _0x52fd2c(this['locale']);return _0x517656['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x517656;}['_createFeedLoader'](){const _0x114a1a=new _0x52fd2c(this['locale']);return _0x114a1a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x496391=>!_0x496391)]},'children':this['_createLoaderChildren']()}),_0x114a1a;}['_createLoaderChildren'](){const _0x117d3a=new Ze();return _0x117d3a['isVisible']=!0x0,[_0x117d3a,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x56bef7){const _0x2e46fc=this['children']['find'](_0x440a5e=>_0x440a5e['options']['id']['includes'](_0x56bef7));if(!_0x2e46fc)throw new _0xec7a4c('ai-chat-feed-view-item-not-found',this,{'id':_0x56bef7});return _0x2e46fc;}['setLoadingMessage'](_0x29199a){this['set']('loadingMessage',_0x29199a);}['toggleLoadingSkeleton'](_0x54a42a){this['set']('isLoadingSkeletonVisible',_0x54a42a);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class nh extends _0x53ea61{['filter'](){let _0x1be3f6=0x0;for(const _0x1e0f40 of this['items'])_0x1be3f6+=_0x1e0f40['items']['length'];return{'resultsCount':_0x1be3f6,'totalItemsCount':_0x1be3f6};}}const ah='ck-ai-chat__prompt-input_highlighted';class _s extends _0x2585ad{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x2fc81a,_0x22cfc2){super(_0x2fc81a,{'queryView':{'label':'','creator':_0xf21d21,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new nh(_0x2fc81a),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x22cfc2,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=_s['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=_s['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',(_0x3bc94d,_0x1218a8)=>!_0x3bc94d&&!_0x1218a8),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x40c037,_0x1a4b17)=>{this['isUploadInProgress']||this['isEmpty']||_0x40c037['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1a4b17());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x3d4a5e=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x3d4a5e)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x408682=_0x1f62ac(_0x3d4a5e);this['fire']('sendUserMessage',_0x408682),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x412178){this['queryView']['fieldView']['set']('placeholder',_0x412178);}['focus'](_0x4971b6=!0x1){super['focus'](),_0x4971b6&&(this['element']['classList']['contains'](ah)||(this['element']['classList']['add'](ah),setTimeout(()=>{this['element']['classList']['remove'](ah);},0x320)));}['_createSubmitButton'](){const _0x3d885b=new _0x129639(this['locale']);return _0x3d885b['set']({'icon':_0x3601db,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x3d885b['on']('execute',()=>{this['submit']();}),_0x3d885b;}['setIsUploadInProgress'](_0x10cf37){this['isUploadInProgress']=_0x10cf37;}['_setUpAddContextButtonPositioning'](){const _0x3fc65c=this['locale'],_0x209161=()=>{_0xa06698['window']['requestAnimationFrame'](()=>{if(_0x15cbc7(this['element'])){const _0xe731c7=new _0x2d2067(this['queryView']['fieldView']['element']),_0x2fd62b=new _0x2d2067(this['_addContextButtonView']['element']),_0x1589f5=_0xe731c7['width'],_0x6d8c4='rtl'===_0x3fc65c['uiLanguageDirection']?'right':'left';_0xe731c7['excludeScrollbarsAndBorders']();const _0x5844e6=_0x1589f5-_0xe731c7['width']+0x1;this['_addContextButtonView']['element']['style'][_0x6d8c4]='calc('+(_0x1589f5-_0x2fd62b['width']-_0x5844e6)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x209161),this['on']('render',()=>{_0x209161(),this['_queryViewResizeObserver']=new _0xa2d87b(this['queryView']['fieldView']['element'],()=>{_0x209161();});});}}const Ea='ck-ai-chat__prompt-capabilities',Ta='ck-ai-chat-controls-button',pa='ck-ai-chat-controls-button--commands',ma='ck-ai-button-tertiary',Ca='ck-ai-chat-controls__model-selection',wa='ck-ai-chat-controls__model-selection__item-name',fa='ck-ai-chat-controls__model-selection__item-description',Sa='ck-ai-chat-controls__model-selection__item-capabilities',ba='n';class vs extends _0x52fd2c{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x27518d){super(_0x27518d),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),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,'modelDisplayMode',_0xb47227=>'selector'===_0xb47227),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x469d9d=>_0x469d9d?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x5cf0f7=>_0x5cf0f7),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x1ff613=>_0x1ff613),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x4fbb36=>i(this['locale'],_0x4fbb36?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0xad0a0a=>_0xad0a0a),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x2c7b72=>i(this['locale'],_0x2c7b72?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Ea]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x395174(),_0x1f30e0(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x46a683,_0x57abdc){if(_0x57abdc)this['set']('modelDisplayMode','hidden');else{const _0x2b52f2=0x1===_0x46a683['length'];this['set']('modelDisplayMode',_0x2b52f2?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x46a683?.['length'])for(const _0x13bdcb of _0x46a683){const _0x4955aa=new _0x1612c4({'label':_0x13bdcb['name'],'withText':!0x0,'role':'menuitemradio','id':_0x13bdcb['id'],'model':_0x13bdcb});_0x4955aa['bind']('isOn')['to'](this,'activeModelId',_0x154294=>_0x154294===_0x13bdcb['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4955aa,'labelView':new Ra(this['locale'],_0x13bdcb)});}}['setWebSearch'](_0x35a6c4){this['set']('webSearchActive',_0x35a6c4);}['setReasoning'](_0x221ae0){this['set']('reasoningActive',_0x221ae0);}['setModel'](_0x33b818){if(!_0x33b818)return;this['activeModelId']=_0x33b818['id'],this['activeModelName']=_0x33b818['name']||_0x33b818['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x33b818['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x33b818['name']);const _0x1c7e02=_0x33b818['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x1c7e02),this['_webSearchButton']['set']('isVisible',_0x1c7e02);const _0x33365b=_0x33b818['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x33365b),this['_reasoningButton']['set']('isVisible',_0x33365b);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x2df288){this['set']('modelSelectorEnabled',!0x1),_0x2df288&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x379e46=new _0x129639();return _0x379e46['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x2ffb5e,'class':Ta,'isToggleable':!0x0,'tooltipPosition':ba}),_0x379e46['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x379e46;}['_createReasoningButton'](){const _0x6d1515=new _0x129639();return _0x6d1515['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x481126,'class':Ta,'isToggleable':!0x0,'tooltipPosition':ba}),_0x6d1515['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x6d1515;}['_createCommandsButton'](){const _0x13cafb=new _0x129639();return _0x13cafb['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x23ccd3,'withText':!0x0,'class':Ta,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':ba}),_0x13cafb['extendTemplate']({'attributes':{'class':[pa]}}),_0x13cafb['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x13cafb;}['_createModelSelectionDropdown'](){const _0x2d4037=_0x3837b3(this['locale']);return _0x2d4037['set']({'panelPosition':'ne','class':[Ca]}),_0x2d4037['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':ba,'class':ma}),this['listenTo'](_0x2d4037,'execute',_0x48a27c=>{this['fire']('selectModel',_0x48a27c['source']['model']);}),_0x2d4037;}['_createModelNameView'](){const _0x1a979d=new Oa(this['locale']);return _0x1a979d['bind']('text')['to'](this,'activeModelName',_0x427ed2=>_0x427ed2??''),_0x1a979d['bind']('isVisible')['to'](this,'modelDisplayMode',_0x334eb5=>'name'===_0x334eb5),_0x1a979d;}}let Ra=class extends _0x3e41bf{constructor(_0x377814,_0x55f87e){super();const _0x28768c=this['bindTemplate'],_0x163f65=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x28768c['to']('style'),'id':_0x28768c['to']('id')},'children':[{'tag':'div','attributes':{'class':[wa]},'children':[{'text':_0x28768c['to']('text')}]},{'tag':'div','attributes':{'class':[fa]},'children':[{'tag':'span','children':[{'text':_0x55f87e['description']}]}]},{'tag':'div','attributes':{'class':[Sa]},'children':_0x163f65}]}),_0x163f65['addMany'](this['_getCapabilityParts'](_0x377814,_0x2ffb5e,'AI_CHAT_SEARCH_WEB',_0x55f87e['capabilities']['webSearch']?.['enabled']??!0x1)),_0x163f65['addMany'](this['_getCapabilityParts'](_0x377814,_0x481126,'AI_CHAT_REASONING',_0x55f87e['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x16382c,_0x5999de,_0xc90357,_0x2eb547){const _0x285d53=new _0x3d6008();_0x285d53['content']=_0x5999de;const _0x379dee=new _0x52fd2c(_0x16382c);_0x379dee['setTemplate']({'tag':'span','children':[{'text':i(_0x16382c,_0xc90357)+':\x20'}]});const _0x365815=new _0x52fd2c(_0x16382c);return _0x365815['setTemplate']({'tag':'span','children':[{'text':i(_0x16382c,_0x2eb547?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x285d53,_0x379dee,_0x365815];}},Oa=class extends _0x52fd2c{constructor(_0x441fe6){super(_0x441fe6),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x21d3e7=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x21d3e7['if']('isVisible','ck-hidden',_0x24e314=>!_0x24e314)]},'children':[{'text':_0x21d3e7['to']('text')}]});}};const ka='ck-ai-chat-context-controls__url-form',Na='ck-ai-chat-context-controls__url-input-section';class Vo extends _0x52fd2c{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x4e5c39){super(_0x4e5c39),this['focusTracker']=new _0x264c5d(),this['keystrokes']=new _0x299178(),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 _0x471d76({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x47e1d2=>{this['focusTracker']['add'](_0x47e1d2['element']),this['keystrokes']['listenTo'](_0x47e1d2['element']);}),_0x126cc1({'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'](_0x4e85ec){this['urlInputField']['errorText']=_0x4e85ec,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x5f1705=new _0x129639(this['locale']);return _0x5f1705['set']({'icon':_0x6e207c,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x50b8ee,_0x28dab4,_0x29b712)=>{_0x5f1705['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x29b712?'':'\x20ck-hidden')]});}),_0x5f1705;}['_createUrlInputField'](){const _0x2f55c6=new _0x13eaa4(this['locale'],th);return _0x2f55c6['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x2f55c6['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x2f55c6;}['_createConfirmButton'](){const _0x2fc275=new _0x129639(this['locale']);return _0x2fc275['set']({'icon':_0x53c10a,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x2fc275;}['_setupTemplate'](){const _0x464756=new _0x3d4bc4(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'});_0x464756['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':ka,'tabindex':'-1'},'children':[_0x464756,{'tag':'div','attributes':{'class':Na},'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',_0xaf0919=>{_0xaf0919['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x118c30,_0x2ec5bf)=>{this['clear'](),this['fire']('cancel'),_0x2ec5bf();});}['_handleSubmit'](){const _0xee4ace=this['getValue']()['trim']();_0xee4ace?this['_isValidUrl'](_0xee4ace)?(this['clearError'](),this['fire']('submitUrl',_0xee4ace)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x5b3d78=this['getValue']()['trim'](),_0x5d52f1=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x5b3d78['length']>0x0&&!_0x5d52f1;}['_isValidUrl'](_0x3efa33){try{return!!new URL(_0x3efa33);}catch{return!0x1;}}}const va='ck-ai-chat-resources__item',ya='ck-ai-chat-resources__item--in-context',xa='ck-ai-chat-resources__item-title',La='ck-ai-chat-resources__item__icon';class hc extends _0x27d63c{['resource'];['_titleView'];['_iconView'];constructor(_0x24fc91,_0x11704d){super(_0x24fc91),this['resource']=_0x11704d,this['set']('isInContext',!!_0x11704d['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x323b1a){if(_0x323b1a['isInContext'])return _0x53c10a;switch(_0x323b1a['type']){case Fe['DOCUMENT']:return _0x4e4106;case Fe['URL']:return _0x49a141;case Fe['FILE']:case Fe['TEXT']:return _0x25e079;default:return _0x59d455;}}['highlightText'](_0x40f55b){if(!_0x40f55b||''===_0x40f55b['trim']())return void this['_titleView']['highlightText'](null);const _0x358825=new RegExp(_0x18bda3(_0x40f55b),'gi');this['_titleView']['highlightText'](_0x358825);}['updateResourceState'](_0x3cc1f6){this['resource']['isInContext']=_0x3cc1f6,this['isInContext']=_0x3cc1f6,this['_updateIcon']();}['_createTitleView'](){const _0x1d6172=new _0x3ec926();return _0x1d6172['text']=this['resource']['label'],_0x1d6172['extendTemplate']({'tag':'span','attributes':{'class':[xa]}}),_0x1d6172;}['_createIconView'](){const _0x597194=new _0x3d6008();return _0x597194['content']=this['getResourceIcon'](this['resource']),_0x597194;}['_setupTemplate'](){const _0x239da5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[va,_0x239da5['if']('isVisible','ck-hidden',_0x4c82b0=>!_0x4c82b0),_0x239da5['if']('isInContext',ya)]},'children':[{'tag':'div','attributes':{'class':[La]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x239da5['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Da='ck-ai-chat-resources__list';class Lr extends _0x53ea61{['_source'];constructor(_0x34b6d9,_0x111e4c){super(_0x34b6d9),this['_source']=_0x111e4c,this['extendTemplate']({'attributes':{'class':[Da]}});}['setResources'](_0x406d2e,_0x3c452f){this['items']['clear']();let _0x3d8966=_0x406d2e;if(this['_source']['useDefaultFiltering']&&_0x3c452f&&''!==_0x3c452f['trim']()){const _0x57d97b=new RegExp(_0x3c452f['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x3d8966=_0x406d2e['filter'](_0x1f66cd=>_0x57d97b['test'](_0x1f66cd['label']));}for(const _0x55565e of _0x3d8966){const _0x405adb=new hc(this['locale'],_0x55565e);_0x405adb['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x55565e);}),this['items']['add'](_0x405adb);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x3c452f);}['highlightText'](_0x42cc4f){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x46d31a=>{_0x46d31a['highlightText'](_0x42cc4f);});}['updateResourceState'](_0x17f7e0,_0x2a0bb9){for(const _0x1ae305 of this['items']){const _0x1841ed=_0x1ae305;_0x1841ed['resource']['id']===_0x17f7e0&&_0x1841ed['updateResourceState'](_0x2a0bb9);}}['_handleResourceSelection'](_0x1425a8,_0x3d6aa1){this['fire']('addResourceToContext',{'source':_0x1425a8,'resource':_0x3d6aa1});}}class Ur extends _0x13eaa4{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x3d396c){const t=_0x3d396c['t'],_0x5617c5={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':i(_0x3d396c,'AI_CHAT_SEARCH_RESOURCES')};super(_0x3d396c,_0x5617c5['creator']),this['label']=_0x5617c5['label'],this['_viewConfig']=_0x5617c5,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x3d396c,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x12ece3){this['fire']('search',_0x12ece3);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x3d6008(),this['iconView']['content']=_0x56c043,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x5c8e91,t){this['resetButtonView']=new _0x129639(_0x5c8e91),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x254810,'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',_0x1736d7=>!_0x1736d7),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 lc extends _0x52fd2c{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x294920,_0x2db9a4){super(_0x294920),this['_source']=_0x2db9a4['source'],this['_searchInputVisibleFrom']=_0x2db9a4['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 _0x45b6fa([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Ur(this['locale']);}['_createSearchSection'](){const _0x34a942=new _0x52fd2c(this['locale']);return _0x34a942['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x1702bc,_0x2b1c15)=>{this['loadResources'](_0x2b1c15),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x2b1c15);}),_0x34a942;}['_createResourcesListView'](){const _0xbb68d3=new Lr(this['locale'],this['_source']);return _0xbb68d3['delegate']('addResourceToContext')['to'](this),_0xbb68d3['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0xbb68d3;}['_createSkeletonView'](){const _0x48aeca=new Xe(this['locale'],Ye['aiChatResources']);return _0x48aeca['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0xc50ab2=>!_0xc50ab2)]}}),_0x48aeca;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x2076e3){const _0x55dbba=_0x2ced3c();this['_latestLoadResourcesUid']=_0x55dbba,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x2076e3,'uid':_0x55dbba}),this['isLoading']=!0x0;}['setResources'](_0x1dfb72,_0x2780bb){if(_0x2780bb&&_0x2780bb!==this['_latestLoadResourcesUid'])return;const _0x2ac55a=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x1dfb72,_0x2ac55a),_0x1dfb72['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x1e1711,_0x3e3352){this['_resourcesListView']['updateResourceState'](_0x1e1711,_0x3e3352);}}const Pa='ck-ai-chat-context-controls__source-balloon-panel',Ha='ck-button-icon\x20ck-button-back',Ma='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Po{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x2d6593,_0x5ee5d6,_0x319e40){this['_locale']=_0x2d6593,this['_bodyCollection']=_0x5ee5d6,this['_config']=_0x319e40;}['showSourceResourcesBalloon']({source:_0x57999b,withBackButton:_0x278c77}){let _0x1e8bc2=this['_sourceResourceBalloons']['get'](_0x57999b['id']);_0x1e8bc2||(_0x1e8bc2=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x57999b['id'],_0x1e8bc2),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x1e8bc2)),this['_addSourceResourceContent']({'balloonPanel':_0x1e8bc2,'source':_0x57999b,'withBackButton':_0x278c77}),_0x1e8bc2['show']();const _0x20b9bc=this['_config']['getTargetElement']();_0x20b9bc&&_0x1e8bc2['pin']({'target':_0x20b9bc,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x16b2fc,_0x2edb53,_0x227c63){const _0x4964b=this['_sourceResourceBalloons']['get'](_0x16b2fc);if(!_0x4964b)return;const _0x3f502c=this['_getResourcesViewFromBalloon'](_0x4964b);_0x3f502c&&(_0x3f502c['setResources'](_0x2edb53,_0x227c63),_0x3f502c['once']('change:isLoading',()=>{_0x4964b['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x49b99d){const _0x4b4691=this['_sourceResourceBalloons']['get'](_0x49b99d);_0x4b4691&&requestAnimationFrame(()=>{_0x4b4691['hide'](),this['_sourceResourceBalloons']['delete'](_0x49b99d),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x11d533 of this['_sourceResourceBalloons']['values']())if(_0x11d533['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x5c1c4c,_0x467da8,_0x5716da){const _0x83bb9c=this['_sourceResourceBalloons']['get'](_0x5c1c4c);if(!_0x83bb9c||!_0x83bb9c['isVisible'])return;const _0x2027f1=this['_config']['getTargetElement']();if(!_0x2027f1)return;_0x83bb9c['pin']({'target':_0x2027f1,'limiter':this['_config']['getLimiterElement']()});const _0x36b066=this['_getResourcesViewFromBalloon'](_0x83bb9c);_0x36b066&&_0x36b066['updateResourceState'](_0x467da8,_0x5716da);}['destroy'](){for(const _0x133e30 of this['_sourceResourceBalloons']['values']())_0x133e30['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x15af02=new _0xc6701d(this['_locale']);return _0x15af02['extendTemplate']({'attributes':{'class':Pa}}),this['_bodyCollection']['add'](_0x15af02),_0x15af02;}['_addSourceResourceContent']({balloonPanel:_0x4e24bd,source:_0x4015fe,withBackButton:_0x11d876}){_0x4e24bd['content']['clear']();const _0xd42f69=this['_createBalloonHeader']({'balloonPanel':_0x4e24bd,'source':_0x4015fe,'withBackButton':_0x11d876});_0x4e24bd['content']['add'](_0xd42f69);const _0x2ae50e=this['_createBalloonResourcesView'](_0x4015fe);_0x4e24bd['content']['add'](_0x2ae50e);}['_createBalloonHeader']({balloonPanel:_0x2421b4,source:_0xe7ab00,withBackButton:_0x227c3e}){const _0x3ae019=new _0x3d4bc4(this['_locale'],{'label':_0xe7ab00['label'],'class':Ma});return _0x227c3e&&_0x3ae019['children']['add'](this['_createBackButton'](_0x2421b4),0x0),_0x3ae019;}['_createBackButton'](_0x3a4968){const _0x5137b9=new _0x129639(this['_locale']);return _0x5137b9['set']({'icon':_0x6e207c,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Ha}),_0x5137b9['on']('execute',()=>{_0x3a4968['hide'](),this['_config']['onBackToContext']();}),_0x5137b9;}['_createBalloonResourcesView'](_0x303dc3){const _0x590456=new lc(this['_locale'],{'source':_0x303dc3,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x590456['on']('loadSourceResources',(_0xa9490f,_0x32f06f)=>{this['_config']['onLoadSourceResources'](_0x32f06f);}),_0x590456['on']('addResourceToContext',(_0x310ba8,_0x7bb2e3)=>{this['_config']['onResourceSelected'](_0x7bb2e3['source'],_0x7bb2e3['resource']),this['closeSourceResourceBalloon'](_0x303dc3['id']);}),_0x590456;}['_getResourcesViewFromBalloon'](_0x584074){const _0x2912f8=_0x584074['content']['get'](0x1);return _0x2912f8 instanceof lc?_0x2912f8:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x109e34){_0x27e637({'emitter':_0x109e34,'contextElements':[_0x109e34['element']],'callback':()=>{_0x109e34['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x109e34['isVisible']});}}const xs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Ro='ck-ai-chat-context-controls',Oo='ck-ai-chat-context-controls__pending-contexts',Uo='ck-ai-chat-context-controls__add-context-balloon-panel',Lo='ck-ai-chat-context-controls__add-context-button',No='ck-ai-chat-context-controls__url-balloon-panel',Mo='ck-ai-chat-context-controls__balloon-button',Ho='ck-ai-chat-context-controls__balloon-button-source',jo='ck-ai-chat-controls-button',Fo='ck-ai-chat-context-chips-wrapper-balloon',Xo='ck-ai-chat-controls_context_show-more-button',yo='ck-ai-chat-context-controls__show-more-balloon-panel',Do='ck-ai-chat',$o=[_0xc6701d['defaultPositions']['northArrowSouthWest'],_0xc6701d['defaultPositions']['northArrowSouth'],_0xc6701d['defaultPositions']['northArrowSouthEast'],_0xc6701d['defaultPositions']['southArrowNorthWest'],_0xc6701d['defaultPositions']['southArrowNorth'],_0xc6701d['defaultPositions']['southArrowNorthEast']];class Is extends _0x52fd2c{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x25e7ce,_0x3112ca){super(_0x25e7ce),this['bodyCollection']=_0x3112ca['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x25e7ce),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x25e7ce),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x25e7ce),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x25e7ce,_0x3112ca);const _0x270321={'cssClasses':{'showMoreButton':Xo,'showMoreBalloon':yo,'overflowContainer':Fo,'controlsButton':jo}};this['_overflowManager']=new Io(_0x25e7ce,this['_currentContextsChips'],_0x270321,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'](_0x1b6e0c,_0x588874){const _0x1b4c3b=this['_createContextButton'](_0x1b6e0c,'current',!0x0,_0x588874);this['_addContextToCollection'](_0x1b4c3b,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x771b46){this['_removeContextFromCollection'](_0x771b46,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x771b46,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x477a7f,_0x4a8874){let _0x3be939=this['_currentContextsChips']['find'](_0x55b871=>_0x55b871['id']===_0x477a7f);_0x3be939||(_0x3be939=this['_overflowManager']['overflowChips']['find'](_0x3fcd9a=>_0x3fcd9a['id']===_0x477a7f)),_0x3be939&&(_0x3be939['isLoading']=_0x4a8874);}['setConversationContext'](_0x46df72){this['_conversationContextsChips']['clear']();for(const _0x5bd45b of _0x46df72){const _0x12d620=this['_createContextButton'](_0x5bd45b,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x12d620,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x7b2bb1,_0x455a93,_0x59f1f5){this['_resourcesBalloonView']['updateResourceState'](_0x7b2bb1,_0x455a93,_0x59f1f5);}['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']({source:_0x1addf9,withBackButton:_0x588ef9}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x1addf9,'withBackButton':_0x588ef9}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x1b3438,_0x19d9a1,_0x479b72,_0x1528b6){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x1b3438,_0x479b72,_0x1528b6);}['closeSourceResourceBalloon'](_0x33b841){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x33b841),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x278646){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x278646),this['_setAddContextButtonEnabled'](_0x278646);}['_setAddContextButtonEnabled'](_0x546a83){const _0x4f6a30=!_0x546a83['document']['isHidden']&&_0x546a83['document']['enabled'],_0x9d0eec=_0x546a83['urls']['enabled'],_0x505cc0=_0x546a83['files']['enabled'],_0xf401ac=_0x546a83['sources']['length']>0x0,_0x2bfe97=_0x546a83['customItems']&&_0x546a83['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x4f6a30||_0x9d0eec||_0x505cc0||_0xf401ac||_0x2bfe97;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Ro,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Oo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x14980d){const _0x53ef24=new _0x129639(_0x14980d);return _0x53ef24['set']({'label':i(_0x14980d,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':jo+'\x20'+Lo,'icon':_0x4dc24b,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x53ef24;}['_createAddContextBalloonPanelView'](_0x1695bc){return this['_createBaseBalloonPanel'](_0x1695bc,Uo);}['_createUrlBalloonPanelView'](_0x2594af){const _0x1950c5=this['_createBaseBalloonPanel'](_0x2594af,No);return this['_addUrlContent'](_0x1950c5,_0x2594af),_0x1950c5;}['_createResourcesBalloonView'](_0x27ca59,_0x39df21){const _0x362a5d={'searchInputVisibleFrom':_0x39df21['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o});},'onResourceSelected':(_0x3005a9,_0x3b9919)=>{this['fire']('addResourceToContext',{'source':_0x3005a9,'resource':_0x3b9919});},'onLoadSourceResources':_0x2b6e24=>{this['fire']('loadSourceResources',_0x2b6e24);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Po(_0x27ca59,_0x39df21['bodyCollection'],_0x362a5d);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Do)||document['body'];}['_createBaseBalloonPanel'](_0x6d53b3,_0x426719){const _0x358cdd=new _0xc6701d(_0x6d53b3);return _0x358cdd['extendTemplate']({'attributes':{'class':_0x426719}}),this['bodyCollection']['add'](_0x358cdd),_0x358cdd;}['_setBalloonPanelContent'](_0x3cb4a2,_0x30c76c,_0x515883){if(_0x3cb4a2['content']['clear'](),!_0x515883['document']['isHidden']&&_0x515883['document']['enabled']){const _0x3726c4=this['_createBalloonButton'](_0x30c76c,{'label':i(_0x30c76c,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x4e4106});_0x3726c4['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x3cb4a2['content']['add'](_0x3726c4);}if(_0x515883['urls']['enabled']){const _0x407552=this['_createBalloonButton'](_0x30c76c,{'label':i(_0x30c76c,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x49a141});_0x407552['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}),this['_urlInputView']['focus']();}),_0x3cb4a2['content']['add'](_0x407552);}if(_0x515883['files']['enabled']){const _0x3b3c3d=new _0x2d4ba3(_0x30c76c);_0x3b3c3d['set']({'label':i(_0x30c76c,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x2e92c7,'withText':!0x0,'tooltip':!0x0,'class':Mo,'allowMultipleFiles':!0x0}),_0x3b3c3d['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x3b3c3d['on']('done',(_0x1b036e,_0x22b381)=>{this['fire']('addFileToContext',_0x22b381);}),_0x3b3c3d['tooltip']=!0x0,_0x3cb4a2['content']['add'](_0x3b3c3d);}for(const _0x3cfec5 of _0x515883['sources']){const _0x5efec2=this['_createBalloonButton'](_0x30c76c,{'label':_0x3cfec5['label'],'icon':_0x3cfec5['icon']||_0x59d455,'type':'source'});_0x3cb4a2['content']['add'](_0x5efec2),_0x5efec2['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x3cfec5,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x45e6a9 of _0x515883['customItems']||[]){const _0x572698=this['_createBalloonButton'](_0x30c76c,{'label':_0x45e6a9['label'],'icon':_0x45e6a9['icon']||_0x59d455,'type':'customItem'});_0x3cb4a2['content']['add'](_0x572698),_0x572698['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x45e6a9);});}this['_hasExactlyOneSource']=0x1===_0x3cb4a2['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x433544,_0x46282f){this['_urlInputView']=new Vo(_0x46282f),this['_urlInputView']['on']('submitUrl',(_0x1a47d7,_0x4ccbd9)=>{this['_handleUrlSubmit'](_0x4ccbd9);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o});}),_0x433544['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x55f247,_0x17e7a1){const _0xde1661='source'===_0x17e7a1['type']?new Ua(_0x55f247):new _0x129639(_0x55f247);return _0xde1661['set']({'label':_0x17e7a1['label'],'icon':_0x17e7a1['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Mo}),_0xde1661;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x27e637({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x4d6836){const _0x57b971=this['_addContextBalloonConfig'];_0x57b971['buttonView']['isOn']=_0x4d6836,_0x4d6836?_0x57b971['balloonView']['show']():_0x57b971['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x231c01,buttonView:_0x43256f,hideMethod:_0x30b7f7}=this['_addContextBalloonConfig'];_0x27e637({'emitter':_0x231c01,'contextElements':[_0x231c01['element'],_0x43256f['element']],'callback':()=>{_0x30b7f7();},'activator':()=>_0x43256f['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x2aa249,_0x298b87,_0x7a1916=!0x1,_0x2f5a33=!0x1){const _0x24d2c3='conversation'===_0x298b87||!0x0===_0x2aa249['isReadOnly'],_0x47b70d=new vo(this['locale'],_0x2aa249,_0x24d2c3,_0x7a1916,_0x2f5a33);return _0x24d2c3||_0x47b70d['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x47b70d['id']);}),_0x47b70d;}['_addContextToCollection'](_0x3d61a3,_0x2090b2){_0x2090b2['add'](_0x3d61a3,0x0);}['_removeContextFromCollection'](_0xd07e35,_0x551161){const _0x42a455=_0x551161['find'](_0x4d822a=>_0x4d822a['id']===_0xd07e35);_0x42a455&&_0x551161['remove'](_0x42a455);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x717db4){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x717db4);}}class Ua extends _0x129639{['arrowView'];constructor(_0x3114b5){super(_0x3114b5),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ho]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x27d471=new _0x3d6008();return _0x27d471['content']=_0x3ff01c,_0x27d471['extendTemplate']({'attributes':{'class':Ho+'__arrow'}}),_0x27d471;}}class Cs extends _0x52fd2c{['_cancelButtonView'];['_loaderView'];constructor(_0x4a3e33){super(_0x4a3e33),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 _0x3e14ae=new _0x129639(this['locale']);return _0x3e14ae['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x1cd249}),_0x3e14ae['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x3e14ae;}['_createLoaderView'](){const _0x7f95a9=new _0x52fd2c(this['locale']);return _0x7f95a9['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')}]}),_0x7f95a9;}}class ni extends _0x52fd2c{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x478fa4,_0x115ba7){super(_0x478fa4),this['_contextPanelView']=this['_createContextPanelView'](_0x478fa4,{'bodyCollection':_0x115ba7['bodyCollection'],'searchInputVisibleFrom':_0x115ba7['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x478fa4),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x478fa4),this['_loaderView']=this['_createLoaderView'](_0x478fa4),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x478fa4),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'](...xs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x232cd2=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x232cd2['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x232cd2['if']('isLoading','ck-hidden',_0x58d012=>_0x58d012||!this['isModelAvailable']),_0x232cd2['if']('isModelAvailable','ck-hidden',_0x13631b=>!_0x13631b||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x232cd2['if']('isLoading','ck-hidden',_0x1dbe31=>!_0x1dbe31)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x232cd2['if']('isModelAvailable','ck-hidden',_0x52eec7=>_0x52eec7)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x27e637({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x7e7a5c,_0x3a09e2){return new Is(_0x7e7a5c,_0x3a09e2);}['_createPromptInputView'](_0x2e5a10){return new _s(_0x2e5a10,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x48f675){return new vs(_0x48f675);}['_createLoaderView'](_0x57d96b){return new Cs(_0x57d96b);}['_createModelUnavailableMessageView'](_0x7befab){const _0x5a17f9=new As(_0x7befab);return _0x5a17f9['delegate']('startConversation')['to'](this),_0x5a17f9;}['_handlePromptInputFocus'](_0x34698b,_0x3cdbc5,_0x70d4c2){_0x70d4c2?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x16dbe6,_0x1dc7cc){this['_contextPanelView']['addContextItem'](_0x16dbe6,_0x1dc7cc);}['removeContextItem'](_0x72e60e){this['_contextPanelView']['removeContextItem'](_0x72e60e);}['setContextItemLoading'](_0x4f05c2,_0x4301b6){this['_contextPanelView']['setContextItemLoading'](_0x4f05c2,_0x4301b6);}['setIsUploadInProgress'](_0x5a4a16){this['_promptInputView']['setIsUploadInProgress'](_0x5a4a16);}['setConversationContext'](_0x5e1ae3){this['_contextPanelView']['setConversationContext'](_0x5e1ae3);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x3aae71,_0x3692a0,_0x22462e){this['_contextPanelView']['updateResourceState'](_0x3aae71,_0x3692a0,_0x22462e);}['setWebSearch'](_0x55075f){this['_promptCapabilitiesView']['setWebSearch'](_0x55075f);}['setReasoning'](_0x18f37d){this['_promptCapabilitiesView']['setReasoning'](_0x18f37d);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x2e3ee9){this['_contextPanelView']['setAddContextOptions'](_0x2e3ee9);}['setInputPlaceholder'](_0x2ff0b8){this['_promptInputView']['setPlaceholderText'](_0x2ff0b8);}['setModelList'](_0x43cc1f,_0x588feb){this['_promptCapabilitiesView']['setModelList'](_0x43cc1f,_0x588feb);}['setModel'](_0x2149bd){_0x2149bd?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x2149bd)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x25d469){this['_promptCapabilitiesView']['disableModelSelector'](_0x25d469);}['populateSourceResourceBalloon'](_0x3f8651,_0x42450d,_0x5acf65,_0x4864bd){this['_contextPanelView']['populateSourceResourceBalloon'](_0x3f8651,_0x42450d,_0x5acf65,_0x4864bd);}['closeSourceResourceBalloon'](_0x3084df){this['_contextPanelView']['closeSourceResourceBalloon'](_0x3084df);}['focusPromptInput'](_0x3803ad=!0x1){this['_promptInputView']['focus'](_0x3803ad);}['setPromptInputValue'](_0x547477){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x547477;}}class As extends _0x52fd2c{constructor(_0x2ea64b){super(_0x2ea64b);const _0x4a293c=new _0x129639(_0x2ea64b);_0x4a293c['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x4a293c['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'},_0x4a293c]}]});}}class li extends _0x3d4bc4{['conversationStartButton'];['resizeButton'];constructor(_0x27dbde,_0x3bd2e3){super(_0x27dbde,{'label':i(_0x27dbde,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Et}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x27dbde),this['children']['add'](this['conversationStartButton']),_0x3bd2e3&&(this['resizeButton']=Hs(_0x27dbde,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x5aa90a){const _0x3b5b2e=new _0x129639(_0x5aa90a);return _0x3b5b2e['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x4c97e0,'class':'ck-ai-chat__start-conversation'}),_0x3b5b2e['on']('execute',()=>{this['fire']('startConversation');}),_0x3b5b2e;}}class ui extends _0x52fd2c{constructor(_0x5ebf5f){super(_0x5ebf5f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x5ebf5f,'AI_DISCLAIMER_TEXT')}]}]});}}class At extends _0x52fd2c{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x28dd77,_0x1b2436){super(_0x28dd77),this['_bodyCollection']=new _0x26c387(_0x28dd77),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new li(_0x28dd77,_0x1b2436['showResizeButton']),this['chatHeader']['delegate'](...Rt)['to'](this),this['chatFeed']=new mi(_0x28dd77,this['_bodyCollection']),this['chatFeed']['delegate'](...Rt)['to'](this),this['chatControls']=new ni(_0x28dd77,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x1b2436['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Rt)['to'](this),this['chatDisclaimer']=new ui(_0x28dd77),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x28dd77['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x30cf0a,_0xb6e752,_0x26635a,_0x3af9b5){this['chatControls']['populateSourceResourceBalloon'](_0x30cf0a,_0xb6e752,_0x26635a,_0x3af9b5);}['closeSourceResourceBalloon'](_0x3cf9a3){this['chatControls']['closeSourceResourceBalloon'](_0x3cf9a3);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class z extends _0x42547c{static get['requires'](){return[it];}['_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(_0x9f9b1f){super(_0x9f9b1f);const _0xef4437=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new St(),this['_view']=new At(this['context']['locale'],{'showResizeButton':_0xef4437['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Rt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x7e662e,{showDiff:_0x9e6f6b})=>{this['showDiff']=_0x9e6f6b;}),_0xef4437['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Et,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x238b41=>_0x238b41),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x137b1e=>_0x137b1e),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x45a625){const _0x14723f=this['context']['config']['get']('ai.chat.welcomeMessage')??i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x45a625['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x14723f}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0x12a173,staticMessage:_0x3ca3c2}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x12a173,'initialContent':'<p>'+_0x3ca3c2+'</p>'});}['addFeedItemUserMessage'](_0x2d0251){const _0x33a9ec=_0x2d0251['attributes']?.['displayedPrompt']||_0x2d0251['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x2d0251['contextItems']['values']()),'initialContent':'<p>'+_0x33a9ec+'</p>','id':_0x2d0251['id']});}['addFeedItemError']({errorMessage:_0x220028,id:_0x3628aa}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x220028+'</p>','id':_0x3628aa});}['addFeedItemAIReply'](_0x305a6d){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x305a6d['interactionId']+':'+_0x305a6d['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x1f41f0){const _0x2d4393=T(this['context']);let _0x3cf1f4=_0x2d4393['config']['get']('ai.availableReplyActions')||[...J];if(_0x2d4393['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x29541a=_0x2d4393['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x29541a,'value');}}else _0x3cf1f4=_0x3cf1f4['filter'](_0x56c02d=>'insertSuggestion'!=_0x56c02d);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x1f41f0['interactionId']+':'+_0x1f41f0['id'],'areActionsDisabled':_0x1f41f0['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x3cf1f4}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x3f7f70,_0x3c723b){const _0x5e4dfb=this['_view']['chatFeed']['children']['last'];if(_0x5e4dfb instanceof Ct)return this['_view']['chatFeed']['children']['remove'](_0x5e4dfb),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x3f7f70['id'],'capabilities':{'isWebSearchEnabled':_0x5e4dfb['capabilities']['isWebSearchEnabled']||_0x3c723b['isWebSearchEnabled'],'isReasoningEnabled':_0x5e4dfb['capabilities']['isReasoningEnabled']||_0x3c723b['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x3f7f70['id'],'capabilities':_0x3c723b});}async['addFeedItemCustomElement'](_0x3a1a99,_0x21211a){let _0x5d9fc2;return await this['_promiseQueue']['enqueue'](async()=>{_0x5d9fc2=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x3a1a99,'id':_0x21211a});}),_0x5d9fc2;}['removeFeedItem'](_0x497e89){this['_view']['chatFeed']['removeItem'](_0x497e89);}['hasFeedItem'](_0x3042b2){return this['_view']['chatFeed']['hasItem'](_0x3042b2);}['updateFeedInteractionHeader'](_0x570964){const _0x12da49=this['_view']['chatFeed']['children']['find'](_0x1b5800=>_0x1b5800['options']['id']==_0x570964['id']&&_0x1b5800 instanceof Ct);_0x12da49&&_0x12da49['set']('isVisible',_0x570964['isVisible']);}async['updateFeedItemAIReplyContent'](_0x6ac570){const _0x447de2=_0x6ac570['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x34a24f=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x6ac570,'abortSignal':_0x34a24f,'renderingStrategy':_0x447de2}),_0x6ac570['isDone']&&this['markFeedItemAsDone'](_0x6ac570['id']);});}['updateFeedItemAIReplySources'](_0x14a0a3,_0x14df4c){this['_view']['chatFeed']['updateWebSources'](_0x14a0a3,_0x14df4c);}async['updateFeedItemAIReplySuggestionContent'](_0x5ce0f3){const _0x550e38=_0x5ce0f3['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x19b03e=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x5ce0f3,'abortSignal':_0x19b03e,'renderingStrategy':_0x550e38}),_0x5ce0f3['isDone']&&this['markFeedItemAsDone'](_0x5ce0f3['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x427d71){this['_view']['chatFeed']['updateSuggestionPartState'](_0x427d71);}['setFeedItemAIReplySuggestionPartActive'](_0x9e173b){this['_view']['chatFeed']['setSuggestionPartActive'](_0x9e173b);}['markFeedItemAsDone'](_0x3c25ad){this['_view']['chatFeed']['markItemAsDone'](_0x3c25ad);}['removeFeedInteraction'](_0x228a78){this['_view']['chatFeed']['getItemIds']()['filter'](_0x549026=>_0x549026['startsWith'](_0x228a78))['forEach'](_0x554a8d=>this['_view']['chatFeed']['removeItem'](_0x554a8d));}['startInteraction'](){const _0x4f5e3e=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x4f5e3e),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x1407f2){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x2a9c68=>_0x2a9c68['startsWith'](_0x1407f2['id']))['forEach'](_0x4e3252=>this['markFeedItemAsDone'](_0x4e3252)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x36fd73,_0x48da9d){this['_view']['chatControls']['addContextItem'](_0x36fd73,_0x48da9d);}['removeContextItem'](_0x1f9cc3){this['_view']['chatControls']['removeContextItem'](_0x1f9cc3);}['setContextItemLoading'](_0x12939,_0x4accc3){this['_view']['chatControls']['setContextItemLoading'](_0x12939,_0x4accc3);}['setIsUploadInProgress'](_0x28cc26){this['_view']['chatControls']['setIsUploadInProgress'](_0x28cc26);}['setConversationContext'](_0x309520){this['_view']['chatControls']['setConversationContext'](_0x309520);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x1ed53b,_0x47d3ef,_0x543612){this['_view']['chatControls']['updateResourceState'](_0x1ed53b,_0x47d3ef,_0x543612);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x2f0ccc){this['_view']['chatControls']['setAddContextOptions'](_0x2f0ccc);}['updateCapabilities'](_0x105904){this['_view']['chatControls']['setWebSearch'](_0x105904['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x105904['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x105904));}['setSelectedModel'](_0xbfdac5,_0x39bb65){this['_view']['chatControls']['setModel'](_0xbfdac5),_0x39bb65&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0xabb476){this['feedItemRenderingStrategy']=_0xabb476;}['toggleLoadingSkeleton'](_0x3285bc){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x3285bc);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x535224,_0x2aa4ea=!0x1){if(_0x2aa4ea&&!mt()&&_0x535224['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x535224);this['_view']['chatHeader']['label']=_0x535224;}['setLoadingMessage'](_0x49c536){this['_view']['chatFeed']['setLoadingMessage'](_0x49c536);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x1a0b65){let _0x1bf19e=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x1a0b65[_0x1bf19e],_0x1bf19e++,_0x1bf19e===_0x1a0b65['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x2f003a){this['_view']['chatHeader']['isMaximized']=_0x2f003a;}['prepareLoadingMessage'](_0x57162f){return _0x57162f['isWebSearchEnabled']&&_0x57162f['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x57162f['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x57162f['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x48b379){return _0x48b379?_0x48b379['isWebSearchEnabled']&&_0x48b379['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x48b379['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x48b379['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'](_0xea0b68,_0x2e0831,_0xd56dbe,_0x4b6e33){this['_view']['populateSourceResourceBalloon'](_0xea0b68,_0x2e0831,_0xd56dbe,_0x4b6e33);}['closeSourceResourceBalloon'](_0x1a3424){this['_view']['closeSourceResourceBalloon'](_0x1a3424);}['setPromptInputValue'](_0x2c99e7){this['_view']['chatControls']['setPromptInputValue'](_0x2c99e7);}['focusPromptInput'](_0x43cae3=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x43cae3);}['scrollFeedToSuggestion'](_0x194d87,_0x4ec2e3){this['_view']['chatFeed']['scrollToSuggestion'](_0x194d87,_0x4ec2e3);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Vi extends _0x53ea61{['sections'];constructor(_0x1e6a5f,_0x2b83fd){super(_0x1e6a5f),this['sections']=_0x2b83fd,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x4231e9){let _0x4e93c2=0x0,_0x52e649=0x0;for(const _0xfecd2 of this['sections']){const {resultsCount:_0x56c902,totalItemsCount:_0x3f537e}=_0xfecd2['filter'](_0x4231e9);_0x4e93c2+=_0x56c902,_0x52e649+=_0x3f537e;}return{'resultsCount':_0x4e93c2,'totalItemsCount':_0x52e649};}}class bi extends _0x27d63c{['title'];['itemsViews'];['_itemsListView'];constructor(_0x54b2f6,{title:_0x371ab5,items:_0x45cdfd}){super(_0x54b2f6);const _0x1d808b=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x371ab5,this['itemsViews']=_0x45cdfd;const _0x106f24=new _0x52fd2c(_0x54b2f6);_0x106f24['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x53ea61(_0x54b2f6),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x1d808b['if']('isVisible','ck-hidden',_0x371416=>!_0x371416)]},'children':[_0x106f24,this['_itemsListView']]});}['filter'](_0x402f0c){const _0x4b4f53=this['itemsViews']['length'];let _0x4bdb25=0x0;for(const _0x224aef of this['itemsViews']){if(_0x402f0c){const _0x535e17=_0x224aef['isMatching'](_0x402f0c);_0x224aef['isVisible']=!!_0x535e17,_0x224aef['highlightText'](_0x402f0c);}else _0x224aef['isVisible']=!0x0,_0x224aef['highlightText'](null);_0x224aef['isVisible']&&_0x4bdb25++;}return this['isVisible']=_0x4bdb25>0x0,{'resultsCount':_0x4bdb25,'totalItemsCount':_0x4b4f53};}['getItem'](_0x38be61){return this['itemsViews']['find'](_0x4a2f2d=>_0x4a2f2d['id']===_0x38be61);}['removeItem'](_0x314f5f){const _0x457726=this['itemsViews']['indexOf'](_0x314f5f);-0x1!==_0x457726&&(this['itemsViews']['splice'](_0x457726,0x1),this['_itemsListView']['items']['remove'](_0x314f5f));}}class yi extends/* #__PURE__ -- @preserve */
27
+ _0x5072a0(_0x27d63c){['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(_0x33a9b2,_0x371fb0){super(_0x33a9b2);const _0x49fcd2=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x371fb0['pinned']),this['set']('loadingState',null),this['id']=_0x371fb0['id'];const {title:_0x43a3e9,createdAt:_0x251567,active:_0x4ec5f5=!0x1}=_0x371fb0;this['_titleView']=new _0x3ec926(),this['_titleView']['text']=_0x43a3e9,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x46cab5=this['_createCheckView'](),_0x258f70=this['_createPinButtonView'](_0x33a9b2),_0x29674b=this['_createMenuDropdownView'](),_0x41c895=this['_createEditInputView'](_0x33a9b2,_0x43a3e9),_0x49c879=this['_createAcceptEditButtonView'](_0x33a9b2,_0x41c895),_0x27fec8=this['_createCancelEditButtonView'](_0x33a9b2,_0x41c895);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x258f70),this['actions']['add'](_0x29674b),this['on']('change:isEdit',(_0x27cc47,_0x19b0b3,_0x13b683)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x13b683?(this['actions']['add'](_0x49c879),this['actions']['add'](_0x27fec8),this['mainContent']['add'](_0x41c895),_0x41c895['element']['focus']()):(this['actions']['add'](_0x258f70),this['actions']['add'](_0x29674b),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x4ec5f5?'ck-ai-chat-history__item--active':'',_0x49fcd2['if']('isVisible','ck-hidden',_0x2bd214=>!_0x2bd214),_0x49fcd2['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',_0x49fcd2['if']('loadingState','ck-hidden',_0x1435b9=>!!_0x1435b9)]},'children':_0x4ec5f5?[_0x46cab5]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x49fcd2['if']('loadingState','ck-hidden',_0x2d8a58=>!_0x2d8a58)]},'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',_0x49fcd2['if']('loadingState','ck-hidden',_0x40bd9d=>!!_0x40bd9d)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x49fcd2['if']('loadingState','ck-hidden',_0x143da9=>!_0x143da9)]},'children':[{'text':_0x49fcd2['to']('loadingState',_0x59474a=>_0x59474a?i(this['locale'],yi['LOADING_LABELS'][_0x59474a]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x251567]}]},{'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'](_0x10dc38){this['_titleView']['text']=_0x1f62ac(_0x10dc38);}['updateLoadingState'](_0x1fad4e,_0x1a91a2){this['set']('loadingState',_0x1a91a2?_0x1fad4e:null);}['_createCheckView'](){const _0x25dc4e=new _0x3d6008();return _0x25dc4e['set']({'content':_0x1d6803}),_0x25dc4e;}['_createPinButtonView'](_0x1de119){const _0x329697=new _0x129639(_0x1de119);return _0x329697['set']({'label':i(_0x1de119,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x2f071c,'withText':!0x1,'tooltip':!0x0}),_0x329697['bind']('isOn')['to'](this,'pinned'),_0x329697['on']('execute',()=>{const _0xef6c68=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0xef6c68});}),_0x329697;}['_createMenuDropdownView'](){const _0x550e0c=_0x3837b3(this['locale'],_0x435fbc),_0x5e3777=_0x550e0c['panelView']['children'];_0x550e0c['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x2c4360}),_0x550e0c['panelPosition']='sw';const _0x1dc8ff=new _0x129639(this['locale']);_0x1dc8ff['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x1dc8ff['withText']=!0x0,_0x1dc8ff['on']('execute',()=>{this['isEdit']=!0x0;});const _0x5aec1a=new _0x129639(this['locale']);_0x5aec1a['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x5aec1a['withText']=!0x0,_0x5aec1a['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x5ed14f=new _0x53ea61(this['locale']),_0x3a59d8=new _0x27d63c(this['locale']);_0x3a59d8['children']['add'](_0x1dc8ff);const _0x40426c=new _0x27d63c(this['locale']);return _0x40426c['children']['add'](_0x5aec1a),_0x5ed14f['items']['addMany']([_0x3a59d8,_0x40426c]),_0x5e3777['add'](_0x5ed14f),_0x550e0c;}['_createEditInputView'](_0x147e9e,_0x268269){const _0x37a5ed=new _0x17f0eb(_0x147e9e),_0xd28819=_0x37a5ed['bindTemplate'];return _0x37a5ed['value']=_0x268269,_0x37a5ed['extendTemplate']({'on':{'keydown':_0xd28819['to'](_0x1f2fba=>{'Enter'==_0x1f2fba['key']&&this['_commitEditInputValue'](_0x37a5ed);})}}),_0x37a5ed;}['_createAcceptEditButtonView'](_0x51707a,_0x31ad1f){const _0x499e0f=new _0x129639(_0x51707a);return _0x499e0f['set']({'icon':_0x1d6803,'withText':!0x1,'tooltip':i(_0x51707a,'AI_CHAT_HISTORY_ACCEPT')}),_0x499e0f['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x499e0f['on']('execute',()=>{this['_commitEditInputValue'](_0x31ad1f);}),_0x499e0f;}['_commitEditInputValue'](_0x393149){const _0xa4b624=_0x393149['element']['value']||'';this['_titleView']['text']=_0xa4b624,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0xa4b624});}['_createCancelEditButtonView'](_0x16f3cb,_0x20e10a){const _0x1d3cd1=new _0x129639(_0x16f3cb);return _0x1d3cd1['set']({'icon':_0x254810,'withText':!0x1,'tooltip':i(_0x16f3cb,'AI_CHAT_HISTORY_CANCEL')}),_0x1d3cd1['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x1d3cd1['on']('execute',()=>{this['isEdit']=!0x1,_0x20e10a['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x1d3cd1;}['_createSpinnerView'](){const _0x30796c=new Ze('tiny');return _0x30796c['isVisible']=!0x0,_0x30796c;}['isMatching'](_0x865882){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x865882)?{'title':!0x0}:null;}['highlightText'](_0x219085){this['_titleView']['highlightText'](_0x219085);}}class Ot extends _0x52fd2c{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x509416,_0x1681db){super(_0x509416),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x1f8e32=new _0x3d4bc4(_0x509416,{'label':i(_0x509416,'AI_CHAT_HISTORY_HEADING'),'icon':Nt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x1681db&&(this['resizeButton']=Hs(_0x509416,this),_0x1f8e32['children']['add'](this['resizeButton'])),this['sectionsView']=new Vi(_0x509416,[]),this['sectionsView']['delegate'](...Ei)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x4dc47c=>!_0x4dc47c)]}}),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':[_0x1f8e32,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['mainErrorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'],this['isMainErrorViewVisible']=!this['isSearchViewVisible']&&!!this['errorMessage'];}['_createSearchView'](){const _0x39e586=new _0x15a37a(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x20a69b=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x20a69b),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x4e43b6=this['_createErrorView']();return _0x4e43b6['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x2e8a1c=>!_0x2e8a1c)]}}),_0x39e586['on']('render',()=>{_0x39e586['children']['add'](_0x4e43b6,0x1);}),_0x39e586['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x32b2d6=>!_0x32b2d6)]}}),_0x39e586;}['_createSkeletonView'](){const _0x2e3de3=new Xe(this['locale'],Ye['aiHistory']);return _0x2e3de3['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x1bce06=>!_0x1bce06)]}}),_0x2e3de3;}['_createErrorView'](){const _0x48ca7b=new _0x52fd2c(this['locale']),_0x43d657=new _0x129639(this['locale']);_0x43d657['set']({'withText':!0x1,'icon':_0x254810,'class':'ck-ai-notification_error__dismiss-button'}),_0x43d657['bind']('isVisible')['to'](this,'hasItems',_0x4f1e03=>!!_0x4f1e03),_0x43d657['on']('execute',()=>{this['errorMessage']='';});const _0x5fa40=this['bindTemplate'];return _0x48ca7b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x5fa40['to']('errorMessage')}]},_0x43d657]}),_0x48ca7b;}['_createEmptyStateView'](){const _0x42cb17=new _0x129639(this['locale']);_0x42cb17['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x4c97e0,'class':'ck-ai-chat__start-conversation'}),_0x42cb17['on']('execute',()=>{this['fire']('openChat');});const _0x2a6cba=new _0x52fd2c(this['locale']);return _0x2a6cba['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x2fb433=>!_0x2fb433)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x42cb17]}),_0x2a6cba;}['_createListItemViews'](_0x225423,_0x21d503){const _0x320057=[];for(const _0x1b5788 of _0x225423){const _0x1b23f6=new yi(_0x21d503,_0x1b5788);_0x1b23f6['delegate'](...Ei)['to'](this),_0x320057['push'](_0x1b23f6);}return _0x320057;}['updateHistoryItemsWithCategories'](_0x16e4e8){const _0x2d2e1d=this['locale']||'en',_0x123b72=[];for(const _0xa36a91 of _0x16e4e8){const _0x5b6084=this['_createListItemViews'](_0xa36a91['items'],_0x2d2e1d);_0x123b72['push'](new bi(_0x2d2e1d,{'title':_0xa36a91['title'],'items':_0x5b6084}));}this['sectionsView']['sections']=_0x123b72,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x123b72),this['hasItems']=_0x16e4e8['some'](_0x3d58c4=>_0x3d58c4['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x4d8903){for(const _0x5610bb of this['sectionsView']['sections']){const _0x3d9142=_0x5610bb['getItem'](_0x4d8903);if(_0x3d9142){if(_0x5610bb['removeItem'](_0x3d9142),0x0===_0x5610bb['itemsViews']['length']){const _0xcc9ecb=this['sectionsView']['sections']['indexOf'](_0x5610bb);-0x1!==_0xcc9ecb&&(this['sectionsView']['sections']['splice'](_0xcc9ecb,0x1),this['sectionsView']['items']['remove'](_0x5610bb));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x1234a3,_0x261dce){for(const _0x5179d7 of this['sectionsView']['sections']){const _0x673416=_0x5179d7['getItem'](_0x1234a3);if(_0x673416){_0x673416['updateTitle'](_0x261dce);break;}}}['updateItemLoadingState'](_0x4af9cd,_0x491f02,_0x22b557){for(const _0x54b5fb of this['sectionsView']['sections']){const _0xb14cdb=_0x54b5fb['getItem'](_0x4af9cd);if(_0xb14cdb){_0xb14cdb['updateLoadingState'](_0x491f02,_0x22b557);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x45530d=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x45530d);}}}const Ei=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x42547c{static get['requires'](){return[it];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4d62f6){super(_0x4d62f6);const _0x4e172a=this['context']['plugins']['get']('AITabs');this['_historyView']=new Ot(this['context']['locale'],_0x4e172a['showResizeButton']),this['_historyView']['delegate'](...Ei)['to'](this),_0x4e172a['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Nt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x14ae43){this['_historyView']['removeHistoryItem'](_0x14ae43);}['updateItems'](_0x503ec2){this['_historyView']['updateHistoryItemsWithCategories'](_0x503ec2);}['updateItemTitle'](_0x13de98,_0x4ff8dd){this['_historyView']['updateItemTitle'](_0x13de98,_0x4ff8dd);}['updateItemLoadingState'](_0x2b46d9,_0x1a828c,_0x508dbf){this['_historyView']['updateItemLoadingState'](_0x2b46d9,_0x1a828c,_0x508dbf);}['setLoadingSkeleton'](_0x260aab){this['_historyView']['isLoading']=_0x260aab;}['showError'](_0x452ac4){this['_historyView']['errorMessage']=_0x452ac4;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x437d3b){this['_historyView']['isMaximized']=_0x437d3b;}}class nr extends ts(){['id'];['createdAt'];constructor({id:_0x4b1e74,title:_0x596c3c,createdAt:_0x8c5a5e,updatedAt:_0x1fe1a7,pinned:_0x1aff27}){super(),this['id']=_0x4b1e74,this['createdAt']=new Date(_0x8c5a5e),this['set']('title',_0x596c3c),this['set']('updatedAt',_0x1fe1a7?new Date(_0x1fe1a7):null),this['set']('pinned',_0x1aff27||!0x1);}['updateTitle'](_0x5cd07a){this['set']('title',_0x1f62ac(_0x5cd07a)),this['updatedAt']=new Date();}['updatePinned'](_0x16e2d3){this['set']('pinned',_0x16e2d3),this['updatedAt']=new Date();}}class Ht extends _0x186953(){['items']=[];['connector'];['group'];constructor({connector:_0x247849,group:_0x46f195}){super(),this['connector']=_0x247849,this['group']=_0x46f195;}async['init'](){try{const _0x470864=this['connector']['fetchConversations'](this['group']),_0x11e0e8=await _0x470864['getConversations']();this['loadItems'](_0x11e0e8);}catch(_0x1167ab){this['fire']('error',{'error':_0x1167ab,'operation':'init'});}}['addItem'](_0x46d756){this['items']['push'](_0x46d756);}async['removeItem'](_0x97b69e){const _0x6ee2ce=this['items']['findIndex'](_0x81f332=>_0x81f332['id']===_0x97b69e);if(-0x1===_0x6ee2ce)return!0x1;try{return await this['connector']['deleteConversation'](_0x97b69e)['execute'](),this['items']['splice'](_0x6ee2ce,0x1),this['fire']('itemRemoved',{'itemId':_0x97b69e}),!0x0;}catch(_0x4692e1){return this['fire']('error',{'error':_0x4692e1,'operation':'removeItem','itemId':_0x97b69e}),!0x1;}}['getItem'](_0x57ad13){return this['items']['find'](_0x9c8cd7=>_0x9c8cd7['id']===_0x57ad13);}async['updateItemTitle'](_0x463cb9,_0x153c32){const _0x3d2eb2=this['getItem'](_0x463cb9);if(!_0x3d2eb2)return!0x1;try{return await this['connector']['updateConversation'](_0x463cb9,{'title':_0x153c32})['getResult'](),_0x3d2eb2['updateTitle'](_0x153c32),this['fire']('itemUpdated',{'itemId':_0x463cb9,'updates':{'title':_0x153c32}}),!0x0;}catch(_0x587481){return this['fire']('error',{'error':_0x587481,'operation':'updateItemTitle','itemId':_0x463cb9}),!0x1;}}async['updateItemPinned'](_0x3eed4c,_0x2378fd){const _0x45cbeb=this['getItem'](_0x3eed4c);if(!_0x45cbeb)return!0x1;try{return await this['connector']['updateConversation'](_0x3eed4c,{'pinned':_0x2378fd})['getResult'](),_0x45cbeb['updatePinned'](_0x2378fd),this['fire']('itemUpdated',{'itemId':_0x3eed4c,'updates':{'pinned':_0x2378fd}}),!0x0;}catch(_0xfec96a){return this['fire']('error',{'error':_0xfec96a,'operation':'updateItemPinned','itemId':_0x3eed4c}),!0x1;}}['loadItems'](_0x267ab2){try{this['items']=[],_0x267ab2['map'](_0x59574c=>{this['addItem'](new nr(_0x59574c));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x313fb0){this['fire']('error',{'error':_0x313fb0,'operation':'loadItems'});}}['getItems'](_0x10691a={}){const _0x4b9d1d=void 0x0!==_0x10691a['pinned']&&_0x10691a['pinned'],_0x4c5316=_0x10691a['from']?new Date(_0x10691a['from']['getFullYear'](),_0x10691a['from']['getMonth'](),_0x10691a['from']['getDate']()):null,_0x57af86=_0x10691a['to']?new Date(_0x10691a['to']['getFullYear'](),_0x10691a['to']['getMonth'](),_0x10691a['to']['getDate']()):null;return this['items']['filter'](_0x558742=>{if(_0x558742['pinned']!==_0x4b9d1d)return!0x1;if(_0x57af86){const _0x3a2645=new Date(_0x558742['createdAt']['getFullYear'](),_0x558742['createdAt']['getMonth'](),_0x558742['createdAt']['getDate']());return _0x4c5316?_0x4c5316['getTime']()===_0x57af86['getTime']()?_0x3a2645['getTime']()===_0x4c5316['getTime']():_0x3a2645<_0x57af86&&_0x3a2645>=_0x4c5316:_0x3a2645<_0x57af86;}return!0x0;});}}class jt extends _0x42547c{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[tt,q,xt,it];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](tt),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](q);const _0xdd4366=this['context']['plugins']['get'](it);try{const _0x16a15a=this['_aiChatController']['getGroupId']();this['history']=new Ht({'connector':this['_aiConnector'],'group':_0x16a15a}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x298d75,_0x656cba)=>{this['_setItemLoading'](_0x656cba['id'],'remove'),this['_handleRemove'](_0x656cba['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x44e552,_0x5175da)=>{this['_setItemLoading'](_0x5175da['id'],'rename'),this['_handleEditTitle'](_0x5175da['id'],_0x5175da['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x2f95be,_0x3c7047)=>{void 0x0!==_0x3c7047['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x3c7047['itemId'],_0x3c7047['updates']['title']),void 0x0!==_0x3c7047['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x3c7047['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x40dfc8,_0xb61ff8)=>{this['_aiChatController']['handleRemovedConversation'](_0xb61ff8['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0xb61ff8['itemId']),this['_clearItemLoading'](_0xb61ff8['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x2cc3d8,_0x421586)=>{this['_handleHistoryErrorUI'](_0x421586['error'],_0x421586['operation'],_0x421586['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x523543,_0x37bcb8)=>{this['_handleSelectConversation'](_0x37bcb8['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x376d6a,_0x839cc6)=>{const _0x5d6b86=_0x839cc6['pinned']?'pin':'unpin';this['_setItemLoading'](_0x839cc6['id'],_0x5d6b86),this['_handleTogglePin'](_0x839cc6['id'],_0x839cc6['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0xdd4366['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0xdd4366['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0xdd4366,'resizedTabs',(_0x1d879a,_0x5ce030)=>{this['_setIsMaximized'](_0x5ce030);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0xdd4366['resize']();});}catch(_0xdcceb5){this['_handleHistoryErrorUI'](_0xdcceb5,'init');}}async['_handleEditTitle'](_0xec255c,_0x3d6b46){await this['history']['updateItemTitle'](_0xec255c,_0x3d6b46);}async['_handleTogglePin'](_0x4e56e6,_0x1544e4){await this['history']['updateItemPinned'](_0x4e56e6,_0x1544e4);}async['_handleRemove'](_0x4329a9){await this['history']['removeItem'](_0x4329a9);}async['_handleSelectConversation'](_0x404e25){await this['_aiChatController']['loadConversation'](_0x404e25);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x34ffe3=this['_aiChatController']['activeConversation']?.['id'],_0xb24b42=this['_getCategorizedItems']()['map'](_0x258fe5=>({'title':_0x258fe5['title'],'items':_0x258fe5['items']['map'](_0xbeb356=>({'id':_0xbeb356['id'],'title':_0xbeb356['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0xbeb356['createdAt'])['toLocaleDateString'](),'active':_0xbeb356['id']===_0x34ffe3,'pinned':_0xbeb356['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0xb24b42);}['_setItemLoading'](_0x1e7ddd,_0x493da1){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x1e7ddd,_0x493da1,!0x0);}['_clearItemLoading'](_0x3d5c1b){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x3d5c1b,null,!0x1);}['_handleHistoryErrorUI'](_0x20fa4a,_0x52b991,_0x106455){const _0x19c4d9=this['_generateErrorMessage'](_0x52b991,_0x106455);this['_aiChatHistoryUi']['showError'](_0x19c4d9),_0x106455&&this['_clearItemLoading'](_0x106455),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x41eae9,_0xa38709){const _0x343978=_0xa38709?this['history']['getItem'](_0xa38709):null,_0x3ebab5=_0x343978?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x41eae9){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3ebab5);case'updateItemPinned':{const _0x21d81b=i(this['context']['locale'],_0x343978?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x21d81b,_0x3ebab5]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3ebab5);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 _0x352ef0=new Date(),_0x1eef99=new Date(_0x352ef0['getFullYear'](),_0x352ef0['getMonth'](),_0x352ef0['getDate']()),_0x44fba0=new Date(_0x1eef99);_0x44fba0['setDate'](_0x44fba0['getDate']()-0x1);const _0x5b8aca=new Date(_0x1eef99);_0x5b8aca['setDate'](_0x5b8aca['getDate']()-0xe);const _0x2c4860=this['history']['getItems']({'pinned':!0x0}),_0x10d7d1=this['history']['getItems']({'from':_0x1eef99,'to':_0x1eef99}),_0x59603e=this['history']['getItems']({'from':_0x44fba0,'to':_0x44fba0}),_0x694c1d=this['history']['getItems']({'from':_0x5b8aca,'to':_0x44fba0}),_0x4c11d0=this['history']['getItems']({'to':_0x5b8aca}),_0x3069d3=[];return _0x2c4860['length']>0x0&&_0x3069d3['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x2c4860}),_0x10d7d1['length']>0x0&&_0x3069d3['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x10d7d1}),_0x59603e['length']>0x0&&_0x3069d3['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x59603e}),_0x694c1d['length']>0x0&&_0x3069d3['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x694c1d}),_0x4c11d0['length']>0x0&&_0x3069d3['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x4c11d0}),_0x3069d3;}['_setIsMaximized'](_0x2cd06c){this['_aiChatHistoryUi']['setIsMaximized'](_0x2cd06c);}}class G extends _0x42547c{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Va extends _0x42547c{static get['requires'](){return[q,D,z,G];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x492b2b){super(_0x492b2b),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.initialConversation','new');}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](q)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](q)['startConversation']();}async['sendMessage']({message:_0x11fa75,attributes:_0x5485c6}){await this['context']['plugins']['get'](q)['sendMessage']({'message':_0x11fa75,'attributes':_0x5485c6});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](q)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](q)['focusPromptInput']();}['registerToolDataCallback'](_0x3fbaf6){this['context']['plugins']['get'](q)['_registerToolDataCallback'](_0x3fbaf6);}}class js extends _0x129639{['id'];constructor(_0x5a5044,_0x520e8){super(_0x5a5044);const {id:_0x3e28ff,type:_0xd885cb,icon:_0x4432c8}=_0x520e8;this['id']=_0x3e28ff,this['set']({'label':_0x520e8['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x520e8['id']}}),_0x4432c8?this['icon']=_0x4432c8:'chat'===_0xd885cb?this['icon']=_0x526982:'review'===_0xd885cb?this['icon']=_0x36f03e:'translate'===_0xd885cb&&(this['icon']=Vt);}}class Mt extends _0x52fd2c{['listView'];constructor(_0x54ac20,_0x5ac99b){super(_0x54ac20);const _0x2ed2f9=_0x5ac99b['map'](_0x1828a2=>{const _0xd41d0b=new _0x27d63c(this['locale']),_0x5d224e=new js(this['locale'],_0x1828a2);return _0xd41d0b['children']['add'](_0x5d224e),_0x5d224e['delegate']('execute')['to'](this),_0xd41d0b;});this['listView']=new _0x53ea61(this['locale']),this['listView']['items']['addMany'](_0x2ed2f9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ut='chat-shortcuts';var Ba=function(_0x38c9f8){return _0x38c9f8['CHAT']='chat',_0x38c9f8['REVIEW']='review',_0x38c9f8['TRANSLATE']='translate',_0x38c9f8;}({});class Ga extends _0x42547c{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[z];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](z),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x5aa1cf=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x5aa1cf['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x5aa1cf,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x1a0444=Object['values'](Ba);this['_shortcuts']['forEach'](_0x595393=>{let _0x30cb25=!0x0;if(_0x595393['id']&&_0x595393['label']&&_0x1a0444['includes'](_0x595393['type'])?'chat'===_0x595393['type']&&(_0x30cb25='string'==typeof _0x595393['prompt']):_0x30cb25=!0x1,!_0x30cb25)throw new _0xec7a4c('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x595393});});}['_injectShortcuts'](){const _0x1b33cd=this['context']['plugins']['get'](z);this['_shortcutsView']=new Mt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x1b33cd['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ut),this['_shortcutsView']['on']('execute',_0x57e6cb=>{const _0x496a49=_0x57e6cb['source']['id'];this['_executeShortcut'](_0x496a49);});}['_removeShortcuts'](){const _0xb638f=this['context']['plugins']['get'](z);_0xb638f['hasFeedItem'](Ut)&&_0xb638f['removeFeedItem'](Ut),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x42dc0f){const _0x13497f=this['_shortcuts']['find'](_0x2b5533=>_0x2b5533['id']===_0x42dc0f),_0xb887c8=_0x13497f['type'];'chat'===_0xb887c8?this['_runChatShortcut'](_0x13497f):'review'===_0xb887c8?_0x13497f['check']?this['_runReviewShortcut'](_0x13497f):this['_switchTab']('reviewMode'):'translate'===_0xb887c8&&(_0x13497f['language']?this['_runTranslateShortcut'](_0x13497f):this['_switchTab']('translate'));}['_switchTab'](_0x3cfd54){if(!this['context']['plugins']['has']('AITabs'))throw new _0xec7a4c('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x3cfd54});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x3cfd54);}async['_runChatShortcut']({prompt:_0x536afc,draftMode:_0x5b7e82,useWebSearch:_0x5ba015=!0x1,useReasoning:_0xe87f2e=!0x1,model:_0x53eda4}){const _0x42ab00=this['context']['plugins']['get']('AIChat'),_0x22f95e=this['context']['plugins']['get']('AIChatController'),_0x4e95bb=_0x22f95e['activeConversation'];let _0x1113ec;_0x1113ec=_0x53eda4?await _0x4e95bb['chatModels']['getModel'](_0x53eda4):await _0x4e95bb['chatModels']['getDefault'](),_0x1113ec&&await _0x4e95bb['setModel'](_0x1113ec),_0x4e95bb['setWebSearch'](_0x5ba015),_0x4e95bb['setReasoning'](_0xe87f2e),_0x22f95e['addCurrentDocumentToChatContext'](),_0x5b7e82?(this['_aiChatUI']['setPromptInputValue'](_0x536afc),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x42ab00['sendMessage']({'message':_0x536afc});}['_runReviewShortcut']({check:_0x2f567a,model:_0x5e288,prompt:_0x19cbfa,params:_0x756610}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0xec7a4c('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x15dc07={'id':_0x2f567a,'isCustom':'custom'===_0x2f567a};_0x5e288&&_0x19cbfa&&(_0x15dc07['args']={'model':_0x5e288,'prompt':_0x19cbfa}),_0x756610&&(_0x15dc07['params']=_0x756610),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x15dc07);}['_runTranslateShortcut']({language:_0x519311}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0xec7a4c('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x519311,'args':{'language':_0x519311}});}}class Bi extends Lt{constructor(_0x2ce5b6){super(_0x2ce5b6);const _0x133619=_0x2ce5b6['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x133619,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x4f4212=this['editor']['plugins']['get']('AITabs')['view'];_0x4f4212['isVisible']=!_0x4f4212['isVisible'];}}class Pt extends _0x421ea3{static get['requires'](){return[it];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x102d97=this['editor'];_0x102d97['commands']['add']('toggleAi',new Bi(_0x102d97)),_0x102d97['ui']['componentFactory']['add']('toggleAi',()=>{const _0x6f3b2a=this['_createAIUIButton'](_0x129639);return _0x6f3b2a['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x6f3b2a;}),_0x102d97['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x24205e=this['_createAIUIButton'](_0xa33d94);return _0x24205e['set']({'role':'menuitemcheckbox'}),_0x24205e;});}['_createAIUIButton'](_0x1ab7b0){const _0x3364c4=this['editor'],_0xd3280a=_0x3364c4['commands']['get']('toggleAi'),_0xdeab9=new _0x1ab7b0(_0x3364c4['locale']);return _0xdeab9['set']({'label':i(_0x3364c4['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x1a8e11,'isToggleable':!0x0}),_0xdeab9['bind']('isEnabled')['to'](_0xd3280a),_0xdeab9['bind']('isOn')['to'](_0xd3280a,'value',_0x21161a=>!!_0x21161a),this['listenTo'](_0xdeab9,'execute',()=>{_0xd3280a['execute']();}),_0xdeab9;}}const F=['applySuggestion','insertSuggestion','showNext','showPrevious'];class gs extends _0x52fd2c{['_errorView'];constructor(_0x1b8c6f){super(_0x1b8c6f),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x468482){this['showError'](_0x468482);}['showError'](_0x4952f6){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x4952f6,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x3554e0=new _0x52fd2c(this['locale']),_0x15ca49=new _0x52fd2c(this['locale']);return _0x15ca49['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x3554e0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x211929=>!_0x211929)]},'children':[_0x15ca49]}),_0x3554e0;}}const $=0xa;class H extends _0x42547c{static get['requires'](){return[D];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x4e5e58){const {id:_0x4923df}=this['_currentConfig']??{};this['_currentConfig']=_0x4e5e58;const {id:_0x11dccd}=this['_currentConfig'];this['isOpen']&&_0x4923df===_0x11dccd?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x8b425e=T(this['context'])['plugins']['get']('Dialog');_0x8b425e['isOpen']&&this['_currentConfig']&&_0x8b425e['id']===this['_currentConfig']['id']&&_0x8b425e['hide']();}['_updateDialog'](){const _0x80cbc6=T(this['context'])['plugins']['get']('Dialog'),{icon:_0x19b99a,title:_0x20ef68}=this['_currentConfig'];_0x80cbc6['view']?.['headerView']&&(_0x80cbc6['view']['headerView']['label']=_0x20ef68,_0x80cbc6['view']['headerView']['iconView']&&_0x19b99a&&(_0x80cbc6['view']['headerView']['iconView']['content']=_0x19b99a)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x80cbc6['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x38d463){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x38d463);}['_showDialog'](){const _0x32c9fd=T(this['context'])['plugins']['get']('Dialog'),{id:_0x35e93b,title:_0x554e4c,icon:_0x39e452,class:_0x4c63bf,mainView:_0xb765d2}=this['_currentConfig'];_0xb765d2['delegate'](...F)['to'](this),_0x32c9fd['show']({'title':_0x554e4c,'icon':_0x39e452,'hasCloseButton':!0x0,'id':_0x35e93b,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x4c63bf||''),'content':_0xb765d2,'onShow':_0x47b08a=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x4e7a84=this['_getSelectionElements']();_0x4e7a84&&_0x4e7a84[0x0]&&_0x527ffd({'target':_0x4e7a84[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x47b08a['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x35e93b});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x35e93b}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x323aaf,_0x34ca79){if(!_0x34ca79)return null;const _0x35594a=this['_getSelectionElements']();if(!_0x35594a||0x0===_0x35594a['length'])return{'left':Math['round'](_0x34ca79['left']+_0x34ca79['width']/0x2-_0x323aaf['width']/0x2),'top':Math['round'](_0x34ca79['top']+_0x34ca79['height']/0x2-_0x323aaf['height']/0x2)};const _0x3949ec=Math['round'](_0x34ca79['left']+_0x34ca79['width']/0x2-_0x323aaf['width']/0x2),_0x324bc9=_0x35594a['map'](_0x1bad67=>new _0x2d2067(_0x1bad67)),_0x1e0d0a=_0x323aaf['height'];return{'left':_0x3949ec,'top':this['_calculateOptimalTopPosition'](_0x324bc9,_0x1e0d0a,_0x34ca79)};}['_calculateOptimalTopPosition'](_0x53cae6,_0x4838a4,_0x5a1fa7){const _0x4601b2=new _0x2d2067(_0xa06698['window']),_0x3d82ed=_0x53cae6['map'](_0x28a3e5=>_0x28a3e5['getVisible']())['filter'](_0x1d63e0=>_0x1d63e0),_0xd357e5=_0x2d2067['getBoundingRect'](_0x3d82ed);if(!_0xd357e5)return Math['round'](_0x5a1fa7['top']+_0x5a1fa7['height']/0x2);const _0x31aa2d=_0x4601b2['getIntersection'](_0xd357e5);if(!_0x31aa2d)return Math['round'](_0x5a1fa7['top']+_0x5a1fa7['height']/0x2);const _0x13e8ee=_0x5a1fa7['getVisible'](),_0x4fa8b1=_0x13e8ee&&_0xd357e5['height']>_0x13e8ee['height'],_0x5325b2=_0x31aa2d['top'],_0x402aba=_0x31aa2d['bottom'];if(_0x4fa8b1){const _0x2bf087=(_0x13e8ee||_0x4601b2)['height']/0x2-_0x4838a4/0x2,_0x2307e7=_0x5325b2-$-_0x5a1fa7['top'],_0x5049af=_0x5a1fa7['bottom']-_0x402aba-$;return _0x2307e7>=_0x4838a4?Math['max']($,_0x5325b2-_0x4838a4-$):_0x5049af>=_0x4838a4?_0x402aba+$:Math['max']($,_0x2bf087);}const _0x6ecbb=_0x5325b2-_0x4838a4,_0x2e52cd=_0x5a1fa7['bottom']-_0x402aba-$,_0x2af39b=_0x5325b2-$-_0x5a1fa7['top'];let _0x7bcd27;if(_0x2e52cd>=_0x4838a4)_0x7bcd27=_0x402aba+$;else{if(_0x2af39b>=_0x4838a4)_0x7bcd27=_0x6ecbb-$;else _0x7bcd27=_0x5325b2+_0xd357e5['height']/0x2-_0x4838a4/0x2;}return _0x7bcd27;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x1c8acb=T(this['context']);this['listenTo'](_0x1c8acb['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x5c4732,data:{newRange:_0x69d458}}of _0x1c8acb['model']['document']['differ']['getChangedMarkers']())if(_0x5c4732['startsWith'](R+':')&&(_0x69d458&&(_0x69d458['start']['isEqual'](_0x69d458['end'])||'$graveyard'==_0x69d458['root']['rootName'])||null==_0x69d458)){const _0x21a9cc=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x21a9cc),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x1ffb09=T(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x1ffb09['model']['document']);}['_getSelectionElements'](){const _0x5803d9=T(this['context']);return _0x123e33(_0x5803d9['editing'],[..._0x5803d9['model']['markers']['getMarkersGroup']('ai-selection'),..._0x5803d9['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class ls extends _0xcb5503{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x6f3eb7,_0x35c16c={}){super(_0x6f3eb7),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x35c16c};const _0x1d1f81=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x1d1f81?'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'](),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']);}['toggleShowChangesEnabled'](_0x4931f5){this['showChangesButton']['isEnabled']=_0x4931f5;}['_setupRatingButtons'](){this['likeButton']=new _0x129639(this['locale']),this['likeButton']['set']({'icon':_0x58f257,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x129639(this['locale']),this['dislikeButton']['set']({'icon':_0xe2a8fb,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x129639(this['locale']),this['copyButton']['set']({'icon':_0xb3df13,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x20de26=new _0x3d6008();_0x20de26['set']({'content':_0x53c10a}),_0x20de26['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'](_0x20de26);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x129639(this['locale']),this['showChangesButton']['set']({'icon':_0x12da34,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':'ck-ai-button-tertiary'}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x344b93=>_0x344b93?_0x1bfe1c:_0x12da34),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class Q extends gs{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x135835,_0x3c4ff4){super(_0x135835);const _0x314ef4=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x264c5d(),this['_keystrokes']=new _0x299178(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x471d76({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x3c4ff4,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new cs(_0x135835),this['_partToolbarView']=new us(_0x135835,_0x3c4ff4['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x3c4ff4),this['_stateView']=new ps(_0x135835),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ls(_0x135835,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new fs(_0x135835,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x419c55,_0x487f08,_0x397c88,_0x75608)=>{let _0x1ba3c2,_0x1c14bc;'pending'===_0x75608?(_0x1ba3c2=this['_partToolbarView'],_0x1c14bc=this['_stateView']):(_0x1ba3c2=this['_stateView'],_0x1c14bc=this['_partToolbarView']),this['_stateView']['setState'](_0x397c88),_0x1ba3c2['isVisible']=!0x1,_0x1c14bc['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x314ef4['to']('_state',_0xcd3ac7=>'ck-ai-chat-balloon-main_state_'+_0xcd3ac7)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x3c4ff4);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0x20c44f){_0x20c44f?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x20c44f);}['setState'](_0x4f8103){this['_state']=_0x4f8103;}['showError'](_0x38b781){super['showError'](_0x38b781),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x5b98d3){super['showBlockingError'](_0x5b98d3),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x935a7f){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x935a7f;}['togglePartToolbarEnabled'](_0xe2f35a){this['_partToolbarView']['isEnabled']=_0xe2f35a;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x5d0270,showSuggestButton:_0x338065}){_0x5d0270=_0x5d0270&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x338065=_0x338065&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x5d0270,'showSuggestButton':_0x338065});}['_createNextButtonView'](){const _0x4ffc9f=new _0x129639(this['locale']);return _0x4ffc9f['set']({'icon':_0xe3deeb,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x4ffc9f['on']('execute',()=>{this['fire']('showNext');}),_0x4ffc9f;}['_createPreviousButtonView'](){const _0x1752a3=new _0x129639(this['locale']);return _0x1752a3['set']({'icon':_0x3970c2,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x1752a3['on']('execute',()=>{this['fire']('showPrevious');}),_0x1752a3;}}class fs extends _0x52fd2c{constructor(_0x108d05,_0x416c9b){super(_0x108d05),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x416c9b});}}class qt extends _0x421ea3{static get['requires'](){return[_0x52f20e,H];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x448e19){super(_0x448e19),this['set']('showDiff',!0x1);}['open'](_0x14fdf0){const _0x4c8d0b=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x4c8d0b['plugins']['get']('AIBalloon')['open']({..._0x14fdf0,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x14fdf0['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x14fdf0['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x44ec48){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x44ec48);}['setState'](_0x587085){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x587085);}['_createChatBalloonView'](){const _0x30c2b4=this['editor'],_0x2f4068=_0x30c2b4['plugins']['get']('AIBalloon'),_0x4334c0=_0x30c2b4['commands']['get']('trackChanges');let _0x183ef4=_0x30c2b4['config']['get']('ai.availableReplyActions')||[...J];_0x30c2b4['plugins']['has']('TrackChanges')||(_0x183ef4=_0x183ef4['filter'](_0x3c4c74=>'insertSuggestion'!=_0x3c4c74));const _0x177ae4=new Q(_0x30c2b4['locale'],{'availableActions':_0x183ef4,'showApplyButton':!0x0,'showSuggestButton':!!_0x4334c0});return _0x177ae4['bind']('showDiff')['to'](this),_0x177ae4['delegate'](...W)['to'](this),_0x177ae4['delegate']('showPrevious','showNext')['to'](this),_0x2f4068['delegate']('dialogClosed')['to'](this),_0x177ae4['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x177ae4['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x177ae4['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x4334c0&&_0x177ae4['bind']('isTrackChangesOn')['to'](_0x4334c0,'value'),_0x177ae4['render'](),_0x177ae4;}['_toggleRotatorButtonsInDialogHeader'](_0x267ebe){const _0x4fa257=this['editor'],_0x22eab8=_0x4fa257['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x267ebe),_0x22eab8['has'](this['_chatBalloonView']['previousButtonView'])||(_0x22eab8['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x4fa257['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x22eab8['remove'](this['_chatBalloonView']['previousButtonView']),_0x22eab8['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Fa extends _0x421ea3{static get['requires'](){return[Pt,qt,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0x30a2a7){const {editor:_0x319716,action:_0x31571f,withText:_0x5d353a=!0x1,withIcon:_0x1e2dde=!0x0,isInDropdown:_0x1e3ffb=!0x0,shouldPreventFocus:_0x1a621c=!0x1}=_0x30a2a7;return()=>{const _0x196f3c=_0x319716['locale'],_0x28e70b=new _0x129639(_0x196f3c),_0x1afd9d=_0x28e70b['bindTemplate'];_0x1e3ffb&&_0x28e70b['extendTemplate']({'on':{'mouseenter':_0x1afd9d['to'](()=>{_0x1a621c&&_0x1a621c()||_0x28e70b['focus']();})}});const _0x36159f=_0x31571f['icon']??_0x31571f['parent']?.['icon'];return _0x28e70b['set']({'label':_0x31571f['displayedPrompt'],'withText':_0x5d353a,'role':'menuitem','icon':_0x1e2dde?_0x36159f??yt:void 0x0,'tooltip':!_0x5d353a,'class':'ck-ai-quick-actions-button','isEnabled':_0x31571f['isEnabled']}),_0x28e70b['on']('execute',()=>{_0x319716['editing']['view']['focus'](),_0x319716['commands']['execute']('aiQuickAction',_0x31571f);}),_0x28e70b;};}class Qs extends _0x1841ad{['arrowView'];constructor(_0x70381c,_0x1e19f7){super(_0x70381c,_0x1e19f7);const _0x3fbe35=this['bindTemplate'];this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':['ck-dropdown-menu-list__nested-menu__button'],'aria-haspopup':!0x0,'aria-expanded':this['bindTemplate']['to']('isOn',_0x3d80f1=>String(_0x3d80f1)),'data-cke-tooltip-disabled':_0x3fbe35['to']('isOn')},'on':{'mouseenter':_0x3fbe35['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x37135d=new _0x3d6008();return _0x37135d['content']=_0x3ff01c,_0x37135d['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x37135d;}}class Gs extends _0x53ea61{['_allListItems'];['_allSearchableItems'];constructor(_0x3e5d76,_0x44b14b,_0x51ada2){super(_0x3e5d76),this['_allListItems']=_0x44b14b,this['_allSearchableItems']=_0x51ada2;}['filter'](_0x17c186){if(!_0x17c186)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0xd7ebbc=_0x17c186['source']['toLowerCase']()['trim'](),_0x475522=this['_allSearchableItems']['filter'](_0x4ba73f=>(_0x4ba73f['groupLabel']?_0x4ba73f['label']+'\x20('+_0x4ba73f['groupLabel']+')':_0x4ba73f['label'])['toLowerCase']()['includes'](_0xd7ebbc));return this['items']['clear'](),this['items']['addMany'](_0x475522['sort']((_0x40b4d0,_0x32d37)=>{const _0x36e0e4=_0x40b4d0['groupLabel'],_0x41bad1=_0x32d37['groupLabel'];return _0x36e0e4||_0x41bad1?_0x36e0e4?0x1:-0x1:0x0;})['map'](_0x28ba09=>_0x28ba09['item'])),this['_highlightQuery'](_0xd7ebbc,_0x475522),{'resultsCount':_0x475522['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x212078,_0x4a6117){if(!_0x212078)return;const _0x4ddc27=new RegExp(_0x18bda3(_0x212078),'gi');_0x4a6117['forEach'](_0xbd21d8=>{_0xbd21d8['highlightViews']&&_0xbd21d8['highlightViews']['forEach'](_0x3976ef=>{'function'==typeof _0x3976ef['highlightText']&&_0x3976ef['highlightText'](_0x4ddc27);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x54986c=>{_0x54986c['highlightViews']&&_0x54986c['highlightViews']['forEach'](_0x3aea42=>{'function'==typeof _0x3aea42['highlightText']&&_0x3aea42['highlightText'](null);});});}}const Ks='menu',Os='menuitem';class io extends _0x52fd2c{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x17e8f2,_0x366c32,_0x3c6d11,_0x465a7c,_0x4931f1=!0x1){const _0x29da60=_0x17e8f2['locale'];super(_0x29da60),this['_bodyCollection']=_0x465a7c,this['_hasSearch']=_0x4931f1;const _0x23531f=this['_createListItems'](_0x17e8f2,_0x366c32,_0x3c6d11);this['optionsListView']=new Gs(_0x29da60,_0x23531f,this['_allSearchableItems']),this['optionsListView']['role']=Ks,this['optionsListView']['items']['addMany'](_0x23531f),this['focusTracker']=new _0x264c5d(),this['keystrokes']=new _0x299178(),_0x4931f1&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x23531f,this['focusCycler']=new _0x471d76({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x4931f1&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x2ed414=_0x4931f1&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x45b6fa(_0x2ed414),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x29da60['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x15a37a(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x3ddedc=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x3ddedc);}['_createListItems'](_0x5c9bfb,_0x504242,_0x1cca72){const _0x4dad70=new _0x45b6fa();return _0x504242['forEach'](_0x5a8d63=>{if('actions'in _0x5a8d63){const {listItem:_0x410698}=this['_createActionGroupButton'](_0x5c9bfb,_0x5a8d63,_0x1cca72);_0x4dad70['add'](_0x410698),_0x5a8d63['actions']['forEach'](_0x538595=>{this['_createActionButton'](_0x5c9bfb,_0x538595,_0x5a8d63['label'],_0x5a8d63['icon']);const {listItem:_0x2fc322,highlightViews:_0x4e3069}=this['_createSearchResultActionButton'](_0x5c9bfb,_0x538595,_0x5a8d63['label'],_0x5a8d63['icon']);this['_allSearchableItems']['push']({'item':_0x2fc322,'label':_0x538595['displayedPrompt'],'groupLabel':_0x5a8d63['label'],'highlightViews':_0x4e3069});});}else{const {listItem:_0x3c18b8}=this['_createActionButton'](_0x5c9bfb,_0x5a8d63);_0x4dad70['add'](_0x3c18b8);const _0x4fc842=_0x3c18b8['children']['first'];if(_0x4fc842){const {listItem:_0x19977e,highlightViews:_0x4b03e4}=this['_createSearchResultActionButton'](_0x5c9bfb,_0x5a8d63);this['_allSearchableItems']['push']({'item':_0x19977e,'label':_0x4fc842['label']||'','highlightViews':_0x4b03e4});}}}),_0x4dad70;}['_createActionButton'](_0x268651,_0x3cd54b,_0x3b61ac,_0x133b6f){const _0x41acff=new _0x27d63c(this['locale']);if(_0x3b61ac&&_0x133b6f){const _0x1761b2=new _0x129639(this['locale']),_0x3aa65a=_0x1761b2['bindTemplate'],_0x72049c=new _0x3ec926();_0x72049c['text']=_0x3cd54b['displayedPrompt'];const _0x46984c=new _0x3ec926();_0x46984c['text']=_0x3b61ac;const _0x1422e8=new _0x3d6008();_0x1422e8['content']=_0x133b6f,_0x1422e8['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x288476=new _0x52fd2c(this['locale']);_0x288476['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x5c5d63=new _0x52fd2c(this['locale']);return _0x5c5d63['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x1761b2['set']({'label':_0x3cd54b['displayedPrompt']+'\x20('+_0x3b61ac+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x1761b2['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x72049c,_0x288476,_0x1422e8,_0x46984c,_0x5c5d63],'on':{'mouseenter':_0x3aa65a['to'](()=>{this['_isSearchFocused']()||_0x1761b2['focus']();}),'click':_0x3aa65a['to'](()=>{_0x1761b2['fire']('execute');})}}),_0x1761b2['on']('execute',()=>{_0x268651['editing']['view']['focus'](),_0x268651['commands']['execute']('aiQuickAction',_0x3cd54b);}),_0x41acff['children']['add'](_0x1761b2),{'listItem':_0x41acff,'highlightViews':[_0x72049c,_0x46984c]};}{const _0x25d7c4=new _0x5afd59(),_0x269699=new _0x129639(this['locale'],_0x25d7c4),_0x50f1bf=_0x269699['bindTemplate'],_0x54c493=_0x3cd54b['icon']??_0x3cd54b['parent']?.['icon'],_0x46fd0a=void 0x0!==_0x3cd54b['icon'];return _0x269699['set']({'label':_0x3cd54b['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x46fd0a?_0x54c493??yt:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x269699['extendTemplate']({'on':{'mouseenter':_0x50f1bf['to'](()=>{this['_isSearchFocused']()||_0x269699['focus']();})}}),_0x269699['on']('execute',()=>{_0x268651['editing']['view']['focus'](),_0x268651['commands']['execute']('aiQuickAction',_0x3cd54b);}),_0x41acff['children']['add'](_0x269699),{'listItem':_0x41acff,'highlightViews':[_0x25d7c4]};}}['_createSearchResultActionButton'](_0x2b6d6e,_0x5472c7,_0x4405f4,_0x35c38b){return _0x4405f4&&_0x35c38b?this['_createSearchResultGroupedActionButton'](_0x2b6d6e,_0x5472c7,_0x4405f4,_0x35c38b):this['_createSearchResultIndividualActionButton'](_0x2b6d6e,_0x5472c7);}['_createSearchResultGroupedActionButton'](_0x29f274,_0x2725e7,_0x5d4fc0,_0x24b797){const _0x4ae94d=new _0x27d63c(this['locale']),_0x51383b=new _0x129639(this['locale']),_0x31d1f3=_0x51383b['bindTemplate'],{view:_0x5eb98a,highlightView:_0x5f2d16}=this['_createSearchResultGroupRow'](_0x5d4fc0,_0x24b797),{view:_0x1e0192,highlightView:_0x41f0da}=this['_createSearchResultActionRow'](_0x2725e7['displayedPrompt']),_0x59cfd3=this['_createSearchResultContentView'](_0x5eb98a,_0x1e0192);return _0x51383b['set']({'label':_0x2725e7['displayedPrompt'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0x51383b['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x59cfd3],'on':{'mouseenter':_0x31d1f3['to'](()=>{this['_isSearchFocused']()||_0x51383b['focus']();}),'click':_0x31d1f3['to'](()=>{this['_handleSearchResultButtonClick'](_0x51383b);})}}),this['_setupActionButtonExecution'](_0x51383b,_0x29f274,_0x2725e7),_0x4ae94d['children']['add'](_0x51383b),{'listItem':_0x4ae94d,'highlightViews':[_0x5f2d16,_0x41f0da]};}['_createSearchResultIndividualActionButton'](_0x570f50,_0x1efacc){const _0x357c0a=new _0x27d63c(this['locale']),_0x36ff31=new _0x5afd59(),_0x41eaa7=new _0x129639(this['locale'],_0x36ff31),_0x229559=_0x41eaa7['bindTemplate'];return _0x41eaa7['set']({'label':_0x1efacc['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x41eaa7['extendTemplate']({'on':{'mouseenter':_0x229559['to'](()=>{this['_isSearchFocused']()||_0x41eaa7['focus']();})}}),this['_setupActionButtonExecution'](_0x41eaa7,_0x570f50,_0x1efacc),_0x357c0a['children']['add'](_0x41eaa7),{'listItem':_0x357c0a,'highlightViews':[_0x36ff31]};}['_createSearchResultGroupRow'](_0x5cd414,_0x4ac291){const _0x3e8f16=new _0x52fd2c(this['locale']),_0x125cb1=new _0x3d6008();_0x125cb1['content']=_0x4ac291,_0x125cb1['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x365d9f=new _0x3ec926();return _0x365d9f['text']=_0x5cd414,_0x3e8f16['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x125cb1,_0x365d9f]}),{'view':_0x3e8f16,'highlightView':_0x365d9f};}['_createSearchResultActionRow'](_0x473b9c){const _0x50c25f=new _0x52fd2c(this['locale']),_0x49b51e=new _0x3ec926();return _0x49b51e['text']=_0x473b9c,_0x50c25f['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x49b51e]}),{'view':_0x50c25f,'highlightView':_0x49b51e};}['_createSearchResultContentView'](_0xa62488,_0x3ae842){const _0x3942e0=new _0x52fd2c(this['locale']);return _0x3942e0['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0xa62488,_0x3ae842]}),_0x3942e0;}['_setupActionButtonExecution'](_0x2dbed8,_0x3e2620,_0x431225){_0x2dbed8['on']('execute',()=>{_0x3e2620['editing']['view']['focus'](),_0x3e2620['commands']['execute']('aiQuickAction',_0x431225);});}['_createActionGroupButton'](_0xd9a9e6,_0x1ce853,_0x4debc3){const _0xe8b3d5=new _0x27d63c(this['locale']),_0x150da5=new _0x5afd59(),_0x46a023=new Qs(this['locale'],_0x150da5),_0x216ee8=_0x46a023['bindTemplate'],_0x3ed323=this['_getPanelKeystroke'](_0x4debc3),_0x14fd08=this['_createGroupActionsList'](_0xd9a9e6,_0x1ce853['actions'],_0x4debc3);_0x46a023['set']({'label':_0x1ce853['label'],'withText':!0x0,'role':Os,'icon':_0x1ce853['icon']??yt,'isEnabled':_0x1ce853['actions']['some'](_0x1f3dcc=>_0x1f3dcc['isEnabled'])}),_0x46a023['extendTemplate']({'on':{'mouseenter':_0x216ee8['to'](()=>{this['_isSearchFocused']()||_0x46a023['focus']();})}});const _0x2a695a=new _0xc6701d(this['locale']);return _0x2a695a['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x216ee8['to'](_0x519745=>{this['_handlePanelKeydown'](_0x519745,_0x3ed323,_0x46a023,_0x2a695a);})}}),_0x46a023['bind']('isOn')['to'](_0x2a695a,'isVisible'),this['_bodyCollection']['add'](_0x2a695a),_0x2a695a['content']['add'](_0x14fd08),this['_setupGroupMenuBehavior'](_0x46a023,_0x2a695a),_0xe8b3d5['children']['add'](_0x46a023),{'listItem':_0xe8b3d5,'highlightView':_0x150da5};}['_createGroupActionsList'](_0xcb952a,_0x34f622,_0x46b582){const _0x388ea9=new _0x53ea61(this['locale']);return _0x388ea9['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x34f622['forEach'](_0x578f94=>{const _0x5a8d32=new _0x27d63c(this['locale']),_0x55afd2=Zt({'editor':_0xcb952a,'action':_0x578f94,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x5a8d32['children']['add'](_0x55afd2),_0x46b582['focusTracker']['add'](_0x55afd2),_0x388ea9['items']['add'](_0x5a8d32);}),_0x388ea9;}['_setupGroupMenuBehavior'](_0x295b03,_0x320e2f){const _0x16858c=_0x295b03['bindTemplate'],_0x770f41=this['_getButtonKeystroke'](_0x295b03);_0x295b03['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x16858c['to'](()=>{this['_showNestedPanel'](_0x320e2f,_0x295b03);}),'mouseleave':_0x16858c['to'](_0x544b8b=>{const _0x2f45de=_0x544b8b['relatedTarget'];this['_isMovingToNestedMenu'](_0x2f45de,_0x320e2f)||this['_hideNestedPanel'](_0x320e2f);}),'keydown':_0x16858c['to'](_0x8652cf=>{_0x8652cf['key']==_0x770f41&&(this['_showNestedPanel'](_0x320e2f,_0x295b03),_0x320e2f['content']['get'](0x0)['focus']());})}}),_0x320e2f['on']('render',()=>{_0x320e2f['element']?.['addEventListener']('mouseleave',_0x30c8bd=>{const _0x2c1ea3=_0x30c8bd['relatedTarget'];_0x295b03['element']?.['contains'](_0x2c1ea3)||this['_isMovingToNestedMenu'](_0x2c1ea3,_0x320e2f)||this['_hideNestedPanel'](_0x320e2f);});});}['_showNestedPanel'](_0x3a866d,_0x5c7b68){this['_openNestedPanels']['forEach'](_0x318d0a=>{_0x318d0a!==_0x3a866d&&_0x318d0a['isVisible']&&_0x318d0a['hide']();}),_0x3a866d['show'](),_0x3a866d['pin']({'positions':[_0x668f3b['eastSouth']],'target':_0x5c7b68['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x3a866d);}['_hideNestedPanel'](_0x2e3964){_0x2e3964['hide'](),this['_openNestedPanels']['delete'](_0x2e3964);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x3533d3=>_0x3533d3['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x3b387d,_0x1d4d21){if(!_0x3b387d)return!0x1;if(_0x1d4d21['element']?.['contains'](_0x3b387d))return!0x0;const _0x525646=_0x3b387d;return _0x525646['closest']&&(null!==_0x525646['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x525646['closest']('.ck-ai-quick-actions-group-list')||null!==_0x525646['closest']('.ck-ai-quick-actions-group-button'));}['resetSearch'](){this['_searchTextView']&&this['_searchTextView']['reset']();}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}['_getPanelKeystroke'](_0x417855){return'rtl'===_0x417855['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x31d79e){return'rtl'===_0x31d79e['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x4479d5,_0x512899,_0x547801,_0x15e913){_0x4479d5['key']==_0x512899&&(_0x547801['focus'](),this['_hideNestedPanel'](_0x15e913));}['_handleSearchResultButtonClick'](_0x54cf8c){_0x54cf8c['fire']('execute');}}function Xt(_0x580ef5){const {editor:_0x33e698,content:_0x402678,buttonDefinition:_0xefd500,bodyCollection:_0x1106e3,hasSearch:_0x33832d=!0x1}=_0x580ef5;return()=>{const _0x2e6117=_0x33e698['locale'],_0x2f243e=_0x3837b3(_0x2e6117);_0x2f243e['buttonView']['set']({'icon':_0xefd500['icon']??yt,'label':_0xefd500['label'],'tooltip':!0x0}),_0x2f243e['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x323ce8=new io(_0x33e698,_0x402678,_0x2f243e,_0x1106e3,_0x33832d);if(_0x2f243e['panelView']['children']['add'](_0x323ce8),_0x33832d){const _0x3f7ffe='ai-quick-actions-dropdown-selection';_0x2f243e['on']('change:isOpen',(_0x1537d9,_0xd5ae1b,_0x4a90c4)=>{if(_0x4a90c4){if(_0x33e698['plugins']['has']('AIEditing')){const _0x36ddae=_0x33e698['plugins']['get'](D),_0x1a14bd=_0x33e698['model']['document']['selection'],_0x26d96a=Array['from'](_0x1a14bd['getRanges']());_0x26d96a['length']>0x0&&_0x36ddae['showFakeVisualSelection'](_0x26d96a,_0x3f7ffe,!0x1,!0x0);}}else _0x33e698['plugins']['has']('AIEditing')&&_0x33e698['plugins']['get'](D)['hideFakeVisualSelection'](_0x3f7ffe),_0x323ce8['resetSearch']();});}return _0x2f243e;};}const ee='<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>',ie='<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>',ne='<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 Qt=function(_0x36aa7e){return _0x36aa7e['CHAT']='CHAT',_0x36aa7e['ACTION']='ACTION',_0x36aa7e['REVIEW']='REVIEW',_0x36aa7e;}({}),Ka=function(_0x3cc85f){return _0x3cc85f['CHAT']='AIChat',_0x3cc85f['ACTION']='AIActions',_0x3cc85f['REVIEW']='AIReviewMode',_0x3cc85f;}({});class ii extends _0x421ea3{static get['requires'](){return[te,tt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x1218cf=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x1218cf),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x488e04){return function(_0x379fcc){const _0x5319bc=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x379fcc['uiLanguage']),_0x4e605e=_0x5319bc||'English',_0x3bfdf7=[{'id':'ask-ai','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Gt},{'id':'chat-commands','label':i(_0x379fcc,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Gt,'actions':[{'id':'explain','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x4e605e),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x4e605e),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x4e605e),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Bt},{'id':'continue','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Ft},{'id':'fix-grammar','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Wt},{'id':'adjust-length','label':i(_0x379fcc,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x379fcc,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Yt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x379fcc,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x379fcc,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x379fcc,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x3bfdf7;}(_0x488e04);}async['_getDefaultAndCustomActions'](){const _0x1928a5=ii['getDefaultQuickActions'](this['editor']['locale']),_0x33c029=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x36eb60=[];try{_0x36eb60=await new et({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x2fc8f3){const _0x2cebb0=new _0xec7a4c('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x2fc8f3});_0x4f2fe2(_0x2cebb0['message']);}finally{const _0x1a5199=_0x33c029['map'](_0x32d873=>({..._0x32d873,'icon':void 0x0}));_0x1928a5['find'](_0x139b2e=>'other'===_0x139b2e['id'])['actions']['push'](..._0x1a5199),_0x1928a5['forEach'](_0x2445a8=>{if('actions'in _0x2445a8)_0x2445a8['actions']['forEach'](_0x1446b0=>{if(_0x1446b0['isEnabled']=!!_0x36eb60['find'](_0x1fafe7=>_0x1fafe7['id']===_0x1446b0['model'])||void 0x0===_0x1446b0['model'],!_0x1446b0['isEnabled']){const _0x318ae4=new _0xec7a4c('ai-quick-actions-unavailable-model',this,{'actionId':_0x1446b0['id'],'modelId':_0x1446b0['model']});_0x4f2fe2(_0x318ae4['message']);}});else{if(_0x2445a8['isEnabled']=!!_0x36eb60['find'](_0x13232e=>_0x13232e['id']===_0x2445a8['model'])||void 0x0===_0x2445a8['model'],!_0x2445a8['isEnabled']){const _0x1ec8ca=new _0xec7a4c('ai-quick-actions-unavailable-model',this,{'actionId':_0x2445a8['id'],'modelId':_0x2445a8['model']});_0x4f2fe2(_0x1ec8ca['message']);}}});}return _0x1928a5;}['_initializeQuickActionsComponentsAndCommands'](){const _0x4d8b7f=new _0x26c387(this['editor']['locale']);_0x4d8b7f['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x4d8b7f),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x4d8b7f);}['_initializeQuickActionsDropdown'](_0x4691b9){const _0x5b05d8=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':yt,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x4691b9,'hasSearch':_0x5b05d8}));}['_prepareQuickActionsDefinition'](_0x3abfc0){this['_quickActionsDefinition']=_0x3abfc0['map'](_0x1fe747=>{if('actions'in _0x1fe747){const _0x15dbde=_0x1fe747;return{..._0x15dbde,'actions':_0x15dbde['actions']['map'](_0x548e4d=>{const {actions:_0x30afa0,..._0x285c0a}=_0x15dbde;return{..._0x548e4d,'parent':_0x285c0a};})['filter'](_0x53e4c2=>this['_shouldIncludeAction'](_0x53e4c2))};}return _0x1fe747;})['filter'](_0xb0aa2b=>'actions'in _0xb0aa2b?_0xb0aa2b['actions']['length']>0x0:this['_shouldIncludeAction'](_0xb0aa2b));}['_shouldIncludeAction'](_0x11e406){const _0x671945=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ka[_0x11e406['type']])&&!_0x671945['includes'](_0x11e406['id'])&&!('CHAT'===_0x11e406['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x50b1bc){this['_quickActionsDefinition']['forEach'](_0x8b06d9=>{if('actions'in _0x8b06d9){const _0x341fe0=Xt({'editor':this['editor'],'content':_0x8b06d9['actions'],'buttonDefinition':_0x8b06d9,'bodyCollection':_0x50b1bc});this['editor']['ui']['componentFactory']['add'](_0x8b06d9['id'],_0x341fe0),_0x8b06d9['actions']['forEach'](_0x32a6f6=>{const _0x170bf2=Zt({'editor':this['editor'],'action':_0x32a6f6});this['editor']['ui']['componentFactory']['add'](_0x32a6f6['id'],_0x170bf2);});}else{const _0x5a1f06=Zt({'editor':this['editor'],'action':_0x8b06d9,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x8b06d9['id'],_0x5a1f06);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x205a37=>{const _0x120009=new _0x2e0497(_0x205a37),_0x197d19=i(_0x205a37,'AI_QUICK_ACTIONS_HEADING');_0x120009['buttonView']['set']({'label':_0x197d19,'icon':yt});const _0x1d0374=new _0x47f1f1(_0x205a37);_0x1d0374['set']({'ariaLabel':_0x197d19,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x211ee2=>{if('actions'in _0x211ee2){const _0x329d8e=_0x211ee2,_0x179834=new _0x311641(_0x205a37,_0x120009),_0x51a288=new _0x2e0497(_0x205a37),_0x5d3186=new _0x47f1f1(_0x205a37);_0x51a288['buttonView']['set']({'label':_0x329d8e['label'],'icon':_0x329d8e['icon']}),_0x329d8e['actions']['forEach'](_0x5b1932=>{const _0x8e7b17=new _0x311641(_0x205a37,_0x51a288),_0x19e62b=new _0xa33d94(_0x205a37);_0x19e62b['set']({'label':_0x5b1932['displayedPrompt'],'icon':_0x5b1932['icon'],'role':'menuitem','isEnabled':_0x5b1932['isEnabled']}),_0x19e62b['on']('execute',()=>{this['_executeQuickAction'](_0x5b1932);}),_0x19e62b['delegate']('execute')['to'](_0x51a288),_0x8e7b17['children']['add'](_0x19e62b),_0x5d3186['items']['add'](_0x8e7b17);}),_0x51a288['panelView']['children']['add'](_0x5d3186),_0x179834['children']['add'](_0x51a288),_0x1d0374['items']['add'](_0x179834);}else{const _0x4f79e1=_0x211ee2,_0x294b29=new _0x311641(_0x205a37,_0x120009),_0x25ddc5=new _0xa33d94(_0x205a37);_0x25ddc5['set']({'label':_0x4f79e1['displayedPrompt'],'icon':_0x4f79e1['icon'],'role':'menuitem','isEnabled':_0x4f79e1['isEnabled']}),_0x25ddc5['on']('execute',()=>{this['_executeQuickAction'](_0x4f79e1);}),_0x25ddc5['delegate']('execute')['to'](_0x120009),_0x294b29['children']['add'](_0x25ddc5),_0x1d0374['items']['add'](_0x294b29);}});const _0x3c5e78=Object['values'](Ka)['some'](_0x46ca4b=>this['editor']['plugins']['has'](_0x46ca4b));return _0x120009['set']({'isEnabled':_0x3c5e78}),_0x120009['panelView']['children']['add'](_0x1d0374),_0x120009;});}['_executeQuickAction'](_0xc4262){const _0x2a17f0=this['editor'];_0x2a17f0['editing']['view']['focus'](),_0x2a17f0['commands']['execute']('aiQuickAction',_0xc4262);const _0x2767a7=_0x2a17f0['ui']['view']['menuBarView'];_0x2767a7&&_0x2767a7['close']&&_0x2767a7['close']();}}class ci extends Lt{['execute'](_0x1f6d72){switch(this['_expandSelectionIfCollapsed'](),_0x1f6d72['type']){case Qt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5ed5b0=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0xec7a4c('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5ed5b0});}this['_handleAIChatAction'](_0x1f6d72);break;case Qt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x171f6b=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0xec7a4c('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x171f6b});}this['_handleAIActionsAction'](_0x1f6d72);break;case Qt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x23a26a=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0xec7a4c('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x23a26a});}this['_handleAIReviewAction'](_0x1f6d72);}}async['_handleAIChatAction'](_0x172d78){const _0x2b6ad6=this['editor']['plugins']['get']('AIChat'),_0x36d20f=this['editor']['plugins']['get']('AIChatController'),_0x197f8b=this['editor']['plugins']['get']('AITabs')['view'];if(_0x197f8b['isVisible']||(_0x197f8b['isVisible']=!0x0),'chat'!==_0x197f8b['activeTab']&&_0x197f8b['activateTab']('chat'),'ask-ai'===_0x172d78['id'])_0x36d20f['removeSelectionFromChatContext'](),await _0x2b6ad6['addSelectionToChatContext'](),_0x2b6ad6['focusPromptInput']();else await _0x2b6ad6['startConversation'](),_0x36d20f['removeSelectionFromChatContext'](),await _0x2b6ad6['addSelectionToChatContext'](),_0x2b6ad6['focusPromptInput'](),await _0x2b6ad6['sendMessage']({'message':_0x172d78['prompt']||_0x172d78['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x172d78['id']},'displayedPrompt':_0x172d78['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x5f35e7=this['editor'],_0x231d4b=_0x5f35e7['model']['document']['selection'];if(!_0x231d4b['isCollapsed'])return;const _0x268c6d=_0x314279(_0x231d4b['getSelectedBlocks']())||_0x5f35e7['model']['schema']['getLimitElement'](_0x231d4b);_0x5f35e7['model']['change'](_0x1f29e0=>{_0x1f29e0['setSelection'](_0x268c6d,'in');});}['_handleAIActionsActionLabel'](_0x29e533){return _0x29e533['parent']?.['label']&&'other'!==_0x29e533['parent']?.['id']?_0x29e533['parent']['label']+':\x20'+_0x29e533['displayedPrompt']:_0x29e533['displayedPrompt'];}async['_handleAIActionsAction'](_0x4d43c0){const _0x19bb7c=this['editor']['plugins']['get']('AIActions'),_0x3fc8f4=_0x4d43c0['prompt']?{'userMessage':_0x4d43c0['prompt'],'model':_0x4d43c0['model']}:{'actionName':_0x4d43c0['actionName']||_0x4d43c0['id'],'args':_0x4d43c0['args']},_0xb67286=this['_handleAIActionsActionLabel'](_0x4d43c0);await _0x19bb7c['executeAction'](_0x3fc8f4,_0xb67286,_0x4d43c0['icon']);}async['_handleAIReviewAction'](_0x255a67){console['log']('handleAIReviewAction',_0x255a67);}}class ti extends _0x421ea3{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x550f13=this['editor'],_0x58185e=new ci(this['editor']);if(_0x550f13['commands']['add']('aiQuickAction',_0x58185e),_0x550f13['plugins']['has']('AIChat')){const _0x41e085=this['editor']['plugins']['get']('AIChat');_0x550f13['model']['document']['selection']['on']('change:range',(_0x293673,_0x103a57)=>{_0x103a57['directChange']&&_0x41e085['removeSelectionFromChatContext']();});}}}class ys extends di{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x3f47ea=this['documentContextContent']['children']['map'](_0x44b410=>({'node':_0x44b410,'id':ut(_0x44b410,'data-id')})),_0x386dab=this['parsedMergedContent']['children']['map'](_0xf3fc92=>({'node':_0xf3fc92,'id':ut(_0xf3fc92,'data-id')||_0x2ced3c()})),_0x36d8bc=_0x5dbbe5(_0x3f47ea,_0x386dab,{'comparator':(_0x967599,_0x288845)=>_0x967599['id']==_0x288845['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x36d8bc['length']&&_0x36d8bc[_0x36d8bc['length']-0x1]['removed'];)_0x36d8bc['pop']();}const _0x4ab8a2=_0x36d8bc['map'](_0x2a8833=>{const _0x9f2687=_0x2a8833['added']?'new':_0x2a8833['removed']?'removed':'modified';return{'node':_0x2a8833['value'][0x0]['node'],'type':_0x9f2687,'id':_0x2a8833['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x4ab8a2,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x216f1d,_0x1ea198){return _0x1ea198;}}class ft extends os{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x266555){super(_0x266555),this['content']=_0x266555['content'],this['version']=_0x266555['version'],this['actionName']=_0x266555['actionName'],this['args']=_0x266555['args'],this['userMessage']=_0x266555['userMessage'],this['model']=_0x266555['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':Fe['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x1846b5){const _0x14e052=new ys({'editor':this['editor'],'documentContextContent':this['content'],..._0x1846b5});return this['replies']['push'](_0x14e052),_0x14e052['delegate'](...We)['to'](this),this['fire']('replyCreated',_0x14e052),_0x14e052;}}class Bn extends _0xcb5503{constructor(_0x55e64e,_0x55b41a=!0x0,_0x519e68=!0x0){super(_0x55e64e),this['set']('isEnabled',!0x1),_0x55b41a&&(this['applyButton']=this['_createButton'](i(_0x55e64e,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x519e68&&(this['suggestButton']=this['_createButton'](i(_0x55e64e,'AI_BALLOON_SUGGEST_BUTTON'),_0x55b41a?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x55b41a,'showSuggestButton':_0x519e68}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x1418fa,showSuggestButton:_0x123038}){this['applyButton']&&(this['applyButton']['isVisible']=_0x1418fa),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x123038);}['_createButton'](_0x3f3278,_0xa9582c){const _0x5945b0=new _0x129639(this['locale']);return _0x5945b0['set']({'label':_0x3f3278,'class':_0xa9582c,'isVisible':!0x0,'withText':!0x0}),_0x5945b0;}}class yn extends _0x52fd2c{constructor(_0x4a316f){super(_0x4a316f),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(_0x4a316f,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0x52fd2c{constructor(_0x5710b8){super(_0x5710b8),this['set']('isVisible',!0x0);const _0x38fc6e=new Ze('small');_0x38fc6e['isVisible']=!0x0;const _0x1e7194=new _0x52fd2c(this['locale']);_0x1e7194['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x56318c=>!_0x56318c)]},'children':[_0x38fc6e,_0x1e7194]});}}class Tt extends gs{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x3e88b6,_0x10c375){super(_0x3e88b6),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x10c375,this['_focusTracker']=new _0x264c5d(),this['_keystrokes']=new _0x299178(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x471d76({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x45b6fa(),this['_addContentWrapper'](_0x10c375),this['_addDisclaimerView'](),this['_addToolbar'](_0x10c375),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x10c375);});}['render'](){super['render']();for(const _0x57bd17 of this['_focusables'])this['_focusTracker']['add'](_0x57bd17['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x29f565){-0x1===_0x29f565?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x5cf95d){this['_isLoading']=_0x5cf95d;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x26a1db){super['showError'](_0x26a1db),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x344826){super['showBlockingError'](_0x344826),this['setErrorState']();}['addMiniToolbarItem'](_0x53010f){this['_miniToolbarView']['items']['has'](_0x53010f)||this['_miniToolbarView']['items']['add'](_0x53010f);}['removeMiniToolbarItem'](_0x193690){this['_miniToolbarView']['items']['has'](_0x193690)&&this['_miniToolbarView']['items']['remove'](_0x193690);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x407696,showSuggestButton:_0x204f92}){_0x407696=_0x407696&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x204f92=_0x204f92&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x407696,'showSuggestButton':_0x204f92});}async['updateContent'](_0x34aae4){await this['_streamableContentView']['update'](_0x34aae4);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x2bbb98){this['_contentWrapper']=new _0x52fd2c(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x2bbb98['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x17e0c2,showSuggestButton:_0x18e245}){this['_toolbarView']=new Bn(this['locale'],_0x17e0c2,_0x18e245),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x30fa02,_0x5de96e,_0x184bb6)=>!(_0x30fa02||_0x5de96e||_0x184bb6)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x17e0c2,'showSuggestButton':_0x18e245}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x3b4182){return this['_miniToolbarView']=new ls(this['locale'],_0x3b4182),this['_miniToolbarView']['delegate'](...W)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x328676,_0x2eaef9)=>!(_0x328676||_0x2eaef9)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Nn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new cs(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x5dbd5a=new _0x129639(this['locale']),_0x2529d8=new _0x129639(this['locale']),_0xc00f3d=new Ln(this['locale']),_0x2ab88d=new _0x129639(this['locale']);_0x5dbd5a['set']({'icon':_0x2ddaff,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x2529d8['set']({'icon':_0x6e207c,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x2ab88d['set']({'icon':_0x1be2df,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x5dbd5a['bind']('isEnabled')['to'](this,'isBusy',_0x373e12=>!_0x373e12),_0x5dbd5a['on']('execute',()=>{this['fire']('tryAgain');}),_0x2529d8['bind']('isEnabled')['to'](this,'isBusy',_0x1cd854=>!_0x1cd854),_0x2529d8['on']('execute',()=>{this['fire']('showPrevious');}),_0x2ab88d['bind']('isEnabled')['to'](this,'isBusy',_0x349f52=>!_0x349f52),_0x2ab88d['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x2529d8,this['_navigationCounter']=_0xc00f3d,this['_navigationNextButton']=_0x2ab88d,this['_navigationTryAgainButton']=_0x5dbd5a;}['updateMiniToolbarButtons'](_0x27a3e2,_0xc61344){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x57d6e4=_0x27a3e2>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x57d6e4){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x3e4550=_0x27a3e2-_0xc61344;this['_navigationCounter']['setInteractionCount'](_0x3e4550+'/'+_0x27a3e2),this['_navigationPreviousButton']['isEnabled']=_0xc61344<_0x27a3e2-0x1,this['_navigationNextButton']['isEnabled']=_0xc61344>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0x2d426){this['_isLoading']=_0x2d426;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x15a549=this['_getScrollableElement']();_0x15a549&&!this['_scrollManager']&&(this['_scrollManager']=new Qe(_0x15a549));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Ln extends _0x52fd2c{constructor(_0x532fad){super(_0x532fad);const _0x4a00d2=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x4a00d2['to']('interactionCount')}]});}['setInteractionCount'](_0x30c3ef){this['set']('interactionCount',_0x30c3ef);}}class ri extends _0x421ea3{static get['requires'](){return[tt,_0x52f20e,D,H,ot];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x1e9d01){super(_0x1e9d01),this['_bodyCollection']=new _0x26c387(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new St();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x454be4,_0x1b7014,_0xebabfe){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x38ec35,anchorData:_0x1d04a6}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x454be4,_0x38ec35,_0x1d04a6,_0x1b7014,_0xebabfe);}}const {modelFragment:_0x133e02,anchorData:_0x42687c}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x454be4,_0x133e02,_0x42687c,_0x1b7014,_0xebabfe);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x4a5979=this['editor']['plugins']['has']('TrackChanges');let _0x32c76c=this['editor']['config']['get']('ai.availableReplyActions')||[...J];_0x4a5979||(_0x32c76c=_0x32c76c['filter'](_0x40fe0b=>'insertSuggestion'!=_0x40fe0b));const _0x23bc47=this['editor']['commands']['get']('trackChanges'),_0x114f52=new Tt(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x4a5979,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x32c76c});return _0x114f52['bind']('isBusy')['to'](this),_0x23bc47&&_0x114f52['bind']('isTrackChangesOn')['to'](_0x23bc47,'value'),_0x114f52['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x114f52['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x114f52['on']('showNext',()=>{this['_navigateToNext']();}),_0x114f52;}['_getExecuteDataRegular'](){const _0x44e9f9=this['editor']['model']['document']['selection'];if(_0x44e9f9['isCollapsed']){const _0x18bb0c=_0x314279(_0x44e9f9['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x44e9f9);this['editor']['model']['change'](_0x3a32b5=>{_0x3a32b5['setSelection'](_0x18bb0c,'in');});}const _0x37a677=_0x44e9f9['getFirstRange'](),_0x566d11=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x44e9f9),_0x37a677['start'],_0x37a677['end']);this['_copyMarkersToFragment'](_0x566d11,_0x44e9f9,{'isTableSelection':!0x1});const _0x4040fc=_0x44e9f9['getFirstRange']()['start'],_0x4e7087=new Map();let _0x2363d3=_0x566d11;for(let _0x51d260=0x0;_0x51d260<_0x4040fc['path']['length'];_0x51d260++)_0x4e7087['set'](_0x2363d3,_0x4040fc['path'][_0x51d260]),_0x2363d3=_0x2363d3['getChild'](0x0);return{'modelFragment':_0x566d11,'anchorData':_0x4e7087};}['_getExecuteDataInTable'](){const _0x4d9878=this['editor']['model']['document']['selection'],_0x3e0f71=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x493102=_0x4d9878['getFirstRange']()['start']['parent']['parent'],_0x5dff5b=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x493102),this['editor']['model']['createPositionAfter'](_0x493102)),_0x5b20bc=this['_wrapWithCommonAncestors'](_0x3e0f71,_0x5dff5b['start'],_0x5dff5b['end']);this['_copyMarkersToFragment'](_0x5b20bc,_0x4d9878,{'isTableSelection':!0x0});const _0x5d3d17=_0x4d9878['getFirstRange']()['start'],_0x3791d8=new Map();let _0x14558e=_0x5b20bc;for(let _0x14e5a2=0x0;_0x14e5a2<_0x5d3d17['path']['length'];_0x14e5a2++)if(_0x3791d8['set'](_0x14558e,_0x5d3d17['path'][_0x14e5a2]),_0x14e5a2<_0x5d3d17['path']['length']-0x1)_0x14558e=_0x14558e['getChild'](0x0);else{let _0x30abb4=_0x14558e['nextSibling'];for(;_0x30abb4;)_0x3791d8['set'](_0x30abb4,_0x5d3d17['path'][_0x14e5a2]),_0x30abb4=_0x30abb4['nextSibling'];}return{'modelFragment':_0x5b20bc,'anchorData':_0x3791d8};}async['_executeAction'](_0x4800a2,_0x1ec87f,_0x549aa1,_0xb37df4,_0x41b7b6){const _0x530506=this['editor']['plugins']['get'](D),_0x326ffb=this['editor']['plugins']['get'](H),_0x2f0f0b=this['editor']['model']['document']['selection'],_0x57a480=await _0x530506['modelToDataWithIds'](_0x1ec87f),_0x40db8b=this['editor']['model']['document']['version'],_0x4964af=[..._0x2f0f0b['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x326ffb['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0xb37df4,'icon':_0x41b7b6||yt,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x4964af,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x326ffb),this['_interactionParams']={'action':_0x4800a2,'content':_0x57a480,'version':_0x40db8b,'aiBalloon':_0x326ffb,'modelFragment':_0x1ec87f,'anchorData':_0x549aa1},this['_setupApplyListeners'](),this['listenTo'](_0x326ffb,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x326ffb,'dialogClosed',(_0x88878d,{id:_0x467907})=>{if('aiActionsBalloon'===_0x467907){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x3575cd=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x14037f=_0x3575cd['changeGroups'][0x0];_0x14037f&&'pending'===_0x14037f['state']&&_0x3575cd['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x326ffb);}}),this['_createInteraction'](_0x57a480,_0x40db8b,_0x326ffb,_0x4800a2);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x48fb2e,anchorData:_0x55d58a}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x48fb2e,_0x55d58a,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x48fb2e,_0x55d58a,!0x0);});}['_wrapWithCommonAncestors'](_0x288031,_0x38c907,_0x6d621a){const _0x1f7d98=this['editor']['model']['createRange'](_0x38c907,_0x6d621a)['getCommonAncestor'](),_0x36d2f1=_0x1f7d98['is']('documentFragment')?[]:_0x1f7d98['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x36d2f1['length']){const _0x207152=_0x36d2f1['map'](_0x209963=>_0x209963['_clone'](!0x1));for(let _0x53fc5e=0x1;_0x53fc5e<_0x207152['length'];_0x53fc5e++)_0x207152[_0x53fc5e-0x1]['_appendChild'](_0x207152[_0x53fc5e]);return _0x207152[_0x207152['length']-0x1]['_appendChild'](_0x288031),new bt(_0x207152[0x0]);}return _0x288031;}['_copyMarkersToFragment'](_0x19bde8,_0x1a1399,_0x2006dd={'isTableSelection':!0x1}){const _0x3d527e=this['editor']['model'],_0x81d5b2=Array['from'](_0x1a1399['getRanges']()),_0x37be07=_0x1a1399['getFirstRange']()['start'];for(const _0x171f79 of _0x3d527e['markers']){if(_0x171f79['name']['startsWith'](R)||!_0x171f79['affectsData'])continue;const _0x1eb6f2=_0x171f79['getRange']();if(!_0x81d5b2['some'](_0x5c464a=>_0x5c464a['containsRange'](_0x1eb6f2,!0x0)))continue;const _0x1daf0b=this['_regularCalculateMarkerPath'](_0x1eb6f2['start'],_0x37be07,_0x2006dd['isTableSelection']),_0x278804=this['_regularCalculateMarkerPath'](_0x1eb6f2['end'],_0x37be07,_0x2006dd['isTableSelection']),_0x53cba9=_0x3d527e['createPositionFromPath'](_0x19bde8,_0x1daf0b),_0x26df20=_0x3d527e['createPositionFromPath'](_0x19bde8,_0x278804);if(!_0x53cba9['isEqual'](_0x26df20)){const _0x3757ea=_0x3d527e['createRange'](_0x53cba9,_0x26df20);_0x19bde8['markers']['set'](_0x171f79['name'],_0x3757ea);}}}['_regularCalculateMarkerPath'](_0x477d85,_0x568f94,_0x978844=!0x1){const _0x8869de=[..._0x477d85['path']['slice']()];for(let _0x1eec33=0x0;_0x1eec33<Math['max'](_0x568f94['path']['length'],_0x477d85['path']['length']);_0x1eec33++){const _0x7049e5=_0x568f94['path'][_0x1eec33]||0x0,_0x37b61c=(_0x477d85['path'][_0x1eec33]||0x0)-_0x7049e5;if(_0x8869de[_0x1eec33]=_0x37b61c,0x0!==_0x37b61c&&!_0x978844)break;}return _0x8869de;}async['_createInteraction'](_0x35f0fa,_0x19116b,_0x4d6338,_0x197043){const _0x511476=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x197043,'content':_0x35f0fa,'version':_0x19116b,'aiBalloon':_0x4d6338,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x32eab0=new ft({'connector':this['_aiConnector'],'editor':_0x511476,'content':_0x35f0fa,'version':_0x19116b,..._0x197043});this['_interactions']['push'](_0x32eab0);const _0x51f25e=(_0x37eb8c,_0x4f27b0=!0x1,_0x313d5c='streaming')=>this['_promiseQueue']['enqueue'](async _0x246a72=>{try{const _0x103bea=wt({'editor':_0x511476,'changeGroups':_0x37eb8c['changeGroups'],'documentContextContent':_0x37eb8c['documentContextContent'],'showDiff':_0x4f27b0,'trimUnchanged':!0x1});_0x103bea['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x103bea[0x0],'renderingStrategy':_0x313d5c,'abortSignal':_0x246a72});}catch(_0x4d8cd8){if(this['_isAbortError'](_0x4d8cd8))return;throw _0x4d8cd8;}});this['_interaction']['on']('replyCreated',(_0x4a7a56,_0x4a93d1)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x51f25e(_0x4a93d1)['catch'](_0x5a241b=>{this['_isAbortError'](_0x5a241b)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x5a241b),this['_setErrorState'](_0x32eab0));});}),this['_interaction']['on']('replyContentUpdated',(_0x4cba32,_0x18f9ba)=>{_0x51f25e(_0x18f9ba)['catch'](_0x2c4677=>{this['_isAbortError'](_0x2c4677)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x2c4677),this['_setErrorState'](_0x32eab0));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x434b82){this['_isAbortError'](_0x434b82)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x434b82),this['_setErrorState'](_0x32eab0));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x207479,{showDiff:_0x190cc5})=>{try{this['_balloonShowDiff']=_0x190cc5;const _0x2a5c13=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x2a5c13&&await _0x51f25e(_0x2a5c13,_0x190cc5,'static');}catch(_0x41e670){this['_isAbortError'](_0x41e670)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x41e670),this['_setErrorState'](_0x32eab0));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x5d4720,{reply:_0x4d1dbb})=>{const _0x34e9f6={'positiveCount':_0x4d1dbb['changeGroups']['filter'](_0x4d6f48=>'accepted'===_0x4d6f48['state'])['length'],'totalCount':_0x4d1dbb['changeGroups']['length']},_0x3f7100=this['_interaction']['actionCallId'],_0x572d25=this['_interaction']['actionName'];_0x572d25?this['_aiConnector']['upsertAIActionRating'](_0x572d25,_0x3f7100,_0x34e9f6):this['_aiConnector']['upsertCustomAIActionRating'](_0x3f7100,_0x34e9f6);}),this['_setLoadingState']();try{const _0x2e0e37=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x2e0e37;}catch(_0x2706ca){if(this['_isAbortError'](_0x2706ca))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x32eab0);}}['_applyChanges'](_0x3a4f41,_0x4d6e8d,_0x53167c){const _0x2b5f4f=this['editor'];if(_0x53167c&&!_0x2b5f4f['plugins']['has']('TrackChanges'))throw new _0xec7a4c('ai-no-track-changes',null);const _0x34d402=this['editor']['plugins']['get'](ot),_0x4338cc=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x4338cc||!_0x4338cc['replies']['length'])return;const _0x32c81a=_0x4338cc['replies'][_0x4338cc['replies']['length']-0x1],_0x2f2fdb=_0x32c81a['changeGroups'];_0x32c81a['setChangeGroupState'](0x0,'accepted');let _0xd5d2ae=at({'editor':_0x2b5f4f,'reply':_0x32c81a,'interaction':_0x4338cc,'groups':_0x2f2fdb,'transform':!0x1,'documentCompare':_0x34d402,'documentCompareOptions':{'anchor':_0x2b5f4f['model']['createPositionAt'](_0x3a4f41,0x0),'markDeletions':_0x53167c}});_0xd5d2ae=this['_filterOperationsOutsideRange'](_0xd5d2ae,_0x4d6e8d);for(const _0x8e7ec of _0xd5d2ae)this['_anchorOperation'](_0x4d6e8d,_0x8e7ec,_0x2b5f4f['model']['document']['getRoot']());const _0x19c77c=_0x4338cc['getDocumentContext']()['version'],_0x1aebf9=_0x2b5f4f['model']['document']['history']['getOperations'](_0x19c77c),_0x205eab={'document':_0x2b5f4f['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x5d0e19=kt(_0xd5d2ae,_0x1aebf9,_0x205eab)['operationsA'];_0x2b5f4f['model']['change'](_0x63afb2=>{if(_0x63afb2['setSelection'](_0x2b5f4f['model']['document']['selection']['focus']),_0x53167c)_0x2b5f4f['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x5d0e19);else{for(const _0x1e6450 of _0x5d0e19)_0x1e6450['baseVersion']=_0x2b5f4f['model']['document']['version'],rt(_0x2b5f4f,_0x1e6450),_0x63afb2['batch']['addOperation'](_0x1e6450),_0x2b5f4f['model']['applyOperation'](_0x1e6450);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x48b057,_0x264589){return _0x48b057['filter'](_0x1fd04c=>{if('rename'==_0x1fd04c['type']){const _0x5a08cb=_0x1fd04c['position']['nodeAfter'];return!_0x264589['has'](_0x5a08cb);}if(_0x1fd04c['type']['indexOf']('Attribute')>-0x1){const _0x14b1a5=_0x1fd04c['range']['start']['nodeAfter'];return!_0x264589['has'](_0x14b1a5);}return!0x0;});}['_anchorOperation'](_0x447d69,_0x243530,_0x19dabf){const _0x3bc8e7=_0x243530['clone']();for(const _0x186ba3 in _0x243530){const _0x457663=_0x243530[_0x186ba3];_0x457663 instanceof dt?_0x243530[_0x186ba3]=new dt(_0x8c0006(_0x457663['start']),_0x8c0006(_0x457663['end'])):_0x457663 instanceof vt&&(_0x243530[_0x186ba3]=_0x8c0006(_0x457663));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x3bc8e7['type'])){if(_0x3bc8e7['isDocumentOperation']=!0x1,_0x3bc8e7['baseVersion']=null,'remove'==_0x3bc8e7['type']){const _0x25f00b=_0x3bc8e7['sourcePosition'],_0x5002f7=_0x3bc8e7['howMany'];new lt(_0x25f00b,_0x5002f7)['_execute']();}else _0x3bc8e7['_execute']();}function _0x8c0006(_0x4c8d1b){if('$graveyard'==_0x4c8d1b['root']['rootName'])return _0x4c8d1b;const _0x37bb02=[];let _0x57cef7=_0x4c8d1b['root'];for(let _0xfd4bb6=0x0;_0xfd4bb6<_0x4c8d1b['path']['length'];_0xfd4bb6++){const _0x9b0124=_0x447d69['get'](_0x57cef7)||0x0;_0x37bb02[_0xfd4bb6]=_0x4c8d1b['path'][_0xfd4bb6]+_0x9b0124,_0x57cef7=_0x57cef7['getChildAtOffset'](_0x4c8d1b['path'][_0xfd4bb6]);}return new vt(_0x19dabf,_0x37bb02,_0x4c8d1b['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x46e179,content:_0x14493f,version:_0x6dc701,aiBalloon:_0x103278}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x14493f,_0x6dc701,_0x103278,_0x46e179)['catch'](_0x43c94a=>{this['_isAbortError'](_0x43c94a)||console['error']('Error\x20refreshing\x20interaction:',_0x43c94a);});}['_isAbortError'](_0x35a534){return!!_0x35a534['message']&&_0x35a534['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x2823c4=this['_interactions']['length'];this['_currentInteractionIndex']<_0x2823c4-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x5adf9a){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x5adf9a;const _0x340517=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x340517)return;if(_0x340517['hasError'])return this['_setErrorState'](_0x340517),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x340517['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0xda54d4=_0x340517['replies'][_0x340517['replies']['length']-0x1];if(_0xda54d4){const _0x28d01e=this['editor'];try{const _0x16939f=wt({'editor':_0x28d01e,'changeGroups':_0xda54d4['changeGroups'],'documentContextContent':_0xda54d4['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x28e83b=>setTimeout(_0x28e83b,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x16939f[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x645a7d){this['_isAbortError'](_0x645a7d)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x645a7d);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x1093a3){const _0x27bf03=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x27bf03),_0x1093a3['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class Wa extends _0x421ea3{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x135d5b){super(_0x135d5b),_0x135d5b['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Zs extends _0x52fd2c{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x13cce3,_0x5749e9){super(_0x13cce3),this['id']=_0x5749e9,this['set']('status','pending'),this['set']('changeId',_0x5749e9),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x3a2d6b,_0x42ca75)=>{_0x42ca75&&_0x42ca75['target']&&'A'===_0x42ca75['target']['tagName']&&_0x42ca75['preventDefault'](),this['fire']('activateChange',{'id':_0x5749e9,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x5749e9,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x5749e9,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x2685ee=new _0x52fd2c(this['locale']);return _0x2685ee['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x51d4c8=>!_0x51d4c8)]}}),_0x2685ee;}['_createAcceptButtonView'](){const _0x258739=new _0x129639(this['locale']);return _0x258739['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x258739['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5265b8=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x5265b8['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x1a3a1c=>'pending'!==_0x1a3a1c&&'accepted'!==_0x1a3a1c),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x804999=>'pending'===_0x804999),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x37020e=>'accepted'===_0x37020e)]}}),this['on']('change:status',(_0x18a24f,_0x2484a5,_0x5b8d17)=>{_0x258739['isEnabled']='pending'===_0x5b8d17,'accepted'===_0x5b8d17&&(_0x258739['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x258739['icon']=_0x1d6803);}),_0x258739;}['_createDismissButtonView'](){const _0x1276d4=new _0x129639(this['locale']);return _0x1276d4['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x1276d4['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3964c1=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x3964c1['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x13d823=>'pending'!==_0x13d823&&'rejected'!==_0x13d823),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x22b7fd=>'pending'===_0x22b7fd),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x28553e=>'rejected'===_0x28553e)]}}),this['on']('change:status',(_0x4588b4,_0x24a78d,_0x1c9cbe)=>{_0x1276d4['isEnabled']='pending'===_0x1c9cbe,'rejected'===_0x1c9cbe&&(_0x1276d4['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x1276d4['icon']=_0x254810);}),_0x1276d4;}['_createInfoButtonView'](){const _0x3ba77e=new _0x129639(this['locale']);return _0x3ba77e['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':tc,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x3ba77e['bind']('isOn')['to'](this,'isInfoToggleOn',_0x36117b=>_0x36117b),_0x3ba77e['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x3ba77e;}['_createOutdatedButtonView'](){const _0x2469e6=new _0x129639(this['locale']);return _0x2469e6['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x54e109,'withText':!0x0,'isEnabled':!0x1}),_0x2469e6['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x1b3f80=>'outdated'!==_0x1b3f80)],'disabled':'disabled'}}),_0x2469e6;}}class Ve extends _0xc6701d{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x4a235c,_0xa27d10){super(_0x4a235c),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['set']('isDiffActive',!0x1),this['content']['add'](this['_createContentView']()),_0xa27d10['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x2b038a){this['resultItemView']['changeId']=_0x2b038a['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x2b038a['contentDiffed'];}['showBalloon'](_0x34cf7f,_0x48064d,_0x5f52f6,_0x562ea7,_0x1bd771,_0x13c16a){const _0x196f0c=_0x48064d();if(!_0x196f0c)return;this['updateContent'](_0x34cf7f),this['show']();const _0x15ebf9=Array['from'](_0x196f0c['getClientRects']())['reverse'](),_0x479e2f=this['_getPointedRectIndexFromEvent'](_0x5f52f6,_0x15ebf9),_0x24753e=_0x15ebf9[_0x479e2f??0x0];'click'===_0x562ea7?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x48064d(),_0x479e2f,_0x34cf7f['id'],_0x1bd771,_0x13c16a)||_0x24753e})):'hover'===_0x562ea7&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x48064d(),_0x479e2f,_0x34cf7f['id'])||_0x24753e}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){_0x27e637({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x32b28b=[this['element']];return this['_pinnedTargetElement']&&_0x32b28b['push'](this['_pinnedTargetElement']),_0x32b28b;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x5e41c2=new _0x52fd2c();return this['resultItemView']=new Zs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x5e41c2['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x5e41c2;}['_getBestRectPositionOnClick'](_0x268496,_0x13530d,_0x1dbff1,_0xbc9ecc,_0x39321c){if(!_0x268496)return null;const _0x36f5b4=this['position']['replace']('arrow_',''),_0x57ef81=Array['from'](_0x268496['getClientRects']());let _0x3c8d81,_0x181a33=_0x57ef81['reverse']();return void 0x0!==_0x13530d&&this['_isPinnedRectVisible'](_0x181a33[_0x13530d],_0xbc9ecc,_0x39321c)?(_0x3c8d81=_0x181a33[_0x13530d],this['_pinnedRectIndex']=_0x13530d):this['_isPinnedRectVisible'](_0x181a33[0x0],_0xbc9ecc,_0x39321c)&&void 0x0===_0x13530d?_0x3c8d81=_0x181a33[0x0]:(_0x181a33='s'==_0x36f5b4[0x0]?[..._0x57ef81]['reverse']():_0x57ef81,_0x181a33['forEach'](_0x1ae6bf=>{this['_isPinnedRectVisible'](_0x1ae6bf,_0xbc9ecc,_0x39321c)&&(_0x3c8d81=_0x1ae6bf);})),this['_pinnedTargetChangeId']=_0x1dbff1,this['_pinnedTargetElement']=_0x268496,_0x3c8d81||_0x268496['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x4691bc,_0xbbe305,_0x176894){if(!_0x4691bc)return null;const _0x3d151c=Array['from'](_0x4691bc['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0xbbe305&&this['_pinnedTargetChangeId']!==_0x176894)return this['_pinnedRectIndex']=_0xbbe305,this['_pinnedTargetElement']=_0x4691bc,this['_pinnedTargetChangeId']=_0x176894,_0x3d151c[_0xbbe305];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x176894){if(_0x4691bc!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x3d151c[this['_pinnedRectIndex']];}return void 0x0!==_0xbbe305&&this['_pinnedTargetChangeId']!==_0x176894?(this['_pinnedRectIndex']=_0xbbe305,this['_pinnedTargetElement']=_0x4691bc,this['_pinnedTargetChangeId']=_0x176894,_0x3d151c[_0xbbe305]):_0x4691bc['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x491aae,_0x318cce){if(_0x491aae)for(let _0x5e009d=0x0;_0x5e009d<_0x318cce['length'];_0x5e009d++){const _0x3712b1=_0x318cce[_0x5e009d];if(_0x491aae['clientX']>=_0x3712b1['left']-0x3&&_0x491aae['clientX']<=_0x3712b1['right']+0x3&&_0x491aae['clientY']>=_0x3712b1['top']-0x3&&_0x491aae['clientY']<=_0x3712b1['bottom']+0x3)return _0x5e009d;}}['_isPinnedRectVisible'](_0x208b10,_0xc4866d,_0x2377e9){const _0x3b0e2c=new _0x2d2067(_0x208b10),_0x44d7e6=_0xc4866d||document['documentElement'],_0x1028ea=_0x3b0e2c['getIntersection'](_0x59e546(_0x2377e9)),_0x420b83=new _0x2d2067(_0x44d7e6)['getIntersection'](_0x3b0e2c);return!!(_0x1028ea&&_0x420b83&&_0x3b0e2c['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Ie extends _0x42547c{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[it];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1b5355){super(_0x1b5355),this['_bodyCollection']=new _0x26c387(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...ih)['to'](this),this['_balloonSuggestionView']=new Ve(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x139868=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x139868);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x52d9ee){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x381b6a=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x52d9ee,_0x381b6a);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x4311a6){_0x4311a6&&('error-general'!==_0x4311a6['status']?'error-chunk'!==_0x4311a6['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x4873f0){this['_mainView']['addCheckRunResult'](_0x4873f0);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x1cd856){this['_mainView']['showGeneralReviewCoreErrorView'](_0x1cd856??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x4366f8,_0x13a442){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x4366f8,_0x13a442);}['setActiveStateInResults'](_0x2a48dc){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x180c60=>{_0x180c60['id']===_0x2a48dc&&_0x180c60['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x137eb4=>_0x137eb4['setItemAsInactive']());}['updateChangeState'](_0x5a2ff6,_0x141ed4){'accepted'===_0x141ed4||'rejected'===_0x141ed4||'outdated'===_0x141ed4?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x5a2ff6,_0x141ed4):this['_mainView']['reviewCheckResultsView']['showResult'](_0x5a2ff6,_0x141ed4);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x462ee6,_0x311ab7,_0x26bc21,_0x2f1584,_0x219a70,_0x3db2cd){this['_balloonSuggestionView']['showBalloon'](_0x462ee6,_0x311ab7,_0x26bc21,_0x2f1584,_0x219a70,_0x3db2cd);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x2a3348){const _0x4890c2=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x51849c=>_0x51849c['id']===_0x2a3348);return _0x4890c2?_0x4890c2['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x52fd2c{constructor(_0x18fcb2){super(_0x18fcb2),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x2a863f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x2a863f['if']('isVisible','ck-hidden',_0x122b2f=>!_0x122b2f)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x2a863f['to']('errorMessage')}]}]});}}class _e extends _0x52fd2c{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x563862,_0xa3f19c){super(_0x563862),this['reviewCoreHeader']=_0xa3f19c['header'],this['generalErrorView']=new sh(_0x563862),this['reviewCheckListView']=_0xa3f19c['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0xa3f19c['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0xa3f19c['completed'],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','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],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),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0xe87646){this['reviewCheckResultsView']['addResult'](_0xe87646),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;}['showGeneralReviewCoreErrorView'](_0x4d64b8){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x4d64b8;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class _r extends _0x129639{constructor(_0x57109e,_0x2d2570){super(_0x2d2570),this['set']({'label':_0x57109e,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Re extends _0x27d63c{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0xd83a9b,_0x3712a1){super(_0xd83a9b),this['_contents']=_0x3712a1,this['_resultViews']=new _0x45b6fa(),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 ui(_0xd83a9b),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 _0x24b898=this['_createCombinedSkeletonLoader'](),_0x19c819=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x19c819['if']('isLoading','ck-ai_review__check-run_loading',_0x8b6276=>_0x8b6276),_0x19c819['if']('isResultReady','ck-ai_review__check-run_ready',_0xc448f7=>_0xc448f7),_0x19c819['if']('isVisible','ck-hidden',_0x3519aa=>!_0x3519aa)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x49b92e=>_0x49b92e)]},'children':this['_resultViews']},_0x24b898]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x4160ad){const _0x1ce63e=new Zs(this['locale'],_0x4160ad['id']);_0x1ce63e['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x1ce63e),_0x1ce63e['resultResponseView']['element']['innerHTML']=_0x4160ad['contentDiffed'];}['hideResult'](_0x57a40c,_0x3ebb2b){if('pending'===_0x3ebb2b)return;const _0x3a00af=this['_resultViews']['find'](_0x456783=>_0x456783['id']===_0x57a40c);_0x3a00af&&(_0x3a00af['status']=_0x3ebb2b,_0x3a00af['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x421c44,_0x42b0eb){if('pending'!==_0x42b0eb)return;const _0x18fc4b=this['_resultViews']['find'](_0x19bc1a=>_0x19bc1a['id']===_0x421c44);_0x18fc4b&&(_0x18fc4b['status']=_0x42b0eb,_0x18fc4b['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x5c2d1e,_0x20d26e){this['headerTitle']=_0x5c2d1e,this['headerSubtitle']=_0x20d26e||'';}['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 Xe(this['locale'],Ye['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x488977=new _0x52fd2c(this['locale']),_0x11745c=[];for(let _0x2457ed=0x0;_0x2457ed<0x10;_0x2457ed++){const _0x5345db=this['_createSkeletonLoader']();_0x5345db['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x11745c['push'](_0x5345db);}return _0x488977['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x4424b5=>!_0x4424b5)]},'children':_0x11745c}),_0x488977;}['_createErrorView'](){const _0x4e695a=new _0x52fd2c(this['locale']),_0xc8e2c6=new _0x129639(this['locale']),t=this['locale']['t'];return _0x4e695a['delegate']('retryReview')['to'](this),_0xc8e2c6['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0xc8e2c6['on']('execute',()=>{this['fire']('retryReview');}),_0x4e695a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x24833c=>!_0x24833c),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x1289f1=>'chunk'===_0x1289f1)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x4b3e37=>'chunk'===_0x4b3e37)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1d231c=>'general'!==_0x1d231c)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x4aa0c7=>'chunk'!==_0x4aa0c7)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0xc8e2c6]}),_0x4e695a;}['_createCancelButtonView'](){const _0x37ae3c=new _0x129639(this['locale']);return _0x37ae3c['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x1cd249}),_0x37ae3c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x46ae9f=>_0x46ae9f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xc77a9b=>_0xc77a9b)]}}),_0x37ae3c['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x37ae3c;}['_createToggleDiffButtonView'](){const _0x2c3f9a=new _0x129639(this['locale']);_0x2c3f9a['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x2c3f9a['bind']('isEnabled')['to'](this,'isError',_0xeb27c8=>!_0xeb27c8),_0x2c3f9a['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x329b6a=>!_0x329b6a),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4fcbc0=>_0x4fcbc0)]}});const _0x405b32=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x26aebf=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x2c3f9a['bind']('isOn')['to'](this,'isToggleDiffOn',_0x54aeff=>_0x54aeff),_0x2c3f9a['bind']('icon')['to'](this,'isToggleDiffOn',_0x1971eb=>_0x1971eb?_0x4ebd0a:_0x182b81),_0x2c3f9a['bind']('label')['to'](this,'isToggleDiffOn',_0x5746d6=>_0x5746d6?_0x405b32:_0x26aebf),_0x2c3f9a['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x2c3f9a;}['_createAcceptAllButtonView'](){const _0xd3db29=new _0x129639(this['locale']);return _0xd3db29['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0xd3db29['bind']('isEnabled')['to'](this,'isError',_0x1738eb=>!_0x1738eb),_0xd3db29['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5757c1=>!_0x5757c1),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4d9726=>_0x4d9726)]}}),_0xd3db29['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0xd3db29;}['_createExitReviewButtonView'](){const _0x7aa0c1=new _0x129639(this['locale']);return _0x7aa0c1['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x7aa0c1['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x47bc3c=>!_0x47bc3c),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x40d773=>_0x40d773)]}}),_0x7aa0c1['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x7aa0c1;}['_createResultHeaderView'](){const _0x203637=new _0x52fd2c(this['locale']),_0x5f550a=this['_createTitleView']();return _0x203637['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x1bb840=>_0x1bb840)]},'children':[_0x5f550a,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x203637;}['_createTitleView'](){const _0x57868c=new _0x52fd2c(this['locale']),_0x41ed3b=new Ze();return _0x41ed3b['bind']('isVisible')['to'](this,'isResultReady',_0xee64da=>!_0xee64da),_0x57868c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x41ed3b,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2f84fc=>_0x2f84fc)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1dacef=>!_0x1dacef)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x57868c;}['_createFinishReviewButtonView'](){const _0x5968a8=new _r(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x5968a8['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x578d98=>!_0x578d98)]}}),_0x5968a8['delegate']('finishReview')['to'](this),_0x5968a8;}}class Te extends _0x27d63c{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x3970ef,_0x5569fc){super(_0x3970ef),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x5569fc['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x5569fc['headerText']);const _0x1875bf=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x1875bf['if']('isVisible','ck-hidden',_0x1d01e2=>!_0x1d01e2)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x5569fc['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x112537){const _0xfac1aa=new _r(_0x112537,this['locale']);return _0xfac1aa['delegate']('finishReview')['to'](this),_0xfac1aa;}['_createResultHeaderView'](_0x46651e){const _0xe6594d=new _0x52fd2c(this['locale']);return _0xe6594d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0x46651e}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0xe6594d;}}class Dr extends _0x52fd2c{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x5e2e5d,_0x2bfbee){super(_0x5e2e5d),this['_defaultValue']=_0x2bfbee['default']||(_0x2bfbee['data']['length']>0x0?_0x2bfbee['data'][0x0]['id']:''),this['_defaultLabel']=_0x2bfbee['data']['find'](_0x53d298=>_0x53d298['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x3837b3(this['locale']);const _0x8457e1=this['_prepareListOptions'](_0x2bfbee['data']);_0x1f30e0(this['_dropdownView'],_0x8457e1,{'role':'menu','ariaLabel':_0x2bfbee['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xce2593=>{_0xce2593['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x3dd2da=>{this['formValue']=_0x3dd2da['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x3dd2da['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x1f2e36=[]){const _0x361204=new _0x395174();this['resetToDefault']();for(const _0x2bb247 of _0x1f2e36){const _0x214bcc=new _0x1612c4({'label':_0x2bb247['label'],'withText':!0x0,'role':'menuitemradio','id':_0x2bb247['id'],'model':_0x2bb247});_0x214bcc['bind']('isOn')['to'](this,'formValue',_0x33cc51=>_0x33cc51===_0x214bcc['id']);const _0x545ef8={'type':'button','model':_0x214bcc};_0x361204['add'](_0x545ef8);}return _0x361204;}}class cc extends _0x27d63c{['_formItem']=null;constructor(_0x2ee7f0,_0x271a06,_0x3cc9d0){super(_0x2ee7f0),this['argsKey']=_0x271a06?.['argsKey'];if('dropdown'===_0x271a06['formType'])this['_formItem']=new Dr(this['locale'],_0x271a06);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x5562e7=new _0x5db09f(this['locale'],{'children':[this['_formItem']],'class':[_0x3cc9d0?'ck-form__row_with-submit':'']});_0x3cc9d0&&_0x5562e7['children']['add'](_0x3cc9d0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x5562e7]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class mo extends _0x1a6812{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x1e2d03){super(_0x1e2d03),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x299178(),this['minRows']=mo['MIN_ROWS'],this['maxRows']=mo['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class rc extends _0x52fd2c{['focusTracker']=new _0x264c5d();['keystrokes']=new _0x299178();['focusCycler'];['_focusables']=new _0x45b6fa();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x3dccaa,_0x505660,_0x9108e3=!0x1){super(_0x3dccaa),this['_check']=_0x505660,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x505660['defaultModel']?_0x505660['defaultModel']['id']:'',this['_defaultLabel']=_0x505660['defaultModel']?_0x505660['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x13eaa4(this['locale'],()=>new mo(_0x3dccaa)),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 _0x395174(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x9108e3),_0x1f30e0(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x5db09f(this['locale'],{'children':[this['promptInputView']]}),new _0x5db09f(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x2595ea,_0x5d3834)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x5d3834()):_0x5d3834();}),this['focusCycler']=new _0x471d76({'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'](_0x9d1693=>{this['_focusables']['add'](_0x9d1693),this['focusTracker']['add'](_0x9d1693['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 _0xe6bfce of this['_getFormValidators']()){const _0x4b26d5=_0xe6bfce();if(_0x4b26d5)return this['promptInputView']['errorText']=_0x4b26d5,!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 _0x1e7314=new _0x129639(this['locale']),t=this['locale']['t'];return _0x1e7314['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x1e7314['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x1e7314;}['_createCancelButtonView'](){const _0x276ce1=new _0x129639(this['locale']),t=this['locale']['t'];return _0x276ce1['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x276ce1['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3a5ff8=>{_0x3a5ff8['stopPropagation']();})}}),_0x276ce1['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x276ce1;}['_setModelList'](_0x36bff1){this['_modelSelectionDropdownItems']['clear']();const _0x40a451=this['_check']['models'];if(_0x36bff1)this['set']('modelDisplayMode','hidden');else{const _0x4a2211=0x1===_0x40a451['length'];this['set']('modelDisplayMode',_0x4a2211?'name':'selector');}if(this['resetToDefault'](),_0x40a451?.['length']){0x1===_0x40a451['length']&&this['set']('activeModelName',_0x40a451[0x0]['name']||_0x40a451[0x0]['id']);for(const _0x4f82f0 of _0x40a451){const _0x4b7845=new _0x1612c4({'label':_0x4f82f0['name'],'withText':!0x0,'role':'menuitemradio','id':_0x4f82f0['id'],'model':_0x4f82f0});_0x4b7845['bind']('isOn')['to'](this,'modelId',_0x1779d3=>_0x1779d3===_0x4f82f0['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4b7845,'labelView':new po(this['locale'],_0x4f82f0)});}}}['_createModelSelectionDropdown'](){const _0xf091a=_0x3837b3(this['locale']);return _0xf091a['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0xf091a['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0xf091a['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1e332a=>'selector'===_0x1e332a),this['listenTo'](_0xf091a,'execute',_0x6e838a=>{this['modelId']=_0x6e838a['source']['model']['id'],_0xf091a['buttonView']['label']=_0x6e838a['source']['label'];}),_0xf091a;}['_createModelNameView'](){const _0x54105f=new wo(this['locale']);return _0x54105f['bind']('text')['to'](this,'activeModelName',_0x47d9e8=>_0x47d9e8??''),_0x54105f['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5960b6=>'name'===_0x5960b6),_0x54105f;}['_createActionsFooterView'](){const _0x16975a=new _0x52fd2c(this['locale']);return _0x16975a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x16975a;}}class wo extends _0x52fd2c{constructor(_0x2e8125){super(_0x2e8125),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0xe4de91=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0xe4de91['if']('isVisible','ck-hidden',_0x5c7aaf=>!_0x5c7aaf)]},'children':[{'text':_0xe4de91['to']('text')}]});}}class po extends _0x3e41bf{constructor(_0x4e8f88,_0x44cc22){super();const _0x4f9ca1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x4f9ca1['to']('style'),'id':_0x4f9ca1['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x4f9ca1['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x44cc22['description']||'']}]}]});}}class ic extends _0x27d63c{['_formItemsCollection']=new _0x45b6fa();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x580463,_0x392e93,_0x3d6667,_0x281bbe=!0x1){super(_0x580463),this['_hideModels']=_0x281bbe,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x392e93['isParameterized']);const _0x3336ea=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x209eb2=>_0x209eb2),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x345dcc=>_0x345dcc)],'style':{'--ck-ai-review-check-list-item-index':_0x3d6667}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x392e93['title']}]},_0x3336ea]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x392e93['description']?[{'text':_0x392e93['description']}]:[]}]}]},..._0x392e93['isParameterized']?[this['_createParameterizedView'](_0x392e93)]:[],...'custom'===_0x392e93['id']?[this['_createCustomView'](_0x392e93,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x392e93['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x392e93['id'],'args':_0x392e93['useArgs']?_0x392e93['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x27e637({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x14cc53=>{_0x14cc53['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x19a51c=new _0x3d6008();return _0x19a51c['content']=_0x59c457,_0x19a51c['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x19a51c;}['_createParameterizedView'](_0x461d4a){const _0x3c2d93=new _0x52fd2c(),_0x1fdd57=this['_createFormView'](_0x461d4a);return _0x3c2d93['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x2b8525=>!_0x2b8525)]},'children':[_0x1fdd57]}),_0x3c2d93;}['_createFormView'](_0x832458){const _0x22ead5=new _0x52fd2c(),_0x3476aa=Array['isArray'](_0x832458['options'])?_0x832458['options']:[],_0x44863e=new _0x129639(this['locale']),t=this['locale']['t'];_0x44863e['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x44863e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4e56fa=>{_0x4e56fa['stopPropagation']();})}}),_0x44863e['on']('execute',()=>{const _0x32ed1d=[],_0x5876de={};this['_formItemsCollection']['forEach'](_0x208fbc=>{_0x32ed1d['push'](_0x208fbc['value']),_0x832458['useArgs']&&_0x832458['options']&&(_0x5876de[_0x208fbc['argsKey']]=_0x208fbc['value']);}),this['fire']('runReviewCheck',{'id':_0x832458['id'],'params':_0x32ed1d['length']?_0x32ed1d:void 0x0,'args':Object['keys'](_0x5876de)['length']?_0x5876de:void 0x0});});const _0x2cce96=_0x3476aa['length'];return _0x3476aa['forEach']((_0x1a3081,_0x558dc7)=>{const _0x5b3c13=_0x558dc7===_0x2cce96-0x1;this['_formItemsCollection']['add'](new cc(this['locale'],_0x1a3081,_0x5b3c13?_0x44863e:null));}),_0x22ead5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x22ead5;}['_createCustomView'](_0x30dc53,_0x3db056=!0x1){return this['_customCheckView']=new rc(this['locale'],_0x30dc53,_0x3db056),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x2dd98b=>!_0x2dd98b)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x4fb3e9,_0x523e74,_0xecb87a)=>{_0xecb87a||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class pe extends _0x27d63c{['_checkViews'];constructor(_0x30b935){super(_0x30b935),this['_checkViews']=new _0x45b6fa(),this['_setupTemplate']();}['setChecks'](_0x3c7966,_0x23e4cd=!0x1){this['_checkViews']['clear']();for(const [_0x214ced,_0x5a5aec]of _0x3c7966['entries']()){const _0x927359=new ic(this['locale'],_0x5a5aec,_0x214ced,_0x23e4cd);_0x927359['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x927359);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x32b490 of this['_checkViews'])_0x32b490 instanceof ic&&_0x32b490['resetToDefault']();}['_setupTemplate'](){const _0x4f1ef7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x4f1ef7['if']('isVisible','ck-hidden',_0x2258ee=>!_0x2258ee)]},'children':this['_checkViews']});}}class re extends Ie{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x1bbc31=this['context']['locale'],_0x14c1fb=new _0x3d4bc4(_0x1bbc31,{'label':i(_0x1bbc31,'AI_REVIEW_MODE'),'icon':_0x9be02c,'class':'ck-ai-header\x20ck-ai-header_review'});return new _e(this['context']['locale'],{'header':_0x14c1fb,'list':new pe(_0x1bbc31),'results':new Re(_0x1bbc31,{'generalErrorText':i(_0x1bbc31,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new Te(_0x1bbc31,{'headerText':i(_0x1bbc31,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0x1bbc31,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x1bbc31,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x536999=this['context']['plugins']['get']('AITabs');_0x536999['view']['on']('activateTab',(_0x323b12,_0x383505)=>{'reviewMode'===_0x383505?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x536999['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x9be02c,'order':0x0,'content':this['_mainView']});}}const Me='review-';class oe extends _0x42547c{static get['requires'](){return[ot,D];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x49a733){super(_0x49a733),this['_domEmitter']=new(_0x4450a8())(),this['_eventEmitter']=new(_0x186953())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x5be4b6=T(this['context']);_0x5be4b6['conversion']['for']('editingDowncast')['markerToElement']({'model':Me+'insert','view':(_0x436697,{writer:_0x5407f8})=>{const _0x45038a=this['_markers']['get'](_0x436697['markerName']),_0x2bf545={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x45038a?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x436697['markerName']};return _0x5407f8['createUIElement']('span',_0x2bf545,function(_0x481bdb){const _0x1f4a5b=this['toDomElement'](_0x481bdb);return _0x1f4a5b['innerHTML']=_0x45038a?.['content']?.['asString']||'',_0x1f4a5b;});}}),_0x5be4b6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Me+'remove-only','view':_0xc3d612=>{const _0x2636c4=this['_markers']['get'](_0xc3d612['markerName']),_0xb0100a=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x2636c4?.['id']||'')&&_0xb0100a['push']('ck-ai_review__change_active'),{'classes':_0xb0100a,'attributes':{'data-marker-id':_0xc3d612['markerName']}};}}),_0x5be4b6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Me+'remove-context','view':_0x41333f=>{const _0x557c8c=this['_markers']['get'](_0x41333f['markerName']),_0x28f86a=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x557c8c?.['id']||'')&&_0x28f86a['push']('ck-ai_review__change_active'),{'classes':_0x28f86a,'attributes':{'data-marker-id':_0x41333f['markerName']}};}}),_0x5be4b6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Me+'remove-text','view':_0x36f380=>{const _0x3006e3=this['_markers']['get'](_0x36f380['markerName']),_0x75b71b=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x3006e3?.['id']||'')&&_0x75b71b['push']('ck-ai_review__change_active'),{'classes':_0x75b71b,'attributes':{'data-marker-id':_0x36f380['markerName']}};}}),_0x5be4b6['conversion']['for']('dataDowncast')['markerToElement']({'model':Me+'suggestion-context','view':(_0x178a2a,{writer:_0x126126})=>_0x126126['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x178a2a['isOpening']?'start':'end')})}),_0x5be4b6['conversion']['for']('downcast')['attributeToAttribute']({'model':nt,'view':_0x80f6b4});const _0x5dd549=_0x5be4b6['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x5dd549,'mouseup',(_0x49e25e,_0x1b7d76)=>{const _0x351906=_0x1b7d76['target'],_0x33d063=this['_findMarkerElement'](_0x351906);if(!_0x33d063)return;const _0x15c042=_0x33d063['getAttribute']('data-marker-id'),_0x4c57e4=_0x15c042['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x15c042,'changeId':_0x4c57e4,'markerElement':()=>this['_findMarkerElementById'](_0x15c042),'domEvent':_0x1b7d76});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x5dd549,'mouseover',(_0x33e012,_0x211b50)=>{const _0x5a8a86=_0x211b50['target'],_0x5ab6c4=_0x211b50['relatedTarget'];let _0x11b3a3=this['_findMarkerElement'](_0x5a8a86);if(!_0x11b3a3&&_0x5ab6c4&&(_0x11b3a3=this['_findMarkerElement'](_0x5ab6c4)),!_0x11b3a3)return;const _0x2eb6d4=_0x11b3a3['getAttribute']('data-marker-id'),_0xcc8ca9=_0x2eb6d4['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0xcc8ca9,'markerElement':()=>this['_findMarkerElementById'](_0x2eb6d4),'domEvent':_0x211b50});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x1327d9((_0x4080a6,_0x3674ab)=>{const _0xab5451=_0x3674ab['target'];if(this['_findMarkerElement'](_0xab5451))return;_0xab5451['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x5be4b6['model']['document']['registerPostFixer'](_0x85662=>this['_validateMarkers'](_0x5be4b6,_0x85662)),_0x5be4b6['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x5be4b6));}['getDocumentData'](){const _0x1905b6=this['context']['plugins']['get']('AIEditing'),_0x790ed4=T(this['context']),_0x4a4dfc=_0x790ed4['model'],_0x572d13=new bt();for(const _0xe25263 of _0x4a4dfc['document']['getRoot']()['getChildren']()){const _0x2742fd=_0xe25263['_clone'](!0x0);_0x572d13['_appendChild'](_0x2742fd);}for(const _0x1db737 of _0x4a4dfc['markers'])_0x572d13['markers']['set'](_0x1db737['name'],this['_changeRangeOwnerDocument'](_0x1db737['getRange']()['clone'](),_0x572d13));const _0x25760d=new _0x2ce1de({'ignoreElementEnd':!0x0,'startPosition':_0x4a4dfc['createPositionAt'](_0x572d13,0x0)}),_0x54e1a5=new Set(),_0x2fc1d7=new Map();for(const {item:_0x1356a0}of _0x25760d){if(!_0x1356a0['is']('$textProxy'))continue;const _0x55be67=_0x1356a0['parent'];if(_0x55be67&&_0x55be67['is']('element')){const _0x38e274=this['_upsertDataId'](_0x55be67,()=>_0x1905b6['_nextDataId'](_0x54e1a5));_0x54e1a5['add'](_0x38e274);for(const _0x3de9a1 of _0x55be67['getChildren']())_0x3de9a1['is']('element')&&_0x54e1a5['add'](this['_upsertDataId'](_0x3de9a1,()=>_0x1905b6['_nextDataId'](_0x54e1a5)));let _0x3e2100=_0x55be67;for(;_0x3e2100['parent']&&!_0x3e2100['parent']['is']('documentFragment');)_0x3e2100=_0x3e2100['parent'],_0x3e2100['hasAttribute'](nt)&&_0x3e2100['_removeAttribute'](nt);_0x2fc1d7['set'](_0x38e274,{'path':_0x55be67['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x3e2100['_clone'](!0x0),_0x38e274,_0x790ed4['data'])}),_0x25760d['jumpTo'](_0x4a4dfc['createPositionAfter'](_0x55be67));}}return{'content':_0x790ed4['data']['processor']['toData'](_0x790ed4['data']['toView'](_0x572d13)),'version':_0x790ed4['model']['document']['version'],'elements':_0x2fc1d7};}['diffContent'](_0x4a558d,_0x51dce9,_0x365303=!0x1){const _0x15e380=[],_0x3ad9c6=T(this['context']),_0x479c84=_0x3ad9c6['data']['parse'](_0x51dce9,'$documentFragment'),_0x8de539=_0x3ad9c6['data']['parse'](_0x4a558d,'$documentFragment'),_0x5b5997=_0x3ad9c6['model']['createPositionAt'](_0x8de539,0x0);if(this['_haveSingleTopLevelElement'](_0x479c84)){if(!this['_hasSameTopLevelElement'](_0x8de539,_0x479c84))return _0x15e380;}else{const _0x3ff066=_0x3ad9c6['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x8de539,_0x3ff066)||!this['_haveOnlyInlineContent'](_0x479c84,_0x3ff066))return _0x15e380;}const _0x2b0233=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x4a558d,_0x51dce9,{'anchor':_0x5b5997,'markDeletions':!0x0})['getOperations']()['filter'](_0x1a8309=>'insert'===_0x1a8309['type']||'marker'===_0x1a8309['type']&&_0x1a8309['name']['startsWith']('$markedRemove')),_0x19ef35=this['_groupAdjacentOperations'](_0x2b0233),_0x3be8c0=[];if(_0x365303){if(_0x19ef35['length']){const _0x8f239f=_0x19ef35[0x0]['operations'][0x0],_0x13a680='insert'===_0x8f239f['type']?_0x8f239f['position']:_0x8f239f['newRange']['start'],_0x7be075=this['_getPositionLimitingRange'](_0x13a680,_0x3ad9c6,'inside'),_0x3d69e1=_0x7be075?_0x479c84['getChild'](0x0)['getChildren']():_0x479c84['getChildren'](),_0x1de8fe=_0x7be075||_0x3ad9c6['model']['createRangeIn'](_0x8de539),_0x419eec=[new _0xe48208('$markedRemove:synthetic'+_0x2ced3c(),null,_0x1de8fe,_0x3ad9c6['model']['document']['model']['markers'],!0x0,_0x3ad9c6['model']['document']['version']+0x1),new _0xa5baad(_0x1de8fe['end'],_0x3d69e1,_0x3ad9c6['model']['document']['version']+0x2)];_0x3be8c0['push']({'operations':_0x419eec,'operationsIsolated':_0x419eec,'groupOffset':0x0});}}else _0x3be8c0['push'](..._0x19ef35);let _0x7684e7=0x0;return _0x3ad9c6['model']['change'](_0x4c5a52=>{for(let _0x1c59dc=0x0;_0x1c59dc<_0x3be8c0['length'];_0x1c59dc++){const _0x4c8f4f=_0x3be8c0[_0x1c59dc],_0x108360=_0x4c5a52['createDocumentFragment']();for(const _0x1764d9 of _0x8de539['getChildren']())_0x4c5a52['append'](_0x1764d9['_clone'](!0x0),_0x108360);for(const _0x2992ae of _0x4c8f4f['operationsIsolated'])if('insert'===_0x2992ae['type']){const _0x5be5ec=_0x2992ae;_0x5be5ec['baseVersion']=null,_0x5be5ec['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x5be5ec,_0x108360),_0x4c5a52['batch']['addOperation'](_0x2992ae),_0x3ad9c6['model']['applyOperation'](_0x2992ae);const _0xbd7d9a='suggestion:insertion:id:authorId:'+_0x7684e7++,_0x4d09e3=_0x3ad9c6['model']['createRange'](_0x5be5ec['position'],_0x5be5ec['position']['getShiftedBy'](_0x5be5ec['howMany']));_0x108360['markers']['set'](_0xbd7d9a,_0x4d09e3);}else{if('marker'===_0x2992ae['type']&&_0x2992ae['name']['startsWith']('$markedRemove')){const _0x3e241e=_0x2992ae,_0x45498d='suggestion:deletion:id:authorId:'+_0x7684e7++;this['_changeOperationOwnerDocument'](_0x3e241e,_0x108360),_0x108360['markers']['set'](_0x45498d,_0x3e241e['newRange']);}}if(_0x365303)_0x15e380['push']({..._0x4c8f4f,'context':this['_createGetContentFn'](_0x8de539,_0x3ad9c6['data']),'content':this['_createGetContentFn'](_0x8de539,_0x3ad9c6['data'])});else{const _0x59284c=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x4c8f4f['operationsIsolated'][0x0]),_0x108360),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x4c8f4f['operationsIsolated'][_0x4c8f4f['operationsIsolated']['length']-0x1]),_0x108360));_0x108360['markers']['set'](Me+'suggestion-context',new dt(_0x59284c['start'],_0x59284c['end'])),_0x15e380['push']({..._0x4c8f4f,'context':this['_createGetContextFn'](_0x108360,_0x3ad9c6['data'],{'ellipsisBefore':_0x59284c['hasContentBefore'],'ellipsisAfter':_0x59284c['hasContentAfter']}),'content':this['_createGetContentFn'](_0x108360,_0x3ad9c6['data'])});}}}),_0x15e380;}['markChangePositionInEditorContent'](_0x38cc5d,_0x1f1ce1){if(!_0x38cc5d['length'])return;const _0x1abeef=_0x38cc5d[0x0]['parent']['id'],_0x566c5b=_0x1f1ce1['elements']['get'](_0x1abeef);if(!_0x566c5b)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x1abeef);const _0x3500f4=_0x566c5b['path'],_0x456ac2=T(this['context']),_0x5699ac=_0x456ac2['model']['document']['history']['getOperations'](_0x1f1ce1['version']),_0x1be456=[];for(const _0x444955 of _0x38cc5d){const _0x324a5b=_0x444955['operationsIsolated']['map'](_0x122d69=>this['_translateOperationToEditorContent'](_0x122d69,_0x3500f4,_0x456ac2['model']['document']['getRoots']()[0x0]));if(!_0x324a5b||!_0x324a5b['length'])continue;const _0x71b7e1=_0x324a5b['every'](_0x16d1af=>'marker'===_0x16d1af['type']&&_0x16d1af['name']['startsWith']('$markedRemove')),_0x11f633={'document':_0x456ac2['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0xce83f5=kt(_0x324a5b,_0x5699ac,_0x11f633)['operationsA'];for(const _0x40a716 of _0xce83f5)if('insert'===_0x40a716['type']){const _0x57e511=_0x40a716,_0x2aa561=_0x57e511['nodes'];_0x456ac2['model']['change'](_0x14ca78=>{const _0x5c908c=_0x14ca78['createDocumentFragment']();for(const _0x421294 of _0x2aa561)_0x14ca78['append'](_0x421294['_clone'](!0x0),_0x5c908c);_0x1be456['push']({'start':_0x57e511['position'],'end':_0x57e511['position'],'type':'insert','groupId':_0x444955['id'],'content':{'asString':this['_createGetContentFn'](_0x5c908c,_0x456ac2['data'])(),'asFragment':_0x5c908c}});});}else{if('marker'===_0x40a716['type']&&_0x40a716['name']['startsWith']('$markedRemove')){const _0xbe8f3a=_0x40a716;let _0x5ef816='remove-text';if(_0x71b7e1){const _0x28c659=this['_findAdjacentContextDistance'](_0xbe8f3a['newRange']['start'],'backward',_0x456ac2['model']['schema']),_0x569639=this['_findAdjacentContextDistance'](_0xbe8f3a['newRange']['end'],'forward',_0x456ac2['model']['schema']);if(_0x28c659||_0x569639){const _0x555fa0=_0xbe8f3a['newRange']['start']['getShiftedBy'](-_0x28c659),_0x1b797c=_0xbe8f3a['newRange']['end']['getShiftedBy'](_0x569639);_0x1be456['push']({'start':_0x555fa0,'end':_0x1b797c,'groupId':_0x444955['id'],'type':'remove-context'});}else _0x5ef816='remove-only';}_0x1be456['push']({'start':_0xbe8f3a['newRange']['start'],'end':_0xbe8f3a['newRange']['end'],'groupId':_0x444955['id'],'type':_0x5ef816});}}}this['_insertMarkers'](_0x1be456);}['clearAllMarkers'](){const _0x20a7dd=T(this['context']);_0x20a7dd['model']['change'](_0x61d0d6=>{for(const _0x57254c of this['_markers']['keys']())_0x20a7dd['model']['markers']['get'](_0x57254c)&&_0x61d0d6['removeMarker'](_0x57254c);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){T(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){T(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x40253f){const _0x378f8f=T(this['context']),_0x40c3f9=_0x378f8f['model'],_0x37c182=_0x40253f['map'](_0x1cf70f=>this['_getMarkersDataForGroup'](_0x1cf70f))['flat']();_0x40c3f9['change'](_0x23477a=>{for(const _0xb5b88a of _0x37c182){const _0x1de0bb=_0x378f8f['model']['markers']['get'](_0xb5b88a['id']);if(_0x1de0bb){if('insert'===_0xb5b88a['type']){if(!_0xb5b88a['content'])continue;_0x40c3f9['insertContent'](_0xb5b88a['content']['asFragment']||null,_0x1de0bb['getRange']()['start']);}else'remove-text'!==_0xb5b88a['type']&&'remove-only'!==_0xb5b88a['type']||_0x40c3f9['deleteContent'](_0x40c3f9['createSelection'](_0x1de0bb['getRange']()));_0x23477a['removeMarker'](_0xb5b88a['id']),this['_markers']['delete'](_0xb5b88a['id']);}}});}['rejectChange'](_0x52dc4b){const _0x427518=T(this['context']),_0x1a7926=this['_getMarkersDataForGroup'](_0x52dc4b);_0x427518['model']['change'](_0x258bd8=>{for(const _0x27b9b5 of _0x1a7926)_0x258bd8['removeMarker'](_0x27b9b5['id']),this['_markers']['delete'](_0x27b9b5['id']);});}['getEditor'](){return T(this['context']);}['getMarkerElementForChange'](_0x5e8625){const _0x4d4d8b=Array['from'](this['_markers']['values']())['filter'](_0x2a606a=>_0x2a606a['groupId']===_0x5e8625);if(!_0x4d4d8b['length'])return null;const _0x423ae7=0x1===_0x4d4d8b['length']?_0x4d4d8b[0x0]:this['_sortMarkers'](_0x4d4d8b)[0x0],_0x43ee7e=T(this['context'])['model']['markers']['get'](_0x423ae7['id']);if(!_0x43ee7e)return null;return{'modelRange':_0x43ee7e['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x423ae7['id'])};}['getContentElementForChange'](_0x487e75){const _0x3ecd2d=Array['from'](this['_markers']['values']())['filter'](_0x54a280=>_0x54a280['groupId']===_0x487e75);if(!_0x3ecd2d['length'])return null;const _0x1bdfe8=0x1===_0x3ecd2d['length']?_0x3ecd2d[0x0]:this['_sortMarkers'](_0x3ecd2d)[0x0],_0x45b6a6=T(this['context']),_0x3ff4d3=_0x45b6a6['model']['markers']['get'](_0x1bdfe8['id']);if(!_0x3ff4d3)return null;const _0x2b6f9d=_0x3ff4d3['getRange'](),_0x35a4a1=_0x45b6a6['editing']['view']['getDomRoot']();if(!_0x35a4a1||!_0x2b6f9d)return null;let _0x25839a=_0x2b6f9d['start']['parent'];for(;_0x25839a['parent']&&'$root'!==_0x25839a['parent']['name'];)_0x25839a=_0x25839a['parent'];if(!_0x25839a||!_0x25839a['name'])return null;const _0x68b1b1=_0x35a4a1['querySelector']('[data-marker-id=\x22'+_0x1bdfe8['id']+'\x22]');if(!_0x68b1b1)return null;let _0x4f515=null;_0x45b6a6['model']['change'](_0x21728c=>{_0x4f515=_0x21728c['createDocumentFragment'](),_0x21728c['append'](_0x25839a['_clone'](!0x0),_0x4f515);});const _0x3f0094=_0x45b6a6['data']['toView'](_0x4f515)['getChild'](0x0);return _0x68b1b1['closest'](_0x3f0094['name']);}['reactivateMarkers'](_0x5b159c){const _0x1665e8=this['_getMarkersDataForGroup'](_0x5b159c);if(!_0x1665e8['length'])return;const _0x247bff=Array['from'](this['_activeMarkers'])['sort'](),_0x14cefb=Array['from'](new Set(_0x1665e8['map'](_0x15c75c=>_0x15c75c['id'])))['sort']();_0x247bff['join']('|')!==_0x14cefb['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x5b159c));}['setMarkersInElementAsActive'](_0x126504){const _0x5b78f5=this['_getMarkersDataForGroup'](_0x126504);if(!_0x5b78f5['length'])return;const _0x40fdb5=T(this['context']),_0xd044fc=new Set(_0x5b78f5['map'](_0x40ef91=>_0x40ef91['id'])),_0x525ecb=Array['from'](_0xd044fc['values']())['map'](_0x243bdf=>_0x40fdb5['model']['markers']['get'](_0x243bdf))['filter'](_0x1be063=>!!_0x1be063);_0xd044fc['forEach'](_0x45f2a3=>{this['_activeMarkers']['add'](_0x45f2a3);}),_0x40fdb5['model']['change'](()=>{_0x525ecb['forEach'](_0x519da4=>{_0x40fdb5['editing']['reconvertMarker'](_0x519da4);});});}['setAllMarkersAsInactive'](){const _0x1c534f=Array['from'](this['_activeMarkers']);if(!_0x1c534f['length'])return;this['_activeMarkers']['clear']();const _0x389973=T(this['context']),_0x309619=_0x1c534f['map'](_0xe9cbc6=>_0x389973['model']['markers']['get'](_0xe9cbc6))['filter'](_0x579009=>!!_0x579009);_0x389973['model']['change'](()=>{_0x309619['forEach'](_0x6a03e6=>{_0x389973['editing']['reconvertMarker'](_0x6a03e6);});});}['_getPositionLimitingRange'](_0x28121a,_0x4e7988,_0x3463c6='outside'){if(!_0x28121a)return null;let _0x21ebb4=_0x28121a['parent'];for(;_0x21ebb4&&_0x21ebb4['parent']&&'$root'!==_0x21ebb4['parent']['name']&&!_0x4e7988['model']['schema']['isLimit'](_0x21ebb4)&&!_0x4e7988['model']['schema']['isBlock'](_0x21ebb4);)_0x21ebb4=_0x21ebb4['parent'];if(!_0x21ebb4||!_0x21ebb4['name']||'$root'===_0x21ebb4['name'])return null;let _0x446040=null;return _0x4e7988['model']['change'](_0x2f029b=>{_0x446040='inside'===_0x3463c6?_0x2f029b['createRangeIn'](_0x21ebb4):_0x2f029b['createRangeOn'](_0x21ebb4);}),_0x446040;}['_validateMarkers'](_0x44b495,_0x57aa71){const _0x424461=Array['from'](this['_markers']['keys']()),_0x2da425=new Map();for(const _0x576d98 of _0x424461){const _0x12e3b7=_0x44b495['model']['markers']['get'](_0x576d98);if(!_0x12e3b7)continue;const _0x5d527f=_0x12e3b7['getStart']()['path'][0x0];_0x2da425['has'](_0x5d527f)||_0x2da425['set'](_0x5d527f,[]),_0x2da425['get'](_0x5d527f)['push'](_0x12e3b7);}const _0x327505=new Set();for(const _0x1966f9 of _0x44b495['model']['document']['differ']['getChanges']()){let _0x2ff346=-0x1,_0x221b27=null;if('insert'===_0x1966f9['type'])_0x221b27=new dt(_0x1966f9['position'],_0x1966f9['position']['getShiftedBy'](_0x1966f9['length'])),_0x2ff346=_0x1966f9['position']['path'][0x0];else{if('remove'!==_0x1966f9['type'])continue;_0x221b27=new dt(_0x1966f9['position']),_0x2ff346=_0x1966f9['position']['path'][0x0];}const _0x172488=_0x2da425['get'](_0x2ff346)||[];if(_0x172488['length']){for(const _0x136cd6 of _0x172488)if(_0x221b27['root']['rootName']===_0x136cd6['getRange']()['root']['rootName']&&('insert'!==_0x1966f9['type']||!_0x221b27['containsRange'](_0x136cd6['getRange']()))&&(_0x221b27['isIntersecting'](_0x136cd6['getRange']())||_0x221b27['start']['isTouching'](_0x136cd6['getRange']()['end'])||_0x221b27['end']['isTouching'](_0x136cd6['getRange']()['start']))){const _0x3dc428=this['_parseMarkerName'](_0x136cd6['name']);Array['from'](this['_markers']['values']())['filter'](_0x2c4a07=>_0x2c4a07['groupId']===_0x3dc428['groupId'])['forEach'](_0x174994=>_0x327505['add'](_0x174994['id']));}}}if(_0x327505['size']){for(const _0xadb7bf of _0x327505)_0x57aa71['removeMarker'](_0xadb7bf);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x2804fb){for(const {name:_0x288576,data:_0x400ff5}of _0x2804fb['model']['document']['differ']['getChangedMarkers']()){if(!_0x288576['startsWith'](Me))continue;const _0x78070a=_0x400ff5['oldRange'],_0x44fbce=_0x400ff5['newRange'],_0x48163c=_0x78070a&&'$graveyard'===_0x78070a['root']['rootName'],_0x3b7b9e=_0x44fbce&&'$graveyard'===_0x44fbce['root']['rootName'];if(_0x48163c&&_0x3b7b9e)continue;const _0xff77a6=this['_parseMarkerName'](_0x288576);this['_markers']['get'](_0x288576)&&(_0x3b7b9e||!_0x44fbce?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x288576,'changeId':_0xff77a6['groupId']}):_0x48163c&&_0x44fbce&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x288576,'changeId':_0xff77a6['groupId']}));}}['_parseMarkerName'](_0x3fd019){const _0x6fca92=_0x3fd019['split'](':'),_0x271e5e=(_0x6fca92[0x1]||'')['split']('_');return{'prefix':_0x6fca92[0x0],'groupId':_0x271e5e[0x0],'suffix':_0x271e5e[0x1]};}['_translateOperationToEditorContent'](_0x13a74d,_0x319815,_0x21e156){if('insert'===_0x13a74d['type']){const _0x277077=_0x13a74d;return new _0xa5baad(this['_changePosition'](_0x319815['concat'](_0x277077['position']['offset']),_0x21e156),_0x277077['nodes'],_0x277077['baseVersion']);}if('marker'===_0x13a74d['type']&&_0x13a74d['name']['startsWith']('$markedRemove')){const _0x50d945=_0x13a74d;return new _0xe48208(_0x50d945['name'],_0x50d945['oldRange'],this['_changeRange'](_0x50d945['newRange'],_0x319815['concat'](_0x50d945['newRange']['start']['offset']),_0x319815['concat'](_0x50d945['newRange']['end']['offset']),_0x21e156),_0x50d945['_markers'],_0x50d945['affectsData'],_0x50d945['baseVersion']);}return _0x13a74d;}['_groupAdjacentOperations'](_0x17ee4a){if(!_0x17ee4a['length'])return[];const _0x1d9fff=[];let _0x3ec136=0x0,_0xa1741d=0x0,_0x353818=[];for(let _0x47fb71=0x0;_0x47fb71<=_0x17ee4a['length'];_0x47fb71++){const _0x12c273=_0x17ee4a[_0x47fb71],_0x27f1a7=_0x17ee4a[_0x47fb71-0x1];!_0x12c273||_0x27f1a7&&!this['_getOperationEnd'](_0x27f1a7)['isTouching'](this['_getOperationStart'](_0x12c273))?(_0x1d9fff['push']({'operations':_0x353818,'operationsIsolated':_0x353818['map'](_0x5c17c2=>this['_shiftOperation'](_0x5c17c2['clone'](),-_0xa1741d)),'groupOffset':_0x3ec136}),_0x353818=_0x12c273?[_0x12c273]:[],_0xa1741d+=_0x3ec136,_0x3ec136=0x0):_0x353818['push'](_0x12c273),_0x12c273&&'insert'===_0x12c273['type']&&(_0x3ec136+=_0x12c273['howMany']);}return _0x1d9fff;}['_findAdjacentContextDistance'](_0xd2de95,_0x2fbea6,_0x2c545e,_0x617500=0x1){const _0xb0e362=new _0x2ce1de({'startPosition':_0xd2de95,'direction':_0x2fbea6});let _0x43d6e3=0x0;for(let _0x592905=0x0;_0x592905<_0x617500;_0x592905++){let _0xa9d01c=0x0,_0x34dafa=!0x1,_0x3e96c0='forward'===_0x2fbea6?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x23adbb}of _0xb0e362)if(_0x23adbb['is']('$textProxy')){const _0x5c3d29=_0x3e96c0['exec'](_0x23adbb['data']);if(_0x5c3d29&&_0x5c3d29['length']){if(_0xa9d01c+='forward'===_0x2fbea6?_0x5c3d29['index']+_0x5c3d29[0x0]['length']:_0x23adbb['data']['length']-_0x5c3d29['index'],_0x5c3d29[0x0]['length']!==_0x23adbb['data']['length'])break;_0x34dafa=!0x0,_0x3e96c0='forward'===_0x2fbea6?/^\w+/:/\w+$/;}else{if(_0x34dafa)break;_0xa9d01c+=_0x23adbb['offsetSize'];}}else{if(_0x23adbb['is']('element')){_0x2c545e['isInline'](_0x23adbb)&&!_0x34dafa&&(_0xa9d01c+=0x1);break;}}_0x43d6e3+=_0xa9d01c,_0xb0e362['jumpTo'](_0xd2de95['getShiftedBy']('forward'===_0x2fbea6?_0x43d6e3:-_0x43d6e3));}return _0x43d6e3;}['_getChangeContext'](_0x93451,_0x58beae){const _0x5af69e=T(this['context'])['model']['schema'],_0x5361d4=this['_findAdjacentContextDistance'](_0x93451,'backward',_0x5af69e,0x6),_0x15a545=this['_findAdjacentContextDistance'](_0x58beae,'forward',_0x5af69e,0x6),_0x3355d6=_0x93451['getShiftedBy'](-_0x5361d4),_0x18062d=_0x58beae['getShiftedBy'](_0x15a545);return{'start':_0x3355d6,'end':_0x18062d,'hasContentBefore':!_0x3355d6['isAtStart'],'hasContentAfter':!_0x18062d['isAtEnd']};}['_insertMarkers'](_0x55915b){const _0x2c0e52=this['context']['plugins']['get']('AIEditing'),_0x3bffa7=new Set();T(this['context'])['model']['change'](_0x3f2689=>{for(const _0x2863c4 of _0x55915b){const _0x49a9d6=''+Me+_0x2863c4['type']+':'+_0x2863c4['groupId']+'_'+_0x2c0e52['_nextDataId'](_0x3bffa7);this['_markers']['set'](_0x49a9d6,{'id':_0x49a9d6,'groupId':_0x2863c4['groupId'],'type':_0x2863c4['type'],'content':_0x2863c4['content']}),_0x3f2689['addMarker'](_0x49a9d6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3f2689['createRange'](_0x2863c4['start'],_0x2863c4['end'])});}});}['_createGetContextFn'](_0x5a1a79,_0x52b7b9,_0x45b07c){let _0x122869='';return()=>{if(!_0x122869){const _0x4dc3f0=_0x52b7b9['toView'](_0x5a1a79,{'showSuggestionHighlights':!0x0});let _0x442017=_0x4dc3f0['getChild'](0x0);if(_0x442017['is']('containerElement')||(_0x442017=_0x4dc3f0),!_0x442017)return'';let _0x4b594a=!0x1;const _0xe91678=[];for(const _0x4406da of _0x442017['getChildren']())_0x4406da['is']('element','span')&&_0x4406da['hasClass']('ck-ai_review-marker_context-end')&&(_0x4b594a=!0x1),_0x4b594a&&_0xe91678['push'](_0x4406da),_0x4406da['is']('element','span')&&_0x4406da['hasClass']('ck-ai_review-marker_context-start')&&(_0x4b594a=!0x0);_0x442017['_removeChildren'](0x0,_0x442017['childCount']),_0x45b07c?.['ellipsisBefore']&&_0x442017['_appendChild']('…'),_0x442017['_appendChild'](_0xe91678),_0x45b07c?.['ellipsisAfter']&&_0x442017['_appendChild']('…');const _0x5b9a57=_0x52b7b9['htmlProcessor']['domConverter']['viewToDom'](_0x4dc3f0),_0x727b74=_0x52b7b9['htmlProcessor']['htmlWriter']['getHtml'](_0x5b9a57);_0x122869=_0x727b74;}return _0x122869;};}['_createGetContentFn'](_0x129cb8,_0x281fa6){let _0x9c89e2='';return()=>(_0x9c89e2||(_0x9c89e2=_0x281fa6['stringify'](_0x129cb8,{'showSuggestionHighlights':!0x0})),_0x9c89e2);}['_createGetContentUsingDataIdFn'](_0xf45708,_0x2b3e90,_0xe3e7c6){let _0x2d984c='';return()=>{if(!_0x2d984c){const _0x53545b=_0xe3e7c6['toView'](new bt(_0xf45708)),_0x3416be=_0xe3e7c6['htmlProcessor']['domConverter']['viewToDom'](_0x53545b)['querySelector']('[data-id=\x22'+_0x2b3e90+'\x22]');_0x2d984c=_0x3416be?.['outerHTML']||'';}return _0x2d984c;};}['_findMarkerElement'](_0x4f720d,_0x14f994=0x5){let _0x3f744d=_0x4f720d,_0xbbfd2e=null;for(let _0x1a3e5c=0x0;_0x1a3e5c<_0x14f994&&_0x3f744d;_0x1a3e5c++){if(!_0x3f744d['className']){_0x3f744d=_0x3f744d['parentElement'];continue;}if(!(''+_0x3f744d['className'])['includes']('ck-ai_review-marker_')){_0x3f744d=_0x3f744d['parentElement'];continue;}if(!_0x3f744d['getAttribute']('data-marker-id'))break;_0xbbfd2e=_0x3f744d;break;}return _0xbbfd2e;}['_findMarkerElementById'](_0x1ba944){const _0x3ca142=T(this['context']),_0x564fd1=_0x3ca142['model']['markers']['get'](_0x1ba944);return _0x564fd1?_0x189b8b(_0x3ca142['editing'],_0x564fd1):null;}['_getMarkersDataForGroup'](_0x1283d2){return Array['from'](this['_markers']['values']())['filter'](_0x2488d0=>_0x2488d0['groupId']===_0x1283d2);}['_getOperationStart'](_0x160149){return'insert'===_0x160149['type']?_0x160149['position']:_0x160149['newRange']['start'];}['_getOperationEnd'](_0x448699,_0x1c6f38=!0x1){return'insert'===_0x448699['type']?_0x1c6f38?_0x448699['position']:_0x448699['position']['getShiftedBy'](_0x448699['howMany']):_0x448699['newRange']['end'];}['_shiftOperation'](_0xcfeaaf,_0x3895f2){return'insert'===_0xcfeaaf['type']?_0xcfeaaf['position']=_0xcfeaaf['position']['getShiftedBy'](_0x3895f2):'marker'===_0xcfeaaf['type']&&_0xcfeaaf['newRange']&&(_0xcfeaaf['newRange']=new dt(_0xcfeaaf['newRange']['start']['getShiftedBy'](_0x3895f2),_0xcfeaaf['newRange']['end']['getShiftedBy'](_0x3895f2))),_0xcfeaaf;}['_changeOperationOwnerDocument'](_0x567055,_0x5495fc){'insert'===_0x567055['type']?_0x567055['position']=this['_changePositionOwnerDocument'](_0x567055['position'],_0x5495fc):'marker'===_0x567055['type']&&_0x567055['newRange']&&(_0x567055['newRange']=this['_changeRangeOwnerDocument'](_0x567055['newRange'],_0x5495fc));}['_changePositionOwnerDocument'](_0x129d7e,_0x4c46f4){return new vt(_0x4c46f4,_0x129d7e['path']);}['_changeRangeOwnerDocument'](_0x2905d4,_0x54522b){return new dt(this['_changePositionOwnerDocument'](_0x2905d4['start'],_0x54522b),this['_changePositionOwnerDocument'](_0x2905d4['end'],_0x54522b));}['_changePosition'](_0x5d8ffc,_0x307b90){return new vt(_0x307b90,[..._0x5d8ffc]);}['_changeRange'](_0xe547b5,_0xa977a7,_0x951616,_0x26dccf){return new dt(this['_changePosition'](_0xa977a7,_0x26dccf),this['_changePosition'](_0x951616,_0x26dccf));}['_sortMarkers'](_0x4e2a2e){const _0x197da8=_0xdf4f27=>{switch(_0xdf4f27){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x4e2a2e['sort']((_0x112d71,_0x5dc6d1)=>_0x197da8(_0x112d71['type'])-_0x197da8(_0x5dc6d1['type']));}['_hasSameTopLevelElement'](_0x244464,_0x3dfa50){const _0x47381d=_0x244464['getChild'](0x0),_0x27e8d9=_0x3dfa50['getChild'](0x0);return!(!_0x47381d||!_0x27e8d9)&&((!_0x47381d['is']('element')||!_0x27e8d9['is']('element')||_0x47381d['name']===_0x27e8d9['name'])&&!(_0x47381d['is']('element')&&!_0x27e8d9['is']('element')||!_0x47381d['is']('element')&&_0x27e8d9['is']('element')));}['_haveSingleTopLevelElement'](_0x4fc8c3){return 0x1===_0x4fc8c3['childCount'];}['_haveOnlyInlineContent'](_0x422e7e,_0x17c29a){for(const _0x4b633e of _0x422e7e['getChildren']())if(_0x4b633e['is']('element')&&!_0x17c29a['isInline'](_0x4b633e))return!0x1;return!0x0;}['_upsertDataId'](_0x3c7414,_0x545f4e){let _0x442e46=_0x3c7414['getAttribute'](nt);return _0x442e46||(_0x442e46=_0x545f4e(),_0x3c7414['_setAttribute'](nt,_0x442e46)),_0x442e46;}}class Ws extends _0x186953(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x5b0000,contentNew:_0x1cc7f4,contentInitial:_0x5d410c,documentVersion:_0x456c5e}){super(),this['id']=_0x5b0000,this['contentNew']=_0x1cc7f4,this['contentInitial']=_0x5d410c,this['documentVersion']=_0x456c5e;}}class Xs extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x238361,_0x117beb,_0x3c06f4){super(),this['id']=_0x238361,this['parent']=_0x3c06f4,this['_data']=_0x117beb,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 Rr extends ts(){['id']=_0x2ced3c();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x56ccef,_0x355a2a,_0x5b30da,_0xa1f86a,_0x288ad5){super(),this['_sourceCheck']=_0x355a2a,this['_documentData']=_0x56ccef,this['_aiConnector']=_0x5b30da,this['_reviewParams']=_0xa1f86a,this['_reviewArgs']=_0x288ad5,this['on']('change:status',(_0x56106f,_0xafdbb9,_0x501832)=>{'aborted'==_0x501832&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x501832,'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'](_0x53bf72=>'pending'===_0x53bf72['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x3ecfa5){this['_documentData']=_0x3ecfa5;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x25a335=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x2f1d56 of _0x25a335)'unmodified'!==_0x2f1d56['data']['operation']&&('error'!==_0x2f1d56['data']['operation']?'review-metadata'!==_0x2f1d56['event']?this['_addReviewCheckResult'](_0x2f1d56['data']['dataId'],_0x2f1d56['data']['textDelta']):this['callId']=_0x2f1d56['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x5ece17){this['_currentError']=_0x5ece17,_0x5ece17 instanceof Error&&_0x5ece17['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'](_0x4540b7,_0x1900a2){const _0xcbd3c5=this['_results']['get'](_0x4540b7);if(!_0xcbd3c5)return;if(0x0===_0x1900a2['length'])return;const _0x2e8194=[];_0x1900a2['forEach']((_0x329d28,_0x4a283d)=>{const _0x2a0ea8=new Xs(_0xcbd3c5['id']+'-'+_0x4a283d,_0x329d28,_0xcbd3c5);_0x2a0ea8['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x2a0ea8,'status':_0x2a0ea8['status']});}),_0x2a0ea8['on']('change:isActivated',()=>{_0x2a0ea8['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x2a0ea8}):this['fire']('reviewCheckResultDeactivated',{'change':_0x2a0ea8});}),this['_changes']['push'](_0x2a0ea8),_0x2e8194['push'](_0x2a0ea8);}),this['fire']('reviewCheckResultReady',{'changes':_0x2e8194,'result':_0xcbd3c5,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x54dd14){const _0x5a7d90=this['_changes']['find'](_0x12d3ed=>_0x12d3ed['id']===_0x54dd14);return!(!_0x5a7d90||'pending'!==_0x5a7d90['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x2cb8a2=>!0x0===_0x2cb8a2['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x229476=>'pending'===_0x229476['status']);}['getChangeById'](_0x982627){return this['_changes']['find'](_0x124633=>_0x124633['id']===_0x982627);}['markAllChangesAsAccepted'](){for(const _0x2c1847 of this['_changes'])'pending'===_0x2c1847['status']&&(_0x2c1847['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x18de7f){const _0x117458=this['_changes']['find'](_0x555042=>_0x555042['id']===_0x18de7f);_0x117458&&'pending'===_0x117458['status']&&(_0x117458['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x45bd53){const _0x170097=this['_changes']['find'](_0x47a22b=>_0x47a22b['id']===_0x45bd53);_0x170097&&'pending'===_0x170097['status']&&(_0x170097['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x493edf){const _0x54b24b=this['_changes']['find'](_0x5aa34a=>_0x5aa34a['id']===_0x493edf);_0x54b24b&&'pending'===_0x54b24b['status']&&(_0x54b24b['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x3d9574){const _0x1494e7=this['_changes']['find'](_0x40fec3=>_0x40fec3['id']===_0x3d9574);_0x1494e7&&'outdated'===_0x1494e7['status']&&(_0x1494e7['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x4bfe9b){this['_changes']['filter'](_0x25f140=>_0x25f140['isActivated']&&_0x25f140['id']!==_0x4bfe9b)['forEach'](_0x5b1974=>{_0x5b1974['isActivated']=!0x1;});const _0x4b3c3e=this['_changes']['find'](_0x147c55=>_0x147c55['id']===_0x4bfe9b);_0x4b3c3e&&'pending'===_0x4b3c3e['status']&&(_0x4b3c3e['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0xf7306f=>_0xf7306f['isActivated'])['forEach'](_0x43b87d=>{_0x43b87d['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x386442){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0xf11d49;if(_0x386442){const _0x53df59=this['_changes']['find'](_0x258b10=>_0x258b10['id']===_0x386442);if(_0x53df59&&_0x53df59['isRated'])return;_0x53df59&&(_0xf11d49=_0x53df59['parent']['id'],_0x53df59['isRated']=!0x0);}const _0xa1a934={'positiveCount':this['_changes']['filter'](_0x2e9a55=>'accepted'===_0x2e9a55['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0xa1a934,this['callId'],_0xf11d49);}['_addReviewCheckResult'](_0x2d9cdb,_0x43771e){const _0x63e5b2=this['_documentData']['elements']['get'](_0x2d9cdb);if(!_0x63e5b2)return;const _0x5bd22b=_0x63e5b2['getContent']();if(_0x5bd22b===_0x43771e)return;const _0x810ce3=new Ws({'id':_0x2d9cdb,'contentInitial':_0x5bd22b,'contentNew':_0x43771e,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x810ce3['id'],_0x810ce3),this['fire']('reviewCheckResultAdded',{'result':_0x810ce3,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x57d64b=>'pending'===_0x57d64b['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x55263a=>'pending'===_0x55263a['status'])['length']&&(this['status']='finished'));}}class me extends Rr{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x1da271=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x225ba3=0x0;_0x225ba3<this['_reviewParams']['length'];_0x225ba3++){if(!this['_reviewParams'][_0x225ba3]||!this['_sourceCheck']['options'][_0x225ba3])continue;const _0x421d8f=this['_sourceCheck']['options'][_0x225ba3],_0x1b744e=_0x421d8f['data']?.['find'](_0x2a3339=>_0x2a3339['id']===this['_reviewParams'][_0x225ba3]);_0x1b744e&&_0x1da271['push'](_0x1b744e['label']);}return _0x1da271['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x175b07,_0x427319,_0x2c243c){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x427319,_0x175b07,_0x2c243c);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ae extends _0x42547c{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[tt];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x483923,_0x2af78e)=>{const _0x5d2397=this['_aiReviewCheckList']['getCheckById'](_0x2af78e['id']);if(_0x5d2397){this['_onReviewCheckRun'](_0x2af78e),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x2af78e,_0x5d2397),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x5b252c,_0x3c0763)=>{switch(_0x3c0763['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x3c0763);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new _0xec7a4c('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0xec7a4c('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x3c0763['status']&&'error-chunk'!==_0x3c0763['status']&&'error-general'!==_0x3c0763['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x3108ab,_0x3f3eeb)=>{if(!this['_currentReviewCheckRun'])throw new _0xec7a4c('ai-review-mode-no-current-check-run',this);const _0x49109a=this['_diffContent'](_0x3f3eeb['result']['contentInitial'],_0x3f3eeb['result']['contentNew']);_0x3f3eeb['source']['addResultChanges'](_0x3f3eeb['result']['id'],_0x49109a);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x23edcb,_0x51a618)=>{for(const _0x4f4427 of _0x51a618['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x4f4427);this['_markChangePositionInEditorContent'](_0x51a618['changes'],_0x51a618['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x23ac58,_0x2dfbf0)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x2dfbf0['change']['id'],_0x2dfbf0['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x5065e8,_0x231a3e)=>{this['_onReviewCheckResultActivated'](_0x231a3e);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x2c6c46){_0x2c6c46 instanceof Error&&_0x2c6c46['message']['includes']('ai-request-aborted')||(_0x2c6c46 instanceof _0xec7a4c?this['_logError'](_0x2c6c46):this['_logError'](new _0xec7a4c('ai-review-mode-check-run-failed',this,void 0x0,_0x2c6c46)));}}else this['_logError'](new _0xec7a4c('ai-review-mode-source-check-not-found',this,{'checkId':_0x2af78e['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x559223=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x559223['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x559223['map'](_0x5c356c=>_0x5c356c['id']));const _0x6ba227=this['_currentReviewCheckRun'];_0x6ba227['markAllChangesAsAccepted'](),_0x6ba227['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x5e1e6e,_0x165ea4)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x165ea4['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x165ea4['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x165ea4['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x165ea4['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x3f99e4,_0x345b01)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x345b01['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x345b01['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x345b01['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x345b01['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x52150a,_0x39c375)=>{this['_onActivateChange'](_0x39c375);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x176e5c,_0x170a01)=>{this['_onDeactivateChange'](_0x170a01);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x201ebe,_0x1d0f1d)=>{this['_onChangeMarkerClicked'](_0x201ebe,_0x1d0f1d);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x42d68f,_0x49b3ff)=>{this['_onChangeMarkerHovered'](_0x42d68f,_0x49b3ff);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0xd824e2,_0x4a1134)=>{this['_onChangeMarkerRemoved'](_0xd824e2,_0x4a1134);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x939eb5,_0x23e8af)=>{this['_onChangeMarkerRestored'](_0x939eb5,_0x23e8af);});}['_createReviewCheckRun'](_0xecb341,_0x5f224f){return new me(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5f224f,this['_aiConnector'],_0xecb341['params'],_0xecb341['args']);}['_onChangeMarkerRemoved'](_0x556e84,_0xb8eb29){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0xb8eb29['changeId']);}['_onChangeMarkerRestored'](_0x82db99,_0x1fa980){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x1fa980['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x436dc7=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x436dc7&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x549e79=this['_aiReviewCoreEditing']['getEditor']();_0x549e79&&_0x549e79['editing']['view']['change'](_0x23afc4=>{const _0x5bd530=_0x549e79['editing']['view']['document']['getRoot']();_0x23afc4['removeClass']('ck-ai_review-diff',_0x5bd530),_0x23afc4['removeClass']('ck-ai_review-highlights',_0x5bd530),_0x23afc4['removeClass']('ck-ai-translate-mode-content',_0x5bd530);});}['_getTranslationWithDefault'](_0x4768a0,_0x18a6e8){const _0xb5e310=i(this['context']['locale'],_0x4768a0);return _0xb5e310===_0x4768a0?_0x18a6e8:_0xb5e310;}['_logError'](_0x1a4aaf,_0x32ad4a=!0x1){_0x4f2fe2(_0x1a4aaf['message']),_0x32ad4a||(_0x1a4aaf['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x2d73e0){if('content'===this['_changeActivationSource']){const _0x749f0b=this['_aiReviewCoreUi']['getChangeElement'](_0x2d73e0);_0x749f0b&&_0x121c65(_0x749f0b['closest']('.ck-ai_review__check-run-result')||_0x749f0b);}else{if('panel'===this['_changeActivationSource']){const _0x58e44d=this['_getChangeContentElement'](_0x2d73e0);if(!_0x58e44d)return;_0x527ffd({'target':_0x58e44d,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const he=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'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':'tone','commandId':'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'}]}]}];class vr{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x33429a){this['id']=_0x33429a['id'],this['commandId']=_0x33429a['commandId'],this['title']=_0x33429a['title'],this['description']=_0x33429a['description'],this['isParameterized']=_0x33429a['isParameterized'],this['useArgs']=_0x33429a['useArgs'],this['options']=_0x33429a['options'],this['args']=_0x33429a['args'];}}class Js extends ts(){['_checks']=[];['setupChecks'](_0x5a67ab){this['_checks']=_0x5a67ab['map'](_0x5af724=>new vr(_0x5af724));}get['checks'](){return this['_checks'];}['getCheckById'](_0x19c567){return this['checks']['find'](_0x3e8f6c=>_0x3e8f6c['id']===_0x19c567);}['removeCheckById'](_0xad18bd){this['_checks']=this['_checks']['filter'](_0x180907=>_0x180907['id']!==_0xad18bd);}}class de extends vr{['_models']=[];['_defaultModel']=null;constructor(_0x5bae92,_0x48bc22,_0x5db044){super(_0x5bae92),this['_models']=_0x48bc22,this['_defaultModel']=_0x5db044;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class ue extends vr{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x5389ba,_0x4a6ee5,_0x5236c7){super(_0x5389ba),this['prompt']=_0x5389ba['prompt'],this['model']=_0x5389ba['model'],this['model']?this['_defaultModel']=_0x4a6ee5['find'](_0x17f330=>_0x17f330['id']===this['model'])||null:this['_defaultModel']=_0x5236c7;}get['defaultModel'](){return this['_defaultModel'];}}class ce extends Js{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x40ded9,_0x4381d3,_0x40fb49){super(),this['_allModels']=_0x40ded9,this['_recommendedModels']=_0x4381d3,this['_defaultModel']=_0x40fb49;}['setupChecks'](_0xf6a06d){this['_checks']=_0xf6a06d['map'](_0x3ce49b=>!0x0===_0x3ce49b['isExtra']?new ue(_0x3ce49b,this['_allModels'],this['_defaultModel']):'custom'===_0x3ce49b['id']?new de(_0x3ce49b,this['_recommendedModels'],this['_defaultModel']):new vr(_0x3ce49b));}}class le extends Rr{['_prompt'];['_model'];constructor(_0x19995e,_0x5a5ef1,_0x22cbc7,_0x2c2a9f,_0x263a4a){super(_0x22cbc7,_0x2c2a9f,_0x263a4a),this['_prompt']=_0x19995e,this['_model']=_0x5a5ef1;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0xace9d6,_0x23d1d7,_0x8b0c22){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x23d1d7,_0xace9d6,_0x8b0c22);}}class ve extends le{get['subTitle'](){return'';}set['prompt'](_0x4d28d9){this['_prompt']=_0x4d28d9;}set['model'](_0x3831a1){this['_model']=_0x3831a1;}}class se extends ae{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x1736df){super(_0x1736df),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',he['map'](_0x4c6a52=>_0x4c6a52['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x599145,_0x37b0da)=>{this['_isDiffOn']=_0x37b0da['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x51d5b2,_0x1eb326){return _0x51d5b2['isCustom']?new le(_0x51d5b2['args']['prompt'],_0x51d5b2['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x1eb326,this['_aiConnector']):_0x1eb326['isExtra']?new ve(_0x1eb326['prompt'],_0x1eb326['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x1eb326,this['_aiConnector']):new me(this['_aiReviewCoreEditing']['getDocumentData'](),_0x1eb326,this['_aiConnector'],_0x51d5b2['params'],_0x51d5b2['args']);}['_onReviewCheckResultActivated'](_0x36cab0){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x36cab0['change']['id']),this['_scrollToChange'](_0x36cab0['change']['id']);const _0x5ce96e=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x36cab0['change']['id']);if(!_0x5ce96e)return;const _0x5f3d91=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x36cab0['change'],()=>_0x5ce96e['getElement'](),void 0x0,'click',_0x5f3d91?.['editing']?.['view']?.['getDomRoot'](),_0x5f3d91?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x36cab0['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x447515){this['_currentReviewCheckRun']&&'click'===_0x447515['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x447515['id']));}['_onDeactivateChange'](_0x4b97ab){this['_currentReviewCheckRun']&&'balloon'===_0x4b97ab['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x46670c,_0x5b7aa8){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5b7aa8['changeId']);const _0x273e81=this['_currentReviewCheckRun']['getChangeById'](_0x5b7aa8['changeId']);if(!_0x273e81)return;const _0x2b3753=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x273e81,_0x5b7aa8['markerElement'],_0x5b7aa8['domEvent'],'click',_0x2b3753?.['editing']?.['view']?.['getDomRoot'](),_0x2b3753?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x524f76,_0x58adaa){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x7dc56d=this['_currentReviewCheckRun']['getChangeById'](_0x58adaa['changeId']);if(!_0x7dc56d)return;const _0x4ecacb=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x7dc56d,_0x58adaa['markerElement'],_0x58adaa['domEvent'],'hover',_0x4ecacb?.['editing']?.['view']?.['getDomRoot'](),_0x4ecacb?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x1d857f){const _0x37de0f=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1d857f);return _0x37de0f?_0x37de0f['getElement']():null;}['_markChangePositionInEditorContent'](_0x3e8857,_0x4c1e2b){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x3e8857,_0x4c1e2b);}['_diffContent'](_0x1c11ae,_0x22d536){return this['_aiReviewCoreEditing']['diffContent'](_0x1c11ae,_0x22d536);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x447ec2){const _0x3687bb=this['_aiReviewCoreEditing']['getEditor']();_0x447ec2?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x3687bb&&_0x3687bb['editing']['view']['change'](_0x3d8228=>{const _0x2dc236=_0x3687bb['editing']['view']['document']['getRoot']();for(const _0x51cfc9 of _0x2dc236['getClassNames']())_0x51cfc9['startsWith']('ck-ai_review-')&&_0x3d8228['removeClass'](_0x51cfc9,_0x2dc236);_0x3d8228['addClass'](_0x447ec2?'ck-ai_review-diff':'ck-ai_review-highlights',_0x2dc236);});}async['_getChecksList'](){const _0x309f98=[...he,...this['_getExtraChecks']()],_0x438b28=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x438b28,_0x309f98);let _0x2d8174=_0x309f98;this['_hasDefaultAvailableCommands']||(_0x2d8174=_0x438b28['map'](_0x5467ee=>_0x309f98['find'](_0x53b1c9=>_0x53b1c9['id']===_0x5467ee))['filter'](_0x40a0bc=>!!_0x40a0bc)),_0x2d8174=_0x2d8174['map'](_0x29c619=>_0x29c619['isExtra']?_0x29c619:this['_translateReviewCheck'](_0x29c619));const _0x16236c=_0x2d8174['some'](_0x228e94=>_0x228e94['isExtra']||'custom'===_0x228e94['id']);let _0x56671d=[],_0x4b1681=[],_0x142f2b=null;if(_0x16236c){const _0x4c5821=await this['_getModels']();_0x56671d=_0x4c5821['all'],_0x4b1681=_0x4c5821['recommended'],_0x142f2b=_0x4c5821['default'];}const _0x3f6ba0=new ce(_0x56671d,_0x4b1681,_0x142f2b);return _0x3f6ba0['setupChecks'](_0x2d8174),_0x16236c&&this['_filterChecksWithMissingModel'](_0x3f6ba0),_0x3f6ba0;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x23123e=>({'id':_0x23123e['id'],'commandId':_0x23123e['id'],'title':_0x23123e['label'],'description':_0x23123e['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x23123e['prompt'],'model':_0x23123e['model']}));}['_logErrorForNonExistentChecks'](_0xabbaaa,_0x5be4bc){const _0x53f9f9=_0xabbaaa['filter'](_0x1a5639=>!_0x5be4bc['some'](_0x2b526a=>_0x2b526a['id']===_0x1a5639));_0x53f9f9['length']&&this['_logError'](new _0xec7a4c('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x53f9f9['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x385cb3=new et({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x385cb3['getAll'](),'recommended':await _0x385cb3['getAvailableModels'](),'default':await _0x385cb3['getDefault']()};}catch(_0x111cb9){return this['_logError'](new _0xec7a4c('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x111cb9)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x140315){const _0x532953='AI_REVIEW_CHECK_'+_0x140315['id']['toUpperCase']()['replaceAll']('-','_'),_0x38546c={..._0x140315,'title':this['_getTranslationWithDefault'](_0x532953+'_TITLE',_0x140315['title']),'description':this['_getTranslationWithDefault'](_0x532953+'_DESCRIPTION',_0x140315['description'])};return _0x140315['options']&&(_0x38546c['options']=_0x140315['options']['map'](_0x107901=>({..._0x107901,'label':this['_getTranslationWithDefault'](_0x532953+'_OPTIONS_LABEL',_0x107901['label']||''),'data':_0x107901['data']?_0x107901['data']['map'](_0x4b782f=>({..._0x4b782f,'label':this['_getTranslationWithDefault'](_0x532953+'_OPTIONS_DATA_'+_0x4b782f['id']['toUpperCase'](),_0x4b782f['label'])})):void 0x0}))),_0x38546c;}['_filterChecksWithMissingModel'](_0x1f43cf){const _0x29cd6b=[];_0x1f43cf['checks']['forEach'](_0x1c16c7=>{(_0x1c16c7 instanceof ue&&!_0x1c16c7['defaultModel']||_0x1c16c7 instanceof de&&!_0x1c16c7['models']['length'])&&_0x29cd6b['push'](_0x1c16c7['id']);}),_0x29cd6b['length']&&_0x29cd6b['forEach'](_0x25673a=>{_0x1f43cf['removeCheckById'](_0x25673a),this['_logError'](new _0xec7a4c('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x25673a}),!0x0);});}}class Ya extends _0x42547c{static get['requires'](){return[se,re,oe];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class jr extends vr{get['apiId'](){return'translate';}}class be extends Js{['setupChecks'](_0x13d5ae){this['_checks']=_0x13d5ae['map'](_0x257324=>new jr(_0x257324));}}class je extends me{['_title'];constructor(_0x409de7,_0x39df2f,_0x3ef86e,_0x1d183c,_0x557bfd,_0x36d672){super(_0x409de7,_0x39df2f,_0x3ef86e,_0x557bfd,_0x36d672),this['_title']=_0x1d183c;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ae{static get['pluginName'](){return'AITranslateController';}constructor(_0x1d49e7){super(_0x1d49e7),this['context']['config']['define']('ai.translate.languages',[{'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'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x89bb04,_0x33ba6d){return new je(this['_aiReviewCoreEditing']['getDocumentData'](),_0x33ba6d,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x89bb04['params'],_0x89bb04['args']);}['_onReviewCheckResultActivated'](_0x5598d3){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x5598d3['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x5598d3['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x2d63d5){this['_currentReviewCheckRun']&&('hover'===_0x2d63d5['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x2d63d5['id'])),'click'===_0x2d63d5['uiInteraction']&&this['_scrollToChange'](_0x2d63d5['id']));}['_onDeactivateChange'](_0x3ff892){this['_currentReviewCheckRun']&&'panel'===_0x3ff892['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x199f67,_0x23b3b6){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x23b3b6['changeId']),this['_scrollToChange'](_0x23b3b6['changeId']));}['_onChangeMarkerHovered'](_0x35a5c5,_0x3ace0d){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3ace0d['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x3ace0d['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0xcae8c8){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0xcae8c8);}['_markChangePositionInEditorContent'](_0x45a91e,_0x58cfd8){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x45a91e,_0x58cfd8);}['_diffContent'](_0x350d3e,_0x11c289){return this['_aiReviewCoreEditing']['diffContent'](_0x350d3e,_0x11c289,!0x0);}['_onReviewCheckRun'](){const _0x5d4e9a=this['_aiReviewCoreEditing']['getEditor']();_0x5d4e9a&&_0x5d4e9a['editing']['view']['change'](_0x560c95=>{const _0x25e065=_0x5d4e9a['editing']['view']['document']['getRoot']();for(const _0xebbbf9 of _0x25e065['getClassNames']())(_0xebbbf9['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0xebbbf9)&&_0x560c95['removeClass'](_0xebbbf9,_0x25e065);_0x560c95['addClass']('ck-ai-translate-mode-content',_0x25e065);});}async['_getChecksList'](){const _0x407abd=[],_0x12cb62=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x560bfa of _0x12cb62)_0x407abd['push']({'title':_0x560bfa['label'],'id':_0x560bfa['id'],'commandId':_0x560bfa['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x560bfa['id']}});const _0x3b8127=new be();return _0x3b8127['setupChecks'](this['_translateChecks'](_0x407abd)),_0x3b8127;}['_translateChecks'](_0x2decff){return _0x2decff['map'](_0x429992=>{const _0x2d6ba8='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x429992['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x429992,'title':this['_getTranslationWithDefault'](_0x2d6ba8,_0x429992['title'])};});}}class Le extends Re{constructor(_0x32fc42,_0x3267da){super(_0x32fc42,_0x3267da),this['on']('set:isLoading',(_0x430abe,_0x4314cb,_0xfcdb8b)=>{_0xfcdb8b&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x53f7f3,_0x3e13dd,_0x36533e)=>{_0x36533e&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x3a0835=super['_createAcceptAllButtonView']();return _0x3a0835['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x3a0835;}['_createExitReviewButtonView'](){const _0xa6fc26=super['_createExitReviewButtonView']();return _0xa6fc26['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0xa6fc26;}}class Se extends pe{['_setupTemplate'](){const _0xb83e2d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0xb83e2d['if']('isVisible','ck-hidden',_0x4377d8=>!_0x4377d8)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0xb83e2d['if']('isVisible','ck-hidden',_0x4fc8f3=>!_0x4fc8f3)]},'children':this['_checkViews']}]});}}class tr extends Ie{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x3100ab=this['context']['locale'],_0x42ccf3=new _0x3d4bc4(_0x3100ab,{'label':i(_0x3100ab,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x51d188,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x3cf0cb=new _e(_0x3100ab,{'header':_0x42ccf3,'list':new Se(_0x3100ab),'results':new Le(_0x3100ab,{'generalErrorText':i(_0x3100ab,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new Te(_0x3100ab,{'headerText':i(_0x3100ab,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0x3100ab,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x3100ab,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x3cf0cb['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x3cf0cb;}['registerTab'](){const _0x911b15=this['context']['plugins']['get']('AITabs');_0x911b15['view']['on']('activateTab',(_0x520775,_0x1c727d)=>{'translate'===_0x1c727d?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x911b15['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x51d188,'order':0x0,'content':this['_mainView']});}}class $a extends _0x42547c{static get['requires'](){return[rr,tr,oe];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,K as AIAdapter,$n as AIAssistant,n as AIAssistantUI,H as AIBalloon,Va as AIChat,q as AIChatController,G as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,Ga as AIChatShortcuts,z as AIChatUI,tt as AIConnector,D as AIEditing,Fa as AIEditorIntegration,Qt as AIQuickActionType,Wa as AIQuickActions,ii as AIQuickActionsUI,er as AIRequestError,vr as AIReviewCheck,Ws as AIReviewCheckResult,Rr as AIReviewCheckRun,Ya as AIReviewMode,ae as AIReviewModeController,oe as AIReviewModeEditing,re as AIReviewModeUI,it as AITabs,ar as AITextAdapter,Pt as AIToggleButtonUI,$a as AITranslate,rr as AITranslateController,tr as AITranslateUI,Xn as AWSTextAdapter,Qn as OpenAITextAdapter,E as ShowAIAssistantCommand,Bi as ToggleAICommand,Hs as createResizeButton,qn as getDefaultAICommands};