@ckeditor/ckeditor5-ai 48.8.1-alpha.4 → 49.0.0-alpha.0

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 (388) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/aiactions/aiactions.d.ts +109 -73
  3. package/dist/aiactions/model/aiactionsinteraction.d.ts +58 -50
  4. package/dist/aiactions/model/aiactionsreply.d.ts +18 -11
  5. package/dist/aiassistant/adapters/aiadapter.d.ts +48 -48
  6. package/dist/aiassistant/adapters/aitextadapter.d.ts +133 -133
  7. package/dist/aiassistant/adapters/awstextadapter.d.ts +42 -42
  8. package/dist/aiassistant/adapters/openaitextadapter.d.ts +184 -184
  9. package/dist/aiassistant/aiassistant.d.ts +425 -436
  10. package/dist/aiassistant/aiassistantediting.d.ts +51 -51
  11. package/dist/aiassistant/aiassistantui.d.ts +50 -53
  12. package/dist/aiassistant/legacyerrors.d.ts +0 -4
  13. package/dist/aiassistant/ui/aiassistantcontroller.d.ts +106 -105
  14. package/dist/aiassistant/ui/form/aiformcontentarea.d.ts +43 -43
  15. package/dist/aiassistant/ui/form/aiformerrorview.d.ts +19 -19
  16. package/dist/aiassistant/ui/form/aiformpromptview.d.ts +38 -38
  17. package/dist/aiassistant/ui/form/aiformtoolbarview.d.ts +50 -50
  18. package/dist/aiassistant/ui/form/aiformview.d.ts +121 -121
  19. package/dist/aiassistant/ui/form/aihistorylistitemview.d.ts +13 -13
  20. package/dist/aiassistant/ui/form/aihistorylistview.d.ts +27 -27
  21. package/dist/aiassistant/ui/form/prompthistory.d.ts +15 -15
  22. package/dist/aiassistant/ui/showaiassistantcommand.d.ts +35 -35
  23. package/dist/aiassistant/utils/common-translations.d.ts +6 -6
  24. package/dist/aiassistant/utils/normalizecommandsconfig.d.ts +9 -9
  25. package/dist/aiballoon/aiballoon.d.ts +85 -89
  26. package/dist/aiballoon/ui/aiballoondisclaimerview.d.ts +17 -0
  27. package/dist/aiballoon/ui/aiballoontoolbarview.d.ts +56 -0
  28. package/dist/aiballoon/ui/aiballoonview.d.ts +74 -27
  29. package/dist/aiballoon/utils/contentwidth.d.ts +1 -0
  30. package/dist/aichat/aichat.d.ts +88 -87
  31. package/dist/aichat/aichatballoon.d.ts +88 -79
  32. package/dist/aichat/aichatcontroller.d.ts +284 -258
  33. package/dist/aichat/aichatui.d.ts +352 -328
  34. package/dist/aichat/model/aichatcontext.d.ts +655 -654
  35. package/dist/aichat/model/aichatconversation.d.ts +270 -269
  36. package/dist/aichat/model/aichatinteraction.d.ts +45 -49
  37. package/dist/aichat/ui/aichatballoonview.d.ts +73 -101
  38. package/dist/aichat/ui/aichatcontrolsview.d.ts +121 -125
  39. package/dist/aichat/ui/aichatfeedview.d.ts +145 -128
  40. package/dist/aichat/ui/aichatview.d.ts +42 -40
  41. package/dist/aichat/ui/controls/aichatchipsoverflowmanager.d.ts +73 -63
  42. package/dist/aichat/ui/controls/aichatcontextitembuttonview.d.ts +41 -41
  43. package/dist/aichat/ui/controls/aichatcontextpanelurlinputview.d.ts +79 -79
  44. package/dist/aichat/ui/controls/aichatcontextpanelview.d.ts +110 -100
  45. package/dist/aichat/ui/controls/aichatdropzoneview.d.ts +30 -0
  46. package/dist/aichat/ui/controls/aichatpromptcapabilitiesview.d.ts +72 -81
  47. package/dist/aichat/ui/controls/aichatpromptinputview.d.ts +50 -44
  48. package/dist/aichat/ui/controls/aichatpromptsuggestionslistview.d.ts +13 -13
  49. package/dist/aichat/ui/controls/resources/aichatcontextresourceslistview.d.ts +44 -44
  50. package/dist/aichat/ui/controls/resources/aichatcontextresourcesview.d.ts +52 -52
  51. package/dist/aichat/ui/controls/resources/aichatresourcelistitemview.d.ts +57 -56
  52. package/dist/aichat/ui/controls/resources/aichatresourcesballoonview.d.ts +104 -100
  53. package/dist/aichat/ui/controls/resources/aichatresourcessearchinputview.d.ts +53 -53
  54. package/dist/aichat/ui/feed/aichatfeedcontextchipsview.d.ts +22 -22
  55. package/dist/aichat/ui/feed/aichatfeedcustomelementview.d.ts +30 -34
  56. package/dist/aichat/ui/feed/aichatfeederroritemview.d.ts +30 -33
  57. package/dist/aichat/ui/feed/aichatfeedinteractionheaderview.d.ts +24 -24
  58. package/dist/aichat/ui/feed/aichatfeeditemview.d.ts +39 -39
  59. package/dist/aichat/ui/feed/aichatfeedreplyitemview.d.ts +40 -40
  60. package/dist/aichat/ui/feed/aichatfeedsuggestionitemactionsview.d.ts +62 -63
  61. package/dist/aichat/ui/feed/aichatfeedsuggestionitemview.d.ts +87 -82
  62. package/dist/aichat/ui/feed/aichatfeedusermessageitem.d.ts +33 -33
  63. package/dist/aichat/utils/eventnames.d.ts +8 -4
  64. package/dist/aichat/utils/parsesingleurl.d.ts +1 -0
  65. package/dist/aichat/utils/promisequeue.d.ts +26 -25
  66. package/dist/aichat/utils/readdatatransferfiles.d.ts +14 -0
  67. package/dist/aichat/utils/resolvepaste.d.ts +71 -0
  68. package/dist/aichathistory/aichathistory.d.ts +26 -26
  69. package/dist/aichathistory/aichathistorycontroller.d.ts +36 -35
  70. package/dist/aichathistory/aichathistoryui.d.ts +80 -89
  71. package/dist/aichathistory/model/aichathistoryconversations.d.ts +95 -102
  72. package/dist/aichathistory/model/aichathistoryitem.d.ts +52 -53
  73. package/dist/aichathistory/ui/aichathistorylistitemview.d.ts +41 -40
  74. package/dist/aichathistory/ui/aichathistorylistview.d.ts +28 -28
  75. package/dist/aichathistory/ui/aichathistorysectionlistview.d.ts +16 -16
  76. package/dist/aichathistory/ui/aichathistoryview.d.ts +33 -33
  77. package/dist/aichatshortcuts/aichatshortcuts.d.ts +295 -295
  78. package/dist/aichatshortcuts/ui/aichatshortcutsview.d.ts +24 -18
  79. package/dist/aichatshortcuts/ui/aichatshortcutview.d.ts +18 -18
  80. package/dist/aiconfig.d.ts +362 -227
  81. package/dist/aicore/aiconnector.d.ts +428 -334
  82. package/dist/aicore/aicore.d.ts +53 -0
  83. package/dist/aicore/aiediting.d.ts +103 -88
  84. package/dist/aicore/aierrorreporter.d.ts +101 -0
  85. package/dist/aicore/aigateway.d.ts +135 -0
  86. package/dist/aicore/errors/aicoreerror.d.ts +67 -0
  87. package/dist/aicore/errors/geterrorcode.d.ts +17 -0
  88. package/dist/aicore/errors/isaborterror.d.ts +12 -0
  89. package/dist/aicore/errors/normalizeerror.d.ts +23 -0
  90. package/dist/aicore/model/aicapabilities.d.ts +69 -53
  91. package/dist/aicore/model/aicontext.d.ts +116 -77
  92. package/dist/aicore/model/aicontextlibrary.d.ts +71 -0
  93. package/dist/aicore/model/aicontextref.d.ts +37 -0
  94. package/dist/aicore/model/aidefaultcontext.d.ts +83 -0
  95. package/dist/aicore/model/aieditorroot.d.ts +26 -0
  96. package/dist/aicore/model/aiinteraction.d.ts +162 -162
  97. package/dist/aicore/model/aimodels.d.ts +80 -76
  98. package/dist/aicore/model/aireply.d.ts +129 -121
  99. package/dist/aicore/model/airunresult.d.ts +43 -0
  100. package/dist/aicore/model/airunsinglerootresult.d.ts +104 -0
  101. package/dist/aicore/pipeline/airesponseapplier.d.ts +284 -296
  102. package/dist/aicore/pipeline/airesponseparser.d.ts +24 -23
  103. package/dist/aicore/ui/aidisclaimerview.d.ts +12 -13
  104. package/dist/aicore/ui/aidotsloader.d.ts +18 -0
  105. package/dist/aicore/ui/aiheaderview.d.ts +27 -28
  106. package/dist/aicore/ui/aimodelselectorview.d.ts +151 -0
  107. package/dist/aicore/ui/aiseparatorview.d.ts +25 -0
  108. package/dist/aicore/ui/aiskeleton.d.ts +43 -32
  109. package/dist/aicore/ui/aispinner.d.ts +10 -11
  110. package/dist/aicore/ui/suggestioncontainer/aiminitoolbarview.d.ts +55 -56
  111. package/dist/aicore/ui/suggestioncontainer/aisuggestionbodyview.d.ts +95 -80
  112. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontainerview.d.ts +45 -46
  113. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartheaderview.d.ts +67 -37
  114. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.d.ts +21 -31
  115. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.d.ts +46 -21
  116. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.d.ts +91 -58
  117. package/dist/aicore/ui/suggestioncontainer/aisuggestionheaderview.d.ts +26 -35
  118. package/dist/aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.d.ts +30 -27
  119. package/dist/aicore/ui/suggestioncontainer/aiwebsourcesview.d.ts +24 -24
  120. package/dist/aicore/utils/abortabletimeout.d.ts +11 -11
  121. package/dist/aicore/utils/aitabids.d.ts +11 -0
  122. package/dist/aicore/utils/builddocumentsuggestionsmap.d.ts +30 -0
  123. package/dist/aicore/utils/buttonclasses.d.ts +17 -8
  124. package/dist/aicore/utils/cleanupstreamingartifacts.d.ts +12 -0
  125. package/dist/aicore/utils/common-translations.d.ts +6 -6
  126. package/dist/aicore/utils/contentparttranslationkeys.d.ts +27 -0
  127. package/dist/aicore/utils/createresizebutton.d.ts +8 -9
  128. package/dist/aicore/utils/createstartconversationbutton.d.ts +7 -8
  129. package/dist/aicore/utils/documentposition.d.ts +37 -37
  130. package/dist/aicore/utils/documentrange.d.ts +41 -41
  131. package/dist/aicore/utils/eventnames.d.ts +5 -5
  132. package/dist/aicore/utils/geteditorconfig.d.ts +107 -0
  133. package/dist/aicore/utils/geteditorsfromcontext.d.ts +18 -0
  134. package/dist/aicore/utils/getmodeldisplaymode.d.ts +21 -0
  135. package/dist/aicore/utils/getoperationsfordocumentsuggestions.d.ts +20 -0
  136. package/dist/aicore/utils/getrootinfo.d.ts +45 -0
  137. package/dist/aicore/utils/getsuggestionpartsfromreply.d.ts +24 -18
  138. package/dist/aicore/utils/htmlparser.d.ts +23 -16
  139. package/dist/aicore/utils/htmlstreamer.d.ts +79 -79
  140. package/dist/aicore/utils/inlineroot.d.ts +1 -0
  141. package/dist/aicore/utils/istrackchangesenabled.d.ts +23 -0
  142. package/dist/aicore/utils/markoperationsasai.d.ts +21 -0
  143. package/dist/aicore/utils/replyactions.d.ts +13 -0
  144. package/dist/aicore/utils/scrollmanager.d.ts +24 -23
  145. package/dist/aicore/utils/showaitab.d.ts +1 -0
  146. package/dist/aidocumentprocessing/aidocumentprocessinggateway.d.ts +110 -0
  147. package/dist/aidocumentprocessing/model/aidocumentprocessingrunresult.d.ts +19 -0
  148. package/dist/aieditorintegration/aieditorintegration.d.ts +42 -32
  149. package/dist/aieditorintegration/aitogglebutton/aitogglebuttonui.d.ts +33 -34
  150. package/dist/aieditorintegration/aitogglebutton/toggleaicommand.d.ts +12 -12
  151. package/dist/aiquickactions/aiquickactions.d.ts +303 -252
  152. package/dist/aiquickactions/aiquickactionscommand.d.ts +10 -10
  153. package/dist/aiquickactions/aiquickactionsediting.d.ts +22 -22
  154. package/dist/aiquickactions/aiquickactionsui.d.ts +131 -124
  155. package/dist/aiquickactions/ui/aiquickactionsbuttoncreator.d.ts +57 -57
  156. package/dist/aiquickactions/ui/aiquickactionsdropdowncontentview.d.ts +45 -45
  157. package/dist/aiquickactions/ui/aiquickactionsdropdowncreator.d.ts +59 -59
  158. package/dist/aiquickactions/ui/aiquickactionsfilteredlistview.d.ts +0 -4
  159. package/dist/aiquickactions/ui/balloon/aiactionsballoonview.d.ts +73 -136
  160. package/dist/aiquickactions/ui/dropdownmenubuttonwithhighlightview.d.ts +24 -24
  161. package/dist/aireviewcore/aireviewcorecheckregistry.d.ts +37 -0
  162. package/dist/aireviewcore/aireviewcorecontroller.d.ts +48 -23
  163. package/dist/aireviewcore/aireviewcoreediting.d.ts +296 -224
  164. package/dist/aireviewcore/aireviewcoreui.d.ts +109 -85
  165. package/dist/aireviewcore/model/aichecksinglerootresult.d.ts +22 -0
  166. package/dist/aireviewcore/model/aireviewcheck.d.ts +49 -49
  167. package/dist/aireviewcore/model/aireviewchecklist.d.ts +29 -28
  168. package/dist/aireviewcore/model/aireviewcheckresult.d.ts +36 -35
  169. package/dist/aireviewcore/model/aireviewcheckresultchange.d.ts +62 -50
  170. package/dist/aireviewcore/model/aireviewcheckrun.d.ts +174 -147
  171. package/dist/aireviewcore/model/aireviewsystemcheckrun.d.ts +16 -16
  172. package/dist/aireviewcore/types.d.ts +30 -24
  173. package/dist/aireviewcore/ui/aireviewcoreabstractchecklistview.d.ts +50 -0
  174. package/dist/aireviewcore/ui/aireviewcorechecklistitemresultview.d.ts +53 -76
  175. package/dist/aireviewcore/ui/aireviewcorecompletereviewdropdown.d.ts +29 -0
  176. package/dist/aireviewcore/ui/aireviewcorecustomcheckview.d.ts +38 -56
  177. package/dist/aireviewcore/ui/aireviewcorefinishreviewbuttonview.d.ts +8 -9
  178. package/dist/aireviewcore/ui/aireviewcoregeneralerrorview.d.ts +20 -20
  179. package/dist/aireviewcore/ui/aireviewcorenavigationpanelview.d.ts +169 -0
  180. package/dist/aireviewcore/ui/aireviewcoreprogressbarview.d.ts +32 -0
  181. package/dist/aireviewcore/ui/aireviewcorepromptinputview.d.ts +25 -25
  182. package/dist/aireviewcore/ui/aireviewcorereviewchecklistview.d.ts +42 -23
  183. package/dist/aireviewcore/ui/aireviewcorereviewcommandlistitemview.d.ts +49 -39
  184. package/dist/aireviewcore/ui/aireviewcorereviewcompletedview.d.ts +13 -14
  185. package/dist/aireviewcore/ui/aireviewcoreuicheckresultsview.d.ts +114 -87
  186. package/dist/aireviewcore/ui/aireviewcoreview.d.ts +54 -50
  187. package/dist/aireviewcore/ui/changeevents.d.ts +49 -0
  188. package/dist/aireviewcore/ui/form/aireviewcoreformdropdown.d.ts +16 -16
  189. package/dist/aireviewcore/ui/form/aireviewcoreformmanager.d.ts +12 -12
  190. package/dist/aireviewcore/utils/openleaveconfirmationdialog.d.ts +21 -0
  191. package/dist/aireviewcore/utils/reviewcontentpart.d.ts +25 -0
  192. package/dist/aireviewmode/aireviewcheckdefinitions.d.ts +12 -12
  193. package/dist/aireviewmode/aireviewgateway.d.ts +172 -0
  194. package/dist/aireviewmode/aireviewmode.d.ts +260 -126
  195. package/dist/aireviewmode/aireviewmodecheckregistry.d.ts +46 -0
  196. package/dist/aireviewmode/aireviewmodecontroller.d.ts +24 -17
  197. package/dist/aireviewmode/aireviewmodeui.d.ts +17 -17
  198. package/dist/aireviewmode/model/aireviewcheckcustom.d.ts +16 -16
  199. package/dist/aireviewmode/model/aireviewcheckextra.d.ts +35 -30
  200. package/dist/aireviewmode/model/aireviewcustomcheckrun.d.ts +18 -17
  201. package/dist/aireviewmode/model/aireviewextracheckrun.d.ts +15 -15
  202. package/dist/aireviewmode/model/aireviewmodechecklist.d.ts +22 -18
  203. package/dist/aireviewmode/ui/aireviewmodecheckresultsview.d.ts +41 -0
  204. package/dist/aisdk/dataidassigner.d.ts +20 -0
  205. package/dist/aisdk/documentchanges.d.ts +165 -0
  206. package/dist/aisdk/documentchangesutils.d.ts +15 -0
  207. package/dist/aisdk/documentcompare.d.ts +171 -0
  208. package/dist/aisdk/documentcompareutils.d.ts +16 -0
  209. package/dist/aisdk/documentsnapshot.d.ts +48 -0
  210. package/dist/aisdk/extractselectionfromhtml.d.ts +27 -0
  211. package/dist/aisdk/validateoperations.d.ts +43 -0
  212. package/dist/aitabs/aitabs.d.ts +104 -84
  213. package/dist/aitabs/aitabsmainview.d.ts +70 -46
  214. package/dist/aitabs/tabs/aitabsview.d.ts +191 -188
  215. package/dist/aitranslate/aitranslate.d.ts +165 -129
  216. package/dist/aitranslate/aitranslatecheckregistry.d.ts +27 -0
  217. package/dist/aitranslate/aitranslatecontroller.d.ts +18 -15
  218. package/dist/aitranslate/aitranslategateway.d.ts +89 -0
  219. package/dist/aitranslate/aitranslateui.d.ts +17 -18
  220. package/dist/aitranslate/model/aitranslatecheck.d.ts +12 -12
  221. package/dist/aitranslate/model/aitranslatechecklist.d.ts +11 -11
  222. package/dist/aitranslate/model/aitranslatecheckrun.d.ts +24 -23
  223. package/dist/aitranslate/ui/aitranslatechecklistview.d.ts +28 -7
  224. package/dist/aitranslate/ui/aitranslatecheckresultsview.d.ts +11 -11
  225. package/dist/augmentation.d.ts +79 -63
  226. package/dist/errors.d.ts +0 -4
  227. package/dist/errorsmap.d.ts +5 -5
  228. package/dist/index-content.css +0 -96
  229. package/dist/index-editor.css +3948 -3291
  230. package/dist/index.css +3959 -3307
  231. package/dist/index.d.ts +83 -59
  232. package/dist/index.js +19 -6
  233. package/dist/translations/af.js +1 -1
  234. package/dist/translations/af.umd.js +1 -1
  235. package/dist/translations/ar.js +1 -1
  236. package/dist/translations/ar.umd.js +1 -1
  237. package/dist/translations/ast.js +1 -1
  238. package/dist/translations/ast.umd.js +1 -1
  239. package/dist/translations/az.js +1 -1
  240. package/dist/translations/az.umd.js +1 -1
  241. package/dist/translations/be.js +1 -1
  242. package/dist/translations/be.umd.js +1 -1
  243. package/dist/translations/bg.js +1 -1
  244. package/dist/translations/bg.umd.js +1 -1
  245. package/dist/translations/bn.js +1 -1
  246. package/dist/translations/bn.umd.js +1 -1
  247. package/dist/translations/bs.js +1 -1
  248. package/dist/translations/bs.umd.js +1 -1
  249. package/dist/translations/ca.js +1 -1
  250. package/dist/translations/ca.umd.js +1 -1
  251. package/dist/translations/cs.js +1 -1
  252. package/dist/translations/cs.umd.js +1 -1
  253. package/dist/translations/da.js +1 -1
  254. package/dist/translations/da.umd.js +1 -1
  255. package/dist/translations/de-ch.js +1 -1
  256. package/dist/translations/de-ch.umd.js +1 -1
  257. package/dist/translations/de.js +1 -1
  258. package/dist/translations/de.umd.js +1 -1
  259. package/dist/translations/el.js +1 -1
  260. package/dist/translations/el.umd.js +1 -1
  261. package/dist/translations/en-au.js +1 -1
  262. package/dist/translations/en-au.umd.js +1 -1
  263. package/dist/translations/en-gb.js +1 -1
  264. package/dist/translations/en-gb.umd.js +1 -1
  265. package/dist/translations/en.js +1 -1
  266. package/dist/translations/en.umd.js +1 -1
  267. package/dist/translations/eo.js +1 -1
  268. package/dist/translations/eo.umd.js +1 -1
  269. package/dist/translations/es-co.js +1 -1
  270. package/dist/translations/es-co.umd.js +1 -1
  271. package/dist/translations/es.js +1 -1
  272. package/dist/translations/es.umd.js +1 -1
  273. package/dist/translations/et.js +1 -1
  274. package/dist/translations/et.umd.js +1 -1
  275. package/dist/translations/eu.js +1 -1
  276. package/dist/translations/eu.umd.js +1 -1
  277. package/dist/translations/fa.js +1 -1
  278. package/dist/translations/fa.umd.js +1 -1
  279. package/dist/translations/fi.js +1 -1
  280. package/dist/translations/fi.umd.js +1 -1
  281. package/dist/translations/fr.js +1 -1
  282. package/dist/translations/fr.umd.js +1 -1
  283. package/dist/translations/gl.js +1 -1
  284. package/dist/translations/gl.umd.js +1 -1
  285. package/dist/translations/gu.js +1 -1
  286. package/dist/translations/gu.umd.js +1 -1
  287. package/dist/translations/he.js +1 -1
  288. package/dist/translations/he.umd.js +1 -1
  289. package/dist/translations/hi.js +1 -1
  290. package/dist/translations/hi.umd.js +1 -1
  291. package/dist/translations/hr.js +1 -1
  292. package/dist/translations/hr.umd.js +1 -1
  293. package/dist/translations/hu.js +1 -1
  294. package/dist/translations/hu.umd.js +1 -1
  295. package/dist/translations/hy.js +1 -1
  296. package/dist/translations/hy.umd.js +1 -1
  297. package/dist/translations/id.js +1 -1
  298. package/dist/translations/id.umd.js +1 -1
  299. package/dist/translations/it.js +1 -1
  300. package/dist/translations/it.umd.js +1 -1
  301. package/dist/translations/ja.js +1 -1
  302. package/dist/translations/ja.umd.js +1 -1
  303. package/dist/translations/jv.js +1 -1
  304. package/dist/translations/jv.umd.js +1 -1
  305. package/dist/translations/kk.js +1 -1
  306. package/dist/translations/kk.umd.js +1 -1
  307. package/dist/translations/km.js +1 -1
  308. package/dist/translations/km.umd.js +1 -1
  309. package/dist/translations/kn.js +1 -1
  310. package/dist/translations/kn.umd.js +1 -1
  311. package/dist/translations/ko.js +1 -1
  312. package/dist/translations/ko.umd.js +1 -1
  313. package/dist/translations/ku.js +1 -1
  314. package/dist/translations/ku.umd.js +1 -1
  315. package/dist/translations/lt.js +1 -1
  316. package/dist/translations/lt.umd.js +1 -1
  317. package/dist/translations/lv.js +1 -1
  318. package/dist/translations/lv.umd.js +1 -1
  319. package/dist/translations/ms.js +1 -1
  320. package/dist/translations/ms.umd.js +1 -1
  321. package/dist/translations/nb.js +1 -1
  322. package/dist/translations/nb.umd.js +1 -1
  323. package/dist/translations/ne.js +1 -1
  324. package/dist/translations/ne.umd.js +1 -1
  325. package/dist/translations/nl.js +1 -1
  326. package/dist/translations/nl.umd.js +1 -1
  327. package/dist/translations/no.js +1 -1
  328. package/dist/translations/no.umd.js +1 -1
  329. package/dist/translations/oc.js +1 -1
  330. package/dist/translations/oc.umd.js +1 -1
  331. package/dist/translations/pl.js +1 -1
  332. package/dist/translations/pl.umd.js +1 -1
  333. package/dist/translations/pt-br.js +1 -1
  334. package/dist/translations/pt-br.umd.js +1 -1
  335. package/dist/translations/pt.js +1 -1
  336. package/dist/translations/pt.umd.js +1 -1
  337. package/dist/translations/ro.js +1 -1
  338. package/dist/translations/ro.umd.js +1 -1
  339. package/dist/translations/ru.js +1 -1
  340. package/dist/translations/ru.umd.js +1 -1
  341. package/dist/translations/si.js +1 -1
  342. package/dist/translations/si.umd.js +1 -1
  343. package/dist/translations/sk.js +1 -1
  344. package/dist/translations/sk.umd.js +1 -1
  345. package/dist/translations/sl.js +1 -1
  346. package/dist/translations/sl.umd.js +1 -1
  347. package/dist/translations/sq.js +1 -1
  348. package/dist/translations/sq.umd.js +1 -1
  349. package/dist/translations/sr-latn.js +1 -1
  350. package/dist/translations/sr-latn.umd.js +1 -1
  351. package/dist/translations/sr.js +1 -1
  352. package/dist/translations/sr.umd.js +1 -1
  353. package/dist/translations/sv.js +1 -1
  354. package/dist/translations/sv.umd.js +1 -1
  355. package/dist/translations/th.js +1 -1
  356. package/dist/translations/th.umd.js +1 -1
  357. package/dist/translations/ti.js +1 -1
  358. package/dist/translations/ti.umd.js +1 -1
  359. package/dist/translations/tk.js +1 -1
  360. package/dist/translations/tk.umd.js +1 -1
  361. package/dist/translations/tr.js +1 -1
  362. package/dist/translations/tr.umd.js +1 -1
  363. package/dist/translations/tt.js +1 -1
  364. package/dist/translations/tt.umd.js +1 -1
  365. package/dist/translations/ug.js +1 -1
  366. package/dist/translations/ug.umd.js +1 -1
  367. package/dist/translations/uk.js +1 -1
  368. package/dist/translations/uk.umd.js +1 -1
  369. package/dist/translations/ur.js +1 -1
  370. package/dist/translations/ur.umd.js +1 -1
  371. package/dist/translations/uz.js +1 -1
  372. package/dist/translations/uz.umd.js +1 -1
  373. package/dist/translations/vi.js +1 -1
  374. package/dist/translations/vi.umd.js +1 -1
  375. package/dist/translations/zh-cn.js +1 -1
  376. package/dist/translations/zh-cn.umd.js +1 -1
  377. package/dist/translations/zh.js +1 -1
  378. package/dist/translations/zh.umd.js +1 -1
  379. package/package.json +32 -13
  380. package/dist/aichat/ui/controls/aichatcontrolsloaderview.d.ts +0 -12
  381. package/dist/aicore/ui/suggestioncontainer/aisuggestionloaderview.d.ts +0 -16
  382. package/dist/aicore/utils/geteditorfromcontext.d.ts +0 -19
  383. package/dist/aicore/utils/getoperationsfromreply.d.ts +0 -24
  384. package/dist/aiquickactions/ui/balloon/aiactionsballoondisclaimerview.d.ts +0 -17
  385. package/dist/aiquickactions/ui/balloon/aiactionsballoontoolbarview.d.ts +0 -37
  386. package/dist/aireviewcore/ui/aireviewcoreballoonsuggestionview.d.ts +0 -38
  387. package/dist/aitabs/tabs/tabbuttonview.d.ts +0 -47
  388. package/dist/aitabs/tabs/tabpanelview.d.ts +0 -44
package/dist/index.js CHANGED
@@ -20,9 +20,22 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x53fc9f,Command as _0xae9ca1,ContextPlugin as _0x3cc0e4,Editor as _0x3cd9d5}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5c3d91,IconCheck as _0x489882,IconError as _0x2b1be1,IconSubmit as _0xcffe77,IconAIHistory as _0x33c29f,IconMagicWand as _0x94995e,IconRobotPencil as _0x4a06bf,IconMaximize as _0x55d900,IconMinimize as _0x37bd1f,IconShowChangesOn as _0x5a2923,IconShowChangesOff as _0x1aad04,IconDocument as _0x3745a0,IconBoxWithCross as _0x5d4966,IconBoxWithCheck as _0x3a31e4,IconBoxWithMarker as _0x561f7b,IconInfo as _0x467df0,IconWeb as _0x43e506,IconCancel as _0x5777e9,IconSelection as _0x283729,IconFileUpload as _0xc6d689,IconLink as _0x4ad8e3,IconBulb as _0x23256e,IconAI as _0x5ddbf5,IconPreviousArrow as _0x3d9913,IconDocumentOutline as _0x3649ad,IconLoupe as _0x3fa2b6,IconPaperClip as _0x1bd4f2,IconBrowseFiles as _0x23ddc8,IconDropdownArrow as _0x3edc81,IconStop as _0xdb5f07,IconPlus as _0x40c6c9,IconAIChat as _0x24024f,IconPin as _0x321a25,IconThreeHorizontalDots as _0x3c4511,IconAIReview as _0xc8a0b9,IconAITranslate as _0x31db4a,IconAIAskAI as _0x485aef,IconThumbUp as _0x4dcf71,IconThumbDown as _0x102fde,IconChevronDown as _0x3a15b7,IconChevronUp as _0x2ca3b2,IconAIQuickActions as _0x50cf41,IconAIChatCommands as _0x4bc996,IconAIImproveWriting as _0x1f8e78,IconAIContinueWriting as _0x1c6602,IconAIGrammarCheck as _0x1be793,IconAIAdjustLength as _0x3c09f1,IconAIChangeTone as _0x2ad21d,IconAIOther as _0x19a5b3,IconRefresh as tt,IconNextArrow as et,IconOutdated as it,IconEye as st,IconEyeCrossedOut as nt,IconChevronRight as rt}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as ot,CKEditorError as at,ObservableMixin as ht,global as ct,isVisible as lt,Rect as ut,Collection as dt,FocusTracker as _t,KeystrokeHandler as It,first as At,logWarning as gt,logError as Ct,toArray as mt,version as pt,EmitterMixin as Et,scrollViewportToShowTarget as wt,insertToPriorityArray as Tt,scrollAncestorsToShowTarget as ft,ResizeObserver as St,_isMotionReduced as Rt,getConstrainedViewportRect as bt,DomEmitterMixin as Ot}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as kt,ButtonView as vt,View as Nt,SpinnerView as yt,IconView as xt,AutocompleteView as Lt,ListView as Dt,ListItemGroupView as Vt,ListItemView as Pt,ButtonLabelView as Ht,FocusCycler as Mt,createLabeledTextarea as Ut,Dialog as Bt,createDropdown as Gt,addMenuToDropdown as Ft,MenuBarMenuView as Kt,MenuBarMenuListItemButtonView as Wt,DialogViewPosition as Yt,MenuBarMenuListView as $t,MenuBarMenuListItemView as qt,BodyCollection as Qt,BalloonPanelView as Xt,clickOutsideHandler as zt,addListToDropdown as jt,UIModel as Jt,submitHandler as Zt,LabeledFieldView as te,createLabeledInputText as _0x22cbcd,FormHeaderView as _0x4c3dd1,HighlightedTextView as _0x378b1f,ViewCollection as _0x3127bc,FileDialogButtonView as _0x29e35a,InputTextView as _0x5ecc48,SearchTextView as _0x29d55b,ListItemButtonView as _0x5c328f,ButtonLabelWithHighlightView as _0x153bc3,DropdownMenuPanelPositioningFunctions as _0x17daa9,BalloonToolbar as _0x53d0e4,FormRowView as _0x6cbb85,TextareaView as _0x23272a}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x2226b6,ClipboardMarkersUtils as _0xa6f429}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x44e9df,ViewDataTransfer as _0x104872,ViewUpcastWriter as _0x4349bc,Matcher as _0x5e058b,_DetachOperation as _0x42f63b,_insertIntoModelNodeList as _0x967622,_removeFromModelNodeList as _0x5b03c0,ModelRange as _0x5d6ed6,transformOperationSets as _0x2d44f8,ViewDowncastWriter as _0x56ae7f,ModelDocumentFragment as _0xd8720b,ModelPosition as _0x554d31,ModelTreeWalker as _0x5ae065,MarkerOperation as _0x1cab42,InsertOperation as _0x32f2fc}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x491084,escape as _0x2d9792,cloneDeep as _0x4d8886,throttle as _0x134eed,debounce as _0xc92ffd,escapeRegExp as _0x5933ee}from'es-toolkit/compat';import{createParser as _0x24589f}from'eventsource-parser';import{CloudServices as _0x2fe476}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x57287f}from'htmlparser2';import{isTag as _0x5778d8,findOne as _0x10d1dd,getParent as _0x586047,findAll as _0x11b699,removeElement as _0x8926a6,prepend as _0x238c6d,prependChild as _0x3d3041,appendChild as _0x2b0d30,append as _0x1d7e6a,find as _0x18d527,isComment as _0x51bc24,replaceElement as _0x1a09b2,getChildren as _0x31b03f,textContent as _0x5408c8}from'domutils';import ti from'dom-serializer';import{Document as _0x617866,Element as _0x1f4caa,Text as _0x54c8f4,cloneNode as _0x252747,isDocument as _0x19438c,isText as _0x4de3bc,NodeWithChildren as _0x43458d}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x5ed1bb,MarkdownGfmMdToHtml as _0x589477}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x3905b6 from'rehype-sanitize';import{fixElementSuggestionRange as _0x331213,DocumentCompare as _0x490f88,DATA_ID_MODEL_ATTRIBUTE as _0x34af8c,ConfirmMixin as _0x9830fd,getAllMarkersDomElementsSorted as _0x3ba44f,SuggestionsConversion as _0x3fefa0,DATA_ID_VIEW_ATTRIBUTE as _0x1053a9,getMarkerDomElement as _0x3d8b1f}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x53d52c from'morphdom';import{diffArrays as _0x235976}from'diff';const wi='_ungrouppedCommands';function Ti(_0x7edb9,_0x165f85){const _0x42c677=(0x0,_0x165f85['t'])('Other');return _0x7edb9['length']?'groupId'in _0x7edb9[0x0]?_0x7edb9:[{'groupId':wi,'groupLabel':_0x42c677,'order':0x1/0x0,'commands':_0x7edb9}]:[{'groupId':wi,'groupLabel':_0x42c677,'order':0x1/0x0,'commands':[]}];}const fi=globalThis['DataTransfer'],Si='ai-ui';class AIAssistantEditing extends _0x53fc9f{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x5b8fa0}=this,_0x5d09be=['ck-fake-ai-selection'];_0x5b8fa0['config']['get']('ai.assistant.useTheme')&&_0x5d09be['push']('ck-ai-assistant-ui_theme'),_0x5b8fa0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Si,'view':{'classes':_0x5d09be,'priority':0xc}}),_0x5b8fa0['conversion']['for']('editingDowncast')['markerToElement']({'model':Si,'view':(_0x1649c6,{writer:_0x437ffa})=>{if(!_0x1649c6['markerRange']['isCollapsed'])return null;const _0x3549d0=_0x437ffa['createUIElement']('span');return _0x437ffa['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3549d0),_0x3549d0;}});}['afterInit'](){!async function(_0xd189db){const _0x1de8a6=_0xe1ecb8([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]),_0x154d92=0x3dffc4e1,_0x4dfc8e=0x3df84e61^_0x154d92,_0x175cf0=window[_0xe1ecb8([0x44,0x61,0x74,0x65])][_0xe1ecb8([0x6e,0x6f,0x77])](),_0x5cc8bd=_0xd189db[_0xe1ecb8([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x18e589=new window[(_0xe1ecb8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x148532=>{_0x5cc8bd[_0xe1ecb8([0x6f,0x6e,0x63,0x65])](_0xe1ecb8([0x72,0x65,0x61,0x64,0x79]),_0x148532);}),_0x676e5a={[_0xe1ecb8([0x6b,0x74,0x79])]:_0xe1ecb8([0x45,0x43]),[_0xe1ecb8([0x75,0x73,0x65])]:_0xe1ecb8([0x73,0x69,0x67]),[_0xe1ecb8([0x63,0x72,0x76])]:_0xe1ecb8([0x50,0x2d,0x32,0x35,0x36]),[_0xe1ecb8([0x78])]:_0xe1ecb8([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]),[_0xe1ecb8([0x79])]:_0xe1ecb8([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]),[_0xe1ecb8([0x61,0x6c,0x67])]:_0xe1ecb8([0x45,0x53,0x32,0x35,0x36])},_0x8ab6ae=_0x5cc8bd[_0xe1ecb8([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0xe1ecb8([0x67,0x65,0x74])](_0xe1ecb8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5cb334(){let _0x47953a,_0x4a0613=null,_0xfdeae8=null;try{if(_0x8ab6ae==_0xe1ecb8([0x47,0x50,0x4c]))return _0xe1ecb8([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x47953a=_0x5269d1(),!_0x47953a)return _0xe1ecb8([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x47953a[_0xe1ecb8([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0xfdeae8=_0x572467(_0x47953a[_0xe1ecb8([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x47953a[_0xe1ecb8([0x6a,0x74,0x69])])),await _0x317e8a()?_0x2aae0d()?_0x168c8d()?_0xe1ecb8([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x41e4aa()?(_0x47953a[_0xe1ecb8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xe1ecb8([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4a0613=_0xef8129(_0xe1ecb8([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x36b701()):_0xe1ecb8([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0xe1ecb8([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0xe1ecb8([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0xe1ecb8([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x168c8d(){const _0x53be8e=[_0xe1ecb8([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0xe1ecb8([0x74,0x72,0x69,0x61,0x6c])][_0xe1ecb8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x47953a[_0xe1ecb8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x175cf0/0x3e8:0xe10*_0x4dfc8e;return _0x47953a[_0xe1ecb8([0x65,0x78,0x70])]<_0x53be8e;}function _0x2aae0d(){const _0x14f512=_0x47953a[_0xe1ecb8([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x14f512&&(!!_0x14f512[_0xe1ecb8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xe1ecb8([0x2a]))||!!_0x14f512[_0xe1ecb8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xe1ecb8([0x41,0x49])));}function _0x41e4aa(){const _0x3d49da=_0x47953a[_0xe1ecb8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3d49da||0x0==_0x3d49da[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1d31e1}=new URL(window[_0xe1ecb8([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3d49da[_0xe1ecb8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1d31e1))return!0x0;const _0x3aefd2=_0x1d31e1[_0xe1ecb8([0x73,0x70,0x6c,0x69,0x74])](_0xe1ecb8([0x2e]));return _0x3d49da[_0xe1ecb8([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x591f62=>_0x591f62[_0xe1ecb8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xe1ecb8([0x2a])))[_0xe1ecb8([0x6d,0x61,0x70])](_0x32e1fb=>_0x32e1fb[_0xe1ecb8([0x73,0x70,0x6c,0x69,0x74])](_0xe1ecb8([0x2e])))[_0xe1ecb8([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x296982=>_0x296982[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x3aefd2[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xe1ecb8([0x6d,0x61,0x70])](_0x5d4b09=>Array(_0x3aefd2[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x5d4b09[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xe1ecb8([0x66,0x69,0x6c,0x6c])](_0x5d4b09[0x0]===_0xe1ecb8([0x2a])?_0xe1ecb8([0x2a]):'')[_0xe1ecb8([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x5d4b09))[_0xe1ecb8([0x73,0x6f,0x6d,0x65])](_0x48e36d=>_0x3aefd2[_0xe1ecb8([0x65,0x76,0x65,0x72,0x79])]((_0x35ea2a,_0x2c8374)=>_0x48e36d[_0x2c8374]===_0x35ea2a||_0x48e36d[_0x2c8374]===_0xe1ecb8([0x2a])));}function _0x36b701(){return _0x4a0613&&_0xfdeae8?new window[(_0xe1ecb8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x89eada,_0x4949b7)=>{_0x4a0613[_0xe1ecb8([0x74,0x68,0x65,0x6e])](_0x89eada,_0x4949b7),_0xfdeae8[_0xe1ecb8([0x74,0x68,0x65,0x6e])](_0x59bc23=>{_0x59bc23!=_0xe1ecb8([0x56,0x61,0x6c,0x69,0x64])&&_0x89eada(_0x59bc23);},_0x4949b7);}):_0x4a0613||_0xfdeae8||_0xe1ecb8([0x56,0x61,0x6c,0x69,0x64]);}}function _0x572467(_0x7da9c0,_0x480a20){return new window[(_0xe1ecb8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xdc6883=>{if(_0x3b7142())return _0xdc6883(_0xe1ecb8([0x56,0x61,0x6c,0x69,0x64]));_0x5942d1(),_0x5cc8bd[_0xe1ecb8([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0xe1ecb8([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3d2309=!0x1;const _0x576107=ot();function _0x5de7a9(_0x545722){return!!_0x545722&&(typeof _0x545722===_0xe1ecb8([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x545722===_0xe1ecb8([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x545722[_0xe1ecb8([0x74,0x68,0x65,0x6e])]===_0xe1ecb8([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x545722[_0xe1ecb8([0x63,0x61,0x74,0x63,0x68])]===_0xe1ecb8([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1b8a89(_0x41973e){_0xa161c(_0x41973e)[_0xe1ecb8([0x74,0x68,0x65,0x6e])](_0x576f2a=>{if(!_0x576f2a||_0x576f2a[_0xe1ecb8([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0xe1ecb8([0x6f,0x6b]))return _0xe1ecb8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x4a0e3a(_0x570b90(_0x576107+_0x480a20))!=_0x576f2a[_0xe1ecb8([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0xe1ecb8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0xe1ecb8([0x56,0x61,0x6c,0x69,0x64]);})[_0xe1ecb8([0x74,0x68,0x65,0x6e])](_0x16df95=>(_0x4278ed(),_0x16df95),()=>{const _0x4176ef=_0x4342a3();return null==_0x4176ef?(_0x4278ed(),_0xe1ecb8([0x56,0x61,0x6c,0x69,0x64])):_0xe1ecb8(_0x175cf0-_0x4176ef>(0x19f340e1^_0x154d92)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0xe1ecb8([0x74,0x68,0x65,0x6e])](_0xdc6883)[_0xe1ecb8([0x63,0x61,0x74,0x63,0x68])](()=>{_0xdc6883(_0xe1ecb8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x1f3a6d=0x3dc92a61^_0x154d92;function _0x4278ed(){const _0x21b606=_0xe1ecb8([0x6c,0x6c,0x63,0x74,0x2d])+_0x4a0e3a(_0x570b90(_0x7da9c0)),_0x33137a=_0x342641(_0x4a0e3a(window[_0xe1ecb8([0x4d,0x61,0x74,0x68])][_0xe1ecb8([0x63,0x65,0x69,0x6c])](_0x175cf0/_0x1f3a6d)));window[_0xe1ecb8([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xe1ecb8([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x21b606,_0x33137a);}function _0x4342a3(){const _0x4b4773=_0xe1ecb8([0x6c,0x6c,0x63,0x74,0x2d])+_0x4a0e3a(_0x570b90(_0x7da9c0)),_0x313ce0=window[_0xe1ecb8([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xe1ecb8([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4b4773);return _0x313ce0?window[_0xe1ecb8([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x342641(_0x313ce0),0x10)*_0x1f3a6d:null;}function _0xa161c(_0x58a3f8){return new window[(_0xe1ecb8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x452d94,_0x32aebf)=>{_0x58a3f8[_0xe1ecb8([0x74,0x68,0x65,0x6e])](_0x452d94,_0x32aebf),window[_0xe1ecb8([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x32aebf,0x3dfe1021^_0x154d92);});}}_0x5cc8bd[_0xe1ecb8([0x6f,0x6e])](_0xe1ecb8([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x44ab3c,_0x25780f)=>{if(_0x25780f[0x0]!=_0x7da9c0)return _0xdc6883(_0xe1ecb8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x25780f[0x1]={..._0x25780f[0x1],[_0xe1ecb8([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x576107};},{[_0xe1ecb8([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xe1ecb8([0x68,0x69,0x67,0x68])}),_0x5cc8bd[_0xe1ecb8([0x6f,0x6e])](_0xe1ecb8([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x351047=>{_0x5de7a9(_0x351047[_0xe1ecb8([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3d2309=!0x0,_0x1b8a89(_0x351047[_0xe1ecb8([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0xe1ecb8([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xe1ecb8([0x6c,0x6f,0x77])}),_0x18e589[_0xe1ecb8([0x74,0x68,0x65,0x6e])](()=>{_0x3d2309||_0xdc6883(_0xe1ecb8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x3b7142(){return _0x5cc8bd[_0xe1ecb8([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xe1ecb8([0x76,0x69,0x65,0x77])][_0xe1ecb8([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0xe1ecb8([0x61,0x75,0x74,0x6f]);}function _0x5942d1(){_0x5cc8bd[_0xe1ecb8([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xe1ecb8([0x76,0x69,0x65,0x77])][_0xe1ecb8([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0xe1ecb8([0x61,0x75,0x74,0x6f]);}}function _0xef8129(_0x1481c4){const _0x5c368c=[new window[(_0xe1ecb8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x57eecf=>setTimeout(_0x57eecf,0x3df6fa2d^_0x154d92)),_0x18e589[_0xe1ecb8([0x74,0x68,0x65,0x6e])](()=>new window[(_0xe1ecb8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4421d8=>{let _0x2200f0=0x0;_0x5cc8bd[_0xe1ecb8([0x6d,0x6f,0x64,0x65,0x6c])][_0xe1ecb8([0x6f,0x6e])](_0xe1ecb8([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3a2804,_0x4683d2)=>{_0x4683d2[0x0][_0xe1ecb8([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x2200f0++,_0x2200f0==(0x3dffc109^_0x154d92)&&(_0x4421d8(),_0x3a2804[_0xe1ecb8([0x6f,0x66,0x66])]());});}))];return window[_0xe1ecb8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0xe1ecb8([0x72,0x61,0x63,0x65])](_0x5c368c)[_0xe1ecb8([0x74,0x68,0x65,0x6e])](()=>_0x1481c4);}async function _0xbaa125(){await _0x18e589,_0x5cc8bd[_0xe1ecb8([0x6d,0x6f,0x64,0x65,0x6c])][_0xe1ecb8([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x227c18,_0x5cc8bd[_0xe1ecb8([0x6d,0x6f,0x64,0x65,0x6c])][_0xe1ecb8([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x227c18,_0x5cc8bd[_0xe1ecb8([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0xe1ecb8([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x4d91f2(_0x3c1fcb){const _0x2e210a=_0x564ed2();_0x5cc8bd[_0x2e210a]=_0xe1ecb8([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x3c1fcb,_0x3c1fcb!=_0xe1ecb8([0x56,0x61,0x6c,0x69,0x64])&&_0xbaa125();}function _0x564ed2(){const _0x19ab81=window[_0xe1ecb8([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0xe1ecb8([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0xe1ecb8([0x6e,0x6f,0x77])]())[_0xe1ecb8([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0xe1ecb8([0x2e]),'');let _0x8c0c55=_0xe1ecb8([0x6e]);for(let _0x49f9a9=0x0;_0x49f9a9<_0x19ab81[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x49f9a9+=0x2){let _0x3c8857=window[_0xe1ecb8([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x19ab81[_0xe1ecb8([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x49f9a9,_0x49f9a9+0x2));_0x3c8857>=_0x1de8a6[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x3c8857-=_0x1de8a6[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x8c0c55+=_0x1de8a6[_0x3c8857];}return _0x8c0c55;}function _0x5269d1(){const _0x1a2219=_0x8ab6ae[_0xe1ecb8([0x73,0x70,0x6c,0x69,0x74])](_0xe1ecb8([0x2e]));if(0x3!=_0x1a2219[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xe8fa47(_0x1a2219[0x1]);function _0xe8fa47(_0x520211){const _0x1ea7ef=_0x586a12(_0x520211);return _0x1ea7ef&&_0x29fdb2()?_0x1ea7ef:null;function _0x29fdb2(){const _0x39de65=_0x1ea7ef[_0xe1ecb8([0x6a,0x74,0x69])],_0x59aa13=window[_0xe1ecb8([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x39de65[_0xe1ecb8([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x39de65[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x499d29={..._0x1ea7ef,[_0xe1ecb8([0x6a,0x74,0x69])]:_0x39de65[_0xe1ecb8([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x39de65[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x499d29[_0xe1ecb8([0x76,0x63])],_0x570b90(_0x499d29)==_0x59aa13;}}}async function _0x317e8a(){let _0x42c4de=!0x0;try{const _0x182724=_0x8ab6ae[_0xe1ecb8([0x73,0x70,0x6c,0x69,0x74])](_0xe1ecb8([0x2e])),[_0x43bebb,_0x4ce08b,_0x2be051]=_0x182724;return _0x18bab1(_0x43bebb),await _0x59b154(_0x43bebb,_0x4ce08b,_0x2be051),_0x42c4de;}catch{return!0x1;}function _0x18bab1(_0x17e804){const _0x2641d3=_0x586a12(_0x17e804);_0x2641d3&&_0x2641d3[_0xe1ecb8([0x61,0x6c,0x67])]==_0xe1ecb8([0x45,0x53,0x32,0x35,0x36])||(_0x42c4de=!0x1);}async function _0x59b154(_0x5887f2,_0x3ec7a5,_0x2c8a72){const _0x32e359=window[_0xe1ecb8([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0xe1ecb8([0x66,0x72,0x6f,0x6d])](_0x2d0c1b(_0x2c8a72),_0x28a69e=>_0x28a69e[_0xe1ecb8([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x205fbc=new window[(_0xe1ecb8([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0xe1ecb8([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5887f2+_0xe1ecb8([0x2e])+_0x3ec7a5),_0x2656d9=window[_0xe1ecb8([0x63,0x72,0x79,0x70,0x74,0x6f])][_0xe1ecb8([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x2656d9)return;const _0x31e9cf=await _0x2656d9[_0xe1ecb8([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0xe1ecb8([0x6a,0x77,0x6b]),_0x676e5a,{[_0xe1ecb8([0x6e,0x61,0x6d,0x65])]:_0xe1ecb8([0x45,0x43,0x44,0x53,0x41]),[_0xe1ecb8([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0xe1ecb8([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0xe1ecb8([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x2656d9[_0xe1ecb8([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0xe1ecb8([0x6e,0x61,0x6d,0x65])]:_0xe1ecb8([0x45,0x43,0x44,0x53,0x41]),[_0xe1ecb8([0x68,0x61,0x73,0x68])]:{[_0xe1ecb8([0x6e,0x61,0x6d,0x65])]:_0xe1ecb8([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x31e9cf,_0x32e359,_0x205fbc)||(_0x42c4de=!0x1);}}function _0x586a12(_0x1cc112){return _0x1cc112[_0xe1ecb8([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0xe1ecb8([0x65,0x79]))?JSON[_0xe1ecb8([0x70,0x61,0x72,0x73,0x65])](_0x2d0c1b(_0x1cc112)):null;}function _0x2d0c1b(_0x1a5b32){return window[_0xe1ecb8([0x61,0x74,0x6f,0x62])](_0x1a5b32[_0xe1ecb8([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0xe1ecb8([0x2b]))[_0xe1ecb8([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0xe1ecb8([0x2f])));}function _0x570b90(_0x3e461e){let _0x18a0b6=0x1505;function _0xa544b9(_0x570b65){for(let _0x1df587=0x0;_0x1df587<_0x570b65[_0xe1ecb8([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1df587++){const _0x430dae=_0x570b65[_0xe1ecb8([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1df587);_0x18a0b6=(_0x18a0b6<<0x5)+_0x18a0b6+_0x430dae,_0x18a0b6&=_0x18a0b6;}}function _0x23b007(_0xad4903){Array[_0xe1ecb8([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0xad4903)?_0xad4903[_0xe1ecb8([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x23b007):_0xad4903&&typeof _0xad4903==_0xe1ecb8([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0xe1ecb8([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0xad4903)[_0xe1ecb8([0x73,0x6f,0x72,0x74])]()[_0xe1ecb8([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x132f76,_0x26fe72])=>{_0xa544b9(_0x132f76),_0x23b007(_0x26fe72);}):_0xa544b9(window[_0xe1ecb8([0x53,0x74,0x72,0x69,0x6e,0x67])](_0xad4903));}return _0x23b007(_0x3e461e),_0x18a0b6>>>0x0;}function _0x4a0e3a(_0x48ea45){return _0x48ea45[_0xe1ecb8([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0xe1ecb8([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0xe1ecb8([0x30]));}function _0x342641(_0x2dde57){return _0x2dde57[_0xe1ecb8([0x73,0x70,0x6c,0x69,0x74])]('')[_0xe1ecb8([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0xe1ecb8([0x6a,0x6f,0x69,0x6e])]('');}function _0x227c18(){}function _0xe1ecb8(_0x642cfb){return _0x642cfb['map'](_0x1708b4=>String['fromCharCode'](_0x1708b4))['join']('');}_0x4d91f2(await _0x5cb334());}(this);}['showFakeVisualSelection'](){const _0x234abb=this['editor']['model'];_0x234abb['change'](_0x5d7685=>{const _0x282798=_0x234abb['document']['selection']['getRanges']();let _0x412450=0x0;for(const _0x2a9644 of _0x282798){const _0x38b15c=Si+':'+_0x412450;if(_0x234abb['markers']['has'](_0x38b15c))_0x5d7685['updateMarker'](_0x38b15c,{'range':_0x2a9644});else{if(_0x2a9644['start']['isAtEnd']){const _0x25dc35=_0x2a9644['start']['getLastMatchingPosition'](({item:_0x185306})=>!_0x234abb['schema']['isContent'](_0x185306),{'boundaries':_0x2a9644});_0x5d7685['addMarker'](_0x38b15c,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5d7685['createRange'](_0x25dc35,_0x2a9644['end'])});}else _0x5d7685['addMarker'](_0x38b15c,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2a9644});}_0x412450++;}});}['hideFakeVisualSelection'](){const _0xdd5df3=this['editor']['model'],_0x489c68=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](Si));_0x489c68['length']&&_0xdd5df3['change'](_0x1c8f3f=>{_0x489c68['forEach'](_0xfb22e1=>{_0x1c8f3f['removeMarker'](_0xfb22e1);});});}['insertContent'](_0x267048,_0x51fcf8){const _0x112fa1=this['_getAISelection'](),_0x1e1038=_0x51fcf8||_0x112fa1['getFirstRange']();this['editor']['model']['canEditAt'](_0x1e1038)&&this['editor']['model']['change'](_0x37961d=>{this['hideFakeVisualSelection'](),_0x51fcf8||this['_resetContentOfSelectedTableCells'](_0x37961d,_0x112fa1),this['_pasteHTMLUsingClipboard']({'insertAt':_0x1e1038,'writer':_0x37961d,'html':_0x267048});});}['insertContentBelow'](_0x30310d){const {model:_0x37efe6}=this['editor'],_0x3a2e39=this['_getAISelection']();_0x37efe6['change'](()=>{const _0x580c1c=this['_prepareTableInsertBelowPosition'](_0x30310d,_0x3a2e39)||this['_getDefaultInsertBelowPosition'](_0x3a2e39);this['insertContent'](_0x30310d,_0x580c1c);});}['_getAISelection'](){const _0xe0dda1=this['editor']['model'],_0x358619=Array['from'](_0xe0dda1['markers']['getMarkersGroup'](Si))['map'](_0x2ff2cd=>_0x2ff2cd['getRange']());return _0xe0dda1['createSelection'](_0x358619);}['_pasteHTMLUsingClipboard']({writer:_0x1ddb98,html:_0x1e8695,insertAt:_0x18a78d}){const {view:_0x516a8d}=this['editor']['editing'],_0x19a004=this['editor']['plugins']['get'](_0x2226b6),_0x113164=new fi();_0x113164['setData']('text/html',_0x1e8695);const _0x190c0e=new ClipboardEvent('paste',{'clipboardData':_0x113164}),_0x330ffe=new _0x44e9df(_0x516a8d,_0x190c0e,{'dataTransfer':new _0x104872(_0x113164)});_0x1ddb98['setSelection'](_0x18a78d);const _0x12d36f=(_0x2e43a6,_0x29be4f)=>{_0x29be4f['resultRange']&&_0x1ddb98['setSelection'](_0x29be4f['resultRange']);};_0x19a004['once']('contentInsertion',_0x12d36f,{'priority':'lowest'}),_0x516a8d['document']['fire']('paste',_0x330ffe),_0x19a004['off']('contentInsertion',_0x12d36f);}['_getDefaultInsertBelowPosition'](_0x485a3c){const {model:_0x50cdbf}=this['editor'],_0x41bdee=Array['from'](_0x485a3c['getSelectedBlocks']());return _0x41bdee['length']?_0x50cdbf['createPositionAfter'](_0x41bdee['pop']()):_0x485a3c['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0xaed221,_0x336ced){const {model:_0x1b2f3d,plugins:_0x4affba}=this['editor'];if(_0x4affba['has']('TableUtils')){const _0x30ed7a=_0x4affba['get']('TableUtils')['getSelectedTableCells'](_0x336ced);if(_0x30ed7a['length']){const _0x113094=this['_getTableRowCountFromContent'](_0xaed221),_0x2e8d22=this['_createEmptyTableRows'](_0x30ed7a,_0x113094);return _0x1b2f3d['createPositionAt'](_0x2e8d22,0x0);}}return null;}['_getTableRowCountFromContent'](_0x3c07cb){const _0x20f59a=this['editor']['plugins']['get']('TableUtils'),_0x10758e=this['editor']['data']['parse'](_0x3c07cb),_0x457f02=Array['from'](_0x10758e['getChildren']())['filter'](_0x378edd=>_0x378edd['is']('element','table'));let _0x584743=0x0;return _0x457f02['forEach'](_0x1fcc99=>{_0x584743+=_0x20f59a['getRows'](_0x1fcc99);}),_0x584743;}['_createEmptyTableRows'](_0x265fff,_0x45aae3){const _0x3f9cbf=this['editor']['plugins']['get']('TableUtils'),_0x15ef00=_0x3f9cbf['getRowIndexes'](_0x265fff),_0x1392b5=_0x3f9cbf['getColumnIndexes'](_0x265fff),_0x3c95d1=_0x15ef00['last']+0x1,_0x1771e9=_0x1392b5['first'],_0x5875ae=_0x265fff[0x0]['findAncestor']('table');for(let _0x271495=0x0;_0x271495<_0x45aae3;_0x271495++)_0x3f9cbf['insertRows'](_0x5875ae,{'at':_0x3c95d1});return _0x5875ae['getChild'](_0x3c95d1)['getChild'](_0x1771e9);}['_resetContentOfSelectedTableCells'](_0xc6ae62,_0x1a7f21){const {plugins:_0x46001b}=this['editor'],{model:_0x12656b}=_0xc6ae62;if(!_0x46001b['has']('TableUtils'))return;_0x46001b['get']('TableUtils')['getSelectedTableCells'](_0x1a7f21)['length']&&_0x12656b['deleteContent'](_0x1a7f21);}}class AIAdapter extends _0x53fc9f{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new at('aiadapter-text-adapter-not-set',null);}}class AIRequestError extends Error{constructor(_0x5f07a3){super(_0x5f07a3),this['name']='AIRequestError';}}function Ri(_0x4c5b14,_0xff1eae,_0x273dcb){const t=_0x4c5b14['t'];switch(_0xff1eae){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',_0x273dcb);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x273dcb);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'},_0x273dcb);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 _0xff1eae;}}class ShowAIAssistantCommand extends _0xae9ca1{['_commandDefinitions'];constructor(_0x1bb8c3,_0x3d7a18){super(_0x1bb8c3),this['_commandDefinitions']=_0x3d7a18,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x253f8c,_0x49ce22,_0x1cc308)=>{this['isEnabled']&&(this['enabledCommandsIds']=bi(this['_commandDefinitions'],_0x1cc308));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xa176a4,_0x1d8860,_0x73a656)=>{this['enabledCommandsIds']=_0x73a656?bi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x5f3abb=this['editor']['model'];this['_hasContext']=function(_0x592b44){const _0x44eacb=_0x592b44['document']['selection'];return _0x44eacb['isCollapsed']?0x0!==[..._0x44eacb['getSelectedBlocks']()]['length']&&![..._0x44eacb['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x592b44['hasContent'](_0x44eacb['getFirstRange']());}(_0x5f3abb);const _0x545096=_0x5f3abb['document']['selection'],_0x380110=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x2bb76c of _0x545096['getRanges']())for(const _0x57a2f4 of _0x2bb76c['getItems']())if(_0x57a2f4['is']('element')&&_0x380110['includes'](_0x57a2f4['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3f08ef='',_0x4bcf47='',_0x4e0313='custom'){this['editor']['plugins']['get'](AIAssistantUI)['showUI'](_0x3f08ef,_0x4bcf47,_0x4e0313);}}function bi(_0x31892e,_0x3898fe){const _0x267630=new Set();for(const _0x336358 of _0x31892e['values']())(_0x3898fe||!0x1===_0x336358['requiresContent'])&&_0x267630['add'](_0x336358['id']);return Array['from'](_0x267630);}const Oi=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class AIAssistantController extends/* #__PURE__ -- @preserve */
24
- ht(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x66367e,_0x31537c,_0x230a3c){super(),this['editor']=_0x66367e,this['textAdapter']=_0x31537c,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x230a3c,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x3f5dd2,_0x263a7f,_0x436717)=>{this['view']['value']=this['_sanitizeHTML'](_0x436717);}),this['listenTo'](this['view'],'submitPrompt',(_0x36840f,_0xdd4ea9)=>{const _0x1d66f0=this['currentContext']||this['initialContext'];this['_handleQuery'](_0xdd4ea9,_0x1d66f0,'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:_0x43f66d,query:_0x32d6d8,htmlContent:_0x5b5797,label:_0x216fb6,mainActionLabel:_0x5c9989}){this['view']['prompt']=_0x216fb6,this['view']['mainAction']=_0x5c9989,this['initialContext']=_0x5b5797,_0x32d6d8&&(this['view']['isRendered']?this['_handleQuery'](_0x32d6d8,_0x5b5797,_0x43f66d,_0x216fb6):this['view']['once']('render',()=>{this['_handleQuery'](_0x32d6d8,_0x5b5797,_0x43f66d,_0x216fb6);}));}['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'](_0x58a440,_0x43da05,_0x1818d5,_0x25919c){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x43da05,this['previousQuery']=_0x58a440,this['previousLabel']=_0x25919c||_0x58a440,this['previousActionId']=_0x1818d5,new Promise(_0x5b522f=>{this['textAdapter']['makeRequest']({'query':_0x58a440,'context':_0x43da05,'onData':_0x50e8e6=>{this['currentResponse']=_0x50e8e6,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x1818d5})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x1a84d6=>{_0x1a84d6 instanceof AIRequestError?this['view']['handleError'](_0x1a84d6['message']):this['view']['handleError'](),_0x5b522f();})['finally'](()=>{this['stopProcessing'](),_0x5b522f();});});}['_parseAndNormalizeContent'](_0x4df9fa,_0x17420d=!0x1){const _0x53a659=Oi['exec'](_0x4df9fa);_0x4df9fa=_0x53a659?_0x4df9fa['substring'](_0x53a659[0x1]['length']):_0x4df9fa['length']<0x64&&!_0x17420d?'':this['_stripMarkdownSyntax'](_0x4df9fa);const _0x1bc693=this['_domParser']['parseFromString'](_0x4df9fa,'text/html');if(_0x53a659){const _0x31646d=Array['from'](_0x1bc693['body']['childNodes']);_0x31646d['reverse']();for(const _0x184f59 of _0x31646d){if(_0x184f59['nodeType']==Node['ELEMENT_NODE'])break;_0x184f59['remove']();}}const _0x24c9b2=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x1bc693['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x24c9b2);const _0x14fd33=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x398273=this['editor']['data']['toModel'](_0x24c9b2);return _0x14fd33||_0x398273['markers']['clear'](),this['editor']['data']['stringify'](_0x398273);}['_normalizeResponseHeadings'](_0x582de6){const _0x5422d9=new _0x4349bc(this['editor']['editing']['view']['document']),_0x2a2176=new _0x5e058b({'name':/^h[1-5]$/}),_0x1e2a3a=[];let _0x2d4d67=!0x1;for(const _0x4d5030 of _0x582de6)_0x4d5030['is']('element')&&_0x2a2176['match'](_0x4d5030)&&(_0x1e2a3a['push'](_0x4d5030),'h1'==_0x4d5030['name']&&(_0x2d4d67=!0x0));if(_0x2d4d67){for(const _0xbba934 of _0x1e2a3a)_0x5422d9['rename']('h'+(parseInt(_0xbba934['name'][0x1])+0x1),_0xbba934);}}['_isH1TagSupportEnabled'](){const {data:_0x36b0c9,editing:_0x4d8021}=this['editor'],_0x37d691=_0x36b0c9['htmlProcessor']['toView']('<h1></h1>'),_0x20e713=_0x36b0c9['toView'](_0x36b0c9['toModel'](_0x37d691));return!!_0x4d8021['view']['domConverter']['viewToDom'](_0x20e713)['querySelector']('h1');}['_sanitizeHTML'](_0x1cde78){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x1cde78),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x29ee7e){const _0x267038=_0x29ee7e['trim']();return _0x267038['startsWith']('```html')?_0x267038['endsWith']('```')?_0x267038['substring'](0x7,_0x267038['length']-0x3):_0x267038['substring'](0x7):_0x29ee7e;}}const ki={'REPLACE':'replace','INSERT':'insert'};class AIFormToolbarView extends kt{constructor(_0x46c69a){super(_0x46c69a),this['set']('isVisible',!0x1),this['set']('mainAction',ki['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x1dafb3=>Ri(_0x46c69a,'AI_'+_0x1dafb3['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Ri(_0x46c69a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Ri(_0x46c69a,'Try\x20again')),this['stopButton']=this['_createButton'](Ri(_0x46c69a,'Stop'));const _0x48adb8=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x48adb8['if']('isVisible','ck-hidden',_0x548fac=>!_0x548fac)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3340c6,_0x5a24ed){const _0x547e95=new vt(this['locale']);return _0x547e95['set']({'label':_0x3340c6,'class':_0x5a24ed||'','isVisible':!0x0,'withText':!0x0}),_0x547e95;}}class AIFormContentArea extends Nt{['contentFieldView'];['copyButtonView'];constructor(_0x3cd026,_0x3e08ea=''){super(_0x3cd026),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x5abaad=this['bindTemplate'];this['contentFieldView']=new ContentFieldView(_0x3cd026,_0x3e08ea),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x5abaad['if']('isVisible','ck-hidden',_0x1ca6ab=>!_0x1ca6ab)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x5abaad['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 _0x295d7f=!0x1;this['on']('change:value',(_0x54e24a,_0x18e0e2,_0x199b7d)=>{const _0x324cca=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x199b7d),this['isProcessing']&&_0x324cca&&!_0x295d7f&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x21abc4,_0x3e8fe8,_0xc61151)=>{_0x295d7f=!0x1,_0xc61151?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x295d7f=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x295d7f=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x544699=this['locale'],_0x5dfbda=new vt(this['locale']),_0x31fe6c='ck-ai-form__copy-button';return _0x5dfbda['set']({'label':Ri(_0x544699,'Copy'),'icon':_0x5c3d91,'class':_0x31fe6c,'tooltip':!0x0}),_0x5dfbda['bind']('isVisible')['to'](this,'value',_0x2efa34=>!!_0x2efa34),_0x5dfbda['bind']('isEnabled')['to'](this,'isProcessing',_0x247a16=>!_0x247a16),_0x5dfbda['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5dfbda['icon']=_0x489882,_0x5dfbda['class']=_0x31fe6c+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5dfbda['icon']=_0x5c3d91,_0x5dfbda['class']=_0x31fe6c;},0x3e8);}),_0x5dfbda;}['_copyHTMLToClipboard'](_0x1659bc){const {window:_0x36c72b,document:_0x4cf7bb}=ct;if(_0x36c72b['ClipboardItem']){const {Blob:_0x136b64,ClipboardItem:_0x312468}=_0x36c72b,_0x1f7d73=[new _0x312468({'text/html':new _0x136b64([_0x1659bc['innerHTML']],{'type':'text/html'}),'text/plain':new _0x136b64([_0x1659bc['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1f7d73);}else{const _0x42476a=_0x4cf7bb['createElement']('div');_0x42476a['style']['position']='absolute',_0x42476a['style']['left']='-9999px',_0x42476a['innerHTML']='<span>[</span>'+_0x1659bc['innerHTML']+'<span>]</span>',_0x4cf7bb['body']['appendChild'](_0x42476a);const _0x2e165d=_0x4cf7bb['createRange']();_0x2e165d['setStartAfter'](_0x42476a['firstElementChild']),_0x2e165d['setEndBefore'](_0x42476a['lastElementChild']);const _0x5ed063=_0x36c72b['getSelection']();_0x5ed063['removeAllRanges'](),_0x5ed063['addRange'](_0x2e165d),_0x4cf7bb['execCommand']('copy'),_0x42476a['remove']();}}}class ContentFieldView extends Nt{constructor(_0x54a501,_0x3bc7e4=''){super(_0x54a501),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x3bc7e4,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x13ce58){this['element']['innerHTML']=_0x13ce58;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0xe872a3=new Nt(),_0x56f432=this['locale'],_0x3197c4=new yt();return _0x3197c4['isVisible']=!0x0,_0xe872a3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3197c4,{'text':Ri(_0x56f432,'AI\x20is\x20writing...')}]}),_0xe872a3['render'](),_0xe872a3;}}class AIFormErrorView extends Nt{constructor(_0x1e4f4c,_0x25b8e2=''){super(_0x1e4f4c);const _0x2a0eec=new xt(),_0x295da0=this['bindTemplate'];this['set']('text',_0x25b8e2),_0x2a0eec['content']=_0x2b1be1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2a0eec,{'text':_0x295da0['to']('text')}]});}}class AIFormPromptView extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x216c18,_0x441ea3){super(_0x216c18,_0x441ea3),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',(_0x5dfbf8,_0xb65b72)=>{_0x5dfbf8['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xb65b72());});}['_createSubmitButton'](){const _0x3c9220=new vt(this['locale']),_0x2c3bd0=this['locale'];return _0x3c9220['set']({'icon':_0xcffe77,'label':Ri(_0x2c3bd0,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3c9220['on']('execute',()=>{this['submit']();}),_0x3c9220['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x174adb,_0x3aa677)=>!_0x174adb&&_0x3aa677),_0x3c9220;}['_createShowHistoryButton'](){const _0x39ae54=new vt(this['locale']),_0x584bc2=this['resultsView'],_0xb60b85=this['locale'];_0x39ae54['set']({'label':Ri(_0xb60b85,'History'),'withText':!0x1,'icon':_0x33c29f,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x39ae54['bind']('isOn')['to'](_0x584bc2,'isVisible'),_0x39ae54['bind']('isEnabled')['to'](this,'isEnabled'),_0x39ae54['on']('execute',()=>{_0x584bc2['isVisible']=!_0x584bc2['isVisible'],_0x584bc2['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x15fb97=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x25bd7e=new ut(this['queryView']['fieldView']['element']),_0x44eddd=_0x25bd7e['width'],_0x536b77='rtl'===_0xb60b85['uiLanguageDirection']?'left':'right';_0x25bd7e['excludeScrollbarsAndBorders'](),_0x39ae54['element']['style'][_0x536b77]=_0x44eddd-_0x25bd7e['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x15fb97),this['on']('render',_0x15fb97),_0x39ae54;}['submit'](){const _0x527af7=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x527af7);}['focus'](_0x514aae){-0x1===_0x514aae?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class AIHistoryListView extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x2975d9){super(_0x2975d9),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Vt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Ri(_0x2975d9,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x1869b9=0x0;for(const _0x551910 of this['items'])_0x1869b9+=_0x551910['items']['length'];return{'resultsCount':_0x1869b9,'totalItemsCount':_0x1869b9};}['_createClearHistoryButton'](){const _0x59892e=this['locale'],_0x4bf756=new vt(this['locale']);return _0x4bf756['set']({'label':'('+Ri(_0x59892e,'Clear')+')','withText':!0x0}),_0x4bf756['on']('execute',()=>this['fire']('clearHistory')),_0x4bf756;}}class AIHistoryListItemView extends Pt{constructor(_0x4ec4c2){super();const _0x3be3be=new Ht(),_0x2b816a=new vt(this['locale'],_0x3be3be);this['children']['add'](_0x2b816a),_0x2b816a['set']({'label':_0x4ec4c2['prompt'],'withText':!0x0}),_0x2b816a['on']('execute',()=>{this['fire']('execute',{'value':_0x491084(_0x4ec4c2['prompt'])});});}}const vi='CKEditor/AIFormView/PromptHistory';class PromptHistory extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1ac208,_0x25b1c9)=>{const _0x2c122d=Ni(_0x25b1c9['prompt']);for(const _0x531dde of this)if(_0x531dde!=_0x25b1c9&&Ni(_0x531dde['prompt'])===_0x2c122d){this['remove'](_0x531dde);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x464f9e=sessionStorage['getItem'](vi)||'[]';this['addMany'](JSON['parse'](_0x464f9e));}['_saveToSessionStorage'](){sessionStorage['setItem'](vi,JSON['stringify'](this['map'](_0x2acd55=>_0x2acd55)));}}function Ni(_0x5d2536){return _0x5d2536['toLowerCase']()['trim']();}class AIFormView extends Nt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x3744c7,_0x24f32e,_0x2910e4=''){super(_0x3744c7),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',ki['REPLACE']),this['_promptHistory']=new PromptHistory(),this['errorView']=new AIFormErrorView(_0x3744c7),this['contentArea']=new AIFormContentArea(_0x3744c7,_0x2910e4),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 _t(),this['keystrokes']=new It(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Mt({'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 _0x3da30c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x24f32e],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3da30c['if']('isError','ck-hidden',_0x466af4=>!_0x466af4)]},'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'](_0x11a21f=0x1){-0x1===_0x11a21f?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 _0xe25dbc=this['locale'],_0x884298=new AIFormPromptView(_0xe25dbc,{'queryView':{'label':Ri(_0xe25dbc,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Ri(_0xe25dbc,'Empty\x20history'),'secondary':Ri(_0xe25dbc,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x884298['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1ae876,_0x21e8b9)=>_0x1ae876&&!_0x21e8b9),this['listenTo'](_0x884298,'submit',(_0x2320c3,_0x1b9873)=>{this['prompt']=_0x1b9873;const _0x2aebee=_0x2d9792(_0x1b9873);this['fire']('submitPrompt',_0x2aebee),_0x1b9873['trim']()&&this['_promptHistory']['add']({'prompt':_0x2aebee},0x0);},{'priority':'high'}),_0x884298;}['_createHistoryView'](){const _0x22f3d1=new AIHistoryListView(this['locale']);return _0x22f3d1['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](AIHistoryListItemView),_0x22f3d1['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x22f3d1;}['_createToolbar'](){const _0x21708a=new AIFormToolbarView(this['locale']);return _0x21708a['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x33dc7b,_0x16b1c0,_0x48630d)=>_0x33dc7b&&!_0x16b1c0&&!!_0x48630d),_0x21708a['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x21708a['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x14a53a,_0x2d47f8,_0x2537d6)=>_0x14a53a&&!_0x2d47f8&&!!_0x2537d6),_0x21708a['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x21708a['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xa968c3,_0x46ec7e)=>_0xa968c3&&!_0x46ec7e),_0x21708a['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x21708a['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x21708a['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x21708a;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3fb85c=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Ri(_0x3fb85c,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x459133){const _0x4e1e17=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x459133||Ri(_0x4e1e17,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const yi=globalThis['DataTransfer'];class AIAssistantUI extends _0x53fc9f{['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[_0xa6f429,AIAssistantEditing,AIAdapter,Bt];}constructor(_0x112afb){super(_0x112afb),_0x112afb['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x112afb['config']['define']('ai.assistant.contentAreaCssClass',''),_0x112afb['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x112afb['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x54d4e5}=this;this['_aiAdapter']=_0x54d4e5['plugins']['get'](AIAdapter),this['_dialog']=_0x54d4e5['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x861ee8=new ShowAIAssistantCommand(_0x54d4e5,Array['from'](this['_commandDefinitions']['values']()));_0x54d4e5['commands']['add']('showAIAssistant',_0x861ee8),_0x54d4e5['ui']['componentFactory']['add']('aiCommands',_0xc0347e=>{const _0x1eecff=Gt(_0xc0347e);return _0x1eecff['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1eecff['buttonView']['set']({'label':Ri(_0xc0347e,'AI\x20Commands'),'icon':_0x94995e,'tooltip':!0x0}),_0x1eecff['on']('execute',_0x1fbc8b=>this['_onExecute'](_0x1fbc8b['source']['id'])),Ft(_0x1eecff,_0x54d4e5['ui']['view']['body'],function(_0x695192){const _0x1dc766=Ti(_0x695192['config']['get']('ai.assistant.commands'),_0x695192['locale']),_0x20318d=Li(_0x695192,_0x1dc766)['filter'](_0x45e784=>_0x45e784['commands']['length']);if(0x1===_0x20318d['length'])return Li(_0x695192,_0x20318d[0x0]['commands'])['map'](_0x12576a=>({'id':_0x12576a['id'],'label':_0x12576a['label']}));return _0x20318d['map'](_0x37037d=>{const {groupId:_0x596c9a,groupLabel:_0x180ba5,commands:_0x49974a}=_0x37037d,_0x322193=Li(_0x695192,_0x49974a)['map'](_0x47eb29=>({'id':_0x47eb29['id'],'label':_0x47eb29['label']}));return{'id':_0x596c9a,'menu':_0x180ba5||_0x596c9a,'children':_0x322193};});}(_0x54d4e5),{'ariaLabel':Ri(_0xc0347e,'AI\x20Commands')}),_0x1eecff['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x861ee8['on']('change:enabledCommandsIds',_0x54a24e),_0x1eecff['menuView']['once']('render',_0x54a24e),_0x1eecff;function _0x54a24e(){_0x1eecff['isEnabled']=_0x861ee8['enabledCommandsIds']['length']>0x0;for(const _0x2af6bd of _0x1eecff['menuView']['buttons'])_0x2af6bd['isEnabled']=_0x861ee8['enabledCommandsIds']['includes'](_0x2af6bd['id']);}}),_0x54d4e5['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4ec704=>{const _0x3f31a7=new Kt(_0x4ec704);_0x3f31a7['buttonView']['set']({'label':Ri(_0x4ec704,'AI\x20Commands'),'icon':_0x94995e}),_0x3f31a7['bind']('isEnabled')['to'](_0x861ee8,'enabledCommandsIds',_0x15ca55=>_0x15ca55['length']>0x0);const _0x26328c=Ti(_0x54d4e5['config']['get']('ai.assistant.commands'),_0x4ec704);return this['_populateMenuBarMenu'](_0x861ee8,_0x3f31a7,_0x26328c,_0x3ab1b7=>this['_onExecute'](_0x3ab1b7)),_0x3f31a7;}),_0x54d4e5['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x444ed7=this['_createAIAssistantUIButton'](vt);return _0x444ed7['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x444ed7;}),_0x54d4e5['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x1174f8=this['_createAIAssistantUIButton'](Wt);return _0x1174f8['set']({'role':'menuitemcheckbox'}),_0x1174f8;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2a7e6d=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x563cc6;for(const _0x55a7a2 in _0x2a7e6d){const _0x103ccd=_0x55a7a2,_0x2ec12f=_0x2a7e6d[_0x103ccd];if('aiLicenseKeyValid'==_0x2ec12f||'aiLicenseKeyInvalid'==_0x2ec12f||'aiLicenseKeyExpired'==_0x2ec12f||'aiLicenseKeyDomainLimit'==_0x2ec12f||'aiLicenseKeyNotAllowed'==_0x2ec12f||'aiLicenseKeyEvaluationLimit'==_0x2ec12f||'aiLicenseKeyUsageLimit'==_0x2ec12f){delete _0x2a7e6d[_0x103ccd],_0x563cc6=_0x2ec12f,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x563cc6&&_0x2a7e6d['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x563cc6&&_0x2a7e6d['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x563cc6&&_0x2a7e6d['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x563cc6&&_0x2a7e6d['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x563cc6&&_0x2a7e6d['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x563cc6&&_0x2a7e6d['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x1a66ff='',_0x3c9f8a='',_0x1aa374='custom'){const _0x10cd12=this['editor'],_0x4c78ac=_0x10cd12['editing']['view'],_0xe2094f=_0x10cd12['plugins']['get'](AIAssistantEditing),_0xbb4482=_0x10cd12['plugins']['get'](_0xa6f429);_0xe2094f['showFakeVisualSelection']();const _0x3e6a14=new yi(),_0x327614=new ClipboardEvent('copy',{'clipboardData':_0x3e6a14}),_0x923d28=new _0x104872(_0x3e6a14),_0x2642ef=new _0x44e9df(_0x4c78ac,_0x327614,{'dataTransfer':_0x923d28});_0xbb4482['_forceMarkersCopy']('comment',()=>{_0x4c78ac['document']['fire']('copy',_0x2642ef);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new AIAssistantController(_0x10cd12,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x3685cc=_0x923d28['getData']('text/html');const _0x51b4df=_0x10cd12['model']['document']['selection'],_0x5749e1=Array['from'](_0x51b4df['getRanges']());0x1===_0x5749e1['length']&&_0x5749e1[0x0]['isFlat']&&!_0x51b4df['getSelectedElement']()&&''!==_0x3685cc['replace'](/&nbsp;/g,'')['trim']()&&(_0x3685cc='<p>'+_0x3685cc+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x1aa374,'query':_0x1a66ff,'htmlContent':_0x3685cc,'label':_0x3c9f8a,'mainActionLabel':ki[_0x10cd12['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x4a06bf,'title':Ri(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0xe2094f['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2fbf7e=new Map(),_0x3ae582=Ti(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x18d29b of _0x3ae582)for(const _0x28a572 of _0x18d29b['commands'])_0x2fbf7e['set'](_0x28a572['id'],{..._0x28a572,'groupId':_0x18d29b['groupId'],'groupLabel':_0x18d29b['groupLabel']||_0x18d29b['groupId']});return _0x2fbf7e;}['_createAIAssistantUIButton'](_0x39de0d){const _0x382d87=this['editor'],_0x65ed00=_0x382d87['commands']['get']('showAIAssistant'),_0x54892e=new _0x39de0d(_0x382d87['locale']);return _0x54892e['set']({'label':Ri(_0x382d87['locale'],'AI\x20Assistant'),'icon':_0x4a06bf,'isToggleable':!0x0}),_0x54892e['bind']('isEnabled')['to'](_0x65ed00),_0x54892e['bind']('isOn')['to'](this['_dialog'],'id',_0x425e77=>'aiAssistant'===_0x425e77),this['listenTo'](_0x54892e,'execute',()=>{_0x54892e['isOn']?this['hideUI']():_0x65ed00['execute']();}),_0x54892e;}['_initView'](){const _0x5e3e00=this['editor']['plugins']['get'](AIAssistantEditing);this['_formView']=new AIFormView(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',()=>{_0x5e3e00['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x5e3e00['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2a3e4b,ui:{ariaLiveAnnouncer:_0x20d142}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x3bfe25,_0x1dc5fd,_0x28886c)=>{const _0x44eb9b=this['_aiAssistantController']['currentContext'];_0x28886c?_0x20d142['announce'](Ri(_0x2a3e4b,'AI\x20is\x20writing')):_0x44eb9b&&_0x20d142['announce'](Ri(_0x2a3e4b,'Generated\x20content:\x20%0',_0x44eb9b),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3e3068,_0x4cb5ed,_0x420f90)=>{if(_0x420f90){const _0x4c4e47=this['_formView']['errorView']['text'];_0x20d142['announce'](Ri(_0x2a3e4b,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4c4e47));}});}['_onExecute'](_0x77db72){const _0x558b64=this['_commandDefinitions']['get'](_0x77db72),_0x251288=this['editor'],_0x4b4601=_0x251288['model']['document']['selection'],_0x5e6678=_0x251288['commands']['get']('showAIAssistant'),_0x358007=_0x251288['plugins']['get'](AIAssistantEditing),_0x1b749a=''+(_0x558b64['groupId']!==wi?_0x558b64['groupLabel']+':\x20':'')+_0x558b64['label'];if(!0x1!==_0x558b64['requiresContent']&&_0x4b4601['isCollapsed']){const _0x591519=At(_0x4b4601['getSelectedBlocks']())||_0x251288['model']['schema']['getLimitElement'](_0x4b4601);_0x251288['model']['change'](_0x5ce9c8=>{_0x5ce9c8['setSelection'](_0x591519,'in');});}_0x358007['showFakeVisualSelection'](),_0x5e6678['execute'](_0x558b64['prompt'],_0x1b749a,'command:'+_0x77db72);}['_populateMenuBarMenu'](_0x36ec4f,_0x43a6c5,_0x1bf195,_0x58520f){const _0x371574=this['editor'],_0x4bed00=_0x371574['locale'],_0x8f4ba6=new $t(_0x4bed00),_0x3bdf4a=Li(_0x371574,_0x1bf195)['filter'](_0x2b168d=>_0x2b168d['commands']['length']);0x1===_0x3bdf4a['length']?this['_getMenuBarGroupButtons']({'command':_0x36ec4f,'commands':_0x3bdf4a[0x0]['commands'],'parentMenuView':_0x43a6c5,'onExecute':_0x58520f})['forEach'](_0x4dcf7e=>_0x8f4ba6['items']['add'](_0x4dcf7e)):_0x3bdf4a['forEach'](({groupId:_0x1f7cbf,groupLabel:_0x3c7663,commands:_0x51f31e})=>{const _0x4b33c3=new qt(_0x4bed00,_0x43a6c5),_0x5337e1=new Kt(_0x4bed00),_0x4cf571=new $t(_0x4bed00),_0x585654=this['_getMenuBarGroupButtons']({'command':_0x36ec4f,'commands':_0x51f31e,'parentMenuView':_0x5337e1,'onExecute':_0x58520f});_0x5337e1['buttonView']['set']({'label':_0x3c7663||_0x1f7cbf}),_0x5337e1['delegate']('execute')['to'](_0x43a6c5),_0x4cf571['items']['addMany'](_0x585654),_0x5337e1['panelView']['children']['add'](_0x4cf571),_0x4b33c3['children']['add'](_0x5337e1),_0x8f4ba6['items']['add'](_0x4b33c3);}),_0x43a6c5['panelView']['children']['add'](_0x8f4ba6);}['_getMenuBarGroupButtons']({command:_0x1d91d1,commands:_0x262493,parentMenuView:_0x1b3fe0,onExecute:_0x2bd10b}){const _0x4da867=this['editor'],_0x594b47=_0x4da867['locale'];return Li(_0x4da867,_0x262493)['map'](_0x59f203=>{const _0x100ab5=new qt(_0x594b47,_0x1b3fe0),_0x124d9e=new Wt(_0x594b47);return _0x124d9e['set']({'label':_0x59f203['label']}),_0x124d9e['delegate']('execute')['to'](_0x1b3fe0),_0x124d9e['on']('execute',()=>_0x2bd10b(_0x59f203['id'])),_0x124d9e['bind']('isEnabled')['to'](_0x1d91d1,'enabledCommandsIds',_0x1778d1=>_0x1778d1['includes'](_0x59f203['id'])),_0x100ab5['children']['add'](_0x124d9e),_0x100ab5;});}}function xi(_0x4c9a83,_0x4d30e5){return void 0x0!==_0x4c9a83['order']&&void 0x0===_0x4d30e5['order']?0x1:void 0x0===_0x4c9a83['order']&&void 0x0!==_0x4d30e5['order']?-0x1:void 0x0!==_0x4c9a83['order']&&void 0x0!==_0x4d30e5['order']?_0x4c9a83['order']-_0x4d30e5['order']:0x0;}function Li(_0x1722b7,_0x285e14){_0x285e14['sort'](xi);const _0x3d0e0b={},_0x19d1ef=[];for(const _0x511c19 of _0x285e14)if(void 0x0!==_0x511c19['order']){if(_0x511c19['order']in _0x3d0e0b)throw new at('ai-commands-config-order-collision',_0x1722b7,{'conflictingDefinitions':[_0x511c19,_0x3d0e0b[_0x511c19['order']]]});_0x3d0e0b[_0x511c19['order']]=_0x511c19,_0x19d1ef['splice'](_0x511c19['order'],0x0,_0x511c19);}else _0x19d1ef['push'](_0x511c19);return _0x19d1ef;}class AIAssistant extends _0x53fc9f{static get['requires'](){return[AIAssistantUI,AIAssistantEditing];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2b5e42){super(_0x2b5e42);const _0x14aefc=_0x2b5e42['config'],_0x5ac9f5=_0x2b5e42['locale'];_0x14aefc['define']('ai.assistant.preserveComments',!0x0),_0x14aefc['define']('ai.assistant.commands',Di(_0x5ac9f5)),_0x14aefc['define']('ai.assistant.extraCommandGroups',[]),_0x14aefc['define']('ai.assistant.removeCommands',[]);let _0x336a55=Ti(_0x14aefc['get']('ai.assistant.commands'),_0x5ac9f5);const _0x158bf2=_0x14aefc['get']('ai.assistant.extraCommandGroups'),_0xbc779=_0x14aefc['get']('ai.assistant.removeCommands');_0x158bf2['forEach'](_0x1d9e54=>{const _0x56f838=_0x336a55['find'](_0x106eed=>_0x106eed['groupId']===_0x1d9e54['groupId']);_0x56f838?_0x56f838['commands']=_0x56f838['commands']['concat'](_0x1d9e54['commands']):_0x336a55['push'](_0x1d9e54);}),_0x336a55=_0x336a55['filter'](_0x56f28c=>!_0xbc779['includes'](_0x56f28c['groupId'])),_0x336a55['forEach'](_0x587b9c=>{_0x587b9c['commands']=_0x587b9c['commands']['filter'](_0x5311da=>!_0xbc779['includes'](_0x5311da['id']));}),_0x14aefc['set']('ai.assistant.commands',_0x336a55);}}function Di(_0xa6b52f){return[{'groupId':'editOrReview','groupLabel':Ri(_0xa6b52f,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Ri(_0xa6b52f,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Ri(_0xa6b52f,'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':Ri(_0xa6b52f,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Ri(_0xa6b52f,'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':Ri(_0xa6b52f,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Ri(_0xa6b52f,'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':Ri(_0xa6b52f,'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':Ri(_0xa6b52f,'Change\x20tone'),'commands':[{'id':'professional','label':Ri(_0xa6b52f,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Ri(_0xa6b52f,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Ri(_0xa6b52f,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Ri(_0xa6b52f,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Ri(_0xa6b52f,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Ri(_0xa6b52f,'Change\x20style'),'commands':[{'id':'business','label':Ri(_0xa6b52f,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Ri(_0xa6b52f,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Ri(_0xa6b52f,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Ri(_0xa6b52f,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Ri(_0xa6b52f,'Translate'),'commands':[{'id':'translateEnglish','label':Ri(_0xa6b52f,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Ri(_0xa6b52f,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Ri(_0xa6b52f,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Ri(_0xa6b52f,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Ri(_0xa6b52f,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Ri(_0xa6b52f,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Ri(_0xa6b52f,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Ri(_0xa6b52f,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class AITextAdapter extends _0x53fc9f{['abortController'];static get['requires'](){return[AIAdapter];}constructor(_0x2bfef7){super(_0x2bfef7),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](AIAdapter)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x210322){return this['sendRequest'](_0x210322)['catch'](_0x5da1d3=>{if(_0x5da1d3 instanceof AIRequestError)return Promise['reject'](_0x5da1d3);if('AbortError'==_0x5da1d3['name'])return Promise['resolve']();throw console['error'](_0x5da1d3),new at('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x2de68b,_0x410bd9){const _0x32ef37=this['editor']['locale'],_0x436311={'Content-Type':'application/json'};if('object'==typeof _0x2de68b)Object['assign'](_0x436311,_0x2de68b);else{if(_0x2de68b)try{const _0x1aad6e=await _0x2de68b(_0x410bd9);Object['assign'](_0x436311,_0x1aad6e);}catch{return Promise['reject'](new AIRequestError(Ri(_0x32ef37,'AI_ERROR_GET_HEADERS')));}}return _0x436311;}async['_prepareRequestParameters'](_0xc2d2aa,_0x112c91){const _0x1390d7=this['editor']['locale'];if('object'==typeof _0xc2d2aa)return _0xc2d2aa;try{return await _0xc2d2aa(_0x112c91);}catch{return Promise['reject'](new AIRequestError(Ri(_0x1390d7,'AI_ERROR_GET_PARAMETERS')));}}}class OpenAITextAdapter extends AITextAdapter{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x3034ad){super(_0x3034ad),_0x3034ad['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x3034ad['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x3034ad['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x3034ad['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x3034ad['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x3034ad['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x37ad67,context:_0x519aec,onData:_0x175088,actionId:_0x416b02}){const _0x4cd8aa=this['editor']['locale'],_0x55d8bf=await this['prepareMessages'](_0x37ad67,_0x519aec,_0x416b02),_0x4da8b4=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x416b02),_0x58a16c=await this['_prepareRequestParameters'](this['_requestParameters'],_0x416b02),_0x4c9005={'messages':_0x55d8bf,..._0x58a16c},_0x59a732={'method':'POST','headers':_0x4da8b4,'body':JSON['stringify'](_0x4c9005),'signal':this['abortController']['signal']},_0x11ffb5=await fetch(this['_apiUrl'],_0x59a732);if(_0x11ffb5['ok'])return _0x58a16c['stream']?await this['_readStreamableResponse'](_0x11ffb5,_0x175088):await this['_readStaticResponse'](_0x11ffb5,_0x175088),Promise['resolve']();{const _0x428a36=await _0x11ffb5['text']();return _0x428a36['includes']('context_length_exceeded')?Promise['reject'](new AIRequestError(Ri(_0x4cd8aa,'AI_ERROR_CONTEXT_LENGTH'))):_0x428a36['includes']('Moderation')?Promise['reject'](new AIRequestError(Ri(_0x4cd8aa,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x428a36));}}async['prepareMessages'](_0x3999e5,_0xff7b31,_0x3e23b7){let _0x21323e,_0xe08e39;return _0xff7b31?(_0x21323e='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.',_0xe08e39='Instruction:\x0a'+_0x3999e5+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xff7b31):(_0x21323e='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.',_0xe08e39=_0x3999e5),[{'role':'system','content':_0x21323e},{'role':'user','content':_0xe08e39}];}async['_readStreamableResponse'](_0x54bb46,_0x29a672){const _0x502964=_0x54bb46['body']['getReader'](),_0x2fe905=new TextDecoder();let _0x2cfe9e='',_0x378186='',_0x322bbc='',_0x3e8610=!0x1;for(;!_0x3e8610;){const {done:_0x7edc90,value:_0x4b2622}=await _0x502964['read'](),_0x5045d9=_0x2cfe9e+_0x2fe905['decode'](_0x4b2622);let _0x2c8089='';_0x3e8610=_0x7edc90;try{_0x2c8089=this['_cleanUpData'](_0x5045d9),_0x2cfe9e='';}catch{_0x2cfe9e=_0x5045d9;continue;}_0x378186+=_0x2c8089,!_0x3e8610&&this['_isBufferIncomplete'](_0x378186)||_0x378186&&(_0x322bbc+=_0x378186,_0x378186='',_0x29a672(_0x322bbc));}return Promise['resolve']();}async['_readStaticResponse'](_0x26d721,_0x5ec0b3){return _0x5ec0b3((await _0x26d721['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x4cf6e4){const _0xfe0dee=_0x4cf6e4['split']('<')['length']!==_0x4cf6e4['split']('>')['length'],_0x3446a4=_0x4cf6e4['length']<0x1e;return _0xfe0dee&&_0x3446a4;}['_cleanUpData'](_0x2c3d86){return _0x2c3d86['split'](/\n(?![^{]*\})/g)['map'](_0x32d319=>_0x32d319['replace']('data:\x20',''))['filter'](_0x14bf25=>_0x14bf25&&_0x14bf25['length']>0x0&&'[DONE]'!==_0x14bf25)['map'](_0x32f53d=>{const {choices:_0x5a6e37}=JSON['parse'](_0x32f53d);if(_0x5a6e37[0x0]?.['delta']?.['content'])return _0x5a6e37[0x0]['delta']['content'];})['filter'](_0x475da5=>_0x475da5)['join']('');}}class AWSTextAdapter extends AITextAdapter{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),gt('ai-aws-adapter-not-supported');}async['sendRequest'](_0x2049a3){throw Ct('ai-aws-adapter-not-supported'),new AIRequestError(Ri(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class TabButtonView extends vt{constructor(_0x2400e5,_0x3a39e7={}){super(_0x2400e5),this['isToggleable']=!0x0,this['set']('side',_0x3a39e7['side']||'top');const _0x2af47e=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...mt(_0x3a39e7['class']||[]),_0x2af47e['to']('side',_0x39586f=>'ck-tab-button_'+_0x39586f),_0x2af47e['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class TabPanelView extends Nt{['children'];constructor(_0x3ab3de,_0xa05953={}){super(_0x3ab3de);const _0x440278=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...mt(_0xa05953['class']||[]),_0x440278['to']('class'),_0x440278['if']('isVisible','ck-hidden',_0x43bb9d=>!_0x43bb9d)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class AITabsView extends Nt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x56fb00,_0xa50bb={}){super(_0x56fb00),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0xa50bb['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0xa50bb['collapsible']||!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'activeTab',(_0x2b51d9,_0x25df81)=>_0x2b51d9&&null!==_0x25df81);const _0x4bb458=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...mt(_0xa50bb['class']||[]),_0x4bb458['to']('side',_0x5887bc=>'ck-tabs_'+_0x5887bc),_0x4bb458['to']('class'),_0x4bb458['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x4bb458['to']('activeTab',_0x2adbd0=>null===_0x2adbd0?'ck-ai-tabs_collapsed':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x4bb458['to']('side',_0x185ede=>'ck-tabs__buttons-container_'+_0x185ede)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x4bb458['to']('side',_0x58c592=>'ck-tabs__panels-container_'+_0x58c592)]},'children':this['panelViews']},...mt(_0xa50bb['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x33913d){const _0x44c8c9=this['_tabs']['get'](_0x33913d);return _0x44c8c9||null;}['addTab'](_0x1024b5){const _0x2d51c5=this['_setupButton']({'id':_0x1024b5['id'],'label':_0x1024b5['buttonLabel'],'icon':_0x1024b5['buttonIcon'],'order':_0x1024b5['order']}),_0x2175b6=new TabPanelView(this['locale']);return _0x2175b6['render'](),_0x1024b5['content']&&_0x2175b6['children']['add'](_0x1024b5['content']),this['panelViews']['add'](_0x2175b6),this['_tabs']['set'](_0x1024b5['id'],{'button':_0x2d51c5,'panel':_0x2175b6,'order':void 0x0!==_0x1024b5['order']?_0x1024b5['order']:null}),this['fire']('addTab:'+_0x1024b5['id'],{'id':_0x1024b5['id'],'button':_0x2d51c5,'panel':_0x2175b6}),null===this['activeTab']?this['activateTab'](_0x1024b5['id']):this['_hidePanel'](_0x1024b5['id']),{'button':_0x2d51c5,'panel':_0x2175b6};}['activateTab'](_0x296fee){if(null!==_0x296fee&&!this['getTab'](_0x296fee))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x296fee});if(this['activeTab']===_0x296fee)return;const _0x41429f=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x296fee,_0x296fee&&this['_showPanel'](_0x296fee),this['fire']('activateTab:'+_0x296fee,{'newTab':_0x296fee,'oldTab':_0x41429f});}['toggleTabPanel'](_0x30813d){if(!this['getTab'](_0x30813d))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x30813d});this['activeTab']===_0x30813d?this['collapsible']&&(this['activeTab']=null):this['activateTab'](_0x30813d);}['showTab'](_0x1502ee){if(!this['getTab'](_0x1502ee))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1502ee});this['_showPanel'](_0x1502ee),this['_showButton'](_0x1502ee),this['fire']('show:'+_0x1502ee,_0x1502ee);}['hideTab'](_0x1f1196){if(!this['getTab'](_0x1f1196))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1f1196});const _0x1a7d1a=this['activeTab'];this['_hidePanel'](_0x1f1196),this['_hideButton'](_0x1f1196);const _0xaf4d96=this['getTabIds']();_0x1a7d1a===_0x1f1196&&_0xaf4d96['length']>0x1&&this['activateTab'](_0xaf4d96['find'](_0x16bb6e=>_0x16bb6e!==_0x1f1196)),this['fire']('hide:'+_0x1f1196,_0x1f1196);}['_getPanel'](_0x18b3ce){const _0xbf1469=this['_tabs']['get'](_0x18b3ce);return _0xbf1469?_0xbf1469['panel']:null;}['_showPanel'](_0x58efa3){null!==this['activeTab']&&this['activeTab']!==_0x58efa3||this['_getPanel'](_0x58efa3)['show']();}['_hidePanel'](_0x564b78){const _0x463f7c=this['_getPanel'](_0x564b78);_0x463f7c['isVisible']&&(this['activeTab']===_0x564b78&&(this['activeTab']=null),_0x463f7c['hide']());}['_getButton'](_0x3a0ac3){const _0x2ed2d6=this['_tabs']['get'](_0x3a0ac3);return _0x2ed2d6?_0x2ed2d6['button']:null;}['_showButton'](_0x202254){this['_getButton'](_0x202254)['show']();}['_hideButton'](_0xbefef7){this['_getButton'](_0xbefef7)['hide']();}['_setupButton'](_0x36f400){const _0x4e674b=new TabButtonView(this['locale'],{'side':this['side']}),_0x301691=this['buttonViews'];if(_0x4e674b['set']({'label':_0x36f400['label'],'icon':_0x36f400['icon'],'tooltip':!0x0,'withText':!0x0}),_0x4e674b['bind']('isOn')['to'](this,'activeTab',_0x166fb4=>_0x166fb4===_0x36f400['id']),_0x4e674b['bind']('side')['to'](this,'side'),_0x36f400['order']){const _0x698654=[...this['_tabs']]['reduce']((_0x40a92b,_0xf23266)=>{const _0x45d83=_0xf23266[0x0],{order:_0x1927a7}=_0xf23266[0x1];return!_0x1927a7||_0x1927a7>_0x36f400['order']?_0x40a92b:_0x1927a7>=_0x40a92b['order']?{'id':_0x45d83,'order':_0x1927a7}:_0x40a92b;},{'id':'','order':0x0}),_0x30bdff=_0x301691['getIndex'](this['_getButton'](_0x698654['id']));_0x301691['add'](_0x4e674b,_0x30bdff+0x1);}else _0x301691['add'](_0x4e674b);return _0x4e674b['on']('execute',()=>{this['toggleTabPanel'](_0x36f400['id']);}),_0x4e674b;}}const Vi=['overlay','sidebar','custom'],Pi=['left','right'];class AITabsMainView extends AITabsView{constructor(_0x4909ca,_0x46e94c={}){super(_0x4909ca,_0x46e94c),this['set']('type',_0x46e94c['type']||'sidebar'),this['set']('side',_0x46e94c['side']||'right'),this['set']('isVisible',_0x46e94c['visibleByDefault']??!0x0);const _0x5079e3=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x5079e3['if']('type','ck-ai-tabs__overlay',_0x578fd8=>'overlay'===_0x578fd8),_0x5079e3['if']('type','ck-ai-tabs__sidebar',_0x3e2e54=>'sidebar'===_0x3e2e54),_0x5079e3['if']('isVisible','ck-hidden',_0x448262=>!_0x448262)]}}),this['buttonViews']['on']('add',(_0xc0260e,_0x4b7434)=>{_0x4b7434['set']('withText',!0x1);});}}class AITabs extends _0x3cc0e4{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xf8d385){if(super(_0xf8d385),!this['context']['config']['get']('ai.container'))throw new at('ai-tabs-configuration-not-found');this['context']['config']['define']('ai.container.visibleByDefault',!0x0),this['context']['config']['define']('ai.container.collapsible',!0x1);const _0x208ea4=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x208ea4['showResizeButton']&&(this['showResizeButton']=_0x208ea4['showResizeButton']),'sidebar'!==_0x208ea4['type']&&'overlay'!==_0x208ea4['type']||_0x208ea4['side']&&(this['side']=_0x208ea4['side']),'sidebar'===_0x208ea4['type']){if(this['container']=_0x208ea4['element'],this['set']('type','sidebar'),!this['container'])throw new at('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x208ea4['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new AITabsMainView(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':_0x208ea4['visibleByDefault'],'collapsible':_0x208ea4['collapsible']}),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 _0x3cd9d5&&this['context']['ui']['focusTracker']['add'](this['view']['element']),this['listenTo'](this,'resizeTabs',()=>{this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);});}['switchType'](_0x4b68d3){if(_0x4b68d3&&this['type']!==_0x4b68d3){if(!Vi['includes'](_0x4b68d3))throw new at('ai-tabs-unsupported-ui-type');this['type']=_0x4b68d3;}}['switchSide'](_0xb668ae){if(_0xb668ae&&this['side']!==_0xb668ae){if(!Pi['includes'](_0xb668ae))throw new at('ai-tabs-unsupported-ui-side');this['side']=_0xb668ae;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class AIConnector extends _0x3cc0e4{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x2fe476];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x542542){super(_0x542542),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(),this['_responseCache']=new Map();}['init'](){const _0x412f22=this['context']['plugins']['get'](_0x2fe476);if(!_0x412f22['token'])throw new at('ai-missing-token',this);this['_token']=_0x412f22['token'];}['startConversation'](_0x3f7ae3,_0x3d4a8a){const _0x59b636=this['_sendApiRequest']('/conversations','POST',{'id':_0x3f7ae3,'group':_0x3d4a8a});return{'getConversation':async()=>(await _0x59b636['request'])['json'](),'abortController':_0x59b636['abortController']};}['queryAssistant']({message:_0x30a371,conversationId:_0x2222f7,parts:_0xec6a7c,capabilities:_0xe84dc2,model:_0x276c50,attributes:_0x195122}){const _0x5ebc62={'prompt':_0x30a371,'content':_0xec6a7c,'model':_0x276c50,..._0xe84dc2&&{'capabilities':_0xe84dc2},..._0x195122&&{'attributes':_0x195122}},_0x313fbb=this['_sendApiRequest']('/conversations/'+_0x2222f7+'/messages','POST',_0x5ebc62);return{'getStream':async()=>{const _0x4e69e0=(await _0x313fbb['request'])['body'];return this['_getStreamReader'](_0x4e69e0);},'abortController':_0x313fbb['abortController']};}['executeCustomAction']({content:_0x49abb5,message:_0x2d39a5,model:_0x1c468a,outputFormat:_0xc553f4}){const _0x1c4577={'content':[{'type':'text','content':_0x49abb5}],'prompt':_0x2d39a5,'model':_0x1c468a,'outputFormat':_0xc553f4},_0x24129b=this['_sendApiRequest']('/actions/custom/calls','POST',_0x1c4577);return{'getStream':async()=>{const _0x1db089=(await _0x24129b['request'])['body'];return this['_getStreamReader'](_0x1db089);},'abortController':_0x24129b['abortController']};}['executeAction']({actionName:_0xd3e4df,content:_0x13ae3c,args:_0x5adcbf}){const _0x23d94e={'content':[{'type':'text','content':_0x13ae3c}],'args':_0x5adcbf},_0x3a6897=this['_sendApiRequest']('/actions/system/'+_0xd3e4df+'/calls','POST',_0x23d94e);return{'getStream':async()=>{const _0x44ffc6=(await _0x3a6897['request'])['body'];return this['_getStreamReader'](_0x44ffc6);},'abortController':_0x3a6897['abortController']};}['uploadFile'](_0x5a1350,_0x2943c4,_0x3ae6d9){const _0x142bec=new FormData();_0x142bec['append']('file',_0x2943c4,_0x2943c4['name']),_0x3ae6d9&&_0x142bec['append']('attributes',JSON['stringify'](_0x3ae6d9));const _0xd13cb1=this['_sendApiRequest']('/conversations/'+_0x5a1350+'/files','POST',_0x142bec);return{'getId':async()=>(await _0xd13cb1['request'])['json'](),'abortController':_0xd13cb1['abortController']};}['fetchDocument'](_0xca4cff,_0x135ec2){const _0x2ff04d=this['_sendApiRequest']('/conversations/'+_0xca4cff+'/documents/'+_0x135ec2,'GET');return{'getDocument':async()=>(await _0x2ff04d['request'])['json'](),'abortController':_0x2ff04d['abortController']};}['uploadDocument'](_0x51a27e,_0x4a5522,_0x35b47b){const _0x170824={'content':_0x4a5522};_0x35b47b&&(_0x170824['attributes']=_0x35b47b);const _0x59bd97=this['_sendApiRequest']('/conversations/'+_0x51a27e+'/documents','POST',_0x170824);return{'getId':async()=>(await _0x59bd97['request'])['json'](),'abortController':_0x59bd97['abortController']};}['uploadDocuments'](_0x10f8e5,_0x590d61){const _0x59a8c2={'documents':_0x590d61['map'](_0x2e362e=>({'content':_0x2e362e['content'],'attributes':{'version':_0x2e362e['version'],'sessionId':_0x2e362e['sessionId'],'channelId':_0x2e362e['channelId'],'rootName':_0x2e362e['rootName'],'selections':_0x2e362e['selections']},...void 0x0!==_0x2e362e['name']?{'name':_0x2e362e['name']}:{},...void 0x0!==_0x2e362e['description']?{'description':_0x2e362e['description']}:{}}))},_0x82d2b7=this['_sendApiRequest']('/conversations/'+_0x10f8e5+'/documents/batch','POST',_0x59a8c2);return{'getIds':async()=>(await _0x82d2b7['request'])['json'](),'abortController':_0x82d2b7['abortController']};}['fetchDocuments'](_0x302567,_0x547b03){const _0x5c6bcd=new URLSearchParams();_0x5c6bcd['append']('documentIds',_0x547b03['join'](','));const _0x910def=this['_sendApiRequest']('/conversations/'+_0x302567+'/documents/batch?'+_0x5c6bcd['toString'](),'GET');return{'getDocuments':async()=>(await _0x910def['request'])['json'](),'abortController':_0x910def['abortController']};}['fetchConversations'](_0x484a1b,_0x6bc680={}){const _0xfb2649=new URLSearchParams();_0xfb2649['append']('group',_0x484a1b),_0xfb2649['append']('excludeEmpty',!0x1!==_0x6bc680['excludeEmpty']?'true':'false'),_0xfb2649['append']('limit',_0x6bc680['limit']?_0x6bc680['limit']['toString']():'100'),_0xfb2649['append']('sortBy',_0x6bc680['sortBy']?_0x6bc680['sortBy']:'createdAt'),_0xfb2649['append']('order',_0x6bc680['order']?_0x6bc680['order']:'desc');const _0x3ad069=this['_sendApiRequest']('/conversations?'+_0xfb2649['toString'](),'GET');return{'getConversations':async()=>{const _0x58f995=await _0x3ad069['request'];return(await _0x58f995['json']())['items'];},'abortController':_0x3ad069['abortController']};}['deleteConversation'](_0x3f4ffd){const _0x565a13=this['_sendApiRequest']('/conversations/'+_0x3f4ffd,'DELETE');return{'execute':async()=>{await _0x565a13['request'];},'abortController':_0x565a13['abortController']};}['updateConversation'](_0x438c64,_0x563447){const _0x42564a=this['_sendApiRequest']('/conversations/'+_0x438c64,'PATCH',_0x563447);return{'getResult':async()=>(await _0x42564a['request'],_0x563447),'abortController':_0x42564a['abortController']};}['fetchConversation'](_0x58212f){const _0x4cd656=this['_sendApiRequest']('/conversations/'+_0x58212f,'GET');return{'getConversation':async()=>(await _0x4cd656['request'])['json'](),'abortController':_0x4cd656['abortController']};}['fetchConversationMessages'](_0x22ee80){const _0x245ead=this['_sendApiRequest']('/conversations/'+_0x22ee80+'/messages','GET');return{'getMessages':async()=>{const _0x1a9a19=await _0x245ead['request'];return(await _0x1a9a19['json']())['items'];},'abortController':_0x245ead['abortController']};}['uploadUrl'](_0x426888,_0x2cb0e5,_0x176c3c){const _0x598d4a=this['_sendApiRequest']('/conversations/'+_0x426888+'/web-resources','POST',{'url':_0x2cb0e5,'attributes':_0x176c3c});return{'getId':async()=>(await _0x598d4a['request'])['json'](),'abortController':_0x598d4a['abortController']};}['getModels'](_0x3727ed='en'){const _0x50b77c=new URLSearchParams();_0x50b77c['append']('language',_0x3727ed);const _0x385098='/models/1?'+_0x50b77c['toString'](),_0x253c16=this['_sendApiRequest'](_0x385098,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x253c16['request'])['json'](),'abortController':_0x253c16['abortController']};}['deleteFile'](_0x56e379,_0x48b024){const _0x51e848=this['_sendApiRequest']('/conversations/'+_0x56e379+'/files/'+_0x48b024,'DELETE');return{'execute':async()=>{await _0x51e848['request'];},'abortController':_0x51e848['abortController']};}['deleteDocument'](_0x637360,_0x2af9ab){const _0x328bf0=this['_sendApiRequest']('/conversations/'+_0x637360+'/documents/'+_0x2af9ab,'DELETE');return{'execute':async()=>{await _0x328bf0['request'];},'abortController':_0x328bf0['abortController']};}['deleteWebResource'](_0x44d03c,_0x5b8412){const _0x311905=this['_sendApiRequest']('/conversations/'+_0x44d03c+'/web-resources/'+_0x5b8412,'DELETE');return{'execute':async()=>{await _0x311905['request'];},'abortController':_0x311905['abortController']};}['callSystemReview']({reviewName:_0x11d016,content:_0x29c65d,args:_0x4513f1}){const _0xcf4a3a=this['_sendApiRequest']('/reviews/system/'+_0x11d016+'/calls','POST',{'content':[{'type':'text','content':_0x29c65d}],'args':_0x4513f1});return{'getStream':async()=>{const _0x2746f8=(await _0xcf4a3a['request'])['body'];return this['_getStreamReader'](_0x2746f8);},'abortController':_0xcf4a3a['abortController']};}['callCustomReview']({content:_0x596da9,prompt:_0x4a647e,model:_0x541453}){const _0x5f1987=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x596da9}],'prompt':_0x4a647e,'model':_0x541453});return{'getStream':async()=>{const _0x349900=(await _0x5f1987['request'])['body'];return this['_getStreamReader'](_0x349900);},'abortController':_0x5f1987['abortController']};}['upsertAIChatRating'](_0xfef292,_0x1fb452,_0x3bd9d7){const _0x5b49db=this['_sendApiRequest']('/conversations/'+_0xfef292+'/messages/'+_0x1fb452+'/ratings','PUT',{'positiveCount':_0x3bd9d7['positiveCount'],'totalCount':_0x3bd9d7['totalCount'],'modificationId':_0x3bd9d7['modificationId']});return{'execute':async()=>{await _0x5b49db['request'];},'abortController':_0x5b49db['abortController']};}['upsertAIActionRating'](_0x4b54d9,_0x48e2df,_0x3b234c){const _0x4c8c51=this['_sendApiRequest']('/actions/system/'+_0x4b54d9+'/calls/'+_0x48e2df+'/ratings','PUT',{'positiveCount':_0x3b234c['positiveCount'],'totalCount':_0x3b234c['totalCount']});return{'execute':async()=>{await _0x4c8c51['request'];},'abortController':_0x4c8c51['abortController']};}['upsertCustomAIActionRating'](_0x14fa21,_0x442c61){const _0x12b156=this['_sendApiRequest']('/actions/custom/calls/'+_0x14fa21+'/ratings','PUT',{'positiveCount':_0x442c61['positiveCount'],'totalCount':_0x442c61['totalCount']});return{'execute':async()=>{await _0x12b156['request'];},'abortController':_0x12b156['abortController']};}['upsertAIReviewRating'](_0x1692dc,_0x3647d2,_0x353763,_0xe0e97d){const _0x2316d4=this['_sendApiRequest']('/reviews/system/'+_0x1692dc+'/calls/'+_0x3647d2+'/ratings','PUT',{'positiveCount':_0x353763['positiveCount'],'totalCount':_0x353763['totalCount'],'dataId':_0xe0e97d});return{'execute':async()=>{await _0x2316d4['request'];},'abortController':_0x2316d4['abortController']};}['upsertCustomAIReviewRating'](_0x25c921,_0x144295,_0x5bd923){const _0x3249eb=this['_sendApiRequest']('/reviews/custom/calls/'+_0x25c921+'/ratings','PUT',{'positiveCount':_0x144295['positiveCount'],'totalCount':_0x144295['totalCount'],'dataId':_0x5bd923});return{'execute':async()=>{await _0x3249eb['request'];},'abortController':_0x3249eb['abortController']};}['_sendApiRequest'](_0x5106c7,_0x5a2d0a,_0x15600f,_0x5dfaed=!0x1){const _0x563608=new AbortController(),_0x30e77a=_0x5dfaed?_0x5a2d0a+':'+_0x5106c7:null;if(_0x30e77a){const _0x45c197=this['_responseCache']['get'](_0x30e77a);if(_0x45c197)return{'request':_0x45c197['then'](_0x6a0a0d=>_0x6a0a0d['clone']()),'abortController':_0x563608};}const _0x470ee1=_0x15600f instanceof FormData,_0x13cfb2={'Authorization':'Bearer\x20'+this['_token']?.['value'],'X-Editor-Version':pt};_0x15600f&&!_0x470ee1&&(_0x13cfb2['Content-Type']='application/json');const _0x55c79d={'method':_0x5a2d0a,'headers':_0x13cfb2,'signal':_0x563608['signal']};_0x15600f&&(_0x55c79d['body']=_0x470ee1?_0x15600f:JSON['stringify'](_0x15600f));const _0x43ea4b=fetch(''+this['_apiUrl']+_0x5106c7,_0x55c79d)['catch'](_0x1fb9d1=>{_0x30e77a&&this['_responseCache']['delete'](_0x30e77a),this['_handleError'](_0x1fb9d1);})['then'](_0x1a9595=>_0x1a9595['ok']?_0x1a9595:_0x1a9595['json']()['then'](_0x5b89b2=>{throw _0x30e77a&&this['_responseCache']['delete'](_0x30e77a),{'url':this['_apiUrl'],'path':_0x5106c7,'method':_0x5a2d0a,'body':_0x15600f,'status':(_0x1a9595||{})['status'],'statusText':(_0x1a9595||{})['statusText'],'code':_0x5b89b2['code'],'message':_0x5b89b2['message'],'traceId':_0x5b89b2['traceId']};}));return _0x30e77a&&this['_responseCache']['set'](_0x30e77a,_0x43ea4b['then'](_0x344e82=>_0x344e82['clone']())),{'request':_0x43ea4b,'abortController':_0x563608};}async*['_getStreamReader'](_0x59efda){const _0x5f3037=[],_0x437e41=_0x59efda['getReader'](),_0xe26e69=_0x24589f({'onError':_0x4037cf=>{this['_handleError'](_0x4037cf);},'onEvent':_0x2b300f=>{_0x2b300f['data']=JSON['parse'](_0x2b300f['data']),_0x5f3037['push'](_0x2b300f);}});try{let _0xb5f78f=!0x1;for(;!_0xb5f78f;){const {done:_0x1bf161,value:_0xf9a817}=await _0x437e41['read']();_0x1bf161&&(_0xb5f78f=!0x0),_0xe26e69['feed'](this['_decoder']['decode'](_0xf9a817,{'stream':!0x0})),yield*_0x5f3037,_0x5f3037['length']=0x0;}}catch(_0xc61611){this['_handleError'](_0xc61611);}finally{_0x437e41['releaseLock'](),_0xe26e69['reset']();}}['_handleError'](_0x1171de){if(_0x1171de instanceof at)throw _0x1171de;if(_0x1171de instanceof Error&&'AbortError'===_0x1171de['name'])throw new at('ai-request-aborted',this,{'originalError':_0x1171de});throw new at('ai-request-failed',this,{'originalError':_0x1171de});}}function Hi(_0x14428b,_0x2de69c,_0x3f8f1d){const t=_0x14428b['t'];switch(_0x2de69c){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'},_0x3f8f1d);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':'Response\x20stopped.'});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.'},_0x3f8f1d);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.'},_0x3f8f1d);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.'},_0x3f8f1d);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'},_0x3f8f1d);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x3f8f1d);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'},_0x3f8f1d);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.'},_0x3f8f1d);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.'},_0x3f8f1d);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.'},_0x3f8f1d);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.'},_0x3f8f1d);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'},_0x3f8f1d);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.'},_0x3f8f1d);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 _0x2de69c;}}const Mi='ck-ai-button-primary',Ui='ck-ai-button-secondary',Bi='ck-ai-button-tertiary';function Gi(_0x440e74,_0x3b0e9a){const _0xdc4df6=new vt(_0x440e74),_0x538b49=Hi(_0x440e74,'AI_TABS_LABEL_MINIMIZE'),_0x54dca1=Hi(_0x440e74,'AI_TABS_LABEL_MAXIMIZE');return _0xdc4df6['set']({'withText':!0x1,'icon':_0x55d900,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+Bi}),_0xdc4df6['bind']('label')['to'](_0x3b0e9a,'isMaximized',_0x4de773=>_0x4de773?_0x538b49:_0x54dca1),_0xdc4df6['bind']('icon')['to'](_0x3b0e9a,'isMaximized',_0x47f003=>_0x47f003?_0x37bd1f:_0x55d900),_0xdc4df6['bind']('isOn')['to'](_0x3b0e9a,'isMaximized'),_0xdc4df6['on']('execute',()=>{_0x3b0e9a['fire']('resizeTabs');}),_0xdc4df6;}function Fi(_0x4be5e7){return _0x57287f(_0x4be5e7);}function Ki(_0x12a39a){return ti(_0x12a39a);}function Wi(_0x867622,_0x34ad1a,_0x5e1eb5){const _0x1d50a6=null!==_0x34ad1a?_0x48b90b=>_0x48b90b['attribs'][_0x867622]===_0x34ad1a:_0x3f0b10=>Boolean(_0x3f0b10['attribs'][_0x867622]);return _0x10d1dd(_0x50b16a=>_0x5778d8(_0x50b16a)&&_0x1d50a6(_0x50b16a),_0x5e1eb5);}function Yi(_0x34c465,_0x4613c1,_0x248e2a){const _0x2405d3=null!==_0x4613c1?_0x2fd22c=>_0x2fd22c['attribs'][_0x34c465]===_0x4613c1:_0x1ad999=>Boolean(_0x1ad999['attribs'][_0x34c465]);return _0x11b699(_0x10ffcc=>_0x5778d8(_0x10ffcc)&&_0x2405d3(_0x10ffcc),_0x248e2a);}function $i(_0x5edd67,_0x4acc08){return _0x5edd67&&_0x5778d8(_0x5edd67)?_0x5edd67['attribs'][_0x4acc08]:null;}function qi(_0x2d7bc0,_0x13f21c,_0x2ee7bb){_0x5778d8(_0x2d7bc0)&&(null===_0x2ee7bb?delete _0x2d7bc0['attribs'][_0x13f21c]:_0x2d7bc0['attribs'][_0x13f21c]=_0x2ee7bb);}function Qi(_0x5f294d,_0x45d247,_0x5348df){const _0x29a3d9=_0x45d247['cloneNode'](!0x0);'beforebegin'===_0x5348df?_0x238c6d(_0x5f294d,_0x29a3d9):'afterbegin'===_0x5348df?_0x3d3041(_0x5f294d,_0x29a3d9):'beforeend'===_0x5348df?_0x2b0d30(_0x5f294d,_0x29a3d9):'afterend'===_0x5348df&&_0x1d7e6a(_0x5f294d,_0x29a3d9);}function Xi(_0x29330a){const _0xb1a020=[];let _0x50eede=_0x29330a;for(;_0x50eede;)_0x50eede=_0x586047(_0x50eede),_0x50eede&&_0xb1a020['push'](_0x50eede);return _0xb1a020;}function zi(_0x4a40d1){return _0x4a40d1['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ji(_0xa54752){let _0x2f5858=0x0;for(;_0xa54752['parentNode'];)_0xa54752=_0xa54752['parentNode'],_0x2f5858++;return _0x2f5858;}function Ji(_0x42cf0d){const _0x263dad=[];let _0x1b1c86=_0x42cf0d['nextSibling'];for(;_0x1b1c86;)_0x263dad['push'](_0x1b1c86),_0x1b1c86=_0x1b1c86['nextSibling'];_0x263dad['forEach'](_0x143ac6=>{_0x8926a6(_0x143ac6);});}class AIResponseParser extends/* #__PURE__ -- @preserve */
25
- ht(){['_m2html'];constructor(){super();const _0x130d30=Object['entries'](_0x5ed1bb),_0x16c539=_0x130d30['findIndex'](([_0x3f4272])=>'rehypeDomRaw'===_0x3f4272);if(-0x1===_0x16c539)throw new at('ai-response-parser-unable-to-set-up-parser');_0x130d30['splice'](_0x16c539+0x1,0x0,['rehypeSanitize',_0x3905b6]),this['_m2html']=new _0x589477({'plugins':Object['fromEntries'](_0x130d30)});}['convertMarkdownToHTML'](_0x405bec){const _0x43957a=this['_m2html']['parse'](_0x405bec);return this['parseAndNormalizeHTML'](_0x43957a);}['parseAndNormalizeHTML'](_0x73c559){return this['_parseHTML'](_0x73c559);}['_parseHTML'](_0x16cce7){const _0x1b364c=Fi('<dummy>'+_0x16cce7['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x1b364c['children']=_0x1b364c['children'][0x0]['children'],_0x1b364c;}}class AIResponseApplier extends/* #__PURE__ -- @preserve */
26
- ht(){['_generateUid'];['_uidCounter']=0x0;['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x2069db){super(),this['_generateUid']=_0x2069db||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x1225b2,_0x36b16a,_0x491ad1){this['_uidCounter']=0x0;const _0x1b306d=_0x1225b2['cloneNode'](!0x0),_0x4d812e=_0x1b306d['childNodes'],_0x17797b=Array['from'](_0x4d812e)['filter'](_0x4f3ddb=>!(0x3===_0x4f3ddb['nodeType']&&''===Ki(_0x4f3ddb)['trim']())),_0x4018b2=_0x17797b['length'],_0x1fff0f=new Map();for(const _0x3d981d of _0x17797b)_0x3d981d&&_0x5778d8(_0x3d981d)&&void 0x0===_0x3d981d['attribs']['data-id']&&qi(_0x3d981d,'data-id','new-element');if(0x0===_0x36b16a['childNodes']['length']){const _0x24290d=[];return Yi('data-id','new-element',_0x1b306d)['forEach'](_0x537fd2=>{const _0x302c23=this['_generateUid']();qi(_0x537fd2,'data-id',_0x302c23),_0x24290d['push'](_0x302c23);}),this['_removeSpecialComments'](_0x1b306d),{'parsedContent':_0x1b306d,'newNodeIds':_0x24290d,'modifiedNodeIds':[],'removedNodeIds':[],'newAnchorIds':_0x1fff0f};}_0x491ad1&&_0x491ad1['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x1b306d),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Yi('data-id',null,_0x36b16a)['map'](_0x15d99b=>$i(_0x15d99b,'data-id'))['filter'](_0x56716e=>!!_0x56716e));let _0x285297=-0x1,_0x2e5be9=!0x1;for(let _0x25769f=0x0;_0x25769f<_0x4018b2;_0x25769f++){const _0x521fab=_0x17797b[_0x25769f],_0x1853eb=_0x17797b[_0x25769f+0x1];if(this['_isNewNode'](_0x521fab)){if(-0x1===_0x285297&&(_0x285297=_0x25769f),this['_markWrappedElements'](_0x521fab),!this['_isNewNode'](_0x1853eb)){const [_0x2f0b5d,_0x3e3162]=this['_findReferenceNode'](_0x521fab,_0x2e5be9,_0x36b16a);if(_0x2f0b5d){const _0x5484fd=Array['from'](_0x17797b)['slice'](_0x285297,_0x25769f+0x1),_0x4245cd=$i(_0x2f0b5d,'data-id');if(this['_insertNodes'](_0x2f0b5d,_0x5484fd,_0x3e3162),_0x4245cd)for(const _0x5b764c of _0x5484fd){const _0x338a03=$i(_0x5b764c,'data-id');_0x338a03&&_0x1fff0f['set'](_0x338a03,_0x4245cd);}_0x285297=-0x1;}}}else{if(this['_isExistingContentComment'](_0x521fab))_0x2e5be9=!0x0;else{if(this['_isExistingNode'](_0x521fab)){const _0x10bd42=$i(_0x521fab,'data-id');if(_0x10bd42&&this['_existingDataIds']['has'](_0x10bd42)){const _0x486393=Wi('data-id',_0x10bd42,_0x36b16a);this['_replaceNode'](_0x486393,_0x521fab);}}else{if(this['_isDelNode'](_0x521fab)){const _0x48d174=this['_getNodeDataId'](_0x521fab);!!Wi('data-id',_0x48d174,_0x1b306d)||this['_touchedNodesState']['removedIds']['push'](_0x48d174);}}}}}for(const _0x326a00 of this['_touchedNodesState']['removedIds']){const _0x1027cb=Wi('data-id',_0x326a00,_0x36b16a);_0x1027cb&&this['_removeNode'](_0x1027cb,_0x326a00,_0x491ad1);}if(Yi('data-id','new-element',_0x36b16a)['forEach'](_0x26fc74=>{const _0x483a2a=this['_getUid'](_0x26fc74);qi(_0x26fc74,'data-id',_0x483a2a),this['_touchedNodesState']['newIds']['push'](_0x483a2a);}),this['_removeSpecialComments'](_0x36b16a),_0x491ad1&&_0x491ad1['markUnstableElements']&&this['_markUnstableElements'](_0x36b16a,_0x491ad1['markUnstableElementsDepth']||0x0),this['_processWrappedElements'](_0x36b16a,_0x491ad1),_0x491ad1&&_0x491ad1['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){const _0x5e9e77=Yi('data-id',this['_touchedNodesState']['lastTouchedId'],_0x36b16a);let _0x44485e=_0x5e9e77[_0x5e9e77['length']-0x1];for(;_0x44485e;)Ji(_0x44485e),_0x44485e=_0x44485e['parentNode'];}return{'parsedContent':_0x36b16a,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds'],'newAnchorIds':_0x1fff0f};}['_insertNodes'](_0x5bbcd0,_0x7f25d3,_0x8d1ae1){for(const _0x142a17 of _0x7f25d3){const _0x17d6df=this['_getUid'](_0x142a17);qi(_0x142a17,'data-id',_0x17d6df),this['_touchedNodesState']['newIds']['push'](_0x17d6df),this['_touchedNodesState']['lastTouchedId']=_0x17d6df;}const _0xf864a0='afterbegin'===_0x8d1ae1||'afterend'===_0x8d1ae1?_0x7f25d3['reverse']():_0x7f25d3;for(const _0x2c3f97 of _0xf864a0)Qi(_0x5bbcd0,_0x2c3f97,_0x8d1ae1);}['_replaceNode'](_0x276699,_0x188482){if(!_0x276699)return;if(_0x3fc42e=_0x188482,zi(Ki(_0x276699))===zi(Ki(_0x3fc42e)))return;var _0x3fc42e;const _0x5a8a17=this['_getUid'](_0x276699);qi(_0x188482,'data-id',_0x5a8a17),this['_touchedNodesState']['modifiedIds']['push'](_0x5a8a17),this['_touchedNodesState']['lastTouchedId']=_0x5a8a17,_0x1a09b2(_0x276699,_0x188482['cloneNode'](!0x0));}['_removeNode'](_0x4147b6,_0x1b327a,_0x30eed9){if(_0x30eed9&&_0x30eed9['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x1b327a;const _0x287668=_0x30eed9['replaceRemovedWith']['cloneNode'](!0x0);qi(_0x287668,'data-id',_0x1b327a),qi(_0x287668,'data-removed','true'),_0x1a09b2(_0x4147b6,_0x287668);}else _0x8926a6(_0x4147b6);}['_findReferenceNode'](_0x2165de,_0x352c86,_0x5cbdd5){const _0x5f2cdd=this['_findPrevElementWithDataId'](_0x2165de,!0x1);if(_0x5f2cdd){const _0x1ca88a=this['_getNodeDataId'](_0x5f2cdd),_0x3edb96=Wi('data-id',_0x1ca88a,_0x5cbdd5);if(_0x3edb96)return[_0x3edb96,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x1ca88a);}const _0x648d3a=this['_findNextElementWithDataId'](_0x2165de,!0x1);if(_0x648d3a){const _0x27884d=this['_getNodeDataId'](_0x648d3a),_0x4c98a3=Wi('data-id',_0x27884d,_0x5cbdd5);if(_0x4c98a3)return[_0x4c98a3,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x27884d);}return _0x352c86?_0x2165de['nextSibling']?this['_findFallbackReferenceNode'](_0x2165de,_0x5cbdd5):[_0x5cbdd5['childNodes'][_0x5cbdd5['childNodes']['length']-0x1],'afterend']:[_0x5cbdd5['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x2efe52,_0x244179){const _0x1b592e=[],_0x1dd43b=this['_findPrevElementWithDataId'](_0x2efe52,!0x0);if(_0x1dd43b){const _0x27feb9=Wi('data-id',this['_getNodeDataId'](_0x1dd43b),_0x244179);_0x27feb9&&_0x1b592e['push']([_0x27feb9,'afterend']);}const _0x5a33af=this['_findNextElementWithDataId'](_0x2efe52,!0x0);if(_0x5a33af){const _0xa56eef=Wi('data-id',this['_getNodeDataId'](_0x5a33af),_0x244179);_0xa56eef&&_0x1b592e['push']([_0xa56eef,'beforebegin']);}if(_0x1b592e['length']>0x1)return ji(_0x1b592e[0x0][0x0])<=ji(_0x1b592e[0x1][0x0])?_0x1b592e[0x0]:_0x1b592e[0x1];return 0x1===_0x1b592e['length']?_0x1b592e[0x0]:[_0x244179['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x176c03,_0x2f1b0e){let _0xa81867=_0x176c03['nextSibling'],_0x33fd61=null,_0x58e792=!0x1;for(;_0xa81867;){if(_0x51bc24(_0xa81867)){if(this['_isDelNode'](_0xa81867)&&(_0x33fd61=_0xa81867),this['_isExistingContentComment'](_0xa81867)&&_0x2f1b0e&&!_0x58e792){_0x58e792=!0x0,_0xa81867=_0xa81867['nextSibling'];continue;}break;}const _0x4124c0=$i(_0xa81867,'data-id');if(_0x4124c0&&'new-element'!==_0x4124c0&&this['_existingDataIds']['has'](_0x4124c0)){_0x33fd61=_0xa81867;break;}_0xa81867=_0xa81867['nextSibling'];}return _0x33fd61;}['_findPrevElementWithDataId'](_0x3d1c33,_0x5398a7){let _0x39ff5b=_0x3d1c33['previousSibling'],_0x4ceab0=null,_0x3a8b62=!0x1;for(;_0x39ff5b;){if(_0x51bc24(_0x39ff5b)){if(this['_isDelNode'](_0x39ff5b)&&(_0x4ceab0=_0x39ff5b),this['_isExistingContentComment'](_0x39ff5b)&&_0x5398a7&&!_0x3a8b62){_0x3a8b62=!0x0,_0x39ff5b=_0x39ff5b['previousSibling'];continue;}break;}const _0x28a561=$i(_0x39ff5b,'data-id');if(_0x28a561&&'new-element'!==_0x28a561&&this['_existingDataIds']['has'](_0x28a561)){_0x4ceab0=_0x39ff5b;break;}_0x39ff5b=_0x39ff5b['previousSibling'];}return _0x4ceab0;}['_markWrappedElements'](_0x4a9f45){_0x5778d8(_0x4a9f45)&&Yi('data-id',null,_0x4a9f45)['forEach'](_0x566982=>{this['_isExistingNode'](_0x566982)&&(qi(_0x566982,'data-wrapped-id',$i(_0x566982,'data-id')),qi(_0x566982,'data-id',null));});}['_processWrappedElements'](_0x1f722a,_0x1dba13){Yi('data-wrapped-id',null,_0x1f722a)['forEach'](_0x47f992=>{const _0x904143=$i(_0x47f992,'data-wrapped-id');if($i(_0x47f992,'data-unstable')||this['_hasUnstableParent'](_0x47f992))return;const _0x493a8d=Wi('data-id',_0x904143,_0x1f722a);qi(_0x47f992,'data-id',_0x904143),qi(_0x47f992,'data-wrapped-id',null),_0x493a8d&&(this['_removeNode'](_0x493a8d,_0x904143,_0x1dba13),this['_touchedNodesState']['removedIds']['push'](_0x904143),this['_touchedNodesState']['lastTouchedId']=_0x904143);});}['_hasUnstableParent'](_0x9448c){let _0x4c2d8c=_0x9448c['parentNode'];for(;_0x4c2d8c;){if($i(_0x4c2d8c,'data-unstable'))return!0x0;_0x4c2d8c=_0x4c2d8c['parentNode'];}return!0x1;}['_getNodeDataId'](_0x5eec3f){if(!_0x5eec3f)return null;if(_0x5778d8(_0x5eec3f))return $i(_0x5eec3f,'data-id');if(_0x51bc24(_0x5eec3f)){const _0x15e792=Ki(_0x5eec3f)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x15e792&&_0x15e792[0x1])return _0x15e792[0x1];}return null;}['_getUid'](_0xda44a4){return this['_isExistingNode'](_0xda44a4)?$i(_0xda44a4,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x3f59fc){(function(_0x4e8d91){return _0x18d527(_0x5d1939=>_0x51bc24(_0x5d1939),_0x4e8d91,!0x0,0x1/0x0);}(_0x3f59fc)['filter'](_0x3889f1=>this['_isDelNode'](_0x3889f1)||this['_isExistingContentComment'](_0x3889f1))['forEach'](_0x36b87c=>{_0x8926a6(_0x36b87c);}));}['_markLastTagElementUnstable'](_0x52fa99){const _0x5311ea=_0x52fa99['childNodes'],_0x27ac33=_0x5311ea[_0x5311ea['length']-0x1];_0x27ac33&&_0x5778d8(_0x27ac33)&&qi(_0x27ac33,'data-unstable','true');}['_markUnstableElements'](_0x1ce914,_0x433175){const _0x719b3d=Wi('data-unstable','true',_0x1ce914);if(!_0x719b3d)return;const _0x5b8367=Xi(_0x719b3d)['slice'](0x0,-0x1),_0x49c0e1=_0x5b8367['length'];let _0x3d59d1=_0x719b3d;if(_0x49c0e1>_0x433175){let _0x3bd4c9=_0x49c0e1,_0x114f31=null;for(;_0x3bd4c9>_0x433175&&_0x3bd4c9>=0x0;)_0x3bd4c9--,_0x114f31=_0x5b8367[_0x3bd4c9];_0x114f31&&(_0x3d59d1=_0x114f31,qi(_0x719b3d,'data-unstable',null),qi(_0x114f31,'data-unstable','true'));}else{if(_0x49c0e1<_0x433175){let _0x306c55=_0x49c0e1,_0x112809=_0x719b3d;for(;_0x306c55<_0x433175;){const _0x589ad2=_0x112809['childNodes']['filter'](_0x5c866d=>_0x5778d8(_0x5c866d));if(0x0===_0x589ad2['length'])break;_0x306c55++,_0x112809=_0x589ad2[_0x589ad2['length']-0x1];}_0x112809&&(_0x3d59d1=_0x112809,qi(_0x719b3d,'data-unstable',null),qi(_0x112809,'data-unstable','true'));}}let _0x408dd9=_0x3d59d1;for(;_0x408dd9;){for(;_0x408dd9['nextSibling'];)_0x408dd9=_0x408dd9['nextSibling'],_0x5778d8(_0x408dd9)&&qi(_0x408dd9,'data-unstable','true');_0x408dd9=_0x408dd9['parentNode'];}}['_isNewNode'](_0xb9a66){return Boolean('new-element'===$i(_0xb9a66,'data-id'));}['_isExistingNode'](_0x2cad97){return Boolean(($i(_0x2cad97,'data-id')||'')['length']>0x0&&'new-element'!==$i(_0x2cad97,'data-id'));}['_isDelNode'](_0x5b014c){return!!_0x5b014c&&Boolean(_0x51bc24(_0x5b014c)&&Ki(_0x5b014c)['match'](/removed[\s*-]data-id="[^"]+"/));}['_isExistingContentComment'](_0x5726ab){return Boolean(_0x51bc24(_0x5726ab)&&Ki(_0x5726ab)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Zi({editor:_0x6689cd,changeGroups:_0x36e6c7,documentContextContent:_0x24858a,showDiff:_0x280067,trimUnchanged:_0x285b3a=!0x0}){return _0x36e6c7['map'](_0x24e42c=>{const _0x1cfe80=new _0x617866([]),_0x3acbc8=new _0x617866([]),_0x2ae909=new Set();for(const _0x9d1caa of _0x24e42c['changes'])'new'==_0x9d1caa['type']&&Yi('data-id',null,_0x9d1caa['node'])['forEach'](_0x44fe3e=>{_0x2ae909['add']($i(_0x44fe3e,'data-id'));});for(const _0x1a34ca of _0x24e42c['changes'])if('removed'!=_0x1a34ca['type']?_0x3acbc8['children']['push'](_0x1a34ca['node']['cloneNode'](!0x0)):_0x280067||_0x2ae909['has'](_0x1a34ca['id'])||_0x3acbc8['children']['push'](_0x1a34ca['node']['cloneNode'](!0x0)),'new'!=_0x1a34ca['type']&&(_0x280067||'removed'!=_0x1a34ca['type'])){const _0x4c3ddd=_0x10d1dd(_0x308d1b=>$i(_0x308d1b,'data-id')==_0x1a34ca['id'],_0x24858a,!0x0);_0x4c3ddd&&_0x1cfe80['children']['push'](_0x4c3ddd['cloneNode'](!0x0));}const {content:_0x568334,hasChanges:_0x2f9d37}=function(_0x5e0bb,_0x536525,_0x1fc112,_0x540da4,_0x930dc6=!0x0){const _0x4ebd6b=_0x5e0bb['plugins']['get']('DocumentCompare'),_0x3f40f2=Ki(_0x536525),_0xa021b1=Ki(_0x1fc112),_0x1cf9f2=_0x5e0bb['data']['parse'](_0x3f40f2,'$root'),_0x20fcf3=_0x5e0bb['model']['createPositionAt'](_0x1cf9f2,0x0),_0x5977af=_0x4ebd6b['getDiff'](_0x3f40f2,_0xa021b1,{'anchor':_0x20fcf3,'markDeletions':_0x540da4,'targetEditor':_0x5e0bb}),_0x38383f=_0x5977af['getOperations']();if(0x0==_0x38383f['length'])return{'content':_0x536525['cloneNode'](!0x0),'hasChanges':!0x1};_0x540da4?function(_0xf72afe,_0x23e62f,_0x157b81){if(0x0==_0xf72afe['length'])return;const _0x501e32=_0x157b81['plugins']['get']('DocumentCompare'),_0x5b8936=_0x157b81['plugins']['get']('SuggestionsConversion');_0x157b81['model']['change'](_0x130c8c=>{const _0x1e020f=new Set();for(let _0x108191=0x0;_0x108191<_0xf72afe['length'];_0x108191++){const _0x3d585a=_0xf72afe[_0x108191];if(_0x3d585a['baseVersion']=null,_0x3d585a['isDocumentOperation']=!0x1,_0x501e32['isMarkedRemoveOperation'](_0x3d585a)){const _0x1bfd50=_0x331213(_0x3d585a['newRange'],_0x157b81['model']),_0x79a25b='suggestion:deletion:'+ot()+':$aiSuggestion';_0x23e62f['markers']['set'](_0x79a25b,_0x1bfd50);}else switch(_0x3d585a['type']){case'rename':{if(_0x3d585a['oldName']==_0x3d585a['newName'])break;_0x130c8c['batch']['addOperation'](_0x3d585a),_0x157b81['model']['applyOperation'](_0x3d585a);const _0x51501d='$elementName',_0x2b38a5=_0x3d585a['position'],_0x3bc496=_0x157b81['model']['createRange'](_0x2b38a5,_0x157b81['model']['createPositionAt'](_0x2b38a5['nodeAfter'],'end')),_0x3c24f2='suggestion:attribute:'+_0x51501d+':'+ot()+':$aiSuggestion';_0x23e62f['markers']['set'](_0x3c24f2,_0x3bc496);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x3d585a['oldValue']==_0x3d585a['newValue'])break;_0x130c8c['batch']['addOperation'](_0x3d585a),_0x157b81['model']['applyOperation'](_0x3d585a);const _0x4eb0c5=_0x3d585a['key'];if(!_0x5b8936['isRegisteredAttribute'](_0x4eb0c5))break;const _0x209f4e=_0x331213(_0x3d585a['range'],_0x157b81['model']),_0x171540='suggestion:attribute:'+_0x4eb0c5+':'+ot()+':$aiSuggestion';_0x23e62f['markers']['set'](_0x171540,_0x209f4e);break;}case'insert':{_0x130c8c['batch']['addOperation'](_0x3d585a),_0x157b81['model']['applyOperation'](_0x3d585a);if(_0xf72afe[_0x108191+0x1]&&'move'==_0xf72afe[_0x108191+0x1]['type']){ts(_0x23e62f,_0x3d585a);break;}const _0x547af5=_0x3d585a['position'],_0x10a892=_0x3d585a['howMany'],_0x2b0874=_0x331213(_0x157b81['model']['createRange'](_0x547af5,_0x547af5['getShiftedBy'](_0x10a892)),_0x157b81['model']),_0x563344='suggestion:insertion:'+ot()+':$aiSuggestion';_0x23e62f['markers']['set'](_0x563344,_0x2b0874);break;}case'split':{_0x130c8c['batch']['addOperation'](_0x3d585a),_0x157b81['model']['applyOperation'](_0x3d585a);const _0x32ba52=_0x3d585a['splitPosition'],_0x45619d=_0x3d585a['moveTargetPosition'],_0x1c1826=_0x157b81['model']['createRange'](_0x32ba52,_0x45619d),_0x10969a='suggestion:insertion:'+ot()+':$aiSuggestion';_0x23e62f['markers']['set'](_0x10969a,_0x1c1826);break;}case'move':{_0x130c8c['batch']['addOperation'](_0x3d585a),_0x157b81['model']['applyOperation'](_0x3d585a),_0xf72afe[_0x108191-0x1]&&'insert'==_0xf72afe[_0x108191-0x1]['type']&&ts(_0x23e62f,_0x3d585a);const _0x355c78=_0x3d585a['getMovedRangeStart'](),_0xfc1031=_0x3d585a['howMany'];for(let _0x3e4d8f=0x0;_0x3e4d8f<_0xfc1031;_0x3e4d8f++){const _0x25ff00=_0x355c78['getShiftedBy'](_0x3e4d8f)['nodeAfter'];_0x1e020f['add'](_0x25ff00);}break;}case'remove':{const _0xbb5b64=_0x3d585a['sourcePosition'],_0x3642a3=_0x3d585a['howMany'],_0x403a7f=new _0x42f63b(_0xbb5b64,_0x3642a3);_0x130c8c['batch']['addOperation'](_0x403a7f),_0x157b81['model']['applyOperation'](_0x403a7f);break;}}}for(const _0x397351 of _0x1e020f){const _0x2cdc8e=_0x157b81['model']['createRangeOn'](_0x397351),_0x48ed76='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x23e62f['markers']['set'](_0x48ed76,_0x331213(_0x2cdc8e,_0x157b81['model']));}});}(_0x38383f,_0x1cf9f2,_0x5e0bb):_0x5e0bb['model']['change'](_0x252f96=>{for(const _0xd0ee8e of _0x38383f)if('remove'==_0xd0ee8e['type']){const _0x4b5066=_0xd0ee8e['sourcePosition'],_0x4aa142=_0xd0ee8e['howMany'],_0x17436f=new _0x42f63b(_0x4b5066,_0x4aa142);_0x252f96['batch']['addOperation'](_0x17436f),_0x5e0bb['model']['applyOperation'](_0x17436f);}else{if('marker'==_0xd0ee8e['type']){const _0x8cac11=_0xd0ee8e['name'],_0x75f32c=_0xd0ee8e['newRange'];null!==_0x75f32c?_0x1cf9f2['markers']['set'](_0x8cac11,_0x75f32c):_0x1cf9f2['markers']['delete'](_0x8cac11);}else _0xd0ee8e['baseVersion']=null,_0xd0ee8e['isDocumentOperation']=!0x1,_0x252f96['batch']['addOperation'](_0xd0ee8e),_0x5e0bb['model']['applyOperation'](_0xd0ee8e);}});if(_0x930dc6){const _0x33d560=es(_0x5e0bb,_0x38383f,_0x1cf9f2);is(_0x5e0bb['model'],_0x33d560),function(_0xdd3c8e,_0x5c889f){const _0x551bc9=_0x5c889f['getFirstRange']()['start'];let _0x499549=_0x5c889f['getFirstRange']()['end'];const _0x2abf06=_0x551bc9['root'];(_0x499549['textNode']||_0x499549['nodeAfter']&&_0x499549['nodeAfter']['is']('$text'))&&(_0x967622(_0x499549,'...'),_0x499549=_0x499549['getShiftedBy'](0x3)),(_0x551bc9['textNode']||_0x551bc9['nodeBefore']&&_0x551bc9['nodeBefore']['is']('$text'))&&(_0x967622(_0x551bc9,'...'),function(_0x40109a,_0xedab99,_0x4a90ef){for(let [_0x2acb9a,_0x1c8286]of _0x40109a['markers']){const _0x125bd6=_0x1c8286['_getTransformedByInsertion'](_0xedab99,_0x4a90ef,!0x1);_0x1c8286=_0x125bd6[0x0],_0x40109a['markers']['set'](_0x2acb9a,_0x1c8286);}}(_0x2abf06,_0x551bc9,0x3),_0x551bc9['parent']==_0x499549['parent']&&(_0x499549=_0x499549['getShiftedBy'](0x3)));const _0x49ea64=_0xdd3c8e['createRange'](_0xdd3c8e['createPositionAt'](_0x2abf06,0x0),_0x551bc9),_0xcc7a71=_0xdd3c8e['createRange'](_0x499549,_0xdd3c8e['createPositionAt'](_0x2abf06,'end')),_0x54a45b=[..._0x49ea64['getMinimalFlatRanges'](),..._0xcc7a71['getMinimalFlatRanges']()];_0x54a45b['reverse']();for(const _0x456112 of _0x54a45b)_0x5b03c0(_0x456112),ns(_0x2abf06,_0x456112);}(_0x5e0bb['model'],_0x33d560);}const _0x2ffbea=_0x5e0bb['data']['stringify'](_0x1cf9f2,{'showSuggestionHighlights':!0x0});return{'content':Fi(_0x2ffbea),'hasChanges':!0x0};}(_0x6689cd,_0x1cfe80,_0x3acbc8,_0x280067,_0x285b3a);return{'type':_0x24e42c['changes'][0x0]['type'],'index':_0x24e42c['index'],'content':_0x568334,'hasChanges':_0x2f9d37};});}function ts(_0x35f63f,_0x475889){for(const [_0x51ecde,_0xe3dfa7]of _0x35f63f['markers']){const _0x4bf195=_0x5d6ed6['_createFromRanges'](_0xe3dfa7['getTransformedByOperation'](_0x475889));_0x35f63f['markers']['set'](_0x51ecde,_0x4bf195);}}function es(_0x29b85f,_0x3fa7be,_0x14c0da){const _0x57bb54=_0x29b85f['plugins']['get']('DocumentCompare');let _0x3bb38d=_0x29b85f['model']['createPositionAt'](_0x14c0da,Number['POSITIVE_INFINITY']),_0x4a1a82=_0x29b85f['model']['createPositionAt'](_0x14c0da,0x0);for(const _0x998fa7 of _0x3fa7be){let _0x7e68ef,_0x137039;if(_0x57bb54['isMarkedRemoveOperation'](_0x998fa7))_0x7e68ef=_0x998fa7['newRange']['start'],_0x137039=_0x998fa7['newRange']['end'];else switch(_0x3bb38d=_0x3bb38d['getTransformedByOperation'](_0x998fa7),_0x4a1a82=_0x4a1a82['getTransformedByOperation'](_0x998fa7),_0x998fa7['type']){case'rename':_0x7e68ef=_0x998fa7['position'],_0x137039=_0x7e68ef['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x7e68ef=_0x998fa7['range']['start'],_0x137039=_0x998fa7['range']['end'];break;case'insert':_0x7e68ef=_0x998fa7['position'],_0x137039=_0x7e68ef['getShiftedBy'](_0x998fa7['howMany']);break;case'split':_0x7e68ef=_0x998fa7['splitPosition'],_0x137039=_0x998fa7['moveTargetPosition'];break;case'merge':{const _0x3e993f=_0x998fa7['targetPosition']['path']['slice'](0x0,-0x1);_0x7e68ef=_0x29b85f['model']['createPositionFromPath'](_0x14c0da,_0x3e993f),_0x137039=_0x7e68ef['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0xeac10e=_0x998fa7['howMany'],_0x312987=_0x998fa7['sourcePosition']['_getTransformedByInsertion'](_0x998fa7['targetPosition'],_0xeac10e),_0x27ad54=_0x998fa7['getMovedRangeStart']();'remove'==_0x998fa7['type']?(_0x7e68ef=_0x312987,_0x137039=_0x312987):(_0x7e68ef=_0x27ad54,_0x137039=_0x27ad54['getShiftedBy'](_0xeac10e));break;}}_0x7e68ef&&_0x7e68ef['isBefore'](_0x3bb38d)&&(_0x3bb38d=_0x7e68ef['clone'](),_0x3bb38d['stickiness']='toNone'),_0x137039&&_0x137039['isAfter'](_0x4a1a82)&&(_0x4a1a82=_0x137039['clone'](),_0x4a1a82['stickiness']='toNone');}return _0x29b85f['model']['createSelection'](_0x29b85f['model']['createRange'](_0x3bb38d,_0x4a1a82));}function is(_0x3323f5,_0x4a4606){ss(_0x3323f5,_0x4a4606,'forward');const _0x3dff1d=_0x4a4606['getFirstRange']();_0x4a4606['setTo']([]),_0x4a4606['setTo'](_0x3dff1d,{'backward':!0x0}),ss(_0x3323f5,_0x4a4606,'backward');}function ss(_0x5a130e,_0xf40c55,_0x5840aa){let _0x2e5c43=0x14;for(;_0x2e5c43;){_0x5a130e['modifySelection'](_0xf40c55,{'unit':'word','direction':_0x5840aa}),_0x2e5c43--;const _0x48059e=_0xf40c55['focus']['forward'==_0x5840aa?'nodeBefore':'nodeAfter'];if(_0x48059e&&_0x48059e['is']('element')&&_0x5a130e['schema']['isBlock'](_0x48059e)&&_0x5a130e['schema']['isObject'](_0x48059e))break;}}function ns(_0x2df77b,_0x3c9aac){for(const [_0x2e30fd,_0x4ad49c]of _0x2df77b['markers']){const _0x127de8=_0x4ad49c['_getTransformedByDeletion'](_0x3c9aac['start'],_0x3c9aac['end']['offset']-_0x3c9aac['start']['offset']);null!=_0x127de8?_0x2df77b['markers']['set'](_0x2e30fd,_0x127de8):_0x2df77b['markers']['delete'](_0x2e30fd);}}class AIReply extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x617866([]);['parsedMergedContent']=new _0x617866([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['documentId'];['dataIdDocumentSources'];['newNodeAnchorIds']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x454e7f,content:_0x4d97f1='',isDone:_0x2f4979=!0x1,isComplete:_0x314651,interactionId:_0x37cdce,areActionsDisabled:_0x761cc,isFromHistory:_0x3b4d22=!0x1,documentContextContent:_0xa258f6,dataIdDocumentSources:_0xe6fa70,documentId:_0x514c72,locale:_0x2aaf77,id:_0x3be9fd}){super(),this['id']=_0x3be9fd||ot(),this['interactionId']=_0x37cdce,this['type']=_0x454e7f,this['areActionsDisabled']=!!_0x761cc,this['locale']=_0x2aaf77,this['dataIdDocumentSources']=_0xe6fa70,this['documentId']=_0x514c72,this['isFromHistory']=_0x3b4d22,this['aiResponseParser']=new AIResponseParser(),this['aiResponseApplier']=new AIResponseApplier(),this['documentContextContent']=Fi(_0xa258f6||''),this['set']('isDone',_0x2f4979),this['set']('isComplete',_0x314651??_0x2f4979),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x4d97f1);}['appendContent'](_0x3cff90){this['set']('content',this['content']+_0x3cff90);}['done'](_0x2f1879=!0x0){this['isComplete']=_0x2f1879,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x287b10,_0x15764e){this['changeGroups'][_0x287b10]['state']=_0x15764e,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x287b10,'state':_0x15764e});}['getContentParts']({showDiff:_0x455bd1,groupIndex:_0x1678cf,editor:_0x2c9dce}){const _0x276b02=this['_getCachedContentParts'](_0x455bd1,_0x1678cf);if(_0x276b02)return _0x276b02;let _0x49b5ee=[];if(void 0x0===_0x1678cf)_0x49b5ee=this['changeGroups'];else{const _0xc55d79=this['changeGroups']['find'](({index:_0x4add64})=>_0x4add64===_0x1678cf);if(!_0xc55d79)throw new at('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x1678cf});_0x49b5ee=[_0xc55d79];}const _0x674509=Zi({'editor':_0x2c9dce,'showDiff':_0x455bd1,'changeGroups':_0x49b5ee,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x455bd1,_0x674509),_0x674509;}['_getCachedContentParts'](_0x3a4196,_0x2dffdf){const _0x202bc2=_0x3a4196?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x202bc2]['length'])return null;const _0x524746=this['cachedSuggestionContentParts'][_0x202bc2];if(void 0x0===_0x2dffdf)return _0x524746['length']>0x0&&_0x524746['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x3a4196,null),null):_0x4d8886(_0x524746);{const _0xfe2368=_0x524746['find'](({index:_0x244019})=>_0x244019===_0x2dffdf);if(_0xfe2368)return[_0x4d8886(_0xfe2368)];}return null;}['_setCachedContentParts'](_0x3549fd,_0x4d38a3){const _0x531815=_0x3549fd?'withDiff':'withoutDiff';_0x4d38a3?_0x4d38a3['forEach'](_0x13f003=>{const _0x50bcb1=this['cachedSuggestionContentParts'][_0x531815],_0x4e65e4=_0x50bcb1['find'](({index:_0x502604})=>_0x502604===_0x13f003['index']);if(_0x4e65e4){const _0x96fd2d=_0x50bcb1['indexOf'](_0x4e65e4);_0x50bcb1['splice'](_0x96fd2d,0x1,_0x13f003);}else _0x50bcb1['push'](_0x13f003);}):this['cachedSuggestionContentParts'][_0x531815]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x4f0a2c=this['changeGroups'];this['updateChangeGroups']();const _0x17b71d=this['_getDifferentChangeGroups'](_0x4f0a2c,this['changeGroups']);(_0x17b71d['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x17b71d),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x501357,_0x2ff7fc){const _0x4fddb8=[];for(const _0x226570 of _0x2ff7fc){const _0x1e614a=_0x501357[_0x226570['index']];_0x1e614a?_0x1e614a['changes']['length']!==_0x226570['changes']['length']?_0x4fddb8['push'](_0x226570):_0x1e614a['changes']['forEach']((_0x3de856,_0x5dc61f)=>{const _0x5b749d=_0x226570['changes'][_0x5dc61f];_0x3de856['id']!==_0x5b749d['id']&&_0x4fddb8['push'](_0x226570);}):_0x4fddb8['push'](_0x226570);}return _0x4fddb8;}['updateChangeGroups'](){const _0x335736=this['locale']?new _0x1f4caa('p',{},[new _0x1f4caa('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x54c8f4(Hi(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]):void 0x0,_0x5da2a5=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x335736,'cutAfterLastChange':!this['isDone']||!this['isComplete']});if(!_0x5da2a5['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x5da2a5['parsedContent'],this['newNodeAnchorIds']=_0x5da2a5['newAnchorIds'];let _0x252c5a=[];if(_0x11b699(_0x4f4734=>{const _0x6dfadf=$i(_0x4f4734,'data-id');if(!_0x6dfadf||!_0x3dc60c(_0x6dfadf))return!0x1;const _0x42701a=[_0x4f4734,...Xi(_0x4f4734)]['at'](-0x2);if(_0x4f4734!=_0x42701a){const _0x79d5fa=$i(_0x42701a,'data-id');_0x3dc60c(_0x79d5fa)||(_0x252c5a['push']({'node':_0x42701a,'id':_0x79d5fa,'type':'modified'}),_0x5da2a5['modifiedNodeIds']['push'](_0x79d5fa));}else _0x5da2a5['modifiedNodeIds']['includes'](_0x6dfadf)?_0x252c5a['push']({'node':_0x4f4734,'type':'modified','id':_0x6dfadf}):_0x5da2a5['newNodeIds']['includes'](_0x6dfadf)?_0x252c5a['push']({'node':_0x4f4734,'type':'new','id':_0x6dfadf,'anchorId':$i(_0x4f4734['previousSibling'],'data-id')}):_0x252c5a['push']({'node':_0x4f4734,'type':'removed','id':_0x6dfadf});return!0x0;},this['parsedMergedContent']),_0x252c5a=_0x252c5a['filter'](({node:_0x2c7eaa})=>[...Xi(_0x2c7eaa),_0x2c7eaa]['every'](_0x5861ba=>!$i(_0x5861ba,'data-unstable'))),0x0==_0x252c5a['length'])return;const _0x575356=[[_0x252c5a[0x0]]];for(let _0x24a3a6=0x1;_0x24a3a6<_0x252c5a['length'];_0x24a3a6++){const _0x4ce36d=_0x575356[_0x575356['length']-0x1],_0x28bc53=_0x4ce36d[_0x4ce36d['length']-0x1];_0x252c5a[_0x24a3a6]['node']['previousSibling']==_0x28bc53['node']&&'modified'!=_0x252c5a[_0x24a3a6]['type']&&'modified'!=_0x28bc53['type']&&this['_isSameDocument'](_0x252c5a[_0x24a3a6]['node'],_0x28bc53['node'])?_0x4ce36d['push'](_0x252c5a[_0x24a3a6]):_0x575356['push']([_0x252c5a[_0x24a3a6]]);}for(const _0x42fa96 of _0x575356){const _0x178842=_0x42fa96[0x0],_0x1dce57=_0x42fa96[_0x42fa96['length']-0x1],_0x3d9001=_0x592d1f(_0x178842['node']['previousSibling']);_0x3d9001&&this['_isSameDocument'](_0x3d9001['node'],_0x178842['node'])&&_0x42fa96['unshift'](_0x3d9001);const _0x221994=_0x592d1f(_0x1dce57['node']['nextSibling']);_0x221994&&this['_isSameDocument'](_0x221994['node'],_0x1dce57['node'])&&_0x42fa96['push'](_0x221994);}function _0x3dc60c(_0x1e9c2c){return _0x5da2a5['modifiedNodeIds']['includes'](_0x1e9c2c)||_0x5da2a5['newNodeIds']['includes'](_0x1e9c2c)||_0x5da2a5['removedNodeIds']['includes'](_0x1e9c2c);}function _0x592d1f(_0x4ce588){if(_0x4ce588&&$i(_0x4ce588,'data-id')&&!$i(_0x4ce588,'data-unstable')){const _0x53299f=$i(_0x4ce588,'data-id');if(!_0x3dc60c(_0x53299f))return{'node':_0x4ce588,'type':'context','id':_0x53299f};}return null;}this['changeGroups']=_0x575356['map']((_0x594198,_0x500d5e)=>({'changes':_0x594198,'state':'pending','index':_0x500d5e}));}['_isSameDocument'](_0x472ac6,_0x16922c){if(!this['dataIdDocumentSources']?.['size'])return!0x0;const _0xf2e241=this['_resolveDocumentSource'](_0x472ac6),_0xcbc2fa=this['_resolveDocumentSource'](_0x16922c);return!_0xf2e241||!_0xcbc2fa||_0xf2e241['editor']===_0xcbc2fa['editor']&&_0xf2e241['rootName']===_0xcbc2fa['rootName'];}['_resolveDocumentSource'](_0x5b6ecd){if(!_0x5b6ecd||!this['dataIdDocumentSources'])return;const _0x13362c=$i(_0x5b6ecd,'data-id');if(_0x13362c){const _0x9dd383=this['dataIdDocumentSources']['get'](_0x13362c);if(_0x9dd383)return _0x9dd383;const _0x195475=this['newNodeAnchorIds']['get'](_0x13362c),_0x7f55f8=_0x195475?this['dataIdDocumentSources']['get'](_0x195475):void 0x0;if(_0x7f55f8)return _0x7f55f8;}for(let _0x2f5019=_0x5b6ecd['previousSibling'];_0x2f5019;_0x2f5019=_0x2f5019['previousSibling']){const _0x72eda0=$i(_0x2f5019,'data-id'),_0x1b2180=_0x72eda0?this['dataIdDocumentSources']['get'](_0x72eda0):void 0x0;if(_0x1b2180)return _0x1b2180;}for(let _0x4d9d89=_0x5b6ecd['nextSibling'];_0x4d9d89;_0x4d9d89=_0x4d9d89['nextSibling']){const _0x5cbede=$i(_0x4d9d89,'data-id'),_0x319e1f=_0x5cbede?this['dataIdDocumentSources']['get'](_0x5cbede):void 0x0;if(_0x319e1f)return _0x319e1f;}}}const rs=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class AIInteraction extends Et(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['locale'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x59283f,locale:_0x5d3535}){super(),this['id']=ot(),this['connector']=_0x59283f,this['isStopped']=!0x0,this['locale']=_0x5d3535;}async['start'](){const _0x2b51ee=[];let _0x56eae2,_0x5c9ff7,_0x5e1bc4,_0x4460ff=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x500ffa=await this['currentRequest']['getStream']();for await(const _0xc3e20 of _0x500ffa){if(this['isStopped'])return;if('error'==_0xc3e20['event'])return void this['fire']('error',{'error':new at('ai-chat-interaction-error',this)});switch(_0xc3e20['event']){case'message-metadata':this['messageId']=_0xc3e20['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0xc3e20['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0xc3e20['data']['conversationTitle'],!0x0);break;case'source':_0x2b51ee['push'](_0xc3e20['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'](),_0x56eae2='modification-delta'==_0xc3e20['event']?'modification':'text',_0x5c9ff7='modification-delta'==_0xc3e20['event']?_0xc3e20['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x56eae2&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']?'modification-delta'==_0xc3e20['event']&&(this['currentReply']['documentId']=_0xc3e20['data']['documentId']):(this['currentReply']=this['createReply']({'type':_0x56eae2,'interactionId':this['id'],'id':_0x5c9ff7,...'modification-delta'==_0xc3e20['event']&&{'documentId':_0xc3e20['data']['documentId']}}),'modification'==_0x56eae2&&(this['currentReply']['sources']=_0x2b51ee['splice'](0x0))),this['currentReply']['appendContent'](_0xc3e20['data']['textDelta']);break;case'mcp-tool-result':_0x5e1bc4=JSON['parse'](_0xc3e20['data']['result']),this['_handleToolResultData']({'toolName':_0xc3e20['data']['toolName'],'data':_0x5e1bc4['data'],'attributes':_0x5e1bc4['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0xc3e20['data']['toolName'],'data':_0xc3e20['data']['data']});}}_0x4460ff=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x2b51ee['length']>0x0&&(this['currentReply']['sources']=_0x2b51ee['splice'](0x0)),this['_finalizeInteraction'](_0x4460ff),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x4ac904){return this['replies']['find'](_0x12fbab=>_0x12fbab['id']===_0x4ac904);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x33ab08=>_0x33ab08['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x5eb264){const _0x278b56=new AIReply({'locale':this['locale'],'documentContextContent':this['getDocumentContext']()?.['content'],'dataIdDocumentSources':this['getDocumentContext']()?.['dataIdDocumentSources'],..._0x5eb264});return this['replies']['push'](_0x278b56),_0x278b56['delegate'](...rs)['to'](this),this['fire']('replyCreated',_0x278b56),_0x278b56;}['setConversationTitle'](_0x4cf082,_0x3e17eb=!0x1){this['fire']('setConversationTitle',_0x4cf082,_0x3e17eb);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x2d95b1){this['fire']('toolDataReceived',{'type':'result','toolName':_0x2d95b1['toolName'],'data':structuredClone(_0x2d95b1['data']||{}),'attributes':structuredClone(_0x2d95b1['attributes']||{})},this);}['_handleToolNotificationData'](_0x13f733){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x13f733['toolName'],'data':structuredClone(_0x13f733['data'])},this);}['_finalizeInteraction'](_0x4ba274=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x4ba274),this['currentRequest']=this['currentReply']=void 0x0;}}const os=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']]),as=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class AIChatContext extends ht(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x3f1c40,config:_0x198c8f,ownerId:_0x17f3e7}){super(),this['_connector']=_0x3f1c40,this['_config']=_0x198c8f,this['_ownerId']=_0x17f3e7;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_documentSources']=new Map(),this['_dataIdToSource']=new Map(),this['_setAddContextOptionsDefaultState']();}['_getDocumentSource'](_0xf71ac8){if(_0xf71ac8)return this['_documentSources']['get'](_0xf71ac8);}['getSourceByDataId'](_0x10ede1){if(_0x10ede1)return this['_dataIdToSource']['get'](_0x10ede1);}['_getDocumentContextSlice'](_0x29d058){const _0x11390f=this['_getDocumentSource'](_0x29d058);if(_0x11390f)return{'editor':_0x11390f['editor'],'rootName':_0x11390f['rootName'],'html':_0x11390f['content'],'version':_0x11390f['version']};}['getDocumentContextSliceByDataId'](_0x21254e){const _0x40d8db=this['getSourceByDataId'](_0x21254e);return _0x40d8db?this['_getDocumentContextSlice'](_0x40d8db['documentId']):void 0x0;}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x1f1b16){const _0x5c2086=await this['_createContextItemFromContent'](_0x1f1b16);return this['_addToConversationContextItem'](_0x5c2086),'current-document'===_0x5c2086['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x5c2086;}async['populateDocumentsFromMessage'](_0x56ff9a,_0x45a6a5){const _0x811690=_0x56ff9a['filter'](_0x428784=>'document'===_0x428784['type']);if(0x0===_0x811690['length'])return{'hasUnmatched':!0x1};if(0x1===_0x811690['length'])return{'contextItem':await this['populateFromMessage'](_0x811690[0x0]),'hasUnmatched':!0x1};const _0x5cd0a5=_0x811690['map'](_0x9bb231=>_0x9bb231['id']),_0x58033a=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x5cd0a5)['getDocuments'](),_0x660bdf=new Map(_0x58033a['map'](_0x1b21fc=>[_0x1b21fc['id'],_0x1b21fc]));this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();const _0x1de5d4=[];let _0x5567d3=!0x1;for(const _0xf716c6 of _0x811690){const _0xc7a39b=_0x660bdf['get'](_0xf716c6['id']);if(!_0xc7a39b)continue;const _0x508b40=this['_matchDocumentToRoot'](_0xc7a39b,_0x45a6a5),_0x2bd1bb=_0x45a6a5[0x0]&&this['_getFirstRoot'](_0x45a6a5[0x0]);_0x508b40||(_0x5567d3=!0x0);const _0x216847=_0x508b40?.['editor']??_0x2bd1bb?.['editor'],_0xa6fcd5=_0x508b40?.['rootName']??_0x2bd1bb?.['rootName'];if(_0x216847&&_0xa6fcd5){const _0x3a64ac={'editor':_0x216847,'rootName':_0xa6fcd5,'content':_0xc7a39b['content'],'version':_0xc7a39b['attributes']?.['version']??0x0,'name':_0xc7a39b['name'],'description':_0xc7a39b['description']};this['_documentSources']['set'](_0xc7a39b['id'],_0x3a64ac);const _0x516f82=Fi(_0xc7a39b['content']);for(const _0x58b97c of _0x11b699(_0x17b149=>!!$i(_0x17b149,'data-id'),_0x516f82)){const _0x41b4aa=$i(_0x58b97c,'data-id');_0x41b4aa&&this['_dataIdToSource']['set'](_0x41b4aa,{..._0x3a64ac,'documentId':_0xc7a39b['id']});}}_0x1de5d4['push']({'id':_0xc7a39b['id'],'content':_0xc7a39b['content'],'version':_0xc7a39b['attributes']?.['version']??0x0,'sessionId':_0xc7a39b['attributes']?.['sessionId']??null,'selection':[]});}const _0x3a9c66={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x1de5d4,'dataIdDocumentSources':new Map(this['_dataIdToSource'])};return this['_addToConversationContextItem'](_0x3a9c66),this['_toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x3a9c66,'hasUnmatched':_0x5567d3};}['_matchDocumentToRoot'](_0x4b1c49,_0x346780){const _0x2677c0=_0x4b1c49['attributes']?.['channelId'],_0x5d75a0=_0x4b1c49['attributes']?.['rootName'];if(_0x2677c0&&_0x5d75a0){for(const _0x28a149 of _0x346780)if(_0x28a149['config']['get']('collaboration.channelId')===_0x2677c0){for(const _0x1c0061 of _0x28a149['model']['document']['getRoots']())if('$graveyard'!==_0x1c0061['rootName']&&_0x1c0061['rootName']===_0x5d75a0)return{'editor':_0x28a149,'rootName':_0x1c0061['rootName']};}}}['_getFirstRoot'](_0x407479){for(const _0x5e1672 of _0x407479['model']['document']['getRoots']())if('$graveyard'!==_0x5e1672['rootName'])return{'editor':_0x407479,'rootName':_0x5e1672['rootName']};}async['_createContextItemFromContent'](_0x24f6df){if('document'===_0x24f6df['type']){const _0x33ebd5=await this['_connector']['fetchDocument'](this['_ownerId'],_0x24f6df['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x24f6df['type'],'content':_0x33ebd5['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x33ebd5['attributes']?.['version'],'sessionId':_0x33ebd5['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x24f6df['type'])return{'id':_0x24f6df['id'],'uiId':_0x24f6df['id'],'label':_0x24f6df['data']?.['label']||_0x24f6df['id'],'type':'mcp-tool-context','mcpServerName':_0x24f6df['mcpServerName'],'toolName':_0x24f6df['toolName'],'data':_0x24f6df['data']||{}};return{'id':_0x24f6df['id'],'uiId':_0x24f6df['id'],'label':_0x24f6df['attributes']?.['label']||_0x24f6df['name']||_0x24f6df['url']||_0x24f6df['id'],'type':_0x24f6df['type'],..._0x24f6df?.['attributes']?.['resourceId']?{'resourceId':_0x24f6df['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x373515){const _0x3eefac=this['_pendingContextItems']['get'](_0x373515);_0x3eefac?.['isReadOnly']||this['_removeContextItem'](_0x373515);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x1efbfb of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x1efbfb['uiId']);const _0x32ad4e=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x32ad4e&&this['_addContextItem']({..._0x32ad4e,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x4acd03){for(const _0x12a31f of _0x4acd03['values']())this['_addToConversationContextItem'](_0x12a31f);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'](_0x224194){return Array['from'](_0x224194['values']())['flatMap'](_0x16439b=>this['_mapContextItemToRequestData'](_0x16439b));}async['addFilesToContext'](_0x39efb0,_0x2880bb,_0x2d4e53='file'){const _0x1a744d='files-'+ot();this['_startUploadOperation'](_0x1a744d);try{await Promise['all'](_0x39efb0['map'](async _0x163088=>{const _0x1e32ad='file-'+ot(),_0x12eebe=_0x2d9792(_0x163088['name']);try{this['_addContextItem']({'type':_0x2d4e53,'label':_0x2880bb?.['label']||_0x12eebe,'uiId':_0x1e32ad,'resourceId':_0x2880bb?.['resourceId']},!0x0);const _0xe2dac2=this['_connector']['uploadFile'](this['_ownerId'],_0x163088,_0x2880bb);this['_ongoingUploads']['set'](_0x1e32ad,_0xe2dac2['abortController']);const {id:_0x4af4a2}=await _0xe2dac2['getId']();this['_ongoingUploads']['delete'](_0x1e32ad),this['_finishContextItemLoading']({'type':_0x2d4e53,'id':_0x4af4a2,'label':_0x2880bb?.['label']||_0x12eebe,'uiId':_0x1e32ad,'resourceId':_0x2880bb?.['resourceId']},!0x1);}catch(_0x266d8b){this['_ongoingUploads']['delete'](_0x1e32ad);if(!(_0x266d8b instanceof at&&_0x266d8b['message']['startsWith']('ai-request-aborted'))){const _0x2c898f=os['get'](_0x266d8b['code'])||'ai-chat-file-upload-failed',_0x1b15f4=new at(_0x2c898f,null,{'fileName':_0x12eebe,..._0x266d8b});_0x1b15f4['stack']=_0x266d8b['stack'],this['fire']('error',{'error':_0x1b15f4});}this['_removeContextItem'](_0x1e32ad);}}));}finally{this['_finishUploadOperation'](_0x1a744d);}}['addCurrentDocumentToContext'](_0x40e483){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x3f93c1={'type':'document','uiId':'current-document','label':_0x40e483,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x3f93c1);}async['updateCurrentDocument'](_0x40ef45,_0x4bdaf3,_0x15236a,_0x5e03cd,_0x1308c1,_0x493cf3){const _0x5c78d2=this['_pendingContextItems']['get']('current-document');if(_0x5c78d2&&_0x40ef45){_0x5c78d2['selection']=_0x493cf3?_0x493cf3['map'](_0x3d3f1a=>({'start':_0x3d3f1a['start'],'end':_0x3d3f1a['end']})):[];try{if(_0x5c78d2['version']===_0x4bdaf3)return;const {id:_0x403e12}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x40ef45,{'version':_0x4bdaf3,'sessionId':_0x15236a,'channelId':_0x5e03cd,'rootName':_0x1308c1})['getId']();_0x5c78d2['id']=_0x403e12,_0x5c78d2['content']=_0x40ef45,_0x5c78d2['version']=_0x4bdaf3,_0x5c78d2['sessionId']=_0x15236a;}catch(_0x270893){const _0x1cdb9c=new at('ai-chat-document-upload-failed',null);_0x1cdb9c['stack']=_0x270893['stack'],this['fire']('error',{'error':_0x1cdb9c});}}}async['updateCurrentDocuments'](_0x3dffae){const _0x4a343f=this['_pendingContextItems']['get']('current-document');if(!_0x4a343f||!_0x3dffae['length']||_0x3dffae['every'](_0x57a25f=>!_0x57a25f['content']))return;_0x3dffae['length']>0x1&&_0x3dffae['some'](_0x269886=>!_0x269886['description'])&&gt('ai-chat-documents-missing-description');const _0x53d654=_0x5bf51f=>_0x5bf51f?_0x5bf51f['map'](_0x5c7e95=>({'start':_0x5c7e95['start'],'end':_0x5c7e95['end']})):[],_0x259db8=_0x4a343f['documents']??[];if(_0x259db8['length']===_0x3dffae['length']&&_0x3dffae['every']((_0x16d467,_0x16e3b3)=>_0x259db8[_0x16e3b3]?.['version']===_0x16d467['version']))_0x4a343f['documents']=_0x259db8['map']((_0x59de80,_0x2620a3)=>({..._0x59de80,'selection':_0x53d654(_0x3dffae[_0x2620a3]['selections'])}));else try{const _0x5504d7=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x3dffae)['getIds']();_0x4a343f['documents']=_0x3dffae['map']((_0x160feb,_0x4a1a4b)=>({'id':_0x5504d7[_0x4a1a4b]?.['id'],'content':_0x160feb['content'],'version':_0x160feb['version'],'sessionId':_0x160feb['sessionId'],'selection':_0x53d654(_0x160feb['selections'])})),this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();for(let _0x52ea53=0x0;_0x52ea53<_0x3dffae['length'];_0x52ea53++){const _0x561396=_0x5504d7[_0x52ea53]?.['id'],_0x56a661=_0x3dffae[_0x52ea53];if(!_0x561396)continue;const _0x3ae1c5={'editor':_0x56a661['editor'],'rootName':_0x56a661['rootName'],'content':_0x56a661['content'],'version':_0x56a661['version'],'name':_0x56a661['name'],'description':_0x56a661['description']};this['_documentSources']['set'](_0x561396,_0x3ae1c5);const _0x3bb3bf=Fi(_0x56a661['content']);for(const _0x2f9c4f of _0x11b699(_0x2c79f5=>!!$i(_0x2c79f5,'data-id'),_0x3bb3bf)){const _0x1d87f2=$i(_0x2f9c4f,'data-id');_0x1d87f2&&this['_dataIdToSource']['set'](_0x1d87f2,{..._0x3ae1c5,'documentId':_0x561396});}}_0x4a343f['dataIdDocumentSources']=new Map(this['_dataIdToSource']);}catch(_0x34cce1){const _0xe64318=new at('ai-chat-document-upload-failed',null);_0xe64318['stack']=_0x34cce1['stack'],this['fire']('error',{'error':_0xe64318});}}['addSelectionToContext'](_0x263645){this['_addContextItem']({'type':'selection','label':_0x263645,'uiId':'selection','content':_0x263645});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x2f8056,_0x3794f4){const _0x24d06b='url-'+ot();this['_startUploadOperation'](_0x24d06b);const _0x4f1456='url-'+ot();try{this['_addContextItem']({'type':'web-resource','label':_0x3794f4?.['label']||_0x2f8056,'uiId':_0x4f1456,'resourceId':_0x3794f4?.['resourceId']},!0x0);const _0x1f8b5f=this['_connector']['uploadUrl'](this['_ownerId'],_0x2f8056,_0x3794f4);this['_ongoingUploads']['set'](_0x4f1456,_0x1f8b5f['abortController']);const {id:_0x20886b}=await _0x1f8b5f['getId']();this['_ongoingUploads']['delete'](_0x4f1456),this['_finishContextItemLoading']({'type':'web-resource','id':_0x20886b,'label':_0x3794f4?.['label']||_0x2f8056,'uiId':_0x4f1456,'resourceId':_0x3794f4?.['resourceId']},!0x1);}catch(_0x56c273){this['_ongoingUploads']['delete'](_0x4f1456),(_0x56c273['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new at('ai-chat-url-upload-failed',this,{'url':_0x2f8056,'originalError':_0x56c273}),'url':_0x2f8056}),this['_removeContextItem'](_0x4f1456));}finally{this['_finishUploadOperation'](_0x24d06b);}}['addToolItemToContext'](_0x1c7554){_0x1c7554['id']=_0x1c7554['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x1c7554['uiId'],_0x1c7554),this['fire']('contextItemAdded',{'contextItem':_0x1c7554,'isLoading':!0x1});}async['loadSourceResources'](_0x16a2a7,_0x35f973,_0x4c7570){const _0xca1264=this['_addContextOptionsState']['sources']['find'](_0x28f9ad=>_0x28f9ad['id']===_0x16a2a7);if(!_0xca1264)return this['fire']('error',{'error':new at('ai-chat-source-not-found',this,{'sourceId':_0x16a2a7}),'sourceId':_0x16a2a7}),[];try{const _0x47bb58=(await _0xca1264['getResources'](_0x35f973))['map'](_0x30760f=>{const _0x3326c1=this['_isResourceInContext'](_0x30760f['id']);return{..._0x30760f,'isInContext':_0x3326c1};});return _0xca1264['resources']=_0x47bb58,this['fire']('sourceResourcesLoaded',{'sourceId':_0x16a2a7,'source':_0xca1264,'resources':_0x47bb58,'uid':_0x4c7570}),_0x47bb58;}catch(_0x24dde3){return this['fire']('error',{'error':new at('ai-chat-source-resources-load-failed',this,{'sourceId':_0x16a2a7,'originalError':_0x24dde3}),'sourceId':_0x16a2a7,'sourceLabel':_0xca1264['label']}),[];}}async['addResourceToContext'](_0xa13715,_0x29876f){if(this['_isResourceInContext'](_0x29876f['id']))return;let _0x57358a=_0x29876f['data'];if(!_0x57358a&&_0xa13715['getData'])try{_0x57358a=await _0xa13715['getData'](_0x29876f['id']);}catch(_0x414fe1){return void this['fire']('error',{'error':new at('ai-chat-resource-load-failed',this,{'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id'],'originalError':_0x414fe1}),'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id']});}if(_0x57358a)switch(_0x29876f['type']){case'web-resource':if('string'!=typeof _0x57358a)return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id'],'expectedType':'string','actualType':typeof _0x57358a}),'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id']});await this['addUrlToContext'](_0x57358a,{'label':_0x29876f['label'],'resourceId':_0x29876f['id']});break;case'file':if(!(_0x57358a instanceof File))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id'],'expectedType':'File','actualType':typeof _0x57358a}),'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id']});await this['addFilesToContext']([_0x57358a],{'label':_0x29876f['label'],'resourceId':_0x29876f['id']});break;case'text':if('object'!=typeof _0x57358a||!('content'in _0x57358a)||!('type'in _0x57358a))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x57358a}),'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id']});_0x57358a=AIChatContext['_convertTextResourceToFile'](_0x57358a,_0x29876f['label']),await this['addFilesToContext']([_0x57358a],{'label':_0x29876f['label'],'resourceId':_0x29876f['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new at('ai-chat-context-unsupported-type',this,{'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id'],'resourceType':_0x29876f['type']}),'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id']});}else this['fire']('error',{'error':new at('ai-chat-resource-no-data',this,{'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id']}),'resourceId':_0x29876f['id'],'sourceId':_0xa13715['id']});}static['_convertTextResourceToFile'](_0x2c37f9,_0x266d89){switch(_0x2c37f9['type']){case'markdown':return new File([_0x2c37f9['content']],_0x266d89,{'type':'text/markdown'});case'html':return new File([_0x2c37f9['content']],_0x266d89,{'type':'text/html'});default:return new File([_0x2c37f9['content']],_0x266d89,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x184677){switch(_0x184677['type']){case'file':case'text':return[{'type':'file','id':_0x184677['id']}];case'web-resource':return[{'type':'web-resource','id':_0x184677['id']}];case'document':return _0x184677['documents']?.['length']?_0x184677['documents']['map'](_0x337aae=>({'type':'document','id':_0x337aae['id'],..._0x337aae['selection']?.['length']&&{'selection':_0x337aae['selection']}})):[{'type':'document','id':_0x184677['id'],..._0x184677['selection']?.['length']&&{'selection':_0x184677['selection']}}];case'mcp-tool-context':{const _0x7c4d47=_0x184677;return[{'type':'mcp-tool-context','mcpServerName':_0x7c4d47['mcpServerName'],'toolName':_0x7c4d47['toolName'],'data':{..._0x7c4d47['data'],'label':_0x7c4d47['label']||_0x7c4d47['data']?.['label']||_0x7c4d47['id']},'id':_0x7c4d47['id']}];}default:return[];}}['_addContextItem'](_0x3e057a,_0x5920ec=!0x1){if(this['_pendingContextItems']['set'](_0x3e057a['uiId'],_0x3e057a),_0x3e057a['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x3e057a,'isLoading':_0x5920ec}),'current-document'===_0x3e057a['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x3e057a['resourceId']){const _0x37d56b=this['_findSourceIdsByResourceId'](_0x3e057a['resourceId']);_0x37d56b&&_0x37d56b['forEach'](_0x408000=>{this['_updateResourceInContextState'](_0x408000,_0x3e057a['resourceId'],!0x0);});}}['_removeContextItem'](_0x2b2009){const _0x56212e=this['_pendingContextItems']['get'](_0x2b2009),_0x3d0e23=this['_ongoingUploads']['get'](_0x2b2009);if(_0x3d0e23&&(_0x3d0e23['abort'](),this['_ongoingUploads']['delete'](_0x2b2009)),_0x56212e?.['resourceId']){const _0x389eb7=this['_findSourceIdsByResourceId'](_0x56212e['resourceId']);_0x389eb7&&_0x389eb7['forEach'](_0x214461=>{this['_updateResourceInContextState'](_0x214461,_0x56212e['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x2b2009),this['fire']('contextItemRemoved',{'uiId':_0x2b2009,'type':_0x56212e?.['type']}),'current-document'===_0x2b2009&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x369571,_0x2e10b6){if(this['_pendingContextItems']['has'](_0x369571['uiId'])&&(this['_pendingContextItems']['set'](_0x369571['uiId'],_0x369571),this['fire']('contextItemLoadingEnded',{'contextItem':_0x369571,'isLoading':_0x2e10b6}),_0x369571['resourceId'])){const _0x5e660e=this['_findSourceIdsByResourceId'](_0x369571['resourceId']);_0x5e660e&&_0x5e660e['forEach'](_0x245920=>{this['_updateResourceInContextState'](_0x245920,_0x369571['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x516e45){this['_conversationContextItems']['set'](_0x516e45['uiId'],_0x516e45);}['_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'](_0x581e20=>({..._0x581e20,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x28ad85=>({..._0x28ad85,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x9f3c58=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x9f3c58,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x6d59b7){for(const _0xb2fb60 of this['_pendingContextItems']['values']())if(_0xb2fb60['resourceId']===_0x6d59b7)return!0x0;for(const _0x18fb3a of this['_conversationContextItems']['values']())if(_0x18fb3a['resourceId']===_0x6d59b7)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x3d92d5){const _0x350398=[];for(const _0xc0f7d5 of this['_addContextOptionsState']['sources']){_0xc0f7d5['resources']['find'](_0x142080=>_0x142080['id']===_0x3d92d5)&&_0x350398['push'](_0xc0f7d5['id']);}return 0x0===_0x350398['length']?null:_0x350398;}['_updateResourceInContextState'](_0x4e12e2,_0x4d8cdf,_0x2e2b2c){const _0x50394e=this['_addContextOptionsState']['sources']['find'](_0x451c99=>_0x451c99['id']===_0x4e12e2);if(!_0x50394e)return;const _0x2533ed=_0x50394e['resources']['find'](_0x50c431=>_0x50c431['id']===_0x4d8cdf);_0x2533ed&&(_0x2533ed['isInContext']=_0x2e2b2c,this['fire']('resourceStateChanged',{'sourceId':_0x4e12e2,'resourceId':_0x4d8cdf,'isInContext':_0x2e2b2c}));}['_startUploadOperation'](_0x430fc9){this['_ongoingUploadOperations']['set'](_0x430fc9,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x3bcb5c){this['_ongoingUploadOperations']['delete'](_0x3bcb5c),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const hs=['capabilitiesUpdated'];class AICapabilities extends Et(){['_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'](_0x1a31c1){const _0x1cdc29={};return _0x1a31c1&&_0x1a31c1['isWebSearchEnabled']&&(_0x1cdc29['webSearch']={}),_0x1a31c1&&_0x1a31c1['isReasoningEnabled']&&(_0x1cdc29['reasoning']={}),_0x1cdc29;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x29b1d4){_0x29b1d4!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x29b1d4,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x381bea){_0x381bea!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x381bea,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class AIChatInteraction extends AIInteraction{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x228305){super(_0x228305),this['conversationId']=_0x228305['conversationId'],this['contextItems']=_0x228305['contextItems'],this['capabilities']=_0x228305['capabilities'],this['userMessage']=_0x228305['userMessage'],this['model']=_0x228305['model'],this['attributes']=_0x228305['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':AIChatContext['mapContextItemsToRequestData'](this['contextItems']),'capabilities':AICapabilities['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}['createReply'](_0x1a15c5){const _0x316f7f=this['getDocumentContext']();if(_0x316f7f?.['documents']?.['length']){const _0xc9de71=_0x316f7f['documents']['map'](_0x5acbf2=>_0x5acbf2['content']??'')['join']('');if(_0xc9de71)return super['createReply']({'documentContextContent':_0xc9de71,..._0x1a15c5});}return super['createReply'](_0x1a15c5);}}class AIChatConversation extends Et(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x5b0d68){super(),this['options']=_0x5b0d68,this['connector']=_0x5b0d68['connector'],this['chatModels']=_0x5b0d68['chatModels'],this['id']=_0x5b0d68['conversationId'],this['isFromHistory']=_0x5b0d68['isFromHistory'];}async['init'](_0x494fa4){try{this['chatContext']=new AIChatContext({'connector':this['connector'],'config':_0x494fa4,'ownerId':this['id']}),this['chatContext']['delegate'](...as)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new AICapabilities(),this['chatCapabilities']['delegate'](...hs)['to'](this),this['chatCapabilities']['init']();const _0x109b78=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x109b78});const _0x295d6e=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x295d6e&&await this['setModel'](_0x295d6e);}catch(_0x4cc202){const _0x4653b8=new at('ai-chat-conversation-init-failed',null,{'message':_0x4cc202['message']||_0x4cc202});_0x4653b8['stack']=_0x4cc202['stack'],this['fire']('error',{'error':_0x4653b8});}}async['start'](){if(this['isStarted'])throw new at('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new at('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x58e56c}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x58e56c,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x4ae868){const _0x392357=new at('ai-chat-conversation-start-failed',null,{'message':_0x4ae868['message'],'conversationId':this['id']});throw _0x392357['stack']=_0x4ae868['stack'],this['fire']('error',{'error':_0x392357}),_0x392357;}}async['load'](_0x2c9833,_0x2bde13){try{const _0x3457d5=await this['connector']['fetchConversation'](_0x2c9833)['getConversation'](),_0x1c50ee=await this['connector']['fetchConversationMessages'](_0x2c9833)['getMessages'](),_0x4cae91=_0x1c50ee[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x3457d5['id'],'title'in _0x3457d5?this['fire']('setConversationTitle',_0x3457d5['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x21bc40=(await this['chatModels']['getAll']())['find'](_0x292f95=>_0x292f95['id']['toLowerCase']()===_0x4cae91['toLowerCase']());return this['selectedModel']=_0x21bc40,this['fire']('modelSelected',{'selectedModel':_0x21bc40,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x1c50ee,_0x2bde13,_0x4cae91),this['currentInteraction']=void 0x0,this;}catch(_0x50acbd){const _0x2a53b4=new at('ai-chat-conversation-init-from-id-failed',null,{'message':_0x50acbd['message'],'conversationId':_0x2c9833});throw _0x2a53b4['stack']=_0x50acbd['stack'],this['fire']('error',{'error':_0x2a53b4}),_0x2a53b4;}}async['_processMessagesToInteractions'](_0x50df61,_0x4528bf,_0x146ef9){let _0x196a41,_0x14f221=!0x1;for(const _0x4c958e of _0x50df61)if('user'===_0x4c958e['role']){const {contextItems:_0x5d5c29,hasUnmatched:_0x1f8b1e}=await this['_extractContextItems'](_0x4c958e);_0x14f221=_0x1f8b1e;const _0x21c45e={'isReasoningEnabled':Object['hasOwn'](_0x4c958e['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x4c958e['capabilities'],'webSearch')};_0x196a41=this['createInteraction']({'userMessage':_0x4c958e['prompt'],'contextItems':_0x5d5c29,'capabilities':_0x21c45e,'modelId':_0x146ef9,'attributes':_0x4c958e['attributes']}),this['currentInteraction']=_0x196a41,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x4c958e['role']&&_0x196a41){const _0x34e159=[];for(const _0x107a27 of _0x4c958e['content'])switch(_0x107a27['type']){case'text':case'modification':{const _0x38d732=_0x196a41['getDocumentContext'](),_0x599e40=(_0x38d732?.['documents']?.['length']?_0x38d732['documents']['some'](_0x1e55ab=>_0x1e55ab['sessionId']!==_0x4528bf):_0x38d732?.['sessionId']!==_0x4528bf)||_0x14f221;_0x196a41['currentReply']?.['type']!==_0x107a27['type']&&(_0x196a41['currentReply']=_0x196a41['createReply']({'type':_0x107a27['type'],'isDone':!0x0,'interactionId':_0x196a41['id'],'areActionsDisabled':_0x599e40,'isFromHistory':!0x0}),_0x34e159['length']>0x0&&(_0x196a41['currentReply']['sources']=_0x34e159['splice'](0x0))),_0x196a41['currentReply']['appendContent'](_0x107a27['content']);break;}case'url':_0x34e159['push'](_0x107a27);break;case'mcp-tool-result':{const {data:_0x3b0239,attributes:_0x56163b}=JSON['parse'](_0x107a27['content']);_0x196a41['_handleToolResultData']({'toolName':_0x107a27['toolName'],'data':_0x3b0239,'attributes':_0x56163b});break;}}}}}async['_extractContextItems'](_0x59034c){const _0x32885c=new Map();if(!_0x59034c['content'])return{'contextItems':_0x32885c,'hasUnmatched':!0x1};const _0x1893e7=this['_resolveEditors'](),{contextItem:_0x3c3a88,hasUnmatched:_0x29bc8e}=await this['chatContext']['populateDocumentsFromMessage'](_0x59034c['content'],_0x1893e7);_0x3c3a88&&_0x32885c['set'](_0x3c3a88['id'],_0x3c3a88);for(const _0x1063d2 of _0x59034c['content']){if('document'===_0x1063d2['type'])continue;const _0x427dcf=await this['chatContext']['populateFromMessage'](_0x1063d2);_0x427dcf&&_0x32885c['set'](_0x427dcf['id'],_0x427dcf);}return{'contextItems':_0x32885c,'hasUnmatched':_0x29bc8e};}['_resolveEditors'](){return this['options']['getEditors']?this['options']['getEditors']():this['options']['getEditor']?[this['options']['getEditor']()]:[];}async['handleUserInteraction']({userMessage:_0x3b346e,attributes:_0x59939b}){if(!this['isStarted'])throw new at('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new at('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0xaab588=this['chatContext']['getPendingContextItems'](),_0x196683=this['chatCapabilities']['getCapabilitiesConfig'](),_0x3c9aa8=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x3b346e,'contextItems':_0xaab588,'capabilities':_0x196683,'modelId':_0x3c9aa8,'attributes':_0x59939b}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x3a866d){if(_0x3a866d instanceof at)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x3a866d});else{const _0x1afe8a=os['get'](_0x3a866d['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new at(_0x1afe8a,null,{'error':_0x3a866d})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x55a2c6,contextItems:_0x1d4dbf,capabilities:_0x1a963c,modelId:_0x54f2f0,attributes:_0x32e392}){const _0x285e70=new AIChatInteraction({'userMessage':_0x55a2c6,'contextItems':_0x1d4dbf,'capabilities':_0x1a963c,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x54f2f0,'attributes':_0x32e392});return _0x285e70['delegate'](...rs)['to'](this),this['interactions']['push'](_0x285e70),this['fire']('interactionCreated',_0x285e70),_0x285e70;}['getInteraction'](_0x5af8a3){return this['interactions']['find'](_0x454a80=>_0x454a80['id']===_0x5af8a3);}['removeInteraction'](_0x239361){const _0xeb67e0=this['getInteraction'](_0x239361);_0xeb67e0&&(_0xeb67e0['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0xeb67e0),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0xb1ab91){this['chatContext']['addCurrentDocumentToContext'](_0xb1ab91);}async['updateCurrentDocumentInContext']({content:_0x30735d,version:_0x4432da,sessionId:_0x1916d0,channelId:_0xb95095,rootName:_0x54df81,selections:_0x178ee9}){await this['chatContext']['updateCurrentDocument'](_0x30735d,_0x4432da,_0x1916d0,_0xb95095,_0x54df81,_0x178ee9);}async['updateCurrentDocumentsInContext'](_0xc10aaf){await this['chatContext']['updateCurrentDocuments'](_0xc10aaf);}['getSourceByDataId'](_0x119566){return this['chatContext']['getSourceByDataId'](_0x119566);}['getDocumentContextSliceByDataId'](_0x1a7002){return this['chatContext']['getDocumentContextSliceByDataId'](_0x1a7002);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x2c90ea){this['chatContext']['addSelectionToContext'](_0x2c90ea);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x5c8233){this['chatContext']['addFilesToContext'](_0x5c8233);}['addUrlToContext'](_0x36ae07){this['chatContext']['addUrlToContext'](_0x36ae07);}['addToolItemToContext'](_0xad0ebc){this['chatContext']['addToolItemToContext'](_0xad0ebc);}['addResourceToContext'](_0x56ec79,_0x1f4e2b){this['chatContext']['addResourceToContext'](_0x56ec79,_0x1f4e2b);}['loadSourceResources'](_0x25daef,_0x3bd8c6,_0x514228){return this['chatContext']['loadSourceResources'](_0x25daef,_0x3bd8c6,_0x514228);}['removeFromContext'](_0x32113a){this['chatContext']['removeFromContext'](_0x32113a);}['setWebSearch'](_0x1cbf3f){this['chatCapabilities']['setWebSearch'](_0x1cbf3f);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x292ff3){this['chatCapabilities']['setReasoning'](_0x292ff3);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x4f1f7a){_0x4f1f7a?!0x1===await this['chatModels']['isAvailable'](_0x4f1f7a)&&(gt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x4f1f7a}),_0x4f1f7a=(await this['chatModels']['getAvailableModels']())[0x0]):(gt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x4f1f7a=(await this['chatModels']['getAvailableModels']())[0x0]),_0x4f1f7a['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x4f1f7a,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x4f1f7a}));}}class AIModels extends Et(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x11f6ef,config:_0x4747d2,locale:_0x42fd48}){super(),this['_connector']=_0x11f6ef,this['_config']=_0x4747d2,this['_locale']=_0x42fd48;}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 _0x48d63c=await this['getAll']();let _0x384a8e;return _0x384a8e=this['_availableModels']?this['_filterModels'](_0x48d63c,this['_availableModels']):_0x48d63c['filter'](_0x378599=>_0x378599['recommended']),_0x384a8e;}async['getModel'](_0x2cda80){const _0x40cb46=await this['getAll']();if(!_0x40cb46['length'])return null;if(_0x2cda80){const _0x48846e=this['_getModelById'](_0x40cb46,_0x2cda80);if(_0x48846e)return _0x48846e;gt('ai-chat-model-id-unrecognized',{'modelId':_0x2cda80,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x1c5eb6=await this['getAvailableModels']();if(!_0x1c5eb6['length'])return null;if(this['_defaultModelId']){const _0x230e74=this['_getModelById'](_0x1c5eb6,this['_defaultModelId']);if(_0x230e74)return _0x230e74;gt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x1c5eb6[0x0]['id']});}return _0x1c5eb6[0x0];}async['isAvailable'](_0x4978c1){return(await this['getAvailableModels']())['some'](_0x50ce10=>_0x50ce10['name']===_0x4978c1['name']&&_0x50ce10['provider']===_0x4978c1['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0xfca49f=this['_locale']['uiLanguage']||'en',_0x3b9df6=this['_connector']['getModels'](_0xfca49f),_0x1a0157=await _0x3b9df6['list']();this['_modelList']=_0x1a0157['items']['map'](_0x51e165=>cs(_0x51e165)?{..._0x51e165,'name':Hi(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x51e165);}catch(_0x1122a0){throw Ct('ai-models-unable-to-retrieve',{'error':_0x1122a0}),_0x1122a0;}return[...this['_modelList']];}['_filterModels'](_0x1e4009,_0x29a9f0){let _0x3f13a6;if(_0x29a9f0){_0x3f13a6=[];const _0x29717c=new Set(),_0x126eed='string'==typeof _0x29a9f0?[_0x29a9f0['toLocaleLowerCase']()]:_0x29a9f0['map'](_0x451e61=>_0x451e61['toLocaleLowerCase']());for(const _0x5cf77b of _0x126eed)for(const _0x2786c7 of _0x1e4009)!_0x29717c['has'](_0x2786c7['id'])&&this['_isMatchingFilter'](_0x2786c7,_0x5cf77b)&&(_0x3f13a6['push'](_0x2786c7),_0x29717c['add'](_0x2786c7['id']));}else _0x3f13a6=_0x1e4009;return _0x3f13a6;}['_isMatchingFilter'](_0x504bb6,_0x4c2209){const _0x13560c=_0x504bb6['id']['toLocaleLowerCase'](),_0x1ef362=_0x504bb6['name']['toLocaleLowerCase'](),_0x5dedf5=_0x504bb6['provider']['toLocaleLowerCase']();return _0x13560c===_0x4c2209||_0x1ef362===_0x4c2209||cs(_0x504bb6)&&'auto'===_0x4c2209||_0x5dedf5===_0x4c2209||_0x13560c['startsWith'](_0x4c2209);}['_getModelById'](_0x4ce351,_0x58b82d){return _0x4ce351['find'](_0x5bcc28=>cs(_0x5bcc28)&&'auto'===_0x58b82d?_0x5bcc28:_0x5bcc28['id']===_0x58b82d)||null;}}function cs(_0x346b68){return _0x346b68['id']['startsWith']('agent');}function ls(_0x1f7545){return _0x1f7545?_0x1f7545 instanceof _0x3cd9d5?[_0x1f7545]:_0x1f7545['editors']&&0x0!==_0x1f7545['editors']['length']?Array['from'](_0x1f7545['editors']):[]:[];}function us(_0x2accee){const _0x9f4c27=ls(_0x2accee);if(!_0x9f4c27['length'])throw new at('ai-get-editor-from-context-no-editor');if(0x1===_0x9f4c27['length'])return _0x9f4c27[0x0];const _0x4e07b5=_0x9f4c27['find'](_0x5d3517=>_0x5d3517['ui']?.['focusTracker']?.['isFocused']);if(_0x4e07b5)return _0x4e07b5;const _0x2612c0=function(_0x110461){if(_0x110461 instanceof _0x3cd9d5)return;const _0x508b57=_0x110461;if(!_0x508b57['plugins']||!_0x508b57['plugins']['has']('AIEditing'))return;const _0x1f508c=_0x508b57['plugins']['get']('AIEditing');return _0x1f508c['getLastContentFocusedEditor']?.();}(_0x2accee);return _0x2612c0&&_0x9f4c27['includes'](_0x2612c0)?_0x2612c0:_0x9f4c27[0x0];}function ds(_0xd596b1){return us(_0xd596b1);}function _s({editor:_0x54aa75,interaction:_0x5f489a,reply:_0x484b3d,groups:_0x478845,transform:_0x55e5b0,documentCompare:_0x3babbb,documentCompareOptions:_0xe96699,documentContextSlice:_0x3d27a5}){const _0x5bb801=_0x5f489a['getDocumentContext']();if(!_0x5bb801)return[];const _0x2ca6f2=_0x484b3d['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x302c8d}of _0x478845){const _0x46bb70=_0x302c8d['filter'](_0xf9cecb=>'new'!=_0xf9cecb['type'])['map'](_0x5205b7=>Wi('data-id',_0x5205b7['id'],_0x2ca6f2)),_0x13b98b=_0x302c8d['filter'](_0x3f258f=>'removed'!=_0x3f258f['type'])['map'](_0xb86bd8=>_0xb86bd8['node']['cloneNode'](!0x0));let _0x3e9222=null;if(_0x46bb70['length']){_0x3e9222=_0x46bb70[0x0]['previousSibling'];for(let _0x12ed17=0x0;_0x12ed17<_0x46bb70['length'];_0x12ed17++)_0x8926a6(_0x46bb70[_0x12ed17]);}if(_0x13b98b['length']){_0x3e9222||(_0x302c8d[0x0]['anchorId']?_0x3e9222=Wi('data-id',_0x302c8d[0x0]['anchorId'],_0x2ca6f2):(_0x3e9222=_0x13b98b['shift'](),_0x3d3041(_0x2ca6f2,_0x3e9222)));for(let _0x3657c6=0x0;_0x3657c6<_0x13b98b['length'];_0x3657c6++)_0x1d7e6a(_0x3e9222,_0x13b98b[_0x3657c6]),_0x3e9222=_0x13b98b[_0x3657c6];}}let _0x5a31c2,_0x372eff,_0x503489,_0x12954d=_0xe96699;if(_0x3d27a5){_0x5a31c2=_0x3d27a5['html'],_0x503489=_0x3d27a5['version'],_0x12954d={..._0xe96699,'anchor':_0x3d27a5['rootName']};const _0x5d10db=new _0x617866([]),_0x3866a7=_0x2ca6f2['children'],_0x4ea605=_0x484b3d['dataIdDocumentSources'],_0x4c23f5=_0x484b3d['newNodeAnchorIds'],_0x11fdae=_0x3d27a5['editor'],_0x504b30=_0x3d27a5['rootName'],_0x5b3c83=new Array(_0x3866a7['length']),_0x204d95=_0x4830ec=>_0x4830ec?_0x4830ec['editor']===_0x11fdae&&_0x4830ec['rootName']===_0x504b30:void 0x0;for(let _0x4c5655=0x0;_0x4c5655<_0x3866a7['length'];_0x4c5655++){const _0x4003a3=$i(_0x3866a7[_0x4c5655],'data-id');if(!_0x4003a3)continue;const _0x1dc82f=_0x204d95(_0x4ea605?.['get'](_0x4003a3));if(void 0x0!==_0x1dc82f){_0x5b3c83[_0x4c5655]=_0x1dc82f;continue;}const _0x9175d2=_0x4c23f5['get'](_0x4003a3),_0x4b08b4=_0x9175d2?_0x204d95(_0x4ea605?.['get'](_0x9175d2)):void 0x0;void 0x0!==_0x4b08b4&&(_0x5b3c83[_0x4c5655]=_0x4b08b4);}for(let _0x996c4c=0x0;_0x996c4c<_0x3866a7['length'];_0x996c4c++)if(void 0x0===_0x5b3c83[_0x996c4c]){for(let _0x45cdab=_0x996c4c-0x1;_0x45cdab>=0x0;_0x45cdab--)if(void 0x0!==_0x5b3c83[_0x45cdab]){_0x5b3c83[_0x996c4c]=_0x5b3c83[_0x45cdab];break;}if(void 0x0===_0x5b3c83[_0x996c4c]){for(let _0x19cac2=_0x996c4c+0x1;_0x19cac2<_0x3866a7['length'];_0x19cac2++)if(void 0x0!==_0x5b3c83[_0x19cac2]){_0x5b3c83[_0x996c4c]=_0x5b3c83[_0x19cac2];break;}}}for(let _0x2a572c=0x0;_0x2a572c<_0x3866a7['length'];_0x2a572c++)_0x5b3c83[_0x2a572c]&&_0x5d10db['children']['push'](_0x252747(_0x3866a7[_0x2a572c],!0x0));_0x372eff=Ki(_0x5d10db);}else _0x5a31c2=_0x5bb801['content'],_0x503489=_0x5bb801['version'],_0x372eff=Ki(_0x2ca6f2);const _0x125405=_0x3babbb['getDiff'](_0x5a31c2,_0x372eff,{..._0x12954d,'targetEditor':_0x54aa75})['getOperations']();if(_0x55e5b0){const _0x43d8da=_0x54aa75['model']['document']['history']['getOperations'](_0x503489),_0x11ca0d={'document':_0x54aa75['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x2d44f8(_0x125405,_0x43d8da,_0x11ca0d)['operationsA'];}return _0x125405;}function Is(_0x5bb50d,_0x2a6c71){if('marker'!=_0x2a6c71['type'])return;const _0x4f9602=_0x5bb50d['model']['markers']['get'](_0x2a6c71['name']);_0x4f9602&&(_0x2a6c71['oldRange']=_0x4f9602['getRange']());}class AIChatController extends _0x3cc0e4{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_activeBalloon'];['_wiredBalloons']=new Set();['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[AIConnector,_0x490f88];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new Qt(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 AIModels({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x51a098=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x127485,_0x168aa7)=>{this['_handleUIUserMessage']({'message':_0x168aa7});}),this['listenTo'](_0x51a098['view'],'change:activeTab',(_0x4dd986,_0x47125e,_0x36578f)=>{'chat'!==_0x36578f&&this['removeSelectionFromChatContext']();}),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',(_0x5570a4,_0x3857ce)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x3857ce));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x497c3b,_0x2c271e)=>{this['activeConversation']?.['addUrlToContext'](_0x2c271e);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x2f9a8d,_0x5eafd8)=>{_0x5eafd8['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x49d2d4,_0x54e828)=>{this['activeConversation']?.['addResourceToContext'](_0x54e828['source'],_0x54e828['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x5d9cc5,_0x3f5983)=>{this['_removeFromContext'](_0x3f5983);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x8a8b05,_0x21f95d)=>{this['activeConversation']?.['loadSourceResources'](_0x21f95d['sourceId'],_0x21f95d['query'],_0x21f95d['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x1361d5,_0x45744d)=>{this['activeConversation']?.['setModel'](_0x45744d);}),this['listenTo'](this['_aiChatUi'],'like',(_0x502429,{replyId:_0x2e5395})=>{console['log']('Liked\x20response',_0x2e5395);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x411930,{replyId:_0x338f5b})=>{console['log']('Disliked\x20response',_0x338f5b);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x989c06,_0x4b2735)=>{this['_insertSuggestion'](_0x4b2735);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x1b86aa,{replyId:_0x3d4f1f,partIndex:_0xa81f73})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x3d4f1f,_0xa81f73);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0xdd3595,{replyId:_0x2b281d,partIndex:_0x12154f})=>{const _0xd67ea4=this['_getDocumentRangeForReplyChanges'](_0x2b281d,_0x12154f);_0xd67ea4&&'$graveyard'!=_0xd67ea4['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0xd67ea4['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x12fc8f,_0x3844e4)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x3844e4);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x115aaa,{replyId:_0xdd8ce3,showDiff:_0x284658})=>{const {reply:_0xab6b7a}=this['getInteractionAndReplyById'](_0xdd8ce3),_0x4f5610=_0xab6b7a['getContentParts']({'showDiff':_0x284658,'editor':ds(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0xab6b7a['id'],'parts':_0x4f5610});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x47473b,{replyId:_0x4df826,partIndex:_0x2a6e4f})=>{this['_rejectSuggestion']({'replyId':_0x4df826,'partIndex':_0x2a6e4f}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon')),this['on']('interactionCreated',(_0x26cdea,_0x1305ae)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x1305ae);}),this['on']('replyCreated',(_0x109452,_0x2aae72)=>{this['_addFeedItemReply'](_0x2aae72);});}async['afterInit'](){this['context']instanceof _0x3cd9d5?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x1d3b17,_0x43166d)=>{_0x43166d['on']('ready',()=>{this['_integrateEditor'](_0x43166d);});});const _0x2cea98=this['context']['config']['get']('ai.chat.initialConversation');let _0x2e8f69=_0x2cea98;if('lastCreated'!=_0x2cea98||(_0x2e8f69=await this['_getLastCreatedConversationId'](),_0x2e8f69))return'new'==_0x2e8f69?this['_startConversationSafely']():this['loadConversation'](_0x2e8f69);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x1d12fc){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null,(this['context']['plugins']['get'](AITabs)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x1d12fc)['getConversation'](),await this['_startConversationSafely']({'id':_0x1d12fc}),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x1d12fc,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x1d9502){this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x1d12fc}),this['_logError'](new at('ai-chat-conversation-not-found',this,{'error':_0x1d9502}));}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x5a9162){let _0x30f7f1=null,_0x15fc62=null;this['on']('toolDataReceived',(_0x2140f7,_0x5a213c,_0x3d538e)=>{_0x3d538e['id']!==_0x30f7f1&&(_0x30f7f1=_0x3d538e['id'],_0x15fc62=this['_getAIChatFeedAPI'](_0x3d538e)),_0x5a9162(_0x5a213c,_0x15fc62);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](Hi(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x55f157=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x55f157),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0xbeeeec){await this['_startConversationSafely']({'modelId':_0xbeeeec?.['modelId']});}async['sendMessage'](_0x3c4534){await this['_handleUIUserMessage'](_0x3c4534);}['getGroupId'](){const _0x37948d=this['context']['config']['get']('collaboration.channelId');if(!_0x37948d)throw new at('ai-missing-channel-id',this);return _0x37948d;}['_handleRemovedConversation'](_0x5647f7){this['activeConversation']['id']===_0x5647f7&&this['_startConversationSafely']();}['_insertSuggestion'](_0x208dca){const _0x282b65=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x53f096,interaction:_0x7d8ae5}=this['getInteractionAndReplyById'](_0x208dca['replyId']),_0x3fbb5a=void 0x0!==_0x208dca['partIndex']?[_0x53f096['changeGroups'][_0x208dca['partIndex']]]:_0x53f096['changeGroups']['filter'](_0x38fde4=>'pending'==_0x38fde4['state']);for(const _0x4258fd of this['_groupChangesByTarget'](_0x53f096,_0x3fbb5a)){const {target:_0xe9f799,groups:_0x485c0e,groupsIndexes:_0x420847,slice:_0x18de35}=_0x4258fd;if(!_0xe9f799['editor']['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x245c09=this['_getDocumentRangeForReplyChanges'](_0x208dca['replyId'],_0x420847[0x0]);if(!_0x245c09||'$graveyard'==_0x245c09['range']['root']['rootName']){_0x420847['forEach'](_0x32ae0a=>_0x53f096['setChangeGroupState'](_0x32ae0a,'outdated'));continue;}_0x420847['forEach'](_0x115a47=>_0x53f096['setChangeGroupState'](_0x115a47,'accepted'));const _0x17ad25=_s({'editor':_0xe9f799['editor'],'reply':_0x53f096,'interaction':_0x7d8ae5,'groups':_0x485c0e,'transform':!0x0,'documentCompare':_0x282b65,'documentCompareOptions':{'anchor':_0x18de35?.['rootName']??'main','markDeletions':!0x0},'documentContextSlice':_0x18de35});let _0x4e645b;this['_scrollToSuggestionRange'](_0x245c09['range'],!0x1,_0xe9f799['editor']),_0xe9f799['editor']['model']['change'](_0x34160d=>{_0x4e645b=_0x34160d['batch'],_0xe9f799['editor']['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x17ad25),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x4e645b,{'interactionId':_0x7d8ae5['id'],'replyId':_0x53f096['id'],'indexes':_0x420847['slice']()});}this['_updateRatings'](_0x53f096);}['_applySuggestion'](_0x5e06e7){const _0xf0f396=this['context']['plugins']['get'](_0x490f88),{reply:_0x2b93f9,interaction:_0x1aa8bc}=this['getInteractionAndReplyById'](_0x5e06e7['replyId']),_0x2bcbf5=void 0x0!==_0x5e06e7['partIndex']?[_0x2b93f9['changeGroups'][_0x5e06e7['partIndex']]]:_0x2b93f9['changeGroups']['filter'](_0x1ed729=>'pending'==_0x1ed729['state']);for(const _0x33a88f of this['_groupChangesByTarget'](_0x2b93f9,_0x2bcbf5)){const {target:_0x2da176,groups:_0x57cebc,groupsIndexes:_0x346f54,slice:_0x33631f}=_0x33a88f,_0x2c4a62=this['_getDocumentRangeForReplyChanges'](_0x5e06e7['replyId'],_0x346f54[0x0]);if(!_0x2c4a62||'$graveyard'==_0x2c4a62['range']['root']['rootName']){_0x346f54['forEach'](_0x36c623=>_0x2b93f9['setChangeGroupState'](_0x36c623,'outdated'));continue;}_0x346f54['forEach'](_0x1598a6=>_0x2b93f9['setChangeGroupState'](_0x1598a6,'accepted'));const _0x414bae=_s({'editor':_0x2da176['editor'],'reply':_0x2b93f9,'interaction':_0x1aa8bc,'groups':_0x57cebc,'transform':!0x0,'documentCompare':_0xf0f396,'documentCompareOptions':{'anchor':_0x33631f?.['rootName']??'main','markDeletions':!0x1},'documentContextSlice':_0x33631f});let _0x55fe78;this['_scrollToSuggestionRange'](_0x2c4a62['range'],!0x1,_0x2da176['editor']),_0x2da176['editor']['model']['change'](_0x2f9099=>{_0x55fe78=_0x2f9099['batch'];for(const _0x4acebc of _0x414bae)_0x4acebc['baseVersion']=_0x2da176['editor']['model']['document']['version'],Is(_0x2da176['editor'],_0x4acebc),_0x2f9099['batch']['addOperation'](_0x4acebc),_0x2da176['editor']['model']['applyOperation'](_0x4acebc);}),this['_batchToChanges']['set'](_0x55fe78,{'interactionId':_0x1aa8bc['id'],'replyId':_0x2b93f9['id'],'indexes':_0x346f54['slice']()});}this['_updateRatings'](_0x2b93f9);}['_rejectSuggestion'](_0x4bd717){const {reply:_0x3bd933}=this['getInteractionAndReplyById'](_0x4bd717['replyId']);_0x3bd933['setChangeGroupState'](_0x4bd717['partIndex'],'rejected');}['_openBalloonFor'](_0x473970,_0x381099){if(!this['_aiChatBalloon'])return;const {reply:_0x4e18ca}=this['getInteractionAndReplyById'](_0x473970),_0x304a34=_0x4e18ca['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':ds(this['context'])});let _0x5774c8,_0x899b99;if(void 0x0!==_0x381099?(_0x899b99=_0x304a34['find'](_0x36405a=>_0x36405a['index']==_0x381099),_0x5774c8=_0x899b99?.['index']):(_0x899b99=_0x304a34[0x0],_0x5774c8=_0x899b99['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x473970&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x5774c8)return;const _0x4065ec=this['_getUserPresentableContentPartDocumentRange'](_0x473970,_0x4e18ca,_0x899b99),_0x2fa3ab=_0x4e18ca['changeGroups']['find'](_0x12301d=>_0x12301d['index']==_0x5774c8),_0x401c98=_0x2fa3ab?this['_resolveGroupTarget'](_0x4e18ca,_0x2fa3ab):null,_0x59d216=_0x401c98?.['editor']??ds(this['context']),_0x3f161a=_0x59d216['plugins']['has']('AIChatBalloon')?_0x59d216['plugins']['get']('AIChatBalloon'):this['_aiChatBalloon'];if(this['_activeBalloon']&&this['_activeBalloon']!==_0x3f161a&&this['_activeBalloon']['close'](),!_0x4065ec)return _0x3f161a['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x3f161a,this['_currentPreviewedChangeGroup']={'replyId':_0x473970,'partIndex':_0x5774c8},this['_scrollToSuggestionRange'](_0x4065ec,!0x0,_0x59d216);const _0x51c0dd=this['_getPresentableSiblingContentPartIndex'](_0x473970,_0x5774c8,'next');_0x3f161a['updateContent']({'part':_0x899b99,'renderingStrategy':'static'}),_0x3f161a['open']({'index':_0x5774c8,'title':Hi(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x5774c8+0x1)['toString']()),'showRotator':null!==_0x51c0dd,'ranges':[_0x4065ec],'areActionsDisabled':_0x4e18ca['areActionsDisabled'],'targetEditor':_0x59d216}),_0x3f161a['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x473970,_0x5774c8),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x473970,'index':_0x5774c8,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x42013c,_0x5189b4,_0x4293f6){const {reply:_0x56ea9f}=this['getInteractionAndReplyById'](_0x42013c),_0x5d9da5=_0x56ea9f['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':ds(this['context'])});if(0x1==_0x5d9da5['length'])return null;const _0xaa8365=_0x5d9da5['findIndex'](_0x37d849=>_0x37d849['index']==_0x5189b4),_0x335d32='next'==_0x4293f6?0x1:-0x1;let _0x5735cb=_0x5d9da5['at']((_0xaa8365+_0x335d32)%_0x5d9da5['length'])['index'],_0x459279=_0x5d9da5[_0x5735cb];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x42013c,_0x56ea9f,_0x459279);){if(_0x5735cb=_0x5d9da5['at']((_0x5735cb+_0x335d32)%_0x5d9da5['length'])['index'],_0x5735cb===_0xaa8365)return null;_0x459279=_0x5d9da5[_0x5735cb];}return _0x5735cb;}['_getUserPresentableContentPartDocumentRange'](_0x5ac4ea,_0x8550c7,_0x57a98f){const _0x57e7df=_0x8550c7['changeGroups'];if(!_0x57a98f['hasChanges'])return null;const _0x5f1b48=_0x57e7df['find'](_0x527885=>_0x527885['index']==_0x57a98f['index']);if('pending'!==_0x5f1b48?.['state'])return null;const _0x652255=this['_getDocumentRangeForReplyChanges'](_0x5ac4ea,_0x57a98f['index']);if(!_0x652255)return _0x8550c7['setChangeGroupState'](_0x57a98f['index'],'outdated'),null;const {range:_0x137759,currentIndex:_0x2458d2}=_0x652255;return'$graveyard'==_0x137759['root']['rootName']?(_0x8550c7['setChangeGroupState'](_0x2458d2,'outdated'),null):_0x652255['range'];}['_getDocumentRangeForReplyChanges'](_0x5b2c41,_0x298d8){const {reply:_0x1fe298}=this['getInteractionAndReplyById'](_0x5b2c41),_0xf3ae9=_0x1fe298['changeGroups']['filter'](_0x4626a3=>'pending'==_0x4626a3['state']),_0x4f1bba=_0xf3ae9['map'](_0x243542=>_0x1fe298['changeGroups']['indexOf'](_0x243542));void 0x0===_0x298d8&&(_0x298d8=_0x4f1bba[0x0]);const _0x2423cd=_0x4f1bba['indexOf'](_0x298d8);if(-0x1==_0x2423cd)return null;const _0x155d1d=_0xf3ae9[_0x2423cd],_0x39a944=this['_resolveGroupTarget'](_0x1fe298,_0x155d1d);if(!_0x39a944)return null;const {editor:_0x1e93b7,root:_0x48d855,parsedDocumentContent:_0x168a0a,serializedDocumentContent:_0x2227a2,version:_0x6aec24}=_0x39a944,_0x818cac=new _0x617866([]),_0x38eb43=new _0x617866([]);for(const _0xb2fed0 of _0x155d1d['changes']){const _0x285e5e=this['activeConversation']?.['getSourceByDataId'](_0xb2fed0['id']);if((!_0x285e5e||_0x285e5e['editor']===_0x39a944['editor']&&_0x285e5e['rootName']===_0x39a944['root']['rootName'])&&('removed'!=_0xb2fed0['type']&&_0x38eb43['children']['push'](_0xb2fed0['node']['cloneNode'](!0x0)),'new'!=_0xb2fed0['type'])){const _0x11f5a7=_0x10d1dd(_0x5fd704=>$i(_0x5fd704,'data-id')==_0xb2fed0['id'],_0x168a0a,!0x0);if(!_0x11f5a7)return null;_0x818cac['children']['push'](_0x11f5a7['cloneNode'](!0x0));}}if(0x0==_0x818cac['children']['length']){if(_0x155d1d['changes'][0x0]['anchorId']){const _0x339ec3=Wi('data-id',_0x155d1d['changes'][0x0]['anchorId'],_0x168a0a);_0x818cac['children']['unshift'](_0x339ec3['cloneNode'](!0x0)),_0x38eb43['children']['unshift'](_0x339ec3['cloneNode'](!0x0)),_0x339ec3['nextSibling']&&(_0x818cac['children']['push'](_0x339ec3['nextSibling']['cloneNode'](!0x0)),_0x38eb43['children']['push'](_0x339ec3['nextSibling']['cloneNode'](!0x0)));}else{const _0xf9a398=_0x168a0a['children'][0x0];if(!_0xf9a398)return null;_0x818cac['children']['push'](_0xf9a398['cloneNode'](!0x0)),_0x38eb43['children']['push'](_0xf9a398['cloneNode'](!0x0));}}const _0x5704ce=_0x1e93b7['data']['parse'](_0x2227a2),_0x396e39=Ki(_0x818cac),_0x32e090=_0x1e93b7['data']['parse'](_0x396e39),_0x5396a5=_0x1e93b7['data']['parse'](_0x396e39),_0x52a631=_0x1e93b7['model']['createPositionAt'](_0x32e090,0x0),_0x4d4ad8=Ki(_0x38eb43),_0x5acb92={'targetEditor':_0x1e93b7,'anchor':_0x52a631,'markDeletions':!0x1},_0x52fd8a=_0x1e93b7['plugins']['get'](_0x490f88)['getDiff'](_0x396e39,_0x4d4ad8,_0x5acb92)['getOperations']();if(!_0x52fd8a['length'])return null;_0x1e93b7['model']['change'](_0x47bf92=>{for(const _0x12650b of _0x52fd8a)if('remove'==_0x12650b['type']){const _0x317271=_0x12650b['sourcePosition'],_0x577006=_0x12650b['howMany'],_0x554716=new _0x42f63b(_0x317271,_0x577006);_0x47bf92['batch']['addOperation'](_0x554716),_0x1e93b7['model']['applyOperation'](_0x554716);}else'marker'!==_0x12650b['type']&&(_0x12650b['baseVersion']=null,_0x12650b['isDocumentOperation']=!0x1,_0x47bf92['batch']['addOperation'](_0x12650b),_0x1e93b7['model']['applyOperation'](_0x12650b));});const _0x549bed=es(_0x1e93b7,_0x52fd8a,_0x32e090);is(_0x1e93b7['model'],_0x549bed);const _0x5a9b89=_0x549bed['getFirstRange']()['start']['path']['slice'](),_0x632cfd=_0x549bed['getFirstRange']()['end']['path']['slice'](),_0x865899=[];let _0x41d37d=_0x32e090,_0x483695=_0x5396a5;for(let _0x18629e=0x0;_0x18629e<_0x632cfd['length'];_0x18629e++){const _0x5d0d36=_0x41d37d['maxOffset']-_0x632cfd[_0x18629e];_0x865899[_0x18629e]=_0x483695['maxOffset']-_0x5d0d36,_0x41d37d=_0x41d37d['getChildAtOffset'](_0x632cfd[_0x18629e]),_0x483695=_0x483695['getChildAtOffset'](_0x865899[_0x18629e]);}const _0x28c553=_0x1e93b7['model']['createRange'](_0x1e93b7['model']['createPositionFromPath'](_0x5396a5,_0x5a9b89),_0x1e93b7['model']['createPositionFromPath'](_0x5396a5,_0x865899)),_0x10fd07=_0x5396a5['getChild'](0x0)['getAttribute'](_0x34af8c),_0x334f85=Array['from'](_0x5704ce['getChildren']())['find'](_0x3de38a=>_0x3de38a['getAttribute'](_0x34af8c)==_0x10fd07)['getPath'](),_0x45cfdd=_0x28c553['start']['path']['slice'](),_0x2c2e65=_0x28c553['end']['path']['slice']();_0x45cfdd[0x0]=_0x334f85[0x0]+_0x45cfdd[0x0],_0x2c2e65[0x0]=_0x334f85[0x0]+_0x2c2e65[0x0];let _0x58b8b8=_0x1e93b7['model']['createRange'](_0x1e93b7['model']['createPositionFromPath'](_0x48d855,_0x45cfdd),_0x1e93b7['model']['createPositionFromPath'](_0x48d855,_0x2c2e65));const _0x534998=_0x1e93b7['model']['document']['history']['getOperations'](_0x6aec24);for(const _0x1ad3b8 of _0x534998)_0x58b8b8=_0x5d6ed6['_createFromRanges'](_0x58b8b8['getTransformedByOperation'](_0x1ad3b8));return{'range':_0x58b8b8,'currentIndex':_0x298d8};}['_integrateEditorBalloon'](_0x68f8b3){if(!_0x68f8b3['plugins']['has']('AIChatBalloon'))return;const _0x1320af=_0x68f8b3['plugins']['get']('AIChatBalloon');this['_wiredBalloons']['has'](_0x1320af)||(this['_wiredBalloons']['add'](_0x1320af),this['_aiChatBalloon']||(this['_aiChatBalloon']=_0x1320af),_0x1320af['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x1320af,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x53e92e,partIndex:_0x189300}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x3f8bd3}=this['getInteractionAndReplyById'](_0x53e92e),_0x950775=_0x3f8bd3['changeGroups']['find'](_0x5deb90=>_0x5deb90['index']===_0x189300),_0x1221a6=_0x950775?this['_resolveGroupTarget'](_0x3f8bd3,_0x950775):null,_0x5b42be=_0x3f8bd3['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x189300,'editor':_0x1221a6?.['editor']??ds(this['context'])});(this['_activeBalloon']??_0x1320af)['updateContent']({'part':_0x5b42be[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x1320af,'applySuggestion',()=>{const {replyId:_0x386244,partIndex:_0x5d601b}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x386244,'partIndex':_0x5d601b}),(this['_activeBalloon']??_0x1320af)['setState']('accepted');}),this['listenTo'](_0x1320af,'insertSuggestion',()=>{const {replyId:_0x54af24,partIndex:_0x2f0ac8}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x54af24,'partIndex':_0x2f0ac8}),(this['_activeBalloon']??_0x1320af)['setState']('accepted');}),this['listenTo'](_0x1320af,'rejectSuggestion',()=>{const {replyId:_0x1387be,partIndex:_0x49c038}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x1387be,'partIndex':_0x49c038}),(this['_activeBalloon']??_0x1320af)['setState']('rejected');}),this['listenTo'](_0x1320af,'showNext',()=>{const {replyId:_0x442d83,partIndex:_0x5d39e5}=this['_currentPreviewedChangeGroup'],_0x3195a9=this['_getPresentableSiblingContentPartIndex'](_0x442d83,_0x5d39e5,'next');null!==_0x3195a9&&this['_openBalloonFor'](_0x442d83,_0x3195a9);}),this['listenTo'](_0x1320af,'showPrevious',()=>{const {replyId:_0x1d5ee5,partIndex:_0x480ebe}=this['_currentPreviewedChangeGroup'],_0x4b8f01=this['_getPresentableSiblingContentPartIndex'](_0x1d5ee5,_0x480ebe,'previous');null!==_0x4b8f01&&this['_openBalloonFor'](_0x1d5ee5,_0x4b8f01);}),this['listenTo'](_0x1320af,'dialogClosed',(_0x2852cb,{id:_0x4d4dcb})=>{if('aiChatBalloon'!==_0x4d4dcb)return;const {replyId:_0x402922,partIndex:_0x253a6b}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x402922,'index':_0x253a6b,'isActive':!0x1}),this['_activeBalloon']===_0x1320af&&(this['_activeBalloon']=void 0x0);}));}['_integrateEditor'](_0x50f3a8){if(this['_integrateEditorBalloon'](_0x50f3a8),_0x50f3a8['plugins']['has']('Undo')){const _0xb0ebf2=_0x50f3a8['commands']['get']('undo'),_0x350931=_0x50f3a8['commands']['get']('redo');this['listenTo'](_0xb0ebf2,'revert',(_0x11fa21,_0x21103e,_0x35beff)=>{const _0x5dd235=this['_batchToChanges']['get'](_0x21103e);if(!_0x5dd235)return;const _0x2de275=this['activeConversation']['getInteraction'](_0x5dd235['interactionId']),_0x354220=_0x2de275?.['getReply'](_0x5dd235['replyId']);this['_batchToChanges']['delete'](_0x21103e),_0x2de275&&_0x354220&&(_0x5dd235['indexes']['forEach'](_0x3c94a3=>_0x354220['setChangeGroupState'](_0x3c94a3,'pending')),this['_batchToChanges']['set'](_0x35beff,_0x5dd235));}),this['listenTo'](_0x350931,'revert',(_0x46393f,_0x58aee3,_0x30bf55)=>{const _0x49c3df=this['_batchToChanges']['get'](_0x58aee3);if(!_0x49c3df)return;const _0x46f006=this['activeConversation']['getInteraction'](_0x49c3df['interactionId']),_0x560b75=_0x46f006?.['getReply'](_0x49c3df['replyId']);this['_batchToChanges']['delete'](_0x58aee3),_0x46f006&&_0x560b75&&(_0x49c3df['indexes']['forEach'](_0x41d523=>_0x560b75['setChangeGroupState'](_0x41d523,'accepted')),this['_batchToChanges']['set'](_0x30bf55,_0x49c3df));});}const _0x21a591=_0x50f3a8['config']['get']('ai.chat.context');_0x21a591['alwaysAddSelection']&&_0x21a591['document']['enabled']&&this['listenTo'](_0x50f3a8['model']['document']['selection'],'change:range',(_0x407809,_0x1aed74)=>{if(!_0x1aed74['directChange'])return;'chat'===_0x50f3a8['plugins']['get']('AITabs')['view']['activeTab']&&(_0x50f3a8['model']['hasContent'](_0x50f3a8['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x2c55fc=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x585c8f=await _0x2c55fc['getConversations']();return _0x585c8f['length']?_0x585c8f[0x0]['id']:'new';}catch(_0x500286){return this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':ot()}),this['_logError'](new at('ai-chat-conversation-init-failed',this,{'error':_0x500286})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x2882fc={}){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x2882fc);}catch(_0x5ee5a6){this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x2882fc['id']||ot()}),console['error'](_0x5ee5a6),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0x1420ed,modelId:_0x589fbb}={}){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;let _0x4e0723=_0x589fbb;_0x4e0723||(_0x1420ed||!this['activeConversation']?_0x4e0723=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x4e0723=this['activeConversation']['selectedModel']['id'])),await this['_stopLastInteraction']();const _0x13b612=this['getGroupId'](),_0x52c879=_0x1420ed||ot();let _0x4884fb;this['activeConversation']=new AIChatConversation({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x4e0723,'conversationId':_0x52c879,'group':_0x13b612,'getEditor':()=>ds(this['context']),'getEditors':()=>ls(this['context']),'locale':this['context']['locale'],'isFromHistory':!!_0x1420ed}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x2c784b,_0x440068)=>{this['_aiChatUi']['createConversation'](_0x440068),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x1420ed||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x80320e,_0x34b39d)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x34b39d['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x293f97=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x293f97);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x4cd034=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x4cd034);}),this['activeConversation']['on']('webSearchFinished',(_0x316717,_0x520473)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x520473,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x225506,_0x56e473)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x56e473,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{this['_updateReplyContentThrottled']['flush'](),await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x1ba0e9,_0x45e94d)=>{this['_aiChatUi']['removeFeedInteraction'](_0x45e94d['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x21c1cc,_0x1e7f07,_0x1c8407)=>{this['_updateConversationTitle'](_0x1e7f07,_0x1c8407);}),this['activeConversation']['on']('replyContentUpdated',async(_0xb4b07,_0x3f14f9)=>{void 0x0!==_0x4884fb&&_0x4884fb!==_0x3f14f9['id']&&this['_updateReplyContentThrottled']['flush'](),_0x4884fb=_0x3f14f9['id'],_0x3f14f9['isFromHistory']?await this['_updateReplyContent']({'reply':_0x3f14f9}):await this['_updateReplyContentThrottled']({'reply':_0x3f14f9});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x35fb40,{reply:_0x41783a,index:_0xcd9351,state:_0xf0d5f7})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x41783a['id'],'index':_0xcd9351,'state':_0xf0d5f7}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x41783a['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0xcd9351&&(this['_activeBalloon']??this['_aiChatBalloon'])?.['setState'](_0xf0d5f7);}),this['activeConversation']['on']('contextItemAdded',(_0x544586,_0x2549e3)=>{if(this['_aiChatUi']['addContextItem'](_0x2549e3['contextItem'],_0x2549e3['isLoading']),'selection'===_0x2549e3['contextItem']['type']){const _0x53cecf=[...ds(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x53cecf,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x1daa49,_0x28f3af)=>{this['_aiChatUi']['removeContextItem'](_0x28f3af['uiId']),'current-document'==_0x28f3af['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x28f3af['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0xf01b74,_0x4bd073)=>{this['_aiChatUi']['setContextItemLoading'](_0x4bd073['contextItem']['uiId'],_0x4bd073['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x480be0,_0x34821f)=>{this['_aiChatUi']['setConversationContext'](_0x34821f['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x1d07b2,_0x283030)=>{this['_aiChatUi']['setAddContextOptions'](_0x283030['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x1317e8,_0x104338)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x104338['sourceId'],_0x104338['source'],_0x104338['resources'],_0x104338['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0xed0ca0,_0xacc0ad)=>{this['_aiChatUi']['updateResourceState'](_0xacc0ad['sourceId'],_0xacc0ad['resourceId'],_0xacc0ad['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x198644,_0x1903a6)=>{this['_aiChatUi']['updateCapabilities'](_0x1903a6);}),this['activeConversation']['on']('modelSelected',async(_0x1ec157,_0x112019)=>{const _0x24e8a0=(await this['_aiChatModels']['getAll']())['find'](_0x40f06f=>_0x40f06f['id']===_0x112019['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x24e8a0,_0x112019['isDisabled']);}),this['activeConversation']['on']('error',(_0xeabf0e,{error:_0xb85066,interactionId:_0x3c52ac,fileName:_0x86c104,url:_0x459b76,sourceId:_0x128b07,sourceLabel:_0x1f519d})=>{const _0x2bd328=_0x3c52ac?_0x3c52ac+':'+ot():ot();_0xb85066['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':Hi(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x2bd328}):_0xb85066['message']['startsWith']('ai-chat-conversation-init-failed')||_0xb85066['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x2bd328}),this['_logError'](_0xb85066)):_0xb85066['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x86c104),'id':_0x2bd328}):_0xb85066['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x459b76),'id':_0x2bd328}):_0xb85066['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x2bd328}):_0xb85066['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x2bd328}):_0xb85066['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x128b07&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x128b07),this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x1f519d||'source'),'id':_0x2bd328}),this['_logError'](_0xb85066)):_0xb85066['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x2bd328}),this['_logError'](_0xb85066)):_0xb85066['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x2bd328}),this['_logError'](_0xb85066)):_0xb85066['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x2bd328}),this['_logError'](_0xb85066)):_0xb85066['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x2bd328}),this['_logError'](_0xb85066)):_0xb85066['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x2bd328}),this['_logError'](_0xb85066)):_0xb85066['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x2bd328}),this['_logError'](_0xb85066)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x2bd328}),this['_logError'](_0xb85066));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x1420ed||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x4f7fe8,attributes:_0x1aa588}){if(!this['activeConversation'])throw new at('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x4a9949=await this['_aiEditing']['getDocumentData']();_0x4a9949['length']>0x1?await this['activeConversation']['updateCurrentDocumentsInContext'](_0x4a9949):await this['activeConversation']['updateCurrentDocumentInContext'](_0x4a9949[0x0]);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x4f7fe8,'attributes':_0x1aa588});}['_logError'](_0x20a19a){Ct(_0x20a19a['message']);}['_removeFromContext'](_0x216546){this['activeConversation']?.['removeFromContext'](_0x216546);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x2b3c87){const [_0x229d7e,_0x1f6e69]=_0x2b3c87['split'](':'),_0x1fb541=this['activeConversation']['getInteraction'](_0x229d7e),_0x5bf1c5=_0x1fb541['getReply'](_0x1f6e69);return{'interaction':_0x1fb541,'reply':_0x5bf1c5};}['_resolveGroupTarget'](_0x3b0d9b,_0x8dceb){const _0x326dfa=[..._0x8dceb['changes']['filter'](_0x50e635=>'context'!==_0x50e635['type']),..._0x8dceb['changes']['filter'](_0x2296f2=>'context'===_0x2296f2['type'])];for(const _0x33b343 of _0x326dfa){const _0x4b840a=_0x3b0d9b['newNodeAnchorIds']['get'](_0x33b343['id']),_0x3cf418=this['activeConversation']?.['getSourceByDataId'](_0x33b343['id'])||this['activeConversation']?.['getSourceByDataId'](_0x4b840a)||this['activeConversation']?.['getSourceByDataId'](_0x33b343['anchorId']??void 0x0);if(_0x3cf418){if('destroyed'===_0x3cf418['editor']['state'])return null;const _0x3f9147=_0x3cf418['editor']['model']['document']['getRoot'](_0x3cf418['rootName']);return _0x3f9147?{'editor':_0x3cf418['editor'],'root':_0x3f9147,'parsedDocumentContent':Fi(_0x3cf418['content']),'serializedDocumentContent':_0x3cf418['content'],'version':_0x3cf418['version']}:null;}}const _0x2637bf=ds(this['context']),_0x1ea5a3=this['activeConversation']['getInteraction'](_0x3b0d9b['interactionId']),_0xbcc549=_0x1ea5a3?.['getDocumentContext']();return{'editor':_0x2637bf,'root':_0x2637bf['model']['document']['getRoot'](),'parsedDocumentContent':_0x3b0d9b['documentContextContent'],'serializedDocumentContent':_0xbcc549?.['content'],'version':_0xbcc549?.['version']};}['_groupChangesByTarget'](_0x15289b,_0x1f0534){const _0x2ed009=new Map();for(const _0x3878d6 of _0x1f0534){const _0x4db09a=this['_resolveGroupTarget'](_0x15289b,_0x3878d6);if(!_0x4db09a)continue;const _0x16ff2b=(_0x4db09a['editor']['id']||'e')+'|'+_0x4db09a['root']['rootName'];let _0x53fdd0=_0x2ed009['get'](_0x16ff2b);if(!_0x53fdd0){let _0x54bff4;for(const _0x37855f of[..._0x3878d6['changes']['filter'](_0x273030=>'context'!==_0x273030['type']),..._0x3878d6['changes']['filter'](_0x58fdce=>'context'===_0x58fdce['type'])])if(_0x54bff4=this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x37855f['id'])||this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x15289b['newNodeAnchorIds']['get'](_0x37855f['id'])),_0x54bff4)break;_0x53fdd0={'target':{'editor':_0x4db09a['editor'],'root':_0x4db09a['root']},'slice':_0x54bff4,'groups':[],'groupsIndexes':[]},_0x2ed009['set'](_0x16ff2b,_0x53fdd0);}_0x53fdd0['groups']['push'](_0x3878d6),_0x53fdd0['groupsIndexes']['push'](_0x15289b['changeGroups']['indexOf'](_0x3878d6));}return Array['from'](_0x2ed009['values']());}['_scrollToSuggestionRange'](_0x366d2a,_0x195eb0=!0x1,_0x3d738d){const _0xc5267b={'target':_0x3d738d['editing']['view']['domConverter']['viewRangeToDom'](_0x3d738d['editing']['mapper']['toViewRange'](_0x366d2a)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x195eb0};_0x195eb0&&(_0xc5267b['alignToTop']=!0x0),wt(_0xc5267b);}['_updateConversationTitle'](_0x3e2228,_0x42c78f=!0x1){this['_aiChatUi']['setConversationTitle'](_0x3e2228||Hi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x42c78f);}['_addFeedItemReply'](_0x30f540){'text'===_0x30f540['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x30f540):this['_aiChatUi']['addFeedItemAISuggestion'](_0x30f540);}async['_updateReplyContent']({reply:_0x40fa74,renderingStrategy:_0x7f900e}){const {id:_0x3a768c,interactionId:_0x7ae3d5,isDone:_0x433863,type:_0x30b368,parsedContent:_0x3c013b}=_0x40fa74,_0x4f962f=_0x7ae3d5+':'+_0x3a768c;if('modification'===_0x30b368){const _0x11a59b=_0x40fa74['getContentParts']({'showDiff':this['_aiChatUi']['showDiff'],'editor':ds(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x4f962f,'parts':_0x11a59b,'isDone':_0x433863,'skipLoadingEffects':_0x40fa74['isFromHistory']});}else'text'===_0x30b368&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x4f962f,'parsedContent':_0x3c013b,'renderingStrategy':_0x7f900e,'isDone':_0x433863});_0x433863&&_0x40fa74['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x4f962f,_0x40fa74['sources']);}['_updateReplyContentThrottled']=_0x134eed(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x425582=this['activeConversation']?.['lastInteraction'];_0x425582&&(_0x425582['stop'](),this['_aiChatUi']['stopInteraction'](_0x425582)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0x679bf=this['activeConversation']?.['lastInteraction'];if(_0x679bf){for await(const _0x5da3e9 of _0x679bf['replies'])this['_aiChatUi']['hasFeedItem'](_0x5da3e9['id'])||this['_addFeedItemReply'](_0x5da3e9),await this['_updateReplyContent']({'reply':_0x5da3e9,'renderingStrategy':'static'});}}['_updateRatings'](_0x4470a3){const _0x27e115={'positiveCount':_0x4470a3['changeGroups']['filter'](_0x560e1f=>'accepted'===_0x560e1f['state'])['length'],'totalCount':_0x4470a3['changeGroups']['length'],'modificationId':_0x4470a3['id']},_0x316934=this['activeConversation']['getInteraction'](_0x4470a3['interactionId'])['messageId'];_0x316934&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x316934,_0x27e115);}['_getAIChatFeedAPI'](_0x140b89){const _0x39aa2e=this['_aiChatUi'],_0x26fc3b=()=>{_0x140b89['resetWebSearchState'](),_0x140b89['resetReasoningState'](),_0x39aa2e['clearLoadingMessage']();},_0x381123=()=>{_0x140b89['currentReply']&&(_0x140b89['currentReply']['done'](),_0x140b89['currentReply']=void 0x0);};return{'insertTextReply':(_0x2f3c25,_0x5aab12)=>{_0x381123(),_0x26fc3b();const _0x54d11f=_0x140b89['currentReply']=_0x140b89['createReply']({'type':'text','interactionId':_0x140b89['id'],'content':_0x2f3c25,'id':_0x5aab12||ot()});return _0x381123(),_0x54d11f;},'insertCustomElement':async(_0x83facd,_0x1e294b)=>(_0x381123(),_0x26fc3b(),_0x39aa2e['addFeedItemCustomElement'](_0x83facd,_0x1e294b||ot())),'setLoadingMessage':_0x4bc8a1=>{_0x39aa2e['setLoadingMessage'](_0x4bc8a1);},'clearLoadingMessage':()=>{_0x39aa2e['clearLoadingMessage']();}};}}const As='ai-selection',gs=['br'];class AIEditing extends _0x3cc0e4{constructor(_0x55129b){super(_0x55129b),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_fakeSelections']=[];['_sessionId'];['_lastContentFocusedEditor'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['getLastContentFocusedEditor'](){return this['_lastContentFocusedEditor'];}get['sessionId'](){if(!this['_sessionId']){const _0x48fcf1=ls(this['context']),_0x1f14b2=_0x48fcf1['find'](_0x19cd0e=>_0x19cd0e['plugins']['has']('RealTimeCollaborationClient'))||_0x48fcf1[0x0],_0x161954=_0x1f14b2['plugins']['has']('RealTimeCollaborationClient')&&_0x1f14b2['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x161954||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0x1f3138=ls(this['context']);if(!_0x1f3138['length'])throw new at('ai-get-editor-from-context-no-editor');const _0x4e1abd=[],_0x490281=new Set();for(const _0x26de3a of _0x1f3138){const _0x493b20=_0x26de3a['config']['get']('roots')||{};for(const _0x14cb12 of _0x26de3a['model']['document']['getRoots']()){if('$graveyard'===_0x14cb12['rootName'])continue;const _0x5ac6ae=await this['_getDocumentDataForEditorRoot'](_0x26de3a,_0x14cb12,_0x490281),_0x3342be=_0x493b20[_0x14cb12['rootName']];let _0x5540c9;_0x3342be?.['label']?_0x5540c9=_0x3342be['label']:(gt('ai-document-root-missing-label',{'editor':_0x26de3a,'rootConfig':_0x3342be}),_0x5540c9=_0x14cb12['rootName']),_0x4e1abd['push']({'editor':_0x26de3a,'rootName':_0x14cb12['rootName'],'content':_0x5ac6ae['content'],'version':_0x5ac6ae['version'],'sessionId':this['sessionId'],'channelId':_0x26de3a['config']['get']('collaboration.channelId'),'selections':_0x5ac6ae['selections'],'name':_0x5540c9,'description':_0x3342be?.['description']});}}return _0x4e1abd;}async['_getDocumentDataForEditorRoot'](_0x16c1d9,_0x59b5d1,_0x397c24){const _0x9ddb20=_0x16c1d9['data']['toView'](_0x59b5d1,{'convertAiChatSelectionMarker':!0x0}),_0x2ab9e9=new _0x56ae7f(_0x16c1d9['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x9ddb20,_0x2ab9e9,_0x397c24);let _0x27f80b=await this['_getDocumentDataStringFromView'](_0x9ddb20,_0x16c1d9);const _0x5d065d=this['_getMarkersInDocumentOrder'](_0x16c1d9,_0x59b5d1),_0x463140=[];for(const _0x5a419c of _0x5d065d){const _0x18f7a8='<'+_0x5a419c['name']+':start></'+_0x5a419c['name']+':start>',_0xbb48d7=_0x27f80b['indexOf'](_0x18f7a8);_0x27f80b=_0x27f80b['substring'](0x0,_0xbb48d7)+_0x27f80b['substring'](_0xbb48d7+_0x18f7a8['length']);const _0x2f1f69='<'+_0x5a419c['name']+':end></'+_0x5a419c['name']+':end>',_0x5d7e48=_0x27f80b['indexOf'](_0x2f1f69);_0x27f80b=_0x27f80b['substring'](0x0,_0x5d7e48)+_0x27f80b['substring'](_0x5d7e48+_0x2f1f69['length']),_0x463140['push']({'markerName':_0x5a419c['name'],'start':_0xbb48d7,'end':_0x5d7e48,'htmlFragment':_0x27f80b['substring'](_0xbb48d7,_0x5d7e48)});}return{'content':_0x27f80b,'version':_0x16c1d9['model']['document']['version'],'selections':_0x463140};}async['afterInit'](){this['context']instanceof _0x3cd9d5?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x1fc97b,_0xbe91f4)=>{_0xbe91f4['on']('ready',()=>{this['_integrateEditor'](_0xbe91f4);});});}['_setOutputDataProcessor'](_0x5b735a){this['_outputDataProcessor']=_0x5b735a;}async['_getDocumentDataStringFromView'](_0x28c800,_0x1ecca9){let _0xb517ae;if(this['_outputDataProcessor']){const _0x25e467=_0x1ecca9['data']['processor']['domConverter']['viewToDom'](_0x28c800),_0x49caf2=await this['_outputDataProcessor'](_0x25e467);_0xb517ae=_0x1ecca9['data']['processor']['htmlWriter']['getHtml'](_0x49caf2);}else _0xb517ae=_0x1ecca9['data']['processor']['toData'](_0x28c800);return _0xb517ae;}['_integrateEditor'](_0x195283){if(!_0x195283['config']['get']('collaboration.channelId'))throw new at('ai-missing-channel-id',_0x195283);_0x195283['ui']['focusTracker']['on']('change:isFocused',(_0x47d6b7,_0x3fe36b,_0x539164)=>{_0x539164&&(this['_lastContentFocusedEditor']=_0x195283);}),_0x195283['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x195283&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x195283['conversion']['for']('editingDowncast')['markerToHighlight']({'model':As,'view':({markerName:_0x4bdcd5})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x4bdcd5['split'](':')[0x1]],'priority':0xc})}),_0x195283['conversion']['for']('dataDowncast')['markerToElement']({'model':As+':context','view':(_0x5d2eda,{writer:_0x3d9b11,options:_0x172280})=>_0x172280['convertAiChatSelectionMarker']?_0x3d9b11['createUIElement'](_0x5d2eda['markerName']+':'+(_0x5d2eda['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x458c54){const _0x5c3610=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x458c54);const _0x44ac6f=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x5c3610,_0x44ac6f);}['hideFakeVisualSelection'](_0x174bf4){const _0x570dc3=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x174bf4);const _0x3a9d96=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x570dc3,_0x3a9d96);}async['modelToDataWithIds'](_0xddfe05){const _0x4f92df=ds(this['context']),_0x4203e5=_0x4f92df['data']['toView'](_0xddfe05),_0x5f5673=new _0x56ae7f(_0x4f92df['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x4203e5,_0x5f5673),this['_getDocumentDataStringFromView'](_0x4203e5,_0x4f92df);}['_setDataIdsOnChildren'](_0x312e7e,_0x244f24,_0x31aaa2=new Set()){let _0x2f8e45=!0x1;for(const _0x363e7e of _0x312e7e['getChildren']()){if(!_0x363e7e['is']('view:element')||gs['includes'](_0x363e7e['name']))continue;const _0x10136f=_0x363e7e['is']('view:containerElement'),_0x46fdb7=_0x363e7e['is']('view:emptyElement'),_0xb910d7=this['_setDataIdsOnChildren'](_0x363e7e,_0x244f24,_0x31aaa2);if(_0x363e7e['hasAttribute']('data-id')){_0x2f8e45=!0x0,_0x31aaa2['add'](_0x363e7e['getAttribute']('data-id'));continue;}(_0x10136f||_0x46fdb7||_0xb910d7)&&(_0x244f24['setAttribute']('data-id',this['_nextDataId'](_0x31aaa2),_0x363e7e),_0x2f8e45=!0x0);}return _0x2f8e45;}['_nextDataId'](_0x1564e0){let _0x333331;do{_0x333331='';for(let _0x3de002=0x0;_0x3de002<0x4;_0x3de002++)_0x333331+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x1564e0['has'](_0x333331));return _0x1564e0['add'](_0x333331),_0x333331;}['getSelectionText'](){const {model:_0x3f9f2f}=ds(this['context']),_0xdcd40c=_0x3f9f2f['document']['selection'],_0x4f2deb=[],_0x3235e1=Array['from'](_0xdcd40c['getRanges']());_0x3235e1['sort']((_0x1f203d,_0x37bc81)=>_0x1f203d['start']['isBefore'](_0x37bc81['start'])?-0x1:0x1);for(const _0x5a776f of _0x3235e1)for(const _0x2f7942 of _0x5a776f['getItems']())_0x2f7942['is']('$textProxy')?_0x4f2deb['push'](_0x2f7942['data']):_0x2f7942['is']('element')&&_0x4f2deb['length']>0x0&&'\x20'!==_0x4f2deb[_0x4f2deb['length']-0x1]&&_0x4f2deb['push']('\x20');return _0x4f2deb['length']?'\x22'+_0x4f2deb['join']('')['trim']()+'\x22':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x47b0b2){for(let _0x3d898a=0x0;_0x3d898a<this['_fakeSelections']['length'];_0x3d898a++)if(this['_fakeSelections'][_0x3d898a]['id']==_0x47b0b2)return void this['_fakeSelections']['splice'](_0x3d898a,0x1);}['_addFakeSelection'](_0x2a98ce){this['_removeFakeSelectionById'](_0x2a98ce['id']),Tt(this['_fakeSelections'],_0x2a98ce);}['_refreshFakeSelection'](_0x1e78fb,_0x5e24ef){if(_0x1e78fb==_0x5e24ef)return;const _0x1af5f4=_0x1e78fb?this['_getEditorForFakeSelection'](_0x1e78fb):null,_0x62d0bb=_0x5e24ef?this['_getEditorForFakeSelection'](_0x5e24ef):null,_0x18184f=(_0x3f1af9,_0x4e7098)=>{const _0x4bd525=_0x4e7098['model']['markers']['getMarkersGroup'](As);for(const _0x4de8a0 of _0x4bd525)_0x3f1af9['removeMarker'](_0x4de8a0);},_0x85e996=(_0x412bf7,_0x20fc84,_0x1a0749)=>{const _0x6900a2=_0x20fc84['model'];for(let _0x5a04ea=0x0;_0x5a04ea<_0x1a0749['ranges']['length'];_0x5a04ea++){let _0x1891ab=_0x1a0749['ranges'][_0x5a04ea];const _0x42dd93=As+':'+_0x1a0749['id']+':'+_0x5a04ea;if(_0x1891ab['start']['isAtEnd']){const _0x3b41b=_0x1891ab['start']['getLastMatchingPosition'](({item:_0x1605db})=>!_0x6900a2['schema']['isContent'](_0x1605db),{'boundaries':_0x1891ab});_0x1891ab=_0x412bf7['createRange'](_0x3b41b,_0x1891ab['end']);}_0x412bf7['addMarker'](_0x42dd93,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1891ab});}};_0x1af5f4&&_0x62d0bb&&_0x1af5f4===_0x62d0bb&&_0x5e24ef?_0x1af5f4['model']['change'](_0x4622c6=>{_0x18184f(_0x4622c6,_0x1af5f4),_0x85e996(_0x4622c6,_0x62d0bb,_0x5e24ef);}):(_0x1af5f4&&_0x1af5f4['model']['change'](_0x46f47e=>_0x18184f(_0x46f47e,_0x1af5f4)),_0x62d0bb&&_0x5e24ef&&_0x62d0bb['model']['change'](_0x529f47=>_0x85e996(_0x529f47,_0x62d0bb,_0x5e24ef)));}['_getEditorForFakeSelection'](_0xb40bcf){if(!_0xb40bcf['ranges']['length'])return ds(this['context']);const _0x450829=_0xb40bcf['ranges'][0x0]['root']['document'];return ls(this['context'])['find'](_0x3b1505=>_0x3b1505['model']['document']===_0x450829)??ds(this['context']);}['_getMarkersInDocumentOrder'](_0x4a9a2c,_0x3332cf){const _0x3c501e=Array['from'](_0x4a9a2c['model']['markers']['getMarkersGroup'](As+':context'));return(_0x3332cf?_0x3c501e['filter'](_0xfc9404=>{const _0x1e6fb5=_0xfc9404['getRange']();return _0x1e6fb5&&_0x1e6fb5['root']['rootName']===_0x3332cf['rootName'];}):_0x3c501e)['sort']((_0x14c430,_0x272d99)=>_0x14c430['getStart']()['isBefore'](_0x272d99['getStart']())?-0x1:_0x14c430['getStart']()['isAfter'](_0x272d99['getStart']())?0x1:0x0);}}const Cs=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],ms=[...Cs,'startConversation','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];function ps(_0x353c8f){const _0x28047d=new AbortController();return{'promise':new Promise((_0x5ec9c0,_0x676586)=>{const _0x2b12c7=setTimeout(_0x5ec9c0,_0x353c8f);_0x28047d['signal']['addEventListener']('abort',()=>{clearTimeout(_0x2b12c7),_0x676586();});}),'abortController':_0x28047d};}class HTMLStreamer{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x1e1c30){this['options']={'delay':_0x1e1c30?.['delay']??0xa,'textNodeStyle':_0x1e1c30?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x462e39,targetElement:_0x479b51,abortSignal:_0x23104c}){this['isStreaming']&&this['stop'](),_0x23104c?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x252747(_0x462e39,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x2be9ba=0x0;_0x2be9ba<this['currentIndex'];_0x2be9ba++)this['nodesList'][_0x2be9ba]['shouldBeStreamed']=!0x0;do{const _0x48167b=Date['now'](),_0x1beaf5=this['nodesList'][this['currentIndex']],_0x482348=_0x48167b-this['lastUpdateTime'];if(_0x1beaf5){_0x1beaf5['shouldBeStreamed']=!0x0;let _0x544654=_0x1beaf5['parent'];for(;_0x544654;)_0x544654['shouldBeStreamed']=!0x0,_0x544654=_0x544654['parent'];}if(_0x482348<this['options']['delay'])try{const {promise:_0x29e53e,abortController:_0x213010}=ps(this['options']['delay']-_0x482348);this['timeoutAbortController']=_0x213010,await _0x29e53e;}catch(_0x1213db){return;}_0x53d52c(_0x479b51,'<'+_0x479b51['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x479b51['tagName']+'>',{'childrenOnly':!0x0}),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:_0x2889a2}){Array['from'](_0x2889a2['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x45e455=>{_0x45e455['replaceWith'](_0x45e455['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x4ccc58){let _0x10259c='';if(function(_0x453c6d){return _0x19438c(_0x453c6d);}(_0x4ccc58)){for(const _0x10b0e0 of _0x4ccc58['children'])_0x10259c+=this['renderNode'](_0x10b0e0);}else{if(Ts(_0x4ccc58)){if(!_0x4ccc58['shouldBeStreamed'])return'';const _0x312f3a=_0x4ccc58,_0x43f157=Object['entries'](_0x312f3a['attribs'])['map'](([_0x2ccba1,_0x49d6ba])=>_0x2ccba1+'=\x22'+_0x49d6ba+'\x22')['join']('\x20');_0x10259c+='<'+_0x312f3a['tagName']+(_0x43f157?'\x20'+_0x43f157:'')+'>';for(const _0x2336e0 of _0x31b03f(_0x312f3a))_0x10259c+=this['renderNode'](_0x2336e0);_0x10259c+='</'+_0x312f3a['tagName']+'>';}else{if(!ws(_0x4ccc58))return'';if(!_0x4ccc58['shouldBeStreamed'])return'';!function(_0x285797){if(!_0x285797['parent']||!Ts(_0x285797['parent']))return!0x1;if(!Es['includes'](_0x285797['parent']['tagName']))return!0x1;return!_0x5408c8(_0x285797)['match'](/^\s*[<>]\s*$/);}(_0x4ccc58)?_0x10259c+=ti(_0x4ccc58):_0x10259c+=ti(new _0x1f4caa('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x4ccc58]));}}return _0x10259c;}['getParsedDocumentNodeList'](){const _0x87335=[];return function(_0x53e824,_0x5ae8c3){const _0x518f6e=_0x533e90=>{if(_0x5ae8c3(_0x533e90),_0x533e90 instanceof _0x43458d)for(let _0x3b52d0=0x0;_0x3b52d0<_0x533e90['children']['length'];_0x3b52d0++){const _0x58d84c=_0x533e90['children'][_0x3b52d0];_0x518f6e(_0x58d84c);}};for(let _0x333337=0x0;_0x333337<_0x53e824['children']['length'];_0x333337++)_0x518f6e(_0x53e824['children'][_0x333337]);}(this['document'],_0x428b1b=>{if(ws(_0x428b1b)){const _0x131cd2=this['splitTextNodeIntoWordNodes'](_0x428b1b);_0x131cd2['length']&&_0x87335['push'](..._0x131cd2);}_0x428b1b['isWordSplitSource']||_0x428b1b['isWordSplitResult']||_0x87335['push'](_0x428b1b);}),_0x87335;}['splitTextNodeIntoWordNodes'](_0x4c5279){if(_0x4c5279['isWordSplitSource']||_0x4c5279['isWordSplitResult'])return[];const _0x12aeb5=_0x5408c8(_0x4c5279)['match'](/(?:\s*\S+\s*)/g),_0xd49e53=[];if(_0x12aeb5&&_0x12aeb5['length']>0x1){for(const _0x3f64b9 of _0x12aeb5){const _0x4b630f=new _0x54c8f4(_0x3f64b9);_0x4b630f['isWordSplitResult']=!0x0,_0x238c6d(_0x4c5279,_0x4b630f),_0xd49e53['push'](_0x4b630f);}_0x4c5279['isWordSplitSource']=!0x0,_0x8926a6(_0x4c5279);}return _0xd49e53;}}const Es=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ws(_0x247ef9){return _0x4de3bc(_0x247ef9);}function Ts(_0x510203){return _0x5778d8(_0x510203);}class AIChatFeedItemView extends Nt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x34075f){super();const _0x524947=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new HTMLStreamer(),this['options']=_0x34075f,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x524947['if']('isDone','ck-ai-chat__feed__item_done'),_0x524947['if']('isVisible','ck-hidden',_0x2692a8=>!_0x2692a8),'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'](_0x1c87b5=>{_0x1c87b5['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x21ecfc,_0x306bc0,_0x19a823){await this['htmlStreamer']['stream']({'document':_0x21ecfc,'targetElement':_0x306bc0,'abortSignal':_0x19a823});}}class AISuggestionHeaderView extends Nt{['showChangesToggleView'];constructor(_0x481e46,_0xdc8cd8){super(_0x481e46),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new ShowChangesToggleView(_0x481e46),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+Bi,'label':Hi(_0x481e46,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0xdc8cd8['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x2ffff6=>_0x2ffff6?_0x5a2923:_0x1aad04),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x422170=new xt();_0x422170['content']=_0x3745a0,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0xdc8cd8['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x422170,{'tag':'span','children':[Hi(_0x481e46,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class ShowChangesToggleView extends vt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const fs={'accepted':_0x3a31e4,'rejected':_0x5d4966,'outdated':_0x5d4966};class AISuggestionContentPartStateView extends Nt{['stateIconView'];constructor(_0x14b498){super(_0x14b498);const _0x245e44=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new StateIconView(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x245e44['to']('state',_0x11dde8=>'ck-ai-suggestion__content-part-state_'+_0x11dde8),_0x245e44['if']('isVisible','ck-hidden',_0x1ebdf1=>!_0x1ebdf1)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x245e44['to']('state',_0x25d441=>{switch(_0x25d441){case'accepted':return Hi(_0x14b498,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return Hi(_0x14b498,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return Hi(_0x14b498,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x220fe5){this['state']=_0x220fe5;}}class StateIconView extends xt{constructor(){super(),this['set']('state','accepted'),this['content']=fs[this['state']],this['on']('change:state',()=>{this['content']=fs[this['state']];});}}class AISuggestionContentPartToolbarView extends kt{['_applyButton'];['_suggestButton'];constructor(_0x3ac9c6,_0x213c04,_0x5645ff){super(_0x3ac9c6);const _0x1889d3=Boolean(_0x5645ff);this['set']('isEnabled',!_0x1889d3),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x158240=[];if(_0x1889d3){const _0x356a22=new vt(_0x3ac9c6);_0x356a22['set']({'label':Hi(_0x3ac9c6,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x467df0}),_0x356a22['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x158240['push'](_0x356a22);}else{_0x213c04['includes']('applySuggestion')&&(this['_applyButton']=new vt(_0x3ac9c6),this['_applyButton']['set']({'label':Hi(_0x3ac9c6,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3a31e4}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x158240['push'](this['_applyButton'])),_0x213c04['includes']('insertSuggestion')&&(this['_suggestButton']=new vt(_0x3ac9c6),this['_suggestButton']['set']({'label':Hi(_0x3ac9c6,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x561f7b}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x158240['push'](this['_suggestButton']));const _0x28a344=new vt(_0x3ac9c6);_0x28a344['set']({'label':Hi(_0x3ac9c6,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x5d4966}),_0x28a344['bind']('isEnabled')['to'](this),_0x28a344['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x158240['push'](_0x28a344);}this['items']['addMany'](_0x158240);const _0x3310bf=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x3310bf['if']('isVisible','ck-hidden',_0x1cde75=>!_0x1cde75)]}});}['setButtonsVisibility']({showApplyButton:_0xfea36b,showSuggestButton:_0x1f012d}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0xfea36b),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x1f012d);}}class AISuggestionContentPartHeaderView extends Nt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x5353ce,{part:_0x84891,uiIndex:_0x5e6bde,availableActions:_0x38e47a,areActionsDisabled:_0x1372c9}){super(_0x5353ce),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new AISuggestionContentPartToolbarView(_0x5353ce,_0x38e47a,_0x1372c9),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x84891['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x84891['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x84891['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new AISuggestionContentPartStateView(_0x5353ce),this['titleLabelView']=new AISuggestionBodyContentPartTitleLabelView(_0x5353ce,_0x5e6bde),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',(_0x514c7c,_0x51a644,_0x5962fc,_0x5ae3db)=>{'pending'===_0x5ae3db?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x5962fc?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x5962fc),this['children']['add'](this['stateView']));});}}class AISuggestionBodyContentPartTitleLabelView extends Nt{constructor(_0x53d9d9,_0x4df74e){super(_0x53d9d9),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[Hi(_0x53d9d9,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x4df74e['toString']())]});}}class AISuggestionStreamableContentView extends Nt{['htmlStreamer'];constructor(_0x5f2233){super(_0x5f2233),this['htmlStreamer']=new HTMLStreamer(),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x5026a5,renderingStrategy:_0x53460d,abortSignal:_0x5a2372}){'streaming'===_0x53460d?await this['htmlStreamer']['stream']({'document':_0x5026a5['content'],'targetElement':this['element'],'abortSignal':_0x5a2372}):_0x53d52c(this['element'],'<'+this['element']['tagName']+'>'+Ki(_0x5026a5['content'])+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class AISuggestionBodyViewContentPartView extends Nt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x5467f1,{part:_0x3efc2b,uiIndex:_0x204a43,areActionsDisabled:_0xe9b558,availableActions:_0x3645dd}){super(_0x5467f1);const _0x5cba0b=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x188c3b=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0xe9b558;};this['on']('change:state',_0x188c3b),this['on']('change:isDone',_0x188c3b),_0x188c3b(),this['_children']=this['createCollection'](),this['_headerView']=new AISuggestionContentPartHeaderView(_0x5467f1,{'part':_0x3efc2b,'uiIndex':_0x204a43,'availableActions':_0x3645dd,'areActionsDisabled':_0xe9b558}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Cs)['to'](this),this['_streamableContentView']=new AISuggestionStreamableContentView(_0x5467f1),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x5cba0b['to']('state',_0x5d37ca=>'ck-ai-suggestion__body__content-part_'+_0x5d37ca),_0x5cba0b['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x5cba0b['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x5cba0b['if']('isVisible','ck-hidden',_0x4ea960=>!_0x4ea960)]},'children':this['_children'],'on':{'mouseenter':_0x5cba0b['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x3efc2b['index']});}),'mouseleave':_0x5cba0b['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x3efc2b['index']});}),'click':_0x5cba0b['to'](_0xb72089=>{const _0x3d7689=_0xb72089['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x3d7689)&&this['fire']('showChangeInText',{'index':_0x3efc2b['index']});})}});}async['updateContent']({part:_0x4161b1,showUnchangedParts:_0x77745a=!0x1,abortSignal:_0x8023c0}){this['partDefinition']=_0x4161b1,this['isVisible']=this['partDefinition']['hasChanges']||_0x77745a,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x4161b1,'renderingStrategy':'static','abortSignal':_0x8023c0});}['markAsDone'](){this['isDone']=!0x0;}}class AISkeletonView extends Nt{constructor(_0x2bfc64,_0x3f9f72){super(_0x2bfc64),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x39fa11=>!_0x39fa11)]},'children':this['_createSkeletonItems'](_0x3f9f72)});}['_createSkeletonItems'](_0x3f9a2a){const _0x452b4b=['ck','ck-ai-skeleton__item'];return _0x3f9a2a['map'](_0xd67044=>{let _0x33b644='';switch(_0xd67044['attributes']['align']){case'right':_0x33b644='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x33b644='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x33b644='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0xd67044['tag'],'attributes':{'class':[..._0x452b4b,_0xd67044['attributes']['class']?_0xd67044['attributes']['class']:''],'style':'width:\x20'+_0xd67044['attributes']['width']+';\x20height:\x20'+_0xd67044['attributes']['height']+';'+_0x33b644}};});}}const Ss={'aiSuggestionBody':[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'85%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'75%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}}],'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':Rs(0x5,'100%','44px','right'),'aiChatResources':Rs(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 Rs(_0x52ed24,_0x11212c,_0x2728cc,_0x151f8c){return new Array(_0x52ed24)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x11212c,'height':_0x2728cc,'align':_0x151f8c}}));}class PromiseQueue extends Et(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x3e3cb6){const _0x4d69dd=this['createTask'](_0x3e3cb6);return this['queue']['push'](_0x4d69dd),this['_processQueue'](),_0x4d69dd['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(_0x8c0d5c=>{this['once']('_queueEmpty',()=>{_0x8c0d5c();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x2df15b=this['queue']['shift']();try{await _0x2df15b['callback'](this['_abortController']['signal']),_0x2df15b['resolve']();}catch(_0x4c8823){_0x2df15b['reject'](_0x4c8823);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x539c2c){let _0x2c4d35,_0x327900;const _0x6d5e5b=new Promise((_0x7bbe7a,_0x1abda2)=>{_0x2c4d35=_0x7bbe7a,_0x327900=_0x1abda2;});return{'callback':_0x539c2c,'resolve':_0x2c4d35,'reject':_0x327900,'completePromise':_0x6d5e5b};}}class AIChatFeedErrorItemView extends AIChatFeedItemView{constructor(_0x24cddb){super(_0x24cddb),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x24cddb['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x3e15d3){this['element']['innerHTML']=_0x3e15d3;}}const bs=['applySuggestion','insertSuggestion'];class AIChatFeedSuggestionItemActionsView extends Nt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x1bb3df,_0xc0d294=[...bs],_0x447eff){super(_0x1bb3df);const _0x11e8b2=this['bindTemplate'],_0x2135b2=Boolean(_0x447eff);if(this['set']('isEnabled',!_0x2135b2),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x2135b2){const _0xdb8e13=new vt(_0x1bb3df);_0xdb8e13['set']({'label':Hi(_0x1bb3df,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x467df0}),_0xdb8e13['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x46ae5a=new Nt(_0x1bb3df);_0x46ae5a['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[Hi(_0x1bb3df,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0xdb8e13]}]}),this['children']['add'](_0x46ae5a);}else this['_applyChangesButton']=new vt(_0x1bb3df),this['_applyChangesButton']['set']({'label':Hi(_0x1bb3df,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0xc0d294['includes']('applySuggestion'),'class':Mi}),this['_insertSuggestionsButton']=new vt(_0x1bb3df),this['_insertSuggestionsButton']['set']({'label':Hi(_0x1bb3df,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0xc0d294['includes']('insertSuggestion'),'class':Ui}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x435f7b=>{_0x435f7b['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',_0x11e8b2['if']('isVisible','ck-hidden',_0x4b84c5=>!_0x4b84c5)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x56b646){this['isVisible']=_0x56b646;}['_switchButtonLabelsPlurality'](_0x26eda3){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x26eda3?(this['_applyChangesButton']['label']=Hi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=Hi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=Hi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=Hi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class AIWebSourcesView extends Nt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x37d4c1,_0x5f79e0){super(_0x37d4c1),this['bodyCollection']=_0x5f79e0,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',_0x2aafb0=>!_0x2aafb0)]},'children':this['children']});const _0x92c653=new Nt(this['locale']),_0x258d33=new xt();_0x258d33['content']=_0x43e506,_0x92c653['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x258d33,{'tag':'span','children':[{'text':Hi(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x92c653),this['_setupBalloonPanel'](_0x37d4c1);}['addSource'](_0x23ceea){this['children']['add'](new AIWebSourceView(this['locale'],_0x23ceea,this['balloonPanelView']));}['_setupBalloonPanel'](_0x5ec840){this['balloonPanelView']=new Xt(_0x5ec840),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class AIWebSourceView extends vt{['balloonPanelView'];['source'];constructor(_0x2959e1,_0x7e54e0,_0x52d0d8){super(_0x2959e1),this['source']=_0x7e54e0,this['balloonPanelView']=_0x52d0d8,this['set']({'label':_0x7e54e0['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x322a2d=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x322a2d['to'](()=>{window['open'](_0x7e54e0['url'],'_blank');}),'mouseenter':_0x322a2d['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x322a2d['to'](()=>{this['_hideTooltip']();})}}),_0x7e54e0['favicon']){const _0x365b98=new Nt(_0x2959e1);_0x365b98['setTemplate']({'tag':'img','attributes':{'src':_0x7e54e0['favicon']||_0x43e506,'alt':_0x7e54e0['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x365b98);}else this['set']('icon',_0x43e506);}['_createTooltipContentView'](_0x2033fc,_0x26a250){const _0x1e5983=new Nt(_0x2033fc),_0x3077f4=[];let _0x193dff;_0x26a250?.['favicon']?(_0x193dff=new Nt(_0x2033fc),_0x193dff['setTemplate']({'tag':'img','attributes':{'src':_0x26a250['favicon'],'alt':_0x26a250['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x193dff=new xt(),_0x193dff['content']=_0x43e506,_0x193dff['extendTemplate']({'attributes':{'alt':_0x26a250['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x3077f4['push'](_0x193dff);const _0xa6cd51=new Nt(_0x2033fc);_0xa6cd51['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x26a250['url']},'children':[{'text':new URL(_0x26a250['url'])?.['hostname']}]}),_0x3077f4['push'](_0xa6cd51);const _0x546d42=new Nt(_0x2033fc);_0x546d42['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x3077f4});const _0x1352cc=new Nt(_0x2033fc);return _0x1352cc['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x26a250['title']['length']>0x190?_0x26a250['title']['substring'](0x0,0x190)+'...':_0x26a250['title']}]}),_0x1e5983['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x546d42,_0x1352cc]}),_0x1e5983;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[Xt['defaultPositions']['northArrowSouth'],Xt['defaultPositions']['northArrowSouthWest'],Xt['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 _0x58a053=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x58a053);}}class AISuggestionBodyView extends Nt{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0xc92ffd(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x5863b3,_0x5bf97e){super(_0x5863b3);const {areActionsDisabled:_0x54b5b1,showUnchangedParts:_0x5b8b49,availableActions:_0x1f26ae}=_0x5bf97e;this['_areActionsDisabled']=_0x54b5b1,this['_showUnchangedParts']=_0x5b8b49,this['_availableActions']=_0x1f26ae,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new AISkeletonView(_0x5863b3,Ss['aiSuggestionBody']),this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now'](),this['_children']['add'](this['_skeletonView']),this['_updateContentPartsPromiseQueue']=new PromiseQueue(),this['_emptyPartsWarningView']=new AIChatFeedErrorItemView({'id':'empty-parts-warning','initialContent':Hi(_0x5863b3,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new AIChatFeedSuggestionItemActionsView(_0x5863b3,_0x5bf97e['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new AIWebSourcesView(this['locale'],_0x5bf97e['bodyCollection']),_0x5bf97e['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...Cs)['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']]});}['destroy'](){this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),super['destroy']();}get['partsCount'](){return this['_contentPartViews']['length'];}get['_contentPartViews'](){return Array['from'](this['_children'])['filter'](_0x1b8ea2=>_0x1b8ea2 instanceof AISuggestionBodyViewContentPartView);}async['updateContentParts']({parts:_0xf0402f,abortSignal:_0x14b494,skipLoadingEffects:_0x4e2e36}){this['_cachedContentParts']['length']?_0xf0402f['forEach'](_0x44b74e=>{const _0x900cd=this['_cachedContentParts']['findIndex'](_0x4c7c47=>_0x4c7c47['index']==_0x44b74e['index']);-0x1===_0x900cd?this['_cachedContentParts']['push'](_0x44b74e):this['_cachedContentParts'][_0x900cd]=_0x44b74e;}):this['_cachedContentParts']=_0xf0402f;const _0x3baf09=this['_showUnchangedParts']?_0xf0402f:_0xf0402f['filter'](_0x23192d=>_0x23192d['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x3baf09['length']>0x1),_0x4e2e36&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x4a68bd of _0x3baf09)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x1f22e6=>{let _0x527b8f=this['getPartView'](_0x4a68bd['index']);if(!_0x527b8f){if(_0x527b8f=new AISuggestionBodyViewContentPartView(this['locale'],{'part':_0x4a68bd,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x527b8f['delegate'](...Cs)['to'](this),!_0x4e2e36&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x1f22e6),_0x1f22e6['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x527b8f,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0x4e2e36||this['_showSkeletonDebounced']();}await _0x527b8f['updateContent']({'part':_0x4a68bd,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x1f22e6}),_0x527b8f['markAsDone']();});return _0x14b494?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x2e200d,_0x44a674){const _0x19e426=this['getPartView'](_0x2e200d);_0x19e426&&(_0x19e426['state']=_0x44a674),this['hasPendingParts']='pending'==_0x44a674||this['_contentPartViews']['some'](_0x613864=>'pending'==_0x613864['state']);}['setPartActive'](_0x2b4adf,_0x1f0d9e){if(!0x1===_0x2b4adf){for(const _0x4b3cb0 of this['_contentPartViews'])_0x4b3cb0['isActive']=!0x1;}else{const _0x5c931d=this['getPartView'](_0x2b4adf);_0x5c931d&&(_0x5c931d['isActive']=_0x1f0d9e);}}['updateSources'](_0xdc888c){_0xdc888c['forEach'](_0x175d30=>this['_sourcesView']['addSource'](_0x175d30)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x3f1115){return this['_contentPartViews']['find'](_0x2e444e=>_0x2e444e['partDefinition']['index']==_0x3f1115)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x4a009b=!this['_cachedContentParts']['find'](({hasChanges:_0x2c48ce})=>_0x2c48ce),_0x21060c=!!this['_cachedContentParts']['find'](({hasChanges:_0x526e9d})=>!_0x526e9d);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x21060c,_0x4a009b?this['_emptyPartsWarningView']['setContent'](Hi(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](Hi(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_contentPartViews']['forEach'](_0x72d49=>_0x72d49['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x29f9e0){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x36779a=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x36779a>0x0){const {promise:_0x420e0b,abortController:_0x2016a1}=ps(_0x36779a);_0x29f9e0?.['addEventListener']('abort',()=>_0x2016a1['abort']()),await _0x420e0b['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0x21822e=>_0x21822e['partDefinition']['hasChanges'])['length']>0x0;}}class AISuggestionContainerView extends Nt{['bodyView'];['children'];['headerView'];constructor(_0x18cfc0,_0x3cc187,_0x238185){super(_0x18cfc0);const {showDiff:_0x4a9409,areActionsDisabled:_0x473db4,showUnchangedParts:_0x38a519,availableActions:_0x4d7139}=_0x3cc187;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new AISuggestionHeaderView(_0x18cfc0,{'showDiff':_0x4a9409}),this['headerView']['on']('toggleShowChanges',(_0x6e3592,_0x2a0d4e)=>{this['areChangesVisible']=_0x2a0d4e['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x2a0d4e['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new AISuggestionBodyView(_0x18cfc0,{'areActionsDisabled':_0x473db4,'showUnchangedParts':!!_0x38a519,'availableActions':_0x4d7139,'bodyCollection':_0x238185}),this['bodyView']['delegate'](...Cs)['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'](_0x2109fc){await this['bodyView']['updateContentParts'](_0x2109fc);}['updateSources'](_0x17b7b0){this['bodyView']['updateSources'](_0x17b7b0);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class AIChatFeedSuggestionItemView extends AIChatFeedItemView{['containerView'];constructor(_0x5bb318,_0x43aba0,_0x274f66){super(_0x43aba0),this['set']('isTrackChangesOn',!0x1),this['containerView']=new AISuggestionContainerView(_0x5bb318,{'showDiff':_0x43aba0['showDiff'],'areActionsDisabled':_0x43aba0['areActionsDisabled'],'availableActions':_0x43aba0['availableActions']},_0x274f66),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x5e6f52,_0x22f832)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x22f832['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',(_0x41da90,{index:_0x13a450})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x13a450});}),this['containerView']['on']('applySuggestion',(_0x4ca53a,{index:_0xa8787a}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0xa8787a});}),this['containerView']['on']('insertSuggestion',(_0x499c30,{index:_0x262fa3}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x262fa3});}),this['containerView']['on']('rejectSuggestion',(_0x39ea2f,{index:_0x989b8c})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x989b8c});}),this['containerView']['on']('mouseOverSuggestion',(_0x28a84d,{index:_0x287579})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x287579});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x5b3125,{index:_0x1fc282})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1fc282});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0xa4de2d){await this['containerView']['updateContent'](_0xa4de2d);}['updatePartState'](_0x131a6b,_0x101b8b){this['containerView']['bodyView']['updatePartState'](_0x131a6b,_0x101b8b);}['setPartActive'](_0x4ce109,_0x30d514){!0x1===_0x4ce109?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x4ce109,_0x30d514);}['updateSources'](_0x51b3cf){this['containerView']['updateSources'](_0x51b3cf);}['getPartView'](_0x10b771){return this['containerView']['bodyView']['getPartView'](_0x10b771);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class AIChatFeedReplyItemView extends AIChatFeedItemView{['replyContainer'];['_bodyCollection'];constructor(_0x5f3fae,_0x2a3140,_0x35814f){super(_0x2a3140),this['_bodyCollection']=_0x35814f,this['locale']=_0x5f3fae,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new Nt(),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':Fi(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x143a0b,renderingStrategy:_0x5eb6dc,abortSignal:_0x24ccbe}){'streaming'===_0x5eb6dc?await this['streamIntoElement'](_0x143a0b,this['replyContainer']['element'],_0x24ccbe):this['replyContainer']['element']['innerHTML']=ti(_0x143a0b);}['updateSources'](_0x5c3f94){const _0x14dc7f=new AIWebSourcesView(this['locale'],this['_bodyCollection']);_0x14dc7f['children']['addMany'](_0x5c3f94['map'](_0x57b6e1=>new AIWebSourceView(this['locale'],_0x57b6e1,_0x14dc7f['balloonPanelView']))),_0x14dc7f['isVisible']=!0x0,this['children']['add'](_0x14dc7f);}}class AISpinnerView extends yt{constructor(_0x3db68b=void 0x0){super();const _0x4ba7e2=_0x3db68b?'ck-ai-spinner_'+_0x3db68b:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x4ba7e2]}});}}const Os={'file':_0xc6d689,'document':_0x3745a0,'web-resource':_0x4ad8e3,'text':_0xc6d689,'selection':_0x283729,'mcp-tool-context':_0x3745a0},ks='ck-ai-chat-context-chip',vs='ck-ai-chat-context-chip_wide',Ns='ck-ai-chat-context-chip_document',ys='ck-ai-chat-context-chip__label',xs='ck-ai-chat-context-chip__type-icon',Ls='ck-ai-chat-context-controls__chip-tooltip',Ds='n';class AIChatContextItemButtonView extends vt{constructor(_0xafe34a,_0x508402,_0x36fc68,_0x12215b,_0x3a1b3b=!0x1){super(_0xafe34a),this['_isAnimationOnEnterEnabled']=_0x12215b,this['_initializeProperties'](_0x508402,_0x36fc68,_0x3a1b3b),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'](_0x3cda74,_0x516320,_0x41a04b){this['set']('label',_0x3cda74['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x3cda74['type']),this['set']('id',_0x3cda74['uiId']),this['set']('readonly',_0x516320),this['set']('isLoading',_0x41a04b);}['_setupTemplate'](){const _0xf4d51a=this['_createIconView'](),_0x2e664a=this['_createRemoveButton'](),_0x13b970=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x13b970),'children':this['_createTemplateChildren'](_0xf4d51a,_0x2e664a,_0x13b970)});}['_createTemplateAttributes'](_0x23b3f1){return{'class':[ks,_0x23b3f1['if']('itemType',Ns,_0x249e99=>'document'==_0x249e99),_0x23b3f1['if']('itemType',vs,_0x32b376=>'selection'==_0x32b376)],'data-cke-tooltip-text':_0x23b3f1['to']('label',Vs),'data-cke-tooltip-position':Ds,'data-cke-tooltip-class':Ls};}['_createTemplateChildren'](_0xbfb20c,_0x40862a,_0x507689){const _0x3e1e75=this['_createLabelElement'](_0x507689),_0x2cb73e=this['_createLoaderIcon']();return this['readonly']?[_0xbfb20c,_0x3e1e75]:[_0xbfb20c,_0x2cb73e,_0x3e1e75,_0x40862a];}['_createLabelElement'](_0x54fabc){return{'tag':'span','attributes':{'class':ys},'children':[{'text':_0x54fabc['to']('label')}]};}['_createRemoveButton'](){const _0x3542b2=new vt(this['locale']);return _0x3542b2['set']({'label':Hi(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x5777e9}),this['_setupRemoveButtonEvent'](_0x3542b2),_0x3542b2;}['_setupRemoveButtonEvent'](_0x34eea5){_0x34eea5['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x273094=this['bindTemplate'],_0xef78e4=new xt();return _0xef78e4['content']=Os[this['itemType']],_0xef78e4['extendTemplate']({'attributes':{'class':[xs,_0x273094['if']('isLoading','ck-hidden',_0x40160e=>_0x40160e)]}}),_0xef78e4;}['_handleAnimationEndOnce'](_0x6313af,_0x2d330e){if(!_0x6313af)return;const _0x4eb0ca=()=>{_0x2d330e(),_0x6313af['removeEventListener']('animationend',_0x4eb0ca),_0x6313af['removeEventListener']('webkitAnimationEnd',_0x4eb0ca);};_0x6313af['addEventListener']('animationend',_0x4eb0ca),_0x6313af['addEventListener']('webkitAnimationEnd',_0x4eb0ca);}['_createLoaderIcon'](){const _0x341e31=new AISpinnerView('small');return _0x341e31['bind']('isVisible')['to'](this,'isLoading',_0x199622=>_0x199622),_0x341e31;}}function Vs(_0x850f03){if(!_0x850f03)return _0x850f03;if(_0x850f03['length']<=0x78)return _0x850f03;const _0x54f54e=_0x850f03['slice'](0x0,0x78),_0x36cc6b=_0x54f54e['lastIndexOf']('\x20');return(_0x36cc6b>0x0?_0x54f54e['slice'](0x0,_0x36cc6b):_0x54f54e)+'…';}const Ps={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Hs='300px';class AIChatChipsOverflowManager{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0xcb761f,_0xb73b1,_0x310c86,_0x404bc0,_0xd29c55){this['_locale']=_0xcb761f,this['_visibleChips']=_0xb73b1,this['_config']={...Ps,..._0x310c86,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x310c86['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x404bc0,this['_parentView']=_0xd29c55||null;}['setContainerElement'](_0x532f7a){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x532f7a,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 _0xe35510=[...this['_visibleChips'],...this['_overflowChips']],_0x1bc67c=this['_createCalculationContainer'](),_0x4213b=this['_calculateOverflowInContainer'](_0x1bc67c,_0xe35510),_0x31fe92=_0x1bc67c['_ancestorsToRestore'];_0x31fe92&&this['_restoreAncestorVisibility'](_0x31fe92),_0x1bc67c['remove'](),this['_applyOverflowResults'](_0xe35510,_0x4213b);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),zt({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x3a6254=new vt(this['_locale']);_0x3a6254['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x5bbf9c=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x5bbf9c['push'](this['_config']['cssClasses']['controlsButton']),_0x3a6254['extendTemplate']({'attributes':{'class':_0x5bbf9c}}),_0x3a6254;}['_createShowMoreBalloonPanelView'](){const _0x10b9ba=new Xt(this['_locale']);return _0x10b9ba['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x10b9ba),_0x10b9ba;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x5352fb=>{_0x5352fb['disableAnimationOnEnter']();});const _0xe48992=new Nt(this['_locale']);_0xe48992['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0xe48992);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x1093f5=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x1093f5?'':'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'](_0x5d5f92){const _0xad8cfc=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x338f9c=this['_containerElement']?.['classList'];if(_0x338f9c){const _0x42675a=_0x338f9c[0x0]||'',_0xd3f665=_0x5d5f92['querySelector']('.'+_0x42675a),_0x355ab4=_0x5d5f92['querySelector'](_0xad8cfc);return _0xd3f665||_0x355ab4||_0x5d5f92;}return _0x5d5f92['querySelector'](_0xad8cfc)||_0x5d5f92;}['_calculateContainerWidth'](){const _0xfd2960=this['_parentView']?.['element']||this['_containerElement'];if(!_0xfd2960)return Hs;const _0x61d94a=window['getComputedStyle'](_0xfd2960)['width'];if('auto'===_0x61d94a||'0px'===_0x61d94a||!_0x61d94a){const _0x2a0ff9=_0xfd2960['parentElement'];if(_0x2a0ff9){const _0x540fa0=window['getComputedStyle'](_0x2a0ff9);return'auto'!==_0x540fa0['width']?_0x540fa0['width']:Hs;}return Hs;}return _0x61d94a;}['_applyCalculationStyles'](_0x518931,_0x2bdaa6){this['_config']['cssClasses']['calculationContainer']&&_0x518931['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x518931['style']['width']=_0x2bdaa6,_0x518931['style']['position']='absolute',_0x518931['style']['top']='-9999px',_0x518931['style']['left']='-9999px',_0x518931['style']['opacity']='0',_0x518931['style']['pointerEvents']='none',_0x518931['style']['zIndex']='-1',_0x518931['style']['visibility']='visible\x20!important',_0x518931['style']['display']='block\x20!important',_0x518931['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x113719){_0x113719['forEach'](({element:_0x30b54b,originalDisplay:_0x3ef524,originalVisibility:_0x23b8ce})=>{_0x30b54b['style']['display']=_0x3ef524,_0x30b54b['style']['visibility']=_0x23b8ce;});}['_makeAncestorsVisible'](_0x4c7113){const _0x463608=[];let _0x244317=_0x4c7113;for(;_0x244317&&_0x244317!==document['body'];){const _0x5e2c31=window['getComputedStyle'](_0x244317);'none'!==_0x5e2c31['display']&&'hidden'!==_0x5e2c31['visibility']||(_0x463608['push']({'element':_0x244317,'originalDisplay':_0x244317['style']['display'],'originalVisibility':_0x244317['style']['visibility']}),_0x244317['style']['display']='block',_0x244317['style']['visibility']='visible'),_0x244317=_0x244317['parentElement'];}return _0x463608;}['_createContainerElements'](){let _0x2cfc3a,_0xff4b4e;return this['_parentView']?.['element']?(_0x2cfc3a=this['_parentView']['element']['cloneNode'](!0x0),_0xff4b4e=this['_findTargetContainer'](_0x2cfc3a)):(_0x2cfc3a=document['createElement']('div'),_0xff4b4e=_0x2cfc3a),{'calculationContainer':_0x2cfc3a,'targetContainer':_0xff4b4e};}['_createCalculationContainer'](){const {calculationContainer:_0x335fa5,targetContainer:_0x5ad158}=this['_createContainerElements'](),_0x5bf57c=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x335fa5,_0x5bf57c);const _0x1579bd=this['_parentView']?.['element']||this['_containerElement'],_0x208ca7=_0x1579bd?.['parentElement'];_0x208ca7?_0x208ca7['appendChild'](_0x335fa5):document['body']['appendChild'](_0x335fa5),_0x335fa5['_targetContainer']=_0x5ad158;const _0xa95369=this['_makeAncestorsVisible'](_0x208ca7||null);return _0x335fa5['offsetWidth'],_0x335fa5['_ancestorsToRestore']=_0xa95369,_0x335fa5;}['_calculateOverflowInContainer'](_0x4c8fcd,_0x43e4f5){const _0x2d949c=_0x4c8fcd['_targetContainer']||_0x4c8fcd,_0x4a765d=[],{rowCount:_0x2047bb}=this['_renderChipsAndCountRows'](_0x2d949c,_0x43e4f5);if(_0x2047bb<=this['_config']['maxVisibleRows'])return _0x4a765d;const _0x18455e=_0x43e4f5['slice']();for(;_0x18455e['length']>0x0;){if(this['_testButtonFit'](_0x4c8fcd,_0x2d949c,_0x18455e)){const _0x1514ec=_0x43e4f5['filter'](_0x3c8310=>!_0x18455e['includes'](_0x3c8310));_0x4a765d['push'](..._0x1514ec);break;}if(!_0x18455e['pop']())break;}return _0x4a765d;}['_renderChipsAndCountRows'](_0x8d5d5f,_0xfe13f7){_0x8d5d5f['innerHTML']='',_0xfe13f7['forEach'](_0x2d2e71=>{if(_0x2d2e71['element']){const _0x4cef1b=_0x2d2e71['element']['cloneNode'](!0x0);_0x8d5d5f['appendChild'](_0x4cef1b);}}),_0x8d5d5f['offsetWidth'];const _0x304034=_0x8d5d5f['children'],_0x343db9=[];return Array['from'](_0x304034)['forEach'](_0x49c764=>{const _0x1ae197=_0x49c764['getBoundingClientRect']()['top'];_0x343db9['some'](_0x616148=>Math['abs'](_0x616148-_0x1ae197)<this['_config']['rowDetectionTolerance'])||_0x343db9['push'](_0x1ae197);}),{'rowCount':_0x343db9['length']};}['_createMockButton'](){const _0x261d29=document['createElement']('button');return _0x261d29['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x261d29['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x261d29['textContent']='+\x201',_0x261d29;}['_testButtonFit'](_0x47318b,_0x5a6720,_0x148224){this['_renderChipsAndCountRows'](_0x5a6720,_0x148224);const _0x4fdd4d=this['_createMockButton']();_0x47318b['appendChild'](_0x4fdd4d),_0x47318b['offsetWidth'];const _0x441150=[..._0x5a6720['children'],_0x4fdd4d],_0x12d433=[];_0x441150['forEach'](_0x26d717=>{const _0x535c00=_0x26d717['getBoundingClientRect']()['top'];_0x12d433['some'](_0x85d9c1=>Math['abs'](_0x85d9c1-_0x535c00)<this['_config']['rowDetectionTolerance'])||_0x12d433['push'](_0x535c00);});const _0x13cfb1=_0x12d433['length'];return _0x4fdd4d['remove'](),_0x13cfb1<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x2c04c9,_0xa43f5){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x2c04c9['forEach'](_0x5e9fba=>{_0xa43f5['includes'](_0x5e9fba)?this['_overflowChips']['add'](_0x5e9fba):this['_visibleChips']['add'](_0x5e9fba);});}['_updateOverflowUI'](_0x4bcfaa){if(_0x4bcfaa>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x4bcfaa>0x0&&this['_showMoreButtonView']){const _0x274e6f=''+this['_config']['showMoreLabelPrefix']+(_0x4bcfaa<0x63?_0x4bcfaa:'99');this['_showMoreButtonView']['label']=_0x274e6f;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x287d98,_0x436121){this['_distributeChips'](_0x287d98,_0x436121),this['_updateOverflowUI'](_0x436121['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x5809c4=>{_0x5809c4[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 _0x23acac=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x23acac['width']||0x0===_0x23acac['height'])return!0x1;const _0x14fce0=window['innerHeight']||document['documentElement']['clientHeight'],_0x1cf64a=window['innerWidth']||document['documentElement']['clientWidth'],_0x131992=0xc8;return _0x23acac['bottom']>=-0xc8&&_0x23acac['top']<=_0x14fce0+_0x131992&&_0x23acac['right']>=-0xc8&&_0x23acac['left']<=_0x1cf64a+_0x131992;}}const Ms='ck-ai-chat__feed__context-chips',Us='ck-ai-chat-context-chips-wrapper',Bs='ck-ai-chat-context-chips-wrapper-balloon',Gs='ck-ai-chat-controls-button',Fs='ck-ai-chat-controls_context_show-more-button',Ks='ck-ai-chat-context-controls__show-more-balloon-panel';class AIChatFeedContextChipsView extends Nt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x37c087,_0xf194df,_0x17a246){super(_0x37c087),this['_bodyCollection']=_0x17a246,this['_createContextChips'](_0xf194df);const _0x17b48e={'cssClasses':{'showMoreButton':Fs+'\x20'+Bi,'showMoreBalloon':Ks,'overflowContainer':Bs,'controlsButton':Gs}};this['_overflowManager']=new AIChatChipsOverflowManager(_0x37c087,this['_contextChips'],_0x17b48e,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Ms,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Us},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x5c1f6d=this['element']['querySelector']('.'+Us);_0x5c1f6d&&(this['_overflowManager']['setContainerElement'](_0x5c1f6d),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x380631){for(const _0xc3636 of _0x380631){const _0x181f4e=new AIChatContextItemButtonView(this['locale'],_0xc3636,!0x0,!0x1);this['_contextChips']['add'](_0x181f4e);}}}class AIChatFeedUserMessageItemView extends AIChatFeedItemView{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x27d9d4,_0x190582,_0xc86dd5){super(_0x190582),this['_locale']=_0x27d9d4,this['_bodyCollection']=_0xc86dd5,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 AIChatFeedContextChipsView(this['_locale'],this['options']['contextItems']['filter'](_0x11ab18=>!_0x11ab18['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new Nt(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 AIChatFeedInteractionHeaderView extends AIChatFeedItemView{['capabilities'];constructor(_0x235060,_0x1d5cbc){super(_0x1d5cbc);const {isWebSearchEnabled:_0x1fb19e,isReasoningEnabled:_0x54260b}=_0x1d5cbc['capabilities'],_0x436a9d=[];let _0x5677aa='';_0x1fb19e&&_0x54260b?(_0x5677aa=Hi(_0x235060,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x436a9d['push'](Ws(_0x43e506)),_0x436a9d['push'](Ws(_0x23256e))):_0x1fb19e?(_0x5677aa=Hi(_0x235060,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x436a9d['push'](Ws(_0x43e506))):_0x54260b&&(_0x5677aa=Hi(_0x235060,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x436a9d['push'](Ws(_0x23256e))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x5677aa?'':'ck-hidden']}});const _0x21f780=new Nt();_0x21f780['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x436a9d,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x5677aa]}]}),this['children']['add'](_0x21f780),this['capabilities']=_0x1d5cbc['capabilities'];}}function Ws(_0x43c662){const _0x1020aa=new xt();return _0x1020aa['content']=_0x43c662,_0x1020aa;}const Ys=['wheel','touchstart','pointerdown','keydown'],$s=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class ScrollManager{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0x41e2c5){this['element']=_0x41e2c5,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x1e275c of Ys){const _0x515a2e='keydown'!==_0x1e275c;this['element']['addEventListener'](_0x1e275c,this['_onUserEvent']['bind'](this),{'passive':_0x515a2e,'signal':this['abortController']['signal']});}}['start']({smooth:_0x547ff3=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x547ff3?'smooth':'auto',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'](_0x38003b){if(this['isRunning']){if('keydown'===_0x38003b['type']){const _0x40b901=_0x38003b['key'];if(!$s['includes'](_0x40b901))return;}_0x38003b instanceof WheelEvent?_0x38003b['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0xb00e4f,scrollHeight:_0xd23031,clientHeight:_0x97c524}=this['element'];return _0xd23031-_0xb00e4f-_0x97c524<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':this['scrollBehavior']}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class AIChatFeedCustomElementView extends AIChatFeedItemView{constructor(_0x5d99f8){super(_0x5d99f8),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 AIChatFeedView extends Nt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x254e92,_0x2ebe36){super(_0x254e92),this['_bodyCollection']=_0x2ebe36,this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...ms)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new ScrollManager(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x3bbea7,_0x178f10){let _0x4733f6;return'ai-reply'===_0x3bbea7?_0x4733f6=new AIChatFeedReplyItemView(this['locale'],_0x178f10,this['_bodyCollection']):'ai-suggestion-reply'===_0x3bbea7?(_0x4733f6=new AIChatFeedSuggestionItemView(this['locale'],_0x178f10,this['_bodyCollection']),_0x4733f6['bind']('isTrackChangesOn')['to'](this)):_0x4733f6='user-message'===_0x3bbea7?new AIChatFeedUserMessageItemView(this['locale'],_0x178f10,this['_bodyCollection']):'interaction-header'===_0x3bbea7?new AIChatFeedInteractionHeaderView(this['locale'],_0x178f10):'custom-element'===_0x3bbea7?new AIChatFeedCustomElementView(_0x178f10):new AIChatFeedErrorItemView(_0x178f10),this['children']['add'](_0x4733f6),_0x4733f6;}async['updateReplyItem']({id:_0x259d75,parsedContent:_0x4306ea,renderingStrategy:_0x4c4eef,abortSignal:_0x4878ef}){const _0x5d1254=this['getItemById'](_0x259d75);if(!(_0x5d1254 instanceof AIChatFeedReplyItemView))throw new at('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x5d1254,'id':_0x259d75,'parsedContent':_0x4306ea});await _0x5d1254['updateContent']({'parsedContent':_0x4306ea,'renderingStrategy':_0x4c4eef,'abortSignal':_0x4878ef});}async['updateWebSources'](_0x5b1cdb,_0x3c9709){const _0x2afc9e=this['getItemById'](_0x5b1cdb);if(_0x2afc9e instanceof AIChatFeedSuggestionItemView)_0x2afc9e['updateSources'](_0x3c9709);else{if(!(_0x2afc9e instanceof AIChatFeedReplyItemView))throw new at('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x2afc9e,'id':_0x5b1cdb,'sources':_0x3c9709});_0x2afc9e['updateSources'](_0x3c9709);}}async['updateSuggestionItem']({id:_0xec92d2,parts:_0x49c313,abortSignal:_0x5c8abc,skipLoadingEffects:_0x489fde}){const _0x23e007=this['getItemById'](_0xec92d2);if(!(_0x23e007 instanceof AIChatFeedSuggestionItemView))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x23e007,'id':_0xec92d2,'parts':_0x49c313});await _0x23e007['updateContent']({'parts':_0x49c313,'abortSignal':_0x5c8abc,'skipLoadingEffects':_0x489fde});}['updateSuggestionPartState']({id:_0x39787f,index:_0x5e66d7,state:_0x471a13}){const _0x16dfdd=this['getItemById'](_0x39787f);if(!(_0x16dfdd instanceof AIChatFeedSuggestionItemView))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x39787f});_0x16dfdd['updatePartState'](_0x5e66d7,_0x471a13);}['setSuggestionPartActive']({id:_0x15d636,index:_0x5be76b,isActive:_0x426927}){const _0x10c115=this['getItemById'](_0x15d636);if(!(_0x10c115 instanceof AIChatFeedSuggestionItemView))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x15d636});this['children']['filter'](_0x271d4f=>_0x271d4f instanceof AIChatFeedSuggestionItemView)['forEach'](_0x271f4c=>{_0x271f4c['setPartActive'](!0x1);}),_0x10c115['setPartActive'](_0x5be76b,_0x426927);}['markItemAsDone'](_0x2b65cc){this['getItemById'](_0x2b65cc)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x242802=>_0x242802['options']['id']);}['removeItem'](_0x42c7e8){this['children']['remove'](this['getItemById'](_0x42c7e8));}['hasItem'](_0xc8d222){return!!this['children']['find'](_0x4be252=>_0x4be252['options']['id']['includes'](_0xc8d222));}['scrollToSuggestion'](_0x4e4ebe,_0x17a462){const _0xaaba11=this['getItemById'](_0x4e4ebe);if(!(_0xaaba11 instanceof AIChatFeedSuggestionItemView))return void gt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x4e4ebe,'partIndex':_0x17a462});const _0x1c80d7=_0xaaba11['getPartView'](_0x17a462);_0x1c80d7?ft(_0x1c80d7['element'],0x14,this['element']['parentElement'],!0x0,!0x0):gt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x4e4ebe,'partIndex':_0x17a462});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x3418e8=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x3418e8,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x166e0a=new AISkeletonView(this['locale'],Ss['aiFeed']);return _0x166e0a['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x166e0a;}['_createFeedItems'](){const _0x52ad20=new Nt(this['locale']);return _0x52ad20['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x52ad20;}['_createFeedLoader'](){const _0x5dacc5=new Nt(this['locale']);return _0x5dacc5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x259316=>!_0x259316)]},'children':this['_createLoaderChildren']()}),_0x5dacc5;}['_createLoaderChildren'](){const _0x438ada=new AISpinnerView();return _0x438ada['isVisible']=!0x0,[_0x438ada,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x218ca1){const _0x55a6de=this['children']['find'](_0x596046=>_0x596046['options']['id']['includes'](_0x218ca1));if(!_0x55a6de)throw new at('ai-chat-feed-view-item-not-found',this,{'id':_0x218ca1});return _0x55a6de;}['setLoadingMessage'](_0x1812df){this['set']('loadingMessage',_0x1812df);}['toggleLoadingSkeleton'](_0x3a634c){this['set']('isLoadingSkeletonVisible',_0x3a634c);}['startAutoScroll'](_0x4847e={}){this['scrollManager']['start'](_0x4847e);}['stopAutoScroll'](){this['scrollManager']['stop']();}}class AIChatPromptSuggestionsListView extends Dt{['filter'](){let _0x5dcdb4=0x0;for(const _0x370ba4 of this['items'])_0x5dcdb4+=_0x370ba4['items']['length'];return{'resultsCount':_0x5dcdb4,'totalItemsCount':_0x5dcdb4};}}const qs='ck-ai-chat__prompt-input_highlighted';class AIChatPromptInputView extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x281b81,_0x3bacde){super(_0x281b81,{'queryView':{'label':'','creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new AIChatPromptSuggestionsListView(_0x281b81),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x3bacde,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=AIChatPromptInputView['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=AIChatPromptInputView['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',(_0x31fdb9,_0x1b6f07)=>!_0x31fdb9&&!_0x1b6f07),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x1368af,_0x372cee)=>{this['isUploadInProgress']||this['isEmpty']||_0x1368af['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x372cee());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0xbb94f8=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0xbb94f8)return this['queryView']['errorText']=Hi(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x90939b=_0x2d9792(_0xbb94f8);this['fire']('sendUserMessage',_0x90939b),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x18c085){this['queryView']['fieldView']['set']('placeholder',_0x18c085);}['focus'](_0x6a1909=!0x1){super['focus'](),_0x6a1909&&(this['element']['classList']['contains'](qs)||(this['element']['classList']['add'](qs),setTimeout(()=>{this['element']['classList']['remove'](qs);},0x320)));}['_createSubmitButton'](){const _0x18f507=new vt(this['locale']);return _0x18f507['set']({'icon':_0xcffe77,'label':Hi(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+Mi,'isEnabled':!0x1}),_0x18f507['on']('execute',()=>{this['submit']();}),_0x18f507;}['setIsUploadInProgress'](_0x2f7aad){this['isUploadInProgress']=_0x2f7aad;}['_setUpAddContextButtonPositioning'](){const _0x2ff29d=this['locale'],_0x5632e1=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x319922=new ut(this['queryView']['fieldView']['element']),_0x4e1746=new ut(this['_addContextButtonView']['element']),_0x293e96=_0x319922['width'],_0xdb4941='rtl'===_0x2ff29d['uiLanguageDirection']?'right':'left';_0x319922['excludeScrollbarsAndBorders']();const _0x48ad0c=_0x293e96-_0x319922['width']+0x1;this['_addContextButtonView']['element']['style'][_0xdb4941]='calc('+(_0x293e96-_0x4e1746['width']-_0x48ad0c)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x5632e1),this['on']('render',()=>{_0x5632e1(),this['_queryViewResizeObserver']=new St(this['queryView']['fieldView']['element'],()=>{_0x5632e1();});});}}const Qs='ck-ai-chat__prompt-capabilities',Xs='ck-ai-chat-controls-button',zs='ck-ai-chat-controls-button--commands',js='ck-ai-chat-controls__model-selection',Js='ck-ai-chat-controls__model-selection__item-name',Zs='ck-ai-chat-controls__model-selection__item-description',tn='ck-ai-chat-controls__model-selection__item-capabilities',en='n';class AIChatPromptCapabilitiesView extends Nt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x4f2398){super(_0x4f2398),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',_0x50cdd8=>'selector'===_0x50cdd8),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x25df66=>_0x25df66?this['_modelSelectionDropdown']['buttonView']['label']:Hi(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x8446ca=>_0x8446ca),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x98e32e=>_0x98e32e),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x48a645=>Hi(this['locale'],_0x48a645?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x2db2dd=>_0x2db2dd),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x1b6070=>Hi(this['locale'],_0x1b6070?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Qs]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new dt(),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0xe1c8b5,_0x458cea){if(_0x458cea)this['set']('modelDisplayMode','hidden');else{const _0x196ccb=0x1===_0xe1c8b5['length'];this['set']('modelDisplayMode',_0x196ccb?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0xe1c8b5?.['length'])for(const _0x28b86b of _0xe1c8b5){const _0x3ed462=new Jt({'label':_0x28b86b['name'],'withText':!0x0,'role':'menuitemradio','id':_0x28b86b['id'],'model':_0x28b86b});_0x3ed462['bind']('isOn')['to'](this,'activeModelId',_0x1c85de=>_0x1c85de===_0x28b86b['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x3ed462,'labelView':new sn(this['locale'],_0x28b86b)});}}['setWebSearch'](_0x12af44){this['set']('webSearchActive',_0x12af44);}['setReasoning'](_0x1d0ea1){this['set']('reasoningActive',_0x1d0ea1);}['setModel'](_0x2d7f3d){if(!_0x2d7f3d)return;this['activeModelId']=_0x2d7f3d['id'],this['activeModelName']=_0x2d7f3d['name']||_0x2d7f3d['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x2d7f3d['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x2d7f3d['name']);const _0x34117c=_0x2d7f3d['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x34117c),this['_webSearchButton']['set']('isVisible',_0x34117c);const _0x5f1857=_0x2d7f3d['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x5f1857),this['_reasoningButton']['set']('isVisible',_0x5f1857);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x3ef8ce){this['set']('modelSelectorEnabled',!0x1),_0x3ef8ce&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x211581=new vt();return _0x211581['set']({'label':Hi(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x43e506,'class':Xs+'\x20'+Bi,'isToggleable':!0x0,'tooltipPosition':en}),_0x211581['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x211581;}['_createReasoningButton'](){const _0x6c9f8e=new vt();return _0x6c9f8e['set']({'label':Hi(this['locale'],'AI_CHAT_REASONING'),'icon':_0x23256e,'class':Xs+'\x20'+Bi,'isToggleable':!0x0,'tooltipPosition':en}),_0x6c9f8e['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x6c9f8e;}['_createCommandsButton'](){const _0x1b4c6c=new vt();return _0x1b4c6c['set']({'label':Hi(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x5ddbf5,'withText':!0x0,'class':Xs+'\x20'+Bi,'isToggleable':!0x0,'tooltip':Hi(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':en}),_0x1b4c6c['extendTemplate']({'attributes':{'class':[zs]}}),_0x1b4c6c['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x1b4c6c;}['_createModelSelectionDropdown'](){const _0x2d81a1=Gt(this['locale']);return _0x2d81a1['set']({'panelPosition':'ne','class':[js]}),_0x2d81a1['buttonView']['set']({'label':Hi(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':en,'class':Bi}),this['listenTo'](_0x2d81a1,'execute',_0x383cfb=>{this['fire']('selectModel',_0x383cfb['source']['model']);}),_0x2d81a1;}['_createModelNameView'](){const _0x3e7c63=new nn(this['locale']);return _0x3e7c63['bind']('text')['to'](this,'activeModelName',_0x3db2c5=>_0x3db2c5??''),_0x3e7c63['bind']('isVisible')['to'](this,'modelDisplayMode',_0x55fafb=>'name'===_0x55fafb),_0x3e7c63;}}let sn=class ModelButtonLabelView extends Ht{constructor(_0x43d10a,_0x2e14a4){super();const _0x2aa3fd=this['bindTemplate'],_0x269a4a=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x2aa3fd['to']('style'),'id':_0x2aa3fd['to']('id')},'children':[{'tag':'div','attributes':{'class':[Js]},'children':[{'text':_0x2aa3fd['to']('text')}]},{'tag':'div','attributes':{'class':[Zs]},'children':[{'tag':'span','children':[{'text':_0x2e14a4['description']}]}]},{'tag':'div','attributes':{'class':[tn]},'children':_0x269a4a}]}),_0x269a4a['addMany'](this['_getCapabilityParts'](_0x43d10a,_0x43e506,'AI_CHAT_SEARCH_WEB',_0x2e14a4['capabilities']['webSearch']?.['enabled']??!0x1)),_0x269a4a['addMany'](this['_getCapabilityParts'](_0x43d10a,_0x23256e,'AI_CHAT_REASONING',_0x2e14a4['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x392b5e,_0x57adb2,_0x1f4f38,_0x1c1039){const _0x3ee70d=new xt();_0x3ee70d['content']=_0x57adb2;const _0x46c264=new Nt(_0x392b5e);_0x46c264['setTemplate']({'tag':'span','children':[{'text':Hi(_0x392b5e,_0x1f4f38)+':\x20'}]});const _0x63dc80=new Nt(_0x392b5e);return _0x63dc80['setTemplate']({'tag':'span','children':[{'text':Hi(_0x392b5e,_0x1c1039?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x3ee70d,_0x46c264,_0x63dc80];}},nn=class ModelNameView extends Nt{constructor(_0x3ad3aa){super(_0x3ad3aa),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x543be1=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x543be1['if']('isVisible','ck-hidden',_0x43b507=>!_0x43b507)]},'children':[{'text':_0x543be1['to']('text')}]});}};const rn='ck-ai-chat-context-controls__url-form',on='ck-ai-chat-context-controls__url-input-section';class AIChatContextPanelUrlInputView extends Nt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x111499){super(_0x111499),this['focusTracker']=new _t(),this['keystrokes']=new It(),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 Mt({'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'](_0x239620=>{this['focusTracker']['add'](_0x239620['element']),this['keystrokes']['listenTo'](_0x239620['element']);}),Zt({'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'](_0x1357b6){this['urlInputField']['errorText']=_0x1357b6,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0xf6b95a=new vt(this['locale']);return _0xf6b95a['set']({'icon':_0x3d9913,'tooltip':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x5521a9,_0x453368,_0x55131a)=>{_0xf6b95a['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x55131a?'':'\x20ck-hidden')]});}),_0xf6b95a;}['_createUrlInputField'](){const _0x21a2ae=new te(this['locale'],_0x22cbcd);return _0x21a2ae['set']({'label':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x21a2ae['fieldView']['set']({'placeholder':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x21a2ae;}['_createConfirmButton'](){const _0x51e096=new vt(this['locale']);return _0x51e096['set']({'icon':_0x489882,'tooltip':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x51e096;}['_setupTemplate'](){const _0x29c2bb=new _0x4c3dd1(this['locale'],{'label':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x29c2bb['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':rn,'tabindex':'-1'},'children':[_0x29c2bb,{'tag':'div','attributes':{'class':on},'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',_0x127290=>{_0x127290['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x207c7e,_0x14463a)=>{this['clear'](),this['fire']('cancel'),_0x14463a();});}['_handleSubmit'](){const _0x1b6bd3=this['getValue']()['trim']();_0x1b6bd3?this['_isValidUrl'](_0x1b6bd3)?(this['clearError'](),this['fire']('submitUrl',_0x1b6bd3)):this['setError'](Hi(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](Hi(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x678c01=this['getValue']()['trim'](),_0x1e3448=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x678c01['length']>0x0&&!_0x1e3448;}['_isValidUrl'](_0xb4fc02){try{return!!new URL(_0xb4fc02);}catch{return!0x1;}}}const an='ck-ai-chat-resources__item',hn='ck-ai-chat-resources__item--in-context',cn='ck-ai-chat-resources__item-title',ln='ck-ai-chat-resources__item__icon';class AIChatResourceListItemView extends Pt{['resource'];['_titleView'];['_iconView'];constructor(_0x122880,_0x329e93){super(_0x122880),this['resource']=_0x329e93,this['set']('isInContext',!!_0x329e93['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0xe9cc89){if(_0xe9cc89['isInContext'])return _0x489882;switch(_0xe9cc89['type']){case'document':return _0x3745a0;case'web-resource':return _0x4ad8e3;case'file':case'text':return _0xc6d689;default:return _0x3649ad;}}['highlightText'](_0x2d52f0){if(!_0x2d52f0||''===_0x2d52f0['trim']())return void this['_titleView']['highlightText'](null);const _0x2ef92a=new RegExp(_0x5933ee(_0x2d52f0),'gi');this['_titleView']['highlightText'](_0x2ef92a);}['updateResourceState'](_0x29eb49){this['resource']['isInContext']=_0x29eb49,this['isInContext']=_0x29eb49,this['_updateIcon']();}['_createTitleView'](){const _0x16b680=new _0x378b1f();return _0x16b680['text']=this['resource']['label'],_0x16b680['extendTemplate']({'tag':'span','attributes':{'class':[cn]}}),_0x16b680;}['_createIconView'](){const _0x89415f=new xt();return _0x89415f['content']=this['getResourceIcon'](this['resource']),_0x89415f;}['_setupTemplate'](){const _0x1a9f1a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[an,_0x1a9f1a['if']('isVisible','ck-hidden',_0x97893=>!_0x97893),_0x1a9f1a['if']('isInContext',hn)]},'children':[{'tag':'div','attributes':{'class':[ln]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x1a9f1a['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const un='ck-ai-chat-resources__list';class AIChatContextResourcesListView extends Dt{['_source'];constructor(_0x295804,_0xd14025){super(_0x295804),this['_source']=_0xd14025,this['extendTemplate']({'attributes':{'class':[un]}});}['setResources'](_0x239e16,_0x51dfa1){this['items']['clear']();let _0x4f0fae=_0x239e16;if(this['_source']['useDefaultFiltering']&&_0x51dfa1&&''!==_0x51dfa1['trim']()){const _0x5a33d5=new RegExp(_0x51dfa1['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x4f0fae=_0x239e16['filter'](_0x2dea4d=>_0x5a33d5['test'](_0x2dea4d['label']));}for(const _0x5b505b of _0x4f0fae){const _0x231305=new AIChatResourceListItemView(this['locale'],_0x5b505b);_0x231305['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x5b505b);}),this['items']['add'](_0x231305);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x51dfa1);}['highlightText'](_0x2bd714){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x2323dd=>{_0x2323dd['highlightText'](_0x2bd714);});}['updateResourceState'](_0x388f29,_0x1b0f67){for(const _0x108950 of this['items']){const _0x3ad439=_0x108950;_0x3ad439['resource']['id']===_0x388f29&&_0x3ad439['updateResourceState'](_0x1b0f67);}}['_handleResourceSelection'](_0x356e76,_0x167120){this['fire']('addResourceToContext',{'source':_0x356e76,'resource':_0x167120});}}class AIChatContextResourcesSearchInputView extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0xfddc74){const t=_0xfddc74['t'],_0x44661e={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x22cbcd,'label':Hi(_0xfddc74,'AI_CHAT_SEARCH_RESOURCES')};super(_0xfddc74,_0x44661e['creator']),this['label']=_0x44661e['label'],this['_viewConfig']=_0x44661e,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0xfddc74,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x3314fd){this['fire']('search',_0x3314fd);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x3fa2b6,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x574bd0,t){this['resetButtonView']=new vt(_0x574bd0),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x5777e9,'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',_0x4c42d5=>!_0x4c42d5),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 AIChatContextResourcesView extends Nt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x51e7c3,_0x144725){super(_0x51e7c3),this['_source']=_0x144725['source'],this['_searchInputVisibleFrom']=_0x144725['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 _0x3127bc([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new AIChatContextResourcesSearchInputView(this['locale']);}['_createSearchSection'](){const _0x15ff8d=new Nt(this['locale']);return _0x15ff8d['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x255a63,_0x3f89cd)=>{this['loadResources'](_0x3f89cd),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x3f89cd);}),_0x15ff8d;}['_createResourcesListView'](){const _0x45fea2=new AIChatContextResourcesListView(this['locale'],this['_source']);return _0x45fea2['delegate']('addResourceToContext')['to'](this),_0x45fea2['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x45fea2;}['_createSkeletonView'](){const _0x3231da=new AISkeletonView(this['locale'],Ss['aiChatResources']);return _0x3231da['bind']('isVisible')['to'](this,'isLoading'),_0x3231da;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x4e640a){const _0x292ff0=ot();this['_latestLoadResourcesUid']=_0x292ff0,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x4e640a,'uid':_0x292ff0}),this['isLoading']=!0x0;}['setResources'](_0x18df52,_0x384384){if(_0x384384&&_0x384384!==this['_latestLoadResourcesUid'])return;const _0x9030c9=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x18df52,_0x9030c9),_0x18df52['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x52083a,_0x2532d0){this['_resourcesListView']['updateResourceState'](_0x52083a,_0x2532d0);}}const dn='ck-ai-chat-context-controls__source-balloon-panel',_n='ck-button-icon\x20ck-button-back',In='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class AIChatResourcesBalloonView{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x5b8578,_0x395fe0,_0x5c8146){this['_locale']=_0x5b8578,this['_bodyCollection']=_0x395fe0,this['_config']=_0x5c8146;}['showSourceResourcesBalloon']({source:_0x198135,withBackButton:_0x492d03}){let _0x169d2d=this['_sourceResourceBalloons']['get'](_0x198135['id']);_0x169d2d||(_0x169d2d=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x198135['id'],_0x169d2d),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x169d2d)),this['_addSourceResourceContent']({'balloonPanel':_0x169d2d,'source':_0x198135,'withBackButton':_0x492d03}),_0x169d2d['show']();const _0x22bf32=this['_config']['getTargetElement']();_0x22bf32&&_0x169d2d['pin']({'target':_0x22bf32,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x26bc11,_0xbb8f1f,_0x312950){const _0x124fa9=this['_sourceResourceBalloons']['get'](_0x26bc11);if(!_0x124fa9)return;const _0x255722=this['_getResourcesViewFromBalloon'](_0x124fa9);_0x255722&&(_0x255722['setResources'](_0xbb8f1f,_0x312950),_0x255722['once']('change:isLoading',()=>{_0x124fa9['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x32cd2b){const _0x439ebf=this['_sourceResourceBalloons']['get'](_0x32cd2b);_0x439ebf&&requestAnimationFrame(()=>{_0x439ebf['hide'](),this['_sourceResourceBalloons']['delete'](_0x32cd2b),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x5a1e9f of this['_sourceResourceBalloons']['values']())if(_0x5a1e9f['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x60ad73,_0x5d08f1,_0xe07731){const _0x431d80=this['_sourceResourceBalloons']['get'](_0x60ad73);if(!_0x431d80||!_0x431d80['isVisible'])return;const _0x46f577=this['_config']['getTargetElement']();if(!_0x46f577)return;_0x431d80['pin']({'target':_0x46f577,'limiter':this['_config']['getLimiterElement']()});const _0x52ddd1=this['_getResourcesViewFromBalloon'](_0x431d80);_0x52ddd1&&_0x52ddd1['updateResourceState'](_0x5d08f1,_0xe07731);}['destroy'](){for(const _0x362f12 of this['_sourceResourceBalloons']['values']())_0x362f12['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0xcc0ed4=new Xt(this['_locale']);return _0xcc0ed4['extendTemplate']({'attributes':{'class':dn}}),this['_bodyCollection']['add'](_0xcc0ed4),_0xcc0ed4;}['_addSourceResourceContent']({balloonPanel:_0x31f7ba,source:_0x3b3c68,withBackButton:_0x538b53}){_0x31f7ba['content']['clear']();const _0x2dab73=this['_createBalloonHeader']({'balloonPanel':_0x31f7ba,'source':_0x3b3c68,'withBackButton':_0x538b53});_0x31f7ba['content']['add'](_0x2dab73);const _0x2c21a3=this['_createBalloonResourcesView'](_0x3b3c68);_0x31f7ba['content']['add'](_0x2c21a3);}['_createBalloonHeader']({balloonPanel:_0xf61cae,source:_0x5c2613,withBackButton:_0x518f12}){const _0x53dfb4=new _0x4c3dd1(this['_locale'],{'label':_0x5c2613['label'],'class':In});return _0x518f12&&_0x53dfb4['children']['add'](this['_createBackButton'](_0xf61cae),0x0),_0x53dfb4;}['_createBackButton'](_0x243f26){const _0x760ce5=new vt(this['_locale']);return _0x760ce5['set']({'icon':_0x3d9913,'tooltip':Hi(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':_n}),_0x760ce5['on']('execute',()=>{_0x243f26['hide'](),this['_config']['onBackToContext']();}),_0x760ce5;}['_createBalloonResourcesView'](_0x4c6330){const _0x5434be=new AIChatContextResourcesView(this['_locale'],{'source':_0x4c6330,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x5434be['on']('loadSourceResources',(_0x4ffdef,_0x5e2dfa)=>{this['_config']['onLoadSourceResources'](_0x5e2dfa);}),_0x5434be['on']('addResourceToContext',(_0x59039d,_0x49037c)=>{this['_config']['onResourceSelected'](_0x49037c['source'],_0x49037c['resource']),this['closeSourceResourceBalloon'](_0x4c6330['id']);}),_0x5434be;}['_getResourcesViewFromBalloon'](_0x501cc1){const _0x2b2e8b=_0x501cc1['content']['get'](0x1);return _0x2b2e8b instanceof AIChatContextResourcesView?_0x2b2e8b:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x2c06b7){zt({'emitter':_0x2c06b7,'contextElements':[_0x2c06b7['element']],'callback':()=>{_0x2c06b7['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x2c06b7['isVisible']});}}const An=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],gn='ck-ai-chat-context-controls',Cn='ck-ai-chat-context-controls__pending-contexts',mn='ck-ai-chat-context-controls__add-context-balloon-panel',pn='ck-ai-chat-context-controls__add-context-button',En='ck-ai-chat-context-controls__url-balloon-panel',wn='ck-ai-chat-context-controls__balloon-button',Tn='ck-ai-chat-context-controls__balloon-button-source',fn='ck-ai-chat-controls-button',Sn='ck-ai-chat-context-chips-wrapper-balloon',Rn='ck-ai-chat-controls_context_show-more-button',bn='ck-ai-chat-context-controls__show-more-balloon-panel',On='ck-ai-chat',kn=[Xt['defaultPositions']['northArrowSouthWest'],Xt['defaultPositions']['northArrowSouth'],Xt['defaultPositions']['northArrowSouthEast'],Xt['defaultPositions']['southArrowNorthWest'],Xt['defaultPositions']['southArrowNorth'],Xt['defaultPositions']['southArrowNorthEast']];class AIChatContextPanelView extends Nt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x25b436,_0x4154c3){super(_0x25b436),this['bodyCollection']=_0x4154c3['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x25b436),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x25b436),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x25b436),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x25b436,_0x4154c3);const _0x759399={'cssClasses':{'showMoreButton':Rn+'\x20'+Bi,'showMoreBalloon':bn,'overflowContainer':Sn,'controlsButton':fn}};this['_overflowManager']=new AIChatChipsOverflowManager(_0x25b436,this['_currentContextsChips'],_0x759399,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'](_0x5827a2,_0x5eff4c){const _0x15e4d0=this['_createContextButton'](_0x5827a2,'current',!0x0,_0x5eff4c);this['_addContextToCollection'](_0x15e4d0,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x137f2d){this['_removeContextFromCollection'](_0x137f2d,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x137f2d,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0xfb4c4d,_0x538f9b){let _0x127d99=this['_currentContextsChips']['find'](_0x5a266d=>_0x5a266d['id']===_0xfb4c4d);_0x127d99||(_0x127d99=this['_overflowManager']['overflowChips']['find'](_0x29d96c=>_0x29d96c['id']===_0xfb4c4d)),_0x127d99&&(_0x127d99['isLoading']=_0x538f9b);}['setConversationContext'](_0x400339){this['_conversationContextsChips']['clear']();for(const _0x506530 of _0x400339){const _0x233ffd=this['_createContextButton'](_0x506530,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x233ffd,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x246c2d,_0x1fb7c6,_0x5f21a2){this['_resourcesBalloonView']['updateResourceState'](_0x246c2d,_0x1fb7c6,_0x5f21a2);}['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:_0x4d2e23,withBackButton:_0x1f692d}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x4d2e23,'withBackButton':_0x1f692d}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x1e3671,_0x5cea06,_0x14adf8,_0x2fa4ee){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x1e3671,_0x14adf8,_0x2fa4ee);}['closeSourceResourceBalloon'](_0x507440){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x507440),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x478b9b){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x478b9b),this['_setAddContextButtonEnabled'](_0x478b9b);}['_setAddContextButtonEnabled'](_0x5b8e02){const _0x211764=!_0x5b8e02['document']['isHidden']&&_0x5b8e02['document']['enabled'],_0x1d76ed=_0x5b8e02['urls']['enabled'],_0x2169c6=_0x5b8e02['files']['enabled'],_0x57a708=_0x5b8e02['sources']['length']>0x0,_0x20b844=_0x5b8e02['customItems']&&_0x5b8e02['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x211764||_0x1d76ed||_0x2169c6||_0x57a708||_0x20b844;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[gn,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Cn},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x140cce){const _0x2b9156=new vt(_0x140cce);return _0x2b9156['set']({'label':Hi(_0x140cce,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':fn+'\x20'+pn+'\x20'+Bi,'icon':_0x1bd4f2,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x2b9156;}['_createAddContextBalloonPanelView'](_0x2d87f5){return this['_createBaseBalloonPanel'](_0x2d87f5,mn);}['_createUrlBalloonPanelView'](_0x586a8c){const _0xee1b52=this['_createBaseBalloonPanel'](_0x586a8c,En);return this['_addUrlContent'](_0xee1b52,_0x586a8c),_0xee1b52;}['_createResourcesBalloonView'](_0x454e0b,_0x3a46e6){const _0x5ce63c={'searchInputVisibleFrom':_0x3a46e6['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn});},'onResourceSelected':(_0x5a4261,_0x182054)=>{this['fire']('addResourceToContext',{'source':_0x5a4261,'resource':_0x182054});},'onLoadSourceResources':_0x49a836=>{this['fire']('loadSourceResources',_0x49a836);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new AIChatResourcesBalloonView(_0x454e0b,_0x3a46e6['bodyCollection'],_0x5ce63c);}['_getLimiterElement'](){return this['element']?.['closest']('.'+On)||document['body'];}['_createBaseBalloonPanel'](_0x38684a,_0x2b3e13){const _0x4adfc2=new Xt(_0x38684a);return _0x4adfc2['extendTemplate']({'attributes':{'class':_0x2b3e13}}),this['bodyCollection']['add'](_0x4adfc2),_0x4adfc2;}['_setBalloonPanelContent'](_0x47950e,_0x1fe58b,_0x5632e7){if(_0x47950e['content']['clear'](),!_0x5632e7['document']['isHidden']&&_0x5632e7['document']['enabled']){const _0x53c86b=this['_createBalloonButton'](_0x1fe58b,{'label':Hi(_0x1fe58b,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x3745a0});_0x53c86b['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x47950e['content']['add'](_0x53c86b);}if(_0x5632e7['urls']['enabled']){const _0x55ed97=this['_createBalloonButton'](_0x1fe58b,{'label':Hi(_0x1fe58b,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x4ad8e3});_0x55ed97['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn}),this['_urlInputView']['focus']();}),_0x47950e['content']['add'](_0x55ed97);}if(_0x5632e7['files']['enabled']){const _0xddcfd4=new _0x29e35a(_0x1fe58b);_0xddcfd4['set']({'label':Hi(_0x1fe58b,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x23ddc8,'withText':!0x0,'tooltip':!0x0,'class':wn,'allowMultipleFiles':!0x0}),_0xddcfd4['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0xddcfd4['on']('done',(_0x2c8612,_0x220adf)=>{this['fire']('addFileToContext',_0x220adf);}),_0xddcfd4['tooltip']=!0x0,_0x47950e['content']['add'](_0xddcfd4);}for(const _0x526a0a of _0x5632e7['sources']){const _0x7d7b0a=this['_createBalloonButton'](_0x1fe58b,{'label':_0x526a0a['label'],'icon':_0x526a0a['icon']||_0x3649ad,'type':'source'});_0x47950e['content']['add'](_0x7d7b0a),_0x7d7b0a['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x526a0a,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x486bb2 of _0x5632e7['customItems']||[]){const _0x4f9b25=this['_createBalloonButton'](_0x1fe58b,{'label':_0x486bb2['label'],'icon':_0x486bb2['icon']||_0x3649ad,'type':'customItem'});_0x47950e['content']['add'](_0x4f9b25),_0x4f9b25['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x486bb2);});}this['_hasExactlyOneSource']=0x1===_0x47950e['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x4132fe,_0x1949c3){this['_urlInputView']=new AIChatContextPanelUrlInputView(_0x1949c3),this['_urlInputView']['on']('submitUrl',(_0xeaba09,_0x474d56)=>{this['_handleUrlSubmit'](_0x474d56);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn});}),_0x4132fe['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x426d94,_0x461216){const _0x1a312d='source'===_0x461216['type']?new SourcesBalloonButtonView(_0x426d94):new vt(_0x426d94);return _0x1a312d['set']({'label':_0x461216['label'],'icon':_0x461216['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':wn}),_0x1a312d;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x1a8433){const _0x2330e1=this['_addContextBalloonConfig'];_0x2330e1['buttonView']['isOn']=_0x1a8433,_0x1a8433?_0x2330e1['balloonView']['show']():_0x2330e1['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x7646dd,buttonView:_0x49af4c,hideMethod:_0x439b41}=this['_addContextBalloonConfig'];zt({'emitter':_0x7646dd,'contextElements':[_0x7646dd['element'],_0x49af4c['element']],'callback':()=>{_0x439b41();},'activator':()=>_0x49af4c['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x4585ec,_0x49a2fc,_0x3a26f9=!0x1,_0x15aff8=!0x1){const _0x3180c6='conversation'===_0x49a2fc||!0x0===_0x4585ec['isReadOnly'],_0x5d7495=new AIChatContextItemButtonView(this['locale'],_0x4585ec,_0x3180c6,_0x3a26f9,_0x15aff8);return _0x3180c6||_0x5d7495['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x5d7495['id']);}),_0x5d7495;}['_addContextToCollection'](_0x46fb71,_0x320505){_0x320505['add'](_0x46fb71,0x0);}['_removeContextFromCollection'](_0x37db7b,_0x37259b){const _0x896c53=_0x37259b['find'](_0x52748a=>_0x52748a['id']===_0x37db7b);_0x896c53&&_0x37259b['remove'](_0x896c53);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x509446){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x509446);}}class SourcesBalloonButtonView extends vt{['arrowView'];constructor(_0x245200){super(_0x245200),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Tn]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x369e23=new xt();return _0x369e23['content']=_0x3edc81,_0x369e23['extendTemplate']({'attributes':{'class':Tn+'__arrow'}}),_0x369e23;}}class AIChatControlsLoaderView extends Nt{['_cancelButtonView'];['_loaderView'];constructor(_0x179b1d){super(_0x179b1d),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 _0x41779f=new vt(this['locale']);return _0x41779f['set']({'label':Hi(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':Ui+'\x20ck-ai-button-stop-generating','icon':_0xdb5f07}),_0x41779f['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x41779f;}['_createLoaderView'](){const _0x4e7c52=new Nt(this['locale']);return _0x4e7c52['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':Hi(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x4e7c52;}}class AIChatControlsView extends Nt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x5684be,_0x507cff){super(_0x5684be),this['_contextPanelView']=this['_createContextPanelView'](_0x5684be,{'bodyCollection':_0x507cff['bodyCollection'],'searchInputVisibleFrom':_0x507cff['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x5684be),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x5684be),this['_loaderView']=this['_createLoaderView'](_0x5684be),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x5684be),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'](...An)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x1ca4c2=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x1ca4c2['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x1ca4c2['if']('isLoading','ck-hidden',_0x224e33=>_0x224e33||!this['isModelAvailable']),_0x1ca4c2['if']('isModelAvailable','ck-hidden',_0x1d0b40=>!_0x1d0b40||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x1ca4c2['if']('isLoading','ck-hidden',_0xb2e55c=>!_0xb2e55c)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x1ca4c2['if']('isModelAvailable','ck-hidden',_0x62bf98=>_0x62bf98)]},'children':[this['_modelUnavailableMessageView']]}]}),zt({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x522788,_0x6f5334){return new AIChatContextPanelView(_0x522788,_0x6f5334);}['_createPromptInputView'](_0x1b2398){return new AIChatPromptInputView(_0x1b2398,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x23501a){return new AIChatPromptCapabilitiesView(_0x23501a);}['_createLoaderView'](_0x1283be){return new AIChatControlsLoaderView(_0x1283be);}['_createModelUnavailableMessageView'](_0x4a854d){const _0x2dc084=new AIChatModelUnavailableMessageView(_0x4a854d);return _0x2dc084['delegate']('startConversation')['to'](this),_0x2dc084;}['_handlePromptInputFocus'](_0x35c0a2,_0x4b9253,_0x3eda7d){_0x3eda7d?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1d2690,_0x41da4d){this['_contextPanelView']['addContextItem'](_0x1d2690,_0x41da4d);}['removeContextItem'](_0x3e910f){this['_contextPanelView']['removeContextItem'](_0x3e910f);}['setContextItemLoading'](_0x55a999,_0x11b7f9){this['_contextPanelView']['setContextItemLoading'](_0x55a999,_0x11b7f9);}['setIsUploadInProgress'](_0x358467){this['_promptInputView']['setIsUploadInProgress'](_0x358467);}['setConversationContext'](_0xf4d99f){this['_contextPanelView']['setConversationContext'](_0xf4d99f);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x24474a,_0x476f7a,_0x3cf87a){this['_contextPanelView']['updateResourceState'](_0x24474a,_0x476f7a,_0x3cf87a);}['setWebSearch'](_0x5ba702){this['_promptCapabilitiesView']['setWebSearch'](_0x5ba702);}['setReasoning'](_0x11c851){this['_promptCapabilitiesView']['setReasoning'](_0x11c851);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x3a216a){this['_contextPanelView']['setAddContextOptions'](_0x3a216a);}['setInputPlaceholder'](_0x5e9fd7){this['_promptInputView']['setPlaceholderText'](_0x5e9fd7);}['setModelList'](_0x17178d,_0x19021d){this['_promptCapabilitiesView']['setModelList'](_0x17178d,_0x19021d);}['setModel'](_0x304ee7){_0x304ee7?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x304ee7)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x2ff1e4){this['_promptCapabilitiesView']['disableModelSelector'](_0x2ff1e4);}['populateSourceResourceBalloon'](_0x1edd25,_0x491ebf,_0x27533d,_0x1d5fc1){this['_contextPanelView']['populateSourceResourceBalloon'](_0x1edd25,_0x491ebf,_0x27533d,_0x1d5fc1);}['closeSourceResourceBalloon'](_0x3cf068){this['_contextPanelView']['closeSourceResourceBalloon'](_0x3cf068);}['focusPromptInput'](_0xf438ea=!0x1){this['_promptInputView']['focus'](_0xf438ea);}['setPromptInputValue'](_0x199125){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x199125;}}class AIChatModelUnavailableMessageView extends Nt{constructor(_0x4a03c8){super(_0x4a03c8);const _0x2d5ee5=new vt(_0x4a03c8);_0x2d5ee5['set']({'label':Hi(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x2d5ee5['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':Hi(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x2d5ee5]}]});}}class AIHeaderView extends _0x4c3dd1{['resizeButton'];constructor(_0x1da2f3,_0x5c27c6){super(_0x1da2f3,{'label':_0x5c27c6['label'],'class':'ck-ai-header\x20'+_0x5c27c6['class'],'icon':_0x5c27c6['icon']}),this['set']('isMaximized',!0x1),_0x5c27c6['content']&&this['children']['add'](_0x5c27c6['content']),_0x5c27c6['showResizeButton']&&(this['resizeButton']=Gi(_0x1da2f3,this),this['children']['add'](this['resizeButton']));}}class AIDisclaimerView extends Nt{constructor(_0x410403){super(_0x410403),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':Hi(_0x410403,'AI_DISCLAIMER_TEXT')}]}]});}}function vn(_0x228b0b,_0x5da903){const _0x435c7c=new vt(_0x228b0b);return _0x435c7c['set']({'label':Hi(_0x228b0b,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x40c6c9,'class':'ck-ai-chat__start-conversation\x20'+Ui}),_0x435c7c['on']('execute',()=>{_0x5da903['fire']('startConversation');}),_0x435c7c;}class AIChatView extends Nt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x131892,_0x4659a3){super(_0x131892),this['_bodyCollection']=new Qt(_0x131892),this['_bodyCollection']['attachToDom']();const _0xbe0632=vn(_0x131892,this);this['chatHeader']=new AIHeaderView(_0x131892,{'label':Hi(_0x131892,'AI_CHAT_HEADING'),'icon':_0x24024f,'class':'ck-ai-header_chat','content':_0xbe0632,'showResizeButton':_0x4659a3['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new AIChatFeedView(_0x131892,this['_bodyCollection']),this['chatFeed']['delegate'](...ms)['to'](this),this['chatControls']=new AIChatControlsView(_0x131892,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x4659a3['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...ms)['to'](this),this['chatDisclaimer']=new AIDisclaimerView(_0x131892),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x131892['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x19ecd9,_0x38b5f9,_0x4f355a,_0x716e04){this['chatControls']['populateSourceResourceBalloon'](_0x19ecd9,_0x38b5f9,_0x4f355a,_0x716e04);}['closeSourceResourceBalloon'](_0x2efe56){this['chatControls']['closeSourceResourceBalloon'](_0x2efe56);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class AIChatUI extends _0x3cc0e4{static get['requires'](){return[AITabs];}['_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(_0x4f385e){super(_0x4f385e);const _0x2a9808=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new PromiseQueue(),this['_view']=new AIChatView(this['context']['locale'],{'showResizeButton':_0x2a9808['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate']('resizeTabs')['to'](_0x2a9808),this['_view']['delegate'](...ms)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x4d734b,{showDiff:_0x23f73d})=>{this['showDiff']=_0x23f73d;}),_0x2a9808['view']['addTab']({'id':'chat','buttonLabel':Hi(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x24024f,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x2a9808['view'],'isMaximized',_0x5d5fc6=>_0x5d5fc6),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x5d5e33=>_0x5d5e33),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x349f74){const _0x325bd1=this['context']['config']['get']('ai.chat.welcomeMessage')??Hi(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x349f74['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x325bd1}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x4a6340,staticMessage:_0x12a8a3}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x4a6340,'initialContent':'<p>'+_0x12a8a3+'</p>'});});}async['addFeedItemUserMessage'](_0x5d5738){const _0x5d30d5=_0x5d5738['attributes']?.['displayedPrompt']||_0x5d5738['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x5d5738['contextItems']['values']()),'initialContent':'<p>'+_0x5d30d5+'</p>','id':_0x5d5738['id']});});}async['addFeedItemError']({errorMessage:_0x2e2c8f,id:_0x144d7d}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x2e2c8f+'</p>','id':_0x144d7d});});}async['addFeedItemAIReply'](_0x38dc2a){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x38dc2a['interactionId']+':'+_0x38dc2a['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x3b6f1c){const _0x381322=ds(this['context']);let _0x47e5f9=_0x381322['config']['get']('ai.availableReplyActions')||[...bs];if(_0x381322['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x211b3d=_0x381322['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x211b3d,'value');}}else _0x47e5f9=_0x47e5f9['filter'](_0x314a8e=>'insertSuggestion'!=_0x314a8e);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x3b6f1c['interactionId']+':'+_0x3b6f1c['id'],'areActionsDisabled':_0x3b6f1c['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x47e5f9}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x522e15,_0x27bbab){return this['_promiseQueue']['enqueue'](async()=>{const _0x546594=this['_view']['chatFeed']['children']['last'];if(_0x546594 instanceof AIChatFeedInteractionHeaderView)return this['_view']['chatFeed']['children']['remove'](_0x546594),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x522e15['id'],'capabilities':{'isWebSearchEnabled':_0x546594['capabilities']['isWebSearchEnabled']||_0x27bbab['isWebSearchEnabled'],'isReasoningEnabled':_0x546594['capabilities']['isReasoningEnabled']||_0x27bbab['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x522e15['id'],'capabilities':_0x27bbab});});}async['addFeedItemCustomElement'](_0x6f85e8,_0x125f12){let _0x32d3b6;return await this['_promiseQueue']['enqueue'](async()=>{_0x32d3b6=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x6f85e8,'id':_0x125f12});}),_0x32d3b6;}['removeFeedItem'](_0x521925){this['_view']['chatFeed']['removeItem'](_0x521925);}['hasFeedItem'](_0x134475){return this['_view']['chatFeed']['hasItem'](_0x134475);}['updateFeedInteractionHeader'](_0x2c501a){const _0x2e7847=this['_view']['chatFeed']['children']['find'](_0x1c273d=>_0x1c273d['options']['id']==_0x2c501a['id']&&_0x1c273d instanceof AIChatFeedInteractionHeaderView);_0x2e7847&&_0x2e7847['set']('isVisible',_0x2c501a['isVisible']);}async['updateFeedItemAIReplyContent'](_0x162e53){const _0x30c933=_0x162e53['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1d896d=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x162e53,'abortSignal':_0x1d896d,'renderingStrategy':_0x30c933}),_0x162e53['isDone']&&this['markFeedItemAsDone'](_0x162e53['id']);});}['updateFeedItemAIReplySources'](_0x594ce2,_0x4539c1){this['_view']['chatFeed']['updateWebSources'](_0x594ce2,_0x4539c1);}async['updateFeedItemAIReplySuggestionContent'](_0x47b7d3){return this['_promiseQueue']['enqueue'](async _0x3aadcf=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x47b7d3,'abortSignal':_0x3aadcf}),_0x47b7d3['isDone']&&this['markFeedItemAsDone'](_0x47b7d3['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x10af50){this['_view']['chatFeed']['updateSuggestionPartState'](_0x10af50);}['setFeedItemAIReplySuggestionPartActive'](_0x581abf){this['_view']['chatFeed']['setSuggestionPartActive'](_0x581abf);}['markFeedItemAsDone'](_0xd4d169){this['_view']['chatFeed']['markItemAsDone'](_0xd4d169);}['removeFeedInteraction'](_0x49da1c){this['_view']['chatFeed']['getItemIds']()['filter'](_0x1a3414=>_0x1a3414['startsWith'](_0x49da1c))['forEach'](_0x1f9f5b=>this['_view']['chatFeed']['removeItem'](_0x1f9f5b));}['startInteraction'](){const _0x33429d=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x33429d),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x5b3ce9){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x438f76=>_0x438f76['startsWith'](_0x5b3ce9['id']))['forEach'](_0x2962a5=>this['markFeedItemAsDone'](_0x2962a5)),this['isBusy']=!0x1,this['clearLoadingMessage'](),this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['clearLoadingMessage'](),this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x56700f,_0x3c58da){this['_view']['chatControls']['addContextItem'](_0x56700f,_0x3c58da);}['removeContextItem'](_0x6a0757){this['_view']['chatControls']['removeContextItem'](_0x6a0757);}['setContextItemLoading'](_0x5d0a5d,_0xa4cb7){this['_view']['chatControls']['setContextItemLoading'](_0x5d0a5d,_0xa4cb7);}['setIsUploadInProgress'](_0x233e1a){this['_view']['chatControls']['setIsUploadInProgress'](_0x233e1a);}['setConversationContext'](_0x30aec8){this['_view']['chatControls']['setConversationContext'](_0x30aec8);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x2a175d,_0x12b7ea,_0x2bcc6b){this['_view']['chatControls']['updateResourceState'](_0x2a175d,_0x12b7ea,_0x2bcc6b);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x3d7cd9){this['_view']['chatControls']['setAddContextOptions'](_0x3d7cd9);}['updateCapabilities'](_0x5b14bf){this['_view']['chatControls']['setWebSearch'](_0x5b14bf['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x5b14bf['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x5b14bf));}['setSelectedModel'](_0x2e7819,_0x26ed0b){this['_view']['chatControls']['setModel'](_0x2e7819),_0x26ed0b&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x5822a5){this['feedItemRenderingStrategy']=_0x5822a5;}['toggleLoadingSkeleton'](_0x8dba2c){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x8dba2c);}['resetConversationTitle'](){this['setConversationTitle'](Hi(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x4292a7,_0x44aad1=!0x1){if(_0x44aad1&&!Rt()&&_0x4292a7['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x4292a7);this['_view']['chatHeader']['label']=_0x4292a7;}['setLoadingMessage'](_0x3310e9){this['_view']['chatFeed']['setLoadingMessage'](_0x3310e9);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x18b6ba){let _0x260a6e=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x18b6ba[_0x260a6e],_0x260a6e++,_0x260a6e===_0x18b6ba['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x203bc5){return _0x203bc5['isWebSearchEnabled']&&_0x203bc5['isReasoningEnabled']?Hi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x203bc5['isWebSearchEnabled']?Hi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x203bc5['isReasoningEnabled']?Hi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):Hi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x437f2a){return _0x437f2a?_0x437f2a['isWebSearchEnabled']&&_0x437f2a['isReasoningEnabled']?Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x437f2a['isWebSearchEnabled']?Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x437f2a['isReasoningEnabled']?Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x5ce677,_0x29e1e2,_0x4c2256,_0x29d82c){this['_view']['populateSourceResourceBalloon'](_0x5ce677,_0x29e1e2,_0x4c2256,_0x29d82c);}['closeSourceResourceBalloon'](_0x3b54f0){this['_view']['closeSourceResourceBalloon'](_0x3b54f0);}['setPromptInputValue'](_0x2b2369){this['_view']['chatControls']['setPromptInputValue'](_0x2b2369);}['focusPromptInput'](_0x3f76e2=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x3f76e2);}['scrollFeedToSuggestion'](_0x29be9e,_0x4ca2a2){this['_view']['chatFeed']['scrollToSuggestion'](_0x29be9e,_0x4ca2a2);}['startAutoScroll'](_0x34945b={}){this['_view']['chatFeed']['startAutoScroll'](_0x34945b);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class AIChatHistorySectionListView extends Dt{['sections'];constructor(_0x2806a8,_0x6e57e3){super(_0x2806a8),this['sections']=_0x6e57e3,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x5c9b0f){let _0x49b878=0x0,_0x31649f=0x0;for(const _0x14b917 of this['sections']){const {resultsCount:_0x4dc689,totalItemsCount:_0x20d056}=_0x14b917['filter'](_0x5c9b0f);_0x49b878+=_0x4dc689,_0x31649f+=_0x20d056;}return{'resultsCount':_0x49b878,'totalItemsCount':_0x31649f};}}class AIChatHistoryListView extends Pt{['title'];['itemsViews'];['_itemsListView'];constructor(_0x1150c1,{title:_0x21ed95,items:_0x56ca1d}){super(_0x1150c1);const _0x184799=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x21ed95,this['itemsViews']=_0x56ca1d;const _0x10ffce=new Nt(_0x1150c1);_0x10ffce['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x1150c1),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x184799['if']('isVisible','ck-hidden',_0x1f5bac=>!_0x1f5bac)]},'children':[_0x10ffce,this['_itemsListView']]});}['filter'](_0x4e286a){const _0x5d9f7c=this['itemsViews']['length'];let _0x54ce27=0x0;for(const _0xb32f33 of this['itemsViews']){if(_0x4e286a){const _0xf0ffb4=_0xb32f33['isMatching'](_0x4e286a);_0xb32f33['isVisible']=!!_0xf0ffb4,_0xb32f33['highlightText'](_0x4e286a);}else _0xb32f33['isVisible']=!0x0,_0xb32f33['highlightText'](null);_0xb32f33['isVisible']&&_0x54ce27++;}return this['isVisible']=_0x54ce27>0x0,{'resultsCount':_0x54ce27,'totalItemsCount':_0x5d9f7c};}['getItem'](_0x3fed09){return this['itemsViews']['find'](_0x443100=>_0x443100['id']===_0x3fed09);}['removeItem'](_0x25bbdc){const _0x2eeb76=this['itemsViews']['indexOf'](_0x25bbdc);-0x1!==_0x2eeb76&&(this['itemsViews']['splice'](_0x2eeb76,0x1),this['_itemsListView']['items']['remove'](_0x25bbdc));}}class AIChatHistoryListItemView extends/* #__PURE__ -- @preserve */
27
- _0x9830fd(Pt){['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(_0x4991d5,_0x5e9ee4){super(_0x4991d5);const _0x285163=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x5e9ee4['pinned']),this['set']('loadingState',null),this['set']('title',_0x5e9ee4['title']),this['id']=_0x5e9ee4['id'];const {createdAt:_0x1a14a9,active:_0x33d618=!0x1}=_0x5e9ee4;this['_titleView']=new _0x378b1f(),this['_titleView']['bind']('text')['to'](this,'title',t=>_0x2d9792(t||'')),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x115ee2=this['_createCheckView'](),_0x7486b2=this['_createPinButtonView'](_0x4991d5),_0x14eeed=this['_createMenuDropdownView'](),_0x48eb05=this['_createEditInputView'](_0x4991d5),_0x464b9c=this['_createAcceptEditButtonView'](_0x4991d5,_0x48eb05),_0x592058=this['_createCancelEditButtonView'](_0x4991d5);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x7486b2),this['actions']['add'](_0x14eeed),this['on']('change:isEdit',(_0x122e33,_0x1962a1,_0x46158c)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x46158c?(this['actions']['add'](_0x464b9c),this['actions']['add'](_0x592058),this['mainContent']['add'](_0x48eb05),_0x48eb05['element']['value']=this['title']||'',_0x48eb05['element']['focus']()):(this['actions']['add'](_0x7486b2),this['actions']['add'](_0x14eeed),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x33d618?'ck-ai-chat-history__item--active':'',_0x285163['if']('isVisible','ck-hidden',_0xfde7=>!_0xfde7),_0x285163['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',_0x285163['if']('loadingState','ck-hidden',_0x2dcf40=>!!_0x2dcf40)]},'children':_0x33d618?[_0x115ee2]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x285163['if']('loadingState','ck-hidden',_0x31401c=>!_0x31401c)]},'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-container',_0x285163['if']('loadingState','ck-hidden',_0x308646=>!!_0x308646)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x285163['if']('loadingState','ck-hidden',_0x520809=>!_0x520809)]},'children':[{'text':_0x285163['to']('loadingState',_0x54ea79=>_0x54ea79?Hi(this['locale'],AIChatHistoryListItemView['LOADING_LABELS'][_0x54ea79]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x1a14a9]}]},{'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'](_0x516aaa){this['set']('title',_0x516aaa);}['updateLoadingState'](_0x2ff468,_0x3f13e7){this['set']('loadingState',_0x3f13e7?_0x2ff468:null);}['_createCheckView'](){const _0x362e77=new xt();return _0x362e77['set']({'content':_0x489882}),_0x362e77;}['_createPinButtonView'](_0x183e30){const _0x213fd9=new vt(_0x183e30);return _0x213fd9['set']({'label':Hi(_0x183e30,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x321a25,'withText':!0x1,'tooltip':!0x0}),_0x213fd9['bind']('isOn')['to'](this,'pinned'),_0x213fd9['on']('execute',()=>{const _0xfc89a6=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0xfc89a6});}),_0x213fd9;}['_createMenuDropdownView'](){const _0x381fb5=Gt(this['locale']),_0x97879a=_0x381fb5['panelView']['children'];_0x381fb5['buttonView']['set']({'label':Hi(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x3c4511}),_0x381fb5['panelPosition']='sw';const _0x59e4fa=new vt(this['locale']);_0x59e4fa['label']=Hi(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x59e4fa['withText']=!0x0,_0x59e4fa['on']('execute',()=>{this['isEdit']=!0x0;});const _0x519e57=new vt(this['locale']);_0x519e57['label']=Hi(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x519e57['withText']=!0x0,_0x519e57['on']('execute',()=>{this['showConfirm'](Hi(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x200f5e=new Dt(this['locale']),_0x350dff=new Pt(this['locale']);_0x350dff['children']['add'](_0x59e4fa);const _0x47c343=new Pt(this['locale']);return _0x47c343['children']['add'](_0x519e57),_0x200f5e['items']['addMany']([_0x350dff,_0x47c343]),_0x97879a['add'](_0x200f5e),_0x381fb5;}['_createEditInputView'](_0x13c991){const _0x2af655=new _0x5ecc48(_0x13c991),_0x8b7901=_0x2af655['bindTemplate'];return _0x2af655['extendTemplate']({'on':{'keydown':_0x8b7901['to'](_0x229734=>{'Enter'==_0x229734['key']&&this['_commitEditInputValue'](_0x2af655);})}}),_0x2af655;}['_createAcceptEditButtonView'](_0x54d6f5,_0x3a06ee){const _0x22cc20=new vt(_0x54d6f5);return _0x22cc20['set']({'icon':_0x489882,'withText':!0x1,'tooltip':Hi(_0x54d6f5,'AI_CHAT_HISTORY_ACCEPT')}),_0x22cc20['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x22cc20['on']('execute',()=>{this['_commitEditInputValue'](_0x3a06ee);}),_0x22cc20;}['_commitEditInputValue'](_0x4420bd){const _0x33741d=_0x4420bd['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x33741d});}['_createCancelEditButtonView'](_0x539384){const _0x22d482=new vt(_0x539384);return _0x22d482['set']({'icon':_0x5777e9,'withText':!0x1,'tooltip':Hi(_0x539384,'AI_CHAT_HISTORY_CANCEL')}),_0x22d482['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x22d482['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x22d482;}['_createSpinnerView'](){const _0x3c84e3=new AISpinnerView('tiny');return _0x3c84e3['isVisible']=!0x0,_0x3c84e3;}['isMatching'](_0xb3953c){return'string'==typeof this['title']&&this['title']['match'](_0xb3953c)?{'title':!0x0}:null;}['highlightText'](_0x277ce1){this['_titleView']['highlightText'](_0x277ce1);}}class AIChatHistoryView extends Nt{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x2cf24b,_0x3211a9){super(_0x2cf24b),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x412cd=vn(_0x2cf24b,this);this['headerView']=new AIHeaderView(_0x2cf24b,{'label':Hi(_0x2cf24b,'AI_CHAT_HISTORY_HEADING'),'icon':_0x33c29f,'class':'ck-ai-header_history','content':_0x412cd,'showResizeButton':_0x3211a9}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new AIChatHistorySectionListView(_0x2cf24b,[]),this['sectionsView']['delegate'](...Nn)['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',_0x584e49=>!_0x584e49)]}}),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':[this['headerView'],{'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 _0x1593b9=new _0x29d55b(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':Hi(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x137866=>Hi(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x137866),'secondary':Hi(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x398e50=this['_createErrorView']();return _0x398e50['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x2e929b=>!_0x2e929b)]}}),_0x1593b9['on']('render',()=>{_0x1593b9['children']['add'](_0x398e50,0x1);}),_0x1593b9['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0xcdf1cd=>!_0xcdf1cd)]}}),_0x1593b9;}['_createSkeletonView'](){const _0x4075ce=new AISkeletonView(this['locale'],Ss['aiHistory']);return _0x4075ce['bind']('isVisible')['to'](this,'isLoading'),_0x4075ce;}['_createErrorView'](){const _0x4c5bce=new Nt(this['locale']),_0x162080=new vt(this['locale']);_0x162080['set']({'withText':!0x1,'icon':_0x5777e9,'class':'ck-ai-notification_error__dismiss-button'}),_0x162080['bind']('isVisible')['to'](this,'hasItems',_0x43e966=>!!_0x43e966),_0x162080['on']('execute',()=>{this['errorMessage']='';});const _0x13b7b8=this['bindTemplate'];return _0x4c5bce['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x13b7b8['to']('errorMessage')}]},_0x162080]}),_0x4c5bce;}['_createEmptyStateView'](){const _0x54d724=new Nt(this['locale']);return _0x54d724['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x48547f=>!_0x48547f)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[Hi(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x54d724;}['_createListItemViews'](_0x4f75d2,_0xea4027){const _0x213a5a=[];for(const _0x1d5b14 of _0x4f75d2){const _0x5ab0f8=new AIChatHistoryListItemView(_0xea4027,_0x1d5b14);_0x5ab0f8['delegate'](...Nn)['to'](this),_0x213a5a['push'](_0x5ab0f8);}return _0x213a5a;}['updateHistoryItemsWithCategories'](_0x555194){const _0x5d4e73=this['locale']||'en',_0x2d2b34=[];for(const _0x294894 of _0x555194){const _0x5871e0=this['_createListItemViews'](_0x294894['items'],_0x5d4e73);_0x2d2b34['push'](new AIChatHistoryListView(_0x5d4e73,{'title':_0x294894['title'],'items':_0x5871e0}));}this['sectionsView']['sections']=_0x2d2b34,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x2d2b34),this['hasItems']=_0x555194['some'](_0xf01ba8=>_0xf01ba8['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x5b5399){for(const _0x208e48 of this['sectionsView']['sections']){const _0x491147=_0x208e48['getItem'](_0x5b5399);if(_0x491147){if(_0x208e48['removeItem'](_0x491147),0x0===_0x208e48['itemsViews']['length']){const _0x5ed90e=this['sectionsView']['sections']['indexOf'](_0x208e48);-0x1!==_0x5ed90e&&(this['sectionsView']['sections']['splice'](_0x5ed90e,0x1),this['sectionsView']['items']['remove'](_0x208e48));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x430cb5,_0xf785ab){for(const _0x3f18ff of this['sectionsView']['sections']){const _0xf8960e=_0x3f18ff['getItem'](_0x430cb5);if(_0xf8960e){_0xf8960e['updateTitle'](_0xf785ab);break;}}}['updateItemLoadingState'](_0x6a6327,_0x49b4bb,_0x3a0b80){for(const _0x3aab2c of this['sectionsView']['sections']){const _0x27763e=_0x3aab2c['getItem'](_0x6a6327);if(_0x27763e){_0x27763e['updateLoadingState'](_0x49b4bb,_0x3a0b80);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x33c935=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x33c935);}}}const Nn=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];class AIChatHistoryUI extends _0x3cc0e4{static get['requires'](){return[AITabs];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5bd93c){super(_0x5bd93c);const _0x414b97=this['context']['plugins']['get']('AITabs');this['_historyView']=new AIChatHistoryView(this['context']['locale'],_0x414b97['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x414b97),this['_historyView']['delegate'](...Nn)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x414b97['view'],'isMaximized',_0x5a539f=>_0x5a539f),_0x414b97['view']['addTab']({'id':'history','buttonLabel':Hi(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x33c29f,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x7ede1c){this['_historyView']['removeHistoryItem'](_0x7ede1c);}['updateItems'](_0x2da1fd){this['_historyView']['updateHistoryItemsWithCategories'](_0x2da1fd);}['updateItemTitle'](_0x3567e9,_0x37de61){this['_historyView']['updateItemTitle'](_0x3567e9,_0x37de61);}['updateItemLoadingState'](_0xd6bf9,_0xf165ea,_0x24cff5){this['_historyView']['updateItemLoadingState'](_0xd6bf9,_0xf165ea,_0x24cff5);}['setLoadingSkeleton'](_0x5a357f){this['_historyView']['isLoading']=_0x5a357f;}['showError'](_0x5018a6){this['_historyView']['errorMessage']=_0x5018a6;}['hideError'](){this['_historyView']['errorMessage']='';}}class AIChatHistoryItem extends ht(){['id'];['createdAt'];constructor({id:_0x3e2ad4,title:_0x2dc02e,createdAt:_0x5c170a,updatedAt:_0x115d4a,pinned:_0x309305}){super(),this['id']=_0x3e2ad4,this['createdAt']=new Date(_0x5c170a),this['set']('title',_0x2dc02e),this['set']('updatedAt',_0x115d4a?new Date(_0x115d4a):null),this['set']('pinned',_0x309305||!0x1);}['updateTitle'](_0x33a588){this['set']('title',_0x33a588),this['updatedAt']=new Date();}['updatePinned'](_0x5c495f){this['set']('pinned',_0x5c495f),this['updatedAt']=new Date();}}class AIChatHistoryConversations extends Et(){['items']=[];['connector'];['group'];constructor({connector:_0x1df393,group:_0x14e7be}){super(),this['connector']=_0x1df393,this['group']=_0x14e7be;}async['init'](){try{const _0x20ed50=this['connector']['fetchConversations'](this['group']),_0x52d9b2=await _0x20ed50['getConversations']();this['loadItems'](_0x52d9b2);}catch(_0x11a1f9){this['fire']('error',{'error':_0x11a1f9,'operation':'init'});}}['addItem'](_0x5eddff){this['items']['push'](_0x5eddff);}async['removeItem'](_0x5c7b7f){const _0x3f398a=this['items']['findIndex'](_0x23aee9=>_0x23aee9['id']===_0x5c7b7f);if(-0x1===_0x3f398a)return!0x1;try{return await this['connector']['deleteConversation'](_0x5c7b7f)['execute'](),this['items']['splice'](_0x3f398a,0x1),this['fire']('itemRemoved',{'itemId':_0x5c7b7f}),!0x0;}catch(_0x3236ff){return this['fire']('error',{'error':_0x3236ff,'operation':'removeItem','itemId':_0x5c7b7f}),!0x1;}}['getItem'](_0x291a4a){return this['items']['find'](_0x499388=>_0x499388['id']===_0x291a4a);}async['updateItemTitle'](_0x56143b,_0x119aa4){const _0x2a0a1b=this['getItem'](_0x56143b);if(!_0x2a0a1b)return!0x1;try{return await this['connector']['updateConversation'](_0x56143b,{'title':_0x119aa4})['getResult'](),_0x2a0a1b['updateTitle'](_0x119aa4),this['fire']('itemUpdated',{'itemId':_0x56143b,'updates':{'title':_0x119aa4}}),!0x0;}catch(_0x3fed60){return this['fire']('error',{'error':_0x3fed60,'operation':'updateItemTitle','itemId':_0x56143b}),!0x1;}}async['updateItemPinned'](_0x99d8e5,_0x1f68fd){const _0x4f9bdd=this['getItem'](_0x99d8e5);if(!_0x4f9bdd)return!0x1;try{return await this['connector']['updateConversation'](_0x99d8e5,{'pinned':_0x1f68fd})['getResult'](),_0x4f9bdd['updatePinned'](_0x1f68fd),this['fire']('itemUpdated',{'itemId':_0x99d8e5,'updates':{'pinned':_0x1f68fd}}),!0x0;}catch(_0x487975){return this['fire']('error',{'error':_0x487975,'operation':'updateItemPinned','itemId':_0x99d8e5}),!0x1;}}['loadItems'](_0x16acf9){try{this['items']=[],_0x16acf9['map'](_0x26ccba=>{this['addItem'](new AIChatHistoryItem(_0x26ccba));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0xf6be52){this['fire']('error',{'error':_0xf6be52,'operation':'loadItems'});}}['getItems'](_0x1808f4={}){const _0x1cbff6=void 0x0!==_0x1808f4['pinned']&&_0x1808f4['pinned'],_0x38a428=_0x1808f4['from']?new Date(_0x1808f4['from']['getFullYear'](),_0x1808f4['from']['getMonth'](),_0x1808f4['from']['getDate']()):null,_0x43ffd3=_0x1808f4['to']?new Date(_0x1808f4['to']['getFullYear'](),_0x1808f4['to']['getMonth'](),_0x1808f4['to']['getDate']()):null;return this['items']['filter'](_0x223f29=>{if(_0x223f29['pinned']!==_0x1cbff6)return!0x1;if(_0x43ffd3){const _0x51e6ac=new Date(_0x223f29['createdAt']['getFullYear'](),_0x223f29['createdAt']['getMonth'](),_0x223f29['createdAt']['getDate']());return _0x38a428?_0x38a428['getTime']()===_0x43ffd3['getTime']()?_0x51e6ac['getTime']()===_0x38a428['getTime']():_0x51e6ac<_0x43ffd3&&_0x51e6ac>=_0x38a428:_0x51e6ac<_0x43ffd3;}return!0x0;});}}class AIChatHistoryController extends _0x3cc0e4{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[AIConnector,AIChatController,AIChatHistoryUI,AITabs];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](AIConnector),this['_aiChatHistoryUi']=this['context']['plugins']['get'](AIChatHistoryUI),this['_aiChatController']=this['context']['plugins']['get'](AIChatController);const _0x4d2806=this['context']['plugins']['get'](AITabs);try{const _0x15f7ab=this['_aiChatController']['getGroupId']();this['history']=new AIChatHistoryConversations({'connector':this['_aiConnector'],'group':_0x15f7ab}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x2e1ae9,_0x27ac1e)=>{this['_setItemLoading'](_0x27ac1e['id'],'remove'),this['_handleRemove'](_0x27ac1e['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x221f87,_0x438134)=>{this['_setItemLoading'](_0x438134['id'],'rename'),this['_handleEditTitle'](_0x438134['id'],_0x438134['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x47b97f,_0x1600ae)=>{void 0x0!==_0x1600ae['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x1600ae['itemId'],_0x1600ae['updates']['title']),void 0x0!==_0x1600ae['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x1600ae['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x42d4db,_0x258d3e)=>{this['_aiChatController']['_handleRemovedConversation'](_0x258d3e['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x258d3e['itemId']),this['_clearItemLoading'](_0x258d3e['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x3b0308,_0x3955d5)=>{this['_handleHistoryErrorUI'](_0x3955d5['error'],_0x3955d5['operation'],_0x3955d5['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x5bb21c,_0x24eaaa)=>{this['_handleSelectConversation'](_0x24eaaa['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x1c8fbb,_0x386479)=>{const _0x32706d=_0x386479['pinned']?'pin':'unpin';this['_setItemLoading'](_0x386479['id'],_0x32706d),this['_handleTogglePin'](_0x386479['id'],_0x386479['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x4d2806['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x4d2806['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x4336d9){this['_handleHistoryErrorUI'](_0x4336d9,'init');}}async['_handleEditTitle'](_0x1aea51,_0x2dd1df){await this['history']['updateItemTitle'](_0x1aea51,_0x2dd1df);}async['_handleTogglePin'](_0x412019,_0x34bda1){await this['history']['updateItemPinned'](_0x412019,_0x34bda1);}async['_handleRemove'](_0x3bd9fa){await this['history']['removeItem'](_0x3bd9fa);}async['_handleSelectConversation'](_0x2d9517){await this['_aiChatController']['loadConversation'](_0x2d9517);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x131ef8=this['_aiChatController']['activeConversation']?.['id'],_0x42678e=this['_getCategorizedItems']()['map'](_0x57cdf8=>({'title':_0x57cdf8['title'],'items':_0x57cdf8['items']['map'](_0x1f16a7=>({'id':_0x1f16a7['id'],'title':_0x1f16a7['title']||Hi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x1f16a7['createdAt'])['toLocaleDateString'](),'active':_0x1f16a7['id']===_0x131ef8,'pinned':_0x1f16a7['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x42678e);}['_setItemLoading'](_0x4add8c,_0x5d25c2){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x4add8c,_0x5d25c2,!0x0);}['_clearItemLoading'](_0x7facce){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x7facce,null,!0x1);}['_handleHistoryErrorUI'](_0x38c9b8,_0x197406,_0x533c0d){const _0x588451=this['_generateErrorMessage'](_0x197406,_0x533c0d);this['_aiChatHistoryUi']['showError'](_0x588451),_0x533c0d&&this['_clearItemLoading'](_0x533c0d),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x2e93e8,_0x500fd4){const _0x5c002a=_0x500fd4?this['history']['getItem'](_0x500fd4):null,_0x407039=_0x5c002a?.['title']||Hi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x2e93e8){case'updateItemTitle':return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x407039);case'updateItemPinned':{const _0x557ad0=Hi(this['context']['locale'],_0x5c002a?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x557ad0,_0x407039]);}case'removeItem':return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x407039);case'init':case'loadItems':return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x4a3c0f=new Date(),_0x237a3f=new Date(_0x4a3c0f['getFullYear'](),_0x4a3c0f['getMonth'](),_0x4a3c0f['getDate']()),_0x4e092f=new Date(_0x237a3f);_0x4e092f['setDate'](_0x4e092f['getDate']()-0x1);const _0x4ef42=new Date(_0x237a3f);_0x4ef42['setDate'](_0x4ef42['getDate']()-0xe);const _0x4992b2=this['history']['getItems']({'pinned':!0x0}),_0x1d2700=this['history']['getItems']({'from':_0x237a3f,'to':_0x237a3f}),_0x5a7b22=this['history']['getItems']({'from':_0x4e092f,'to':_0x4e092f}),_0x2d7b08=this['history']['getItems']({'from':_0x4ef42,'to':_0x4e092f}),_0x33688a=this['history']['getItems']({'to':_0x4ef42}),_0x475ca6=[];return _0x4992b2['length']>0x0&&_0x475ca6['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x4992b2}),_0x1d2700['length']>0x0&&_0x475ca6['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x1d2700}),_0x5a7b22['length']>0x0&&_0x475ca6['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x5a7b22}),_0x2d7b08['length']>0x0&&_0x475ca6['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x2d7b08}),_0x33688a['length']>0x0&&_0x475ca6['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x33688a}),_0x475ca6;}}class AIChatHistory extends _0x3cc0e4{static get['requires'](){return[AIChatHistoryController,AIChatHistoryUI];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class AIChat extends _0x3cc0e4{static get['requires'](){return[AIChatController,AIEditing,AIChatUI,AIChatHistory];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x482399){super(_0x482399),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[],'alwaysAddSelection':!0x1}),this['context']['config']['define']('ai.chat.initialConversation','new');}}class AIChatShortcutView extends vt{['id'];constructor(_0x27f0f7,_0x3af242){super(_0x27f0f7);const {id:_0x524906,type:_0x42292f,icon:_0xae49c5}=_0x3af242;this['id']=_0x524906,this['set']({'label':_0x3af242['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x3af242['id']}}),_0xae49c5?this['icon']=_0xae49c5:'chat'===_0x42292f?this['icon']=_0x24024f:'review'===_0x42292f?this['icon']=_0xc8a0b9:'translate'===_0x42292f&&(this['icon']=_0x31db4a);}}class AIChatShortcutsView extends Nt{['listView'];constructor(_0x392d11,_0x1862d9){super(_0x392d11);const _0x139563=_0x1862d9['map'](_0x54a3c0=>{const _0x3936fe=new Pt(this['locale']),_0xd6fea=new AIChatShortcutView(this['locale'],_0x54a3c0);return _0x3936fe['children']['add'](_0xd6fea),_0xd6fea['delegate']('execute')['to'](this),_0x3936fe;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x139563),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const yn='chat-shortcuts';class AIChatShortcuts extends _0x3cc0e4{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[AIChatUI];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](AIChatUI),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x370275=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x370275['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x370275,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x4b41e7=['chat','review','translate'];this['_shortcuts']['forEach'](_0x5455e7=>{let _0x357686=!0x0;if(_0x5455e7['id']&&_0x5455e7['label']&&_0x4b41e7['includes'](_0x5455e7['type'])?'chat'===_0x5455e7['type']&&(_0x357686='string'==typeof _0x5455e7['prompt']):_0x357686=!0x1,!_0x357686)throw new at('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x5455e7});});}['_injectShortcuts'](){const _0x20ad89=this['context']['plugins']['get'](AIChatUI);this['_shortcutsView']=new AIChatShortcutsView(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x20ad89['addFeedItemCustomElement'](this['_shortcutsView']['element'],yn),this['_shortcutsView']['on']('execute',_0x3d02da=>{const _0xfb4d63=_0x3d02da['source']['id'];this['_executeShortcut'](_0xfb4d63);});}['_removeShortcuts'](){const _0x9bf284=this['context']['plugins']['get'](AIChatUI);_0x9bf284['hasFeedItem'](yn)&&_0x9bf284['removeFeedItem'](yn),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x17afc9){const _0x3a9587=this['_shortcuts']['find'](_0x22f496=>_0x22f496['id']===_0x17afc9),_0x3e5c34=_0x3a9587['type'];'chat'===_0x3e5c34?this['_runChatShortcut'](_0x3a9587):'review'===_0x3e5c34?_0x3a9587['commandId']?this['_runReviewShortcut'](_0x3a9587):this['_switchTab']('reviewMode'):'translate'===_0x3e5c34&&(_0x3a9587['language']?this['_runTranslateShortcut'](_0x3a9587):this['_switchTab']('translate'));}['_switchTab'](_0x50feed){if(!this['context']['plugins']['has']('AITabs'))throw new at('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x50feed});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x50feed);}async['_runChatShortcut']({prompt:_0x1cfc49,draftMode:_0xe1a8b7,useWebSearch:_0x298cec=!0x1,useReasoning:_0x427eb0=!0x1,model:_0x5eb3f7}){const _0x328933=this['context']['plugins']['get']('AIChatController'),_0x53e1f2=_0x328933['activeConversation'];let _0x14f782;_0x14f782=_0x5eb3f7?await _0x53e1f2['chatModels']['getModel'](_0x5eb3f7):await _0x53e1f2['chatModels']['getDefault'](),_0x14f782&&await _0x53e1f2['setModel'](_0x14f782),_0x53e1f2['setWebSearch'](_0x298cec),_0x53e1f2['setReasoning'](_0x427eb0),_0x328933['addCurrentDocumentToChatContext'](),_0xe1a8b7?(this['_aiChatUI']['setPromptInputValue'](_0x1cfc49),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x328933['sendMessage']({'message':_0x1cfc49});}['_runReviewShortcut']({commandId:_0xc65800,model:_0x1b82b6,prompt:_0x5926d1,params:_0x5e9bb3}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new at('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x400b0b={'id':_0xc65800,'isCustom':'custom'===_0xc65800};_0x1b82b6&&_0x5926d1&&(_0x400b0b['args']={'model':_0x1b82b6,'prompt':_0x5926d1}),_0x5e9bb3&&(_0x400b0b['params']=_0x5e9bb3),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x400b0b);}['_runTranslateShortcut']({language:_0x1441b8}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new at('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x1441b8,'args':{'language':_0x1441b8}});}}class ToggleAICommand extends _0xae9ca1{constructor(_0x11f120){super(_0x11f120);const _0x1c3c3c=_0x11f120['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x1c3c3c,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x53f04b=this['editor']['plugins']['get']('AITabs')['view'];_0x53f04b['isVisible']=!_0x53f04b['isVisible'];}}class AIToggleButtonUI extends _0x53fc9f{static get['requires'](){return[AITabs];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x229800=this['editor'];_0x229800['commands']['add']('toggleAi',new ToggleAICommand(_0x229800)),_0x229800['ui']['componentFactory']['add']('toggleAi',()=>{const _0x574d60=this['_createAIUIButton'](vt);return _0x574d60['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x574d60;}),_0x229800['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0xba8f97=this['_createAIUIButton'](Wt);return _0xba8f97['set']({'role':'menuitemcheckbox'}),_0xba8f97;});}['_createAIUIButton'](_0x1f4efd){const _0x119a1f=this['editor'],_0x4f4eb5=_0x119a1f['commands']['get']('toggleAi'),_0x5f5c4f=new _0x1f4efd(_0x119a1f['locale']);return _0x5f5c4f['set']({'label':Hi(_0x119a1f['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x485aef,'isToggleable':!0x0}),_0x5f5c4f['bind']('isEnabled')['to'](_0x4f4eb5),_0x5f5c4f['bind']('isOn')['to'](_0x4f4eb5,'value',_0x139bf0=>!!_0x139bf0),this['listenTo'](_0x5f5c4f,'execute',()=>{_0x4f4eb5['execute']();}),_0x5f5c4f;}}const xn=['applySuggestion','insertSuggestion','showNext','showPrevious'];class AIBalloonView extends Nt{['_errorView'];constructor(_0x57c7d4){super(_0x57c7d4),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x2c86fd){this['showError'](_0x2c86fd);}['showError'](_0xbd3510){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0xbd3510,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x363eef=new Nt(this['locale']),_0x2b83bb=new Nt(this['locale']);return _0x2b83bb['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x363eef['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x48303a=>!_0x48303a)]},'children':[_0x2b83bb]}),_0x363eef;}}const Ln=0xa;class AIBalloon extends _0x3cc0e4{static get['requires'](){return[AIEditing];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_getTargetEditor'](){return this['_currentConfig']?.['targetEditor']??ds(this['context']);}['_isUpdatingMarkers']=!0x1;['open'](_0x266c9e){const {id:_0x47fa5d}=this['_currentConfig']??{};this['_currentConfig']=_0x266c9e;const {id:_0x16b957}=this['_currentConfig'];this['isOpen']&&_0x47fa5d===_0x16b957?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x208e47=this['_getTargetEditor']()['plugins']['get']('Dialog');_0x208e47['isOpen']&&this['_currentConfig']&&_0x208e47['id']===this['_currentConfig']['id']&&_0x208e47['hide']();}['_updateDialog'](){const _0x200073=this['_getTargetEditor']()['plugins']['get']('Dialog'),{icon:_0x2ce46c,title:_0x7729e7}=this['_currentConfig'];_0x200073['view']?.['headerView']&&(_0x200073['view']['headerView']['label']=_0x7729e7,_0x200073['view']['headerView']['iconView']&&_0x2ce46c&&(_0x200073['view']['headerView']['iconView']['content']=_0x2ce46c)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x200073['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](AIEditing)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](AIEditing)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x90c3b9=this['_getTargetEditor']()['plugins']['get']('Dialog'),{id:_0x2d01bb,title:_0x172d32,icon:_0x22b609,class:_0x66fb8,mainView:_0x5721ee}=this['_currentConfig'];_0x5721ee['delegate'](...xn)['to'](this),_0x90c3b9['show']({'title':_0x172d32,'icon':_0x22b609,'hasCloseButton':!0x0,'id':_0x2d01bb,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x66fb8||''),'content':_0x5721ee,'onShow':_0xe36c1e=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0xe36c1e['view']?.['updatePosition']();const _0x708a77=this['_getSelectionElements']();_0x708a77&&_0x708a77[0x0]&&wt({'target':_0x708a77[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0xe36c1e['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x2d01bb});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x2d01bb}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x283038,_0x520ebc){if(!_0x520ebc){const _0x15b2be=this['_getTargetRootDomRect']();if(!_0x15b2be)return null;_0x520ebc=_0x15b2be;}const _0xea6395=this['_getSelectionElements']();if(!_0xea6395||0x0===_0xea6395['length'])return{'left':Math['round'](_0x520ebc['left']+_0x520ebc['width']/0x2-_0x283038['width']/0x2),'top':Math['round'](_0x520ebc['top']+_0x520ebc['height']/0x2-_0x283038['height']/0x2)};const _0x23000a=Math['round'](_0x520ebc['left']+_0x520ebc['width']/0x2-_0x283038['width']/0x2),_0x18ebca=_0xea6395['map'](_0x405a5a=>new ut(_0x405a5a)),_0xb6b3cd=_0x283038['height'];return{'left':_0x23000a,'top':this['_calculateOptimalTopPosition'](_0x18ebca,_0xb6b3cd,_0x520ebc)};}['_calculateOptimalTopPosition'](_0x4d07b8,_0x2844cb,_0x505c8f){const _0x2da6f9=new ut(ct['window']),_0x4a6eac=_0x4d07b8['map'](_0x716f92=>_0x716f92['getVisible']())['filter'](_0x3f4c66=>_0x3f4c66),_0x430fc4=ut['getBoundingRect'](_0x4a6eac);if(!_0x430fc4)return Math['round'](_0x505c8f['top']+_0x505c8f['height']/0x2);const _0x588d6e=_0x2da6f9['getIntersection'](_0x430fc4);if(!_0x588d6e)return Math['round'](_0x505c8f['top']+_0x505c8f['height']/0x2);const _0x10359c=_0x505c8f['getVisible'](),_0x277564=_0x10359c&&_0x430fc4['height']>_0x10359c['height'],_0xb492da=_0x588d6e['top'],_0x5ac79b=_0x588d6e['bottom'];if(_0x277564){const _0x1ee42f=(_0x10359c||_0x2da6f9)['height']/0x2-_0x2844cb/0x2,_0x424636=_0xb492da-Ln-_0x505c8f['top'],_0x3539f1=_0x505c8f['bottom']-_0x5ac79b-Ln;return _0x424636>=_0x2844cb?Math['max'](Ln,_0xb492da-_0x2844cb-Ln):_0x3539f1>=_0x2844cb?_0x5ac79b+Ln:Math['max'](Ln,_0x1ee42f);}const _0x18aff5=_0xb492da-_0x2844cb,_0x28ce39=_0x505c8f['bottom']-_0x5ac79b-Ln,_0x2f09d5=_0xb492da-Ln-_0x505c8f['top'];let _0x5b201e;if(_0x28ce39>=_0x2844cb)_0x5b201e=_0x5ac79b+Ln;else{if(_0x2f09d5>=_0x2844cb)_0x5b201e=_0x18aff5-Ln;else _0x5b201e=_0xb492da+_0x430fc4['height']/0x2-_0x2844cb/0x2;}return _0x5b201e;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x80bc48=this['_getTargetEditor']();this['listenTo'](_0x80bc48['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x41248a,data:{newRange:_0x4ef70d}}of _0x80bc48['model']['document']['differ']['getChangedMarkers']())if(_0x41248a['startsWith'](As+':')&&(_0x4ef70d&&(_0x4ef70d['start']['isEqual'](_0x4ef70d['end'])||'$graveyard'==_0x4ef70d['root']['rootName'])||null==_0x4ef70d)){const _0x2edc81=Hi(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x2edc81),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x5589bc=this['_getTargetEditor']();this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x5589bc['model']['document']);}['_getSelectionElements'](){const _0x592b31=this['_getTargetEditor']();return _0x3ba44f(_0x592b31['editing'],[..._0x592b31['model']['markers']['getMarkersGroup']('ai-selection'),..._0x592b31['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getTargetRootDomRect'](){const _0x41e21b=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];if(!_0x41e21b)return null;const _0x3a4a67=this['_getTargetEditor'](),_0x47bea2=_0x3a4a67['editing']['view']['document']['getRoot'](_0x41e21b['rootName']);if(!_0x47bea2)return null;const _0x1f665c=_0x3a4a67['editing']['view']['domConverter']['mapViewToDom'](_0x47bea2);return _0x1f665c&&_0x1f665c instanceof HTMLElement?new ut(_0x1f665c):null;}}class AIMiniToolbarView extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x3ca703,_0x3ae928={}){super(_0x3ca703),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3ae928};const _0x17d1f5=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x17d1f5?'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'](_0x36dad2){this['showChangesButton']['isEnabled']=_0x36dad2;}['_setupRatingButtons'](){this['likeButton']=new vt(this['locale']),this['likeButton']['set']({'icon':_0x4dcf71,'label':Hi(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':Bi,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new vt(this['locale']),this['dislikeButton']['set']({'icon':_0x102fde,'label':Hi(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':Bi,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new vt(this['locale']),this['copyButton']['set']({'icon':_0x5c3d91,'label':Hi(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+Bi,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x5a50d9=new xt();_0x5a50d9['set']({'content':_0x489882}),_0x5a50d9['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\x20'+Bi,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+Bi;},0x7d0);}),this['copyButton']['children']['add'](_0x5a50d9);}['_setupShowChangesButton'](){this['showChangesButton']=new vt(this['locale']),this['showChangesButton']['set']({'icon':_0x1aad04,'label':Hi(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':Bi}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x42cc56=>_0x42cc56?_0x5a2923:_0x1aad04),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class AIChatBalloonView extends AIBalloonView{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x2da476,_0x2c64ac){super(_0x2da476);const _0x57ca5e=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _t(),this['_keystrokes']=new It(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x2c64ac,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new AISuggestionStreamableContentView(_0x2da476),this['_partToolbarView']=new AISuggestionContentPartToolbarView(_0x2da476,_0x2c64ac['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x2c64ac),this['_stateView']=new AISuggestionContentPartStateView(_0x2da476),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new AIMiniToolbarView(_0x2da476,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new AIChatBalloonToolbarContainerView(_0x2da476,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x45159e,_0x392f49,_0x2b8104,_0x4a1eb3)=>{let _0x40d21a,_0x44823d;'pending'===_0x4a1eb3?(_0x40d21a=this['_partToolbarView'],_0x44823d=this['_stateView']):(_0x40d21a=this['_stateView'],_0x44823d=this['_partToolbarView']),this['_stateView']['setState'](_0x2b8104),_0x40d21a['isVisible']=!0x1,_0x44823d['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x57ca5e['to']('_state',_0x28b55a=>'ck-ai-chat-balloon-main_state_'+_0x28b55a)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x2c64ac);});}['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'](_0x5ce603){_0x5ce603?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x5ce603);}['setState'](_0x21a2b4){this['_state']=_0x21a2b4;}['showError'](_0x24d4c0){super['showError'](_0x24d4c0),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x5c7361){super['showBlockingError'](_0x5c7361),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0xa9ae15){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0xa9ae15;}['togglePartToolbarEnabled'](_0x423a58){this['_partToolbarView']['isEnabled']=_0x423a58;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x49bafd,showSuggestButton:_0x152905}){_0x49bafd=_0x49bafd&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x152905=_0x152905&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x49bafd,'showSuggestButton':_0x152905});}['_createNextButtonView'](){const _0x26cc0d=new vt(this['locale']);return _0x26cc0d['set']({'icon':_0x3a15b7,'label':Hi(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x26cc0d['on']('execute',()=>{this['fire']('showNext');}),_0x26cc0d;}['_createPreviousButtonView'](){const _0x265540=new vt(this['locale']);return _0x265540['set']({'icon':_0x2ca3b2,'label':Hi(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x265540['on']('execute',()=>{this['fire']('showPrevious');}),_0x265540;}}class AIChatBalloonToolbarContainerView extends Nt{constructor(_0x45b560,_0x1873e0){super(_0x45b560),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x1873e0});}}class AIChatBalloon extends _0x53fc9f{static get['requires'](){return[Bt,AIBalloon];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x52b11c){super(_0x52b11c),this['set']('showDiff',!0x1);}['open'](_0xed818d){const _0x1cf40e=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x1cf40e['plugins']['get']('AIBalloon')['open']({..._0xed818d,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0xed818d['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0xed818d['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x132e02){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x132e02);}['setState'](_0x3aea23){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x3aea23);}['_createChatBalloonView'](){const _0x298de2=this['editor'],_0x39a04d=_0x298de2['plugins']['get']('AIBalloon'),_0x1a4348=_0x298de2['commands']['get']('trackChanges');let _0xb96a3f=_0x298de2['config']['get']('ai.availableReplyActions')||[...bs];_0x298de2['plugins']['has']('TrackChanges')||(_0xb96a3f=_0xb96a3f['filter'](_0x1bd655=>'insertSuggestion'!=_0x1bd655));const _0x59eff1=new AIChatBalloonView(_0x298de2['locale'],{'availableActions':_0xb96a3f,'showApplyButton':!0x0,'showSuggestButton':!!_0x1a4348});return _0x59eff1['bind']('showDiff')['to'](this),_0x59eff1['delegate'](...Cs)['to'](this),_0x59eff1['delegate']('showPrevious','showNext')['to'](this),_0x39a04d['delegate']('dialogClosed')['to'](this),_0x59eff1['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x59eff1['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x59eff1['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x1a4348&&_0x59eff1['bind']('isTrackChangesOn')['to'](_0x1a4348,'value'),_0x59eff1['render'](),_0x59eff1;}['_toggleRotatorButtonsInDialogHeader'](_0x3406cc){const _0x5918fd=this['editor'],_0x4aa601=_0x5918fd['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x3406cc),_0x4aa601['has'](this['_chatBalloonView']['previousButtonView'])||(_0x4aa601['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x5918fd['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x4aa601['remove'](this['_chatBalloonView']['previousButtonView']),_0x4aa601['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class AIEditorIntegration extends _0x53fc9f{static get['requires'](){return[AIToggleButtonUI,AIChatBalloon,_0x3fefa0];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Dn(_0x3c46f8){const {editor:_0x15789e,action:_0x56513f,withText:_0x37af8e=!0x1,withIcon:_0x718abe=!0x0,isInDropdown:_0x1dadf9=!0x0,shouldPreventFocus:_0x1fe717=!0x1}=_0x3c46f8;return()=>{const _0x4b8a5a=_0x15789e['locale'],_0x565897=new vt(_0x4b8a5a),_0x554222=_0x565897['bindTemplate'];_0x1dadf9&&_0x565897['extendTemplate']({'on':{'mouseenter':_0x554222['to'](()=>{_0x1fe717&&_0x1fe717()||_0x565897['focus']();})}});const _0x54430c=_0x56513f['icon']??_0x56513f['parent']?.['icon'];return _0x565897['set']({'label':_0x56513f['label'],'withText':_0x37af8e,'role':'menuitem','icon':_0x718abe?_0x54430c??_0x50cf41:void 0x0,'tooltip':!_0x37af8e,'class':'ck-ai-quick-actions-button','isEnabled':_0x56513f['isEnabled']}),_0x565897['on']('execute',()=>{_0x15789e['editing']['view']['focus'](),_0x15789e['commands']['execute']('aiQuickAction',_0x56513f);}),_0x565897;};}class DropdownMenuButtonWithHighlightView extends _0x5c328f{['arrowView'];constructor(_0x57fce3,_0x4d37b4){super(_0x57fce3,_0x4d37b4);const _0x3683f2=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',_0x1adc3d=>String(_0x1adc3d)),'data-cke-tooltip-disabled':_0x3683f2['to']('isOn')},'on':{'mouseenter':_0x3683f2['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x37299d=new xt();return _0x37299d['content']=_0x3edc81,_0x37299d['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x37299d;}}class AIQuickActionsFilteredListView extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x254a1f,_0x40acd9,_0x4af47b){super(_0x254a1f),this['_allListItems']=_0x40acd9,this['_allSearchableItems']=_0x4af47b;}['filter'](_0x49e53c){if(!_0x49e53c)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x4781e8=_0x49e53c['source']['toLowerCase']()['trim'](),_0x29cf4d=this['_allSearchableItems']['filter'](_0x519322=>(_0x519322['groupLabel']?_0x519322['label']+'\x20('+_0x519322['groupLabel']+')':_0x519322['label'])['toLowerCase']()['includes'](_0x4781e8));return this['items']['clear'](),this['items']['addMany'](_0x29cf4d['sort']((_0xe6d9c2,_0x181f6f)=>{const _0x563a2e=_0xe6d9c2['groupLabel'],_0x2e08d9=_0x181f6f['groupLabel'];return _0x563a2e||_0x2e08d9?_0x563a2e?0x1:-0x1:0x0;})['map'](_0x121e7f=>_0x121e7f['item'])),this['_highlightQuery'](_0x4781e8,_0x29cf4d),{'resultsCount':_0x29cf4d['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x49f63b,_0x265cb0){if(!_0x49f63b)return;const _0x1de33b=new RegExp(_0x5933ee(_0x49f63b),'gi');_0x265cb0['forEach'](_0x5463aa=>{_0x5463aa['highlightViews']&&_0x5463aa['highlightViews']['forEach'](_0x1a1f37=>{'function'==typeof _0x1a1f37['highlightText']&&_0x1a1f37['highlightText'](_0x1de33b);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x22c396=>{_0x22c396['highlightViews']&&_0x22c396['highlightViews']['forEach'](_0x23980a=>{'function'==typeof _0x23980a['highlightText']&&_0x23980a['highlightText'](null);});});}}const Vn='menu',Pn='menuitem';class AIQuickActionsDropdownContentView extends Nt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x1076dd,_0x1503e3,_0x1bba9b,_0x18da15,_0x382006=!0x1){const _0x31107e=_0x1076dd['locale'];super(_0x31107e),this['_bodyCollection']=_0x18da15,this['_hasSearch']=_0x382006;const _0x4d3d71=this['_createListItems'](_0x1076dd,_0x1503e3,_0x1bba9b);this['optionsListView']=new AIQuickActionsFilteredListView(_0x31107e,_0x4d3d71,this['_allSearchableItems']),this['optionsListView']['role']=Vn,this['optionsListView']['items']['addMany'](_0x4d3d71),this['focusTracker']=new _t(),this['keystrokes']=new It(),_0x382006&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x4d3d71,this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x382006&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x1ccc9c=_0x382006&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x3127bc(_0x1ccc9c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x31107e['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x29d55b(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':Hi(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':Hi(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x5be5d3=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x5be5d3);}['_createListItems'](_0xdc3da2,_0x376950,_0x5384b2){const _0x578bcc=new _0x3127bc();return _0x376950['forEach'](_0x31ec9f=>{if('actions'in _0x31ec9f){const {listItem:_0x5580a9}=this['_createActionGroupButton'](_0xdc3da2,_0x31ec9f,_0x5384b2);_0x578bcc['add'](_0x5580a9),_0x31ec9f['actions']['forEach'](_0x4cd195=>{this['_createActionButton'](_0xdc3da2,_0x4cd195,_0x31ec9f['label'],_0x31ec9f['icon']);const {listItem:_0x2ede0f,highlightViews:_0x1bf4b9}=this['_createSearchResultActionButton'](_0xdc3da2,_0x4cd195,_0x31ec9f['label'],_0x31ec9f['icon']);this['_allSearchableItems']['push']({'item':_0x2ede0f,'label':_0x4cd195['label'],'groupLabel':_0x31ec9f['label'],'highlightViews':_0x1bf4b9});});}else{const {listItem:_0x35837e}=this['_createActionButton'](_0xdc3da2,_0x31ec9f);_0x578bcc['add'](_0x35837e);const _0x62b70d=_0x35837e['children']['first'];if(_0x62b70d){const {listItem:_0x57bedd,highlightViews:_0x3e4fc0}=this['_createSearchResultActionButton'](_0xdc3da2,_0x31ec9f);this['_allSearchableItems']['push']({'item':_0x57bedd,'label':_0x62b70d['label']||'','highlightViews':_0x3e4fc0});}}}),_0x578bcc;}['_createActionButton'](_0x33caa3,_0x151dfc,_0x995110,_0x21aead){const _0x3b8161=new Pt(this['locale']);if(_0x995110&&_0x21aead){const _0x461b2e=new vt(this['locale']),_0x302fae=_0x461b2e['bindTemplate'],_0x377e85=new _0x378b1f();_0x377e85['text']=_0x151dfc['label'];const _0x42ae6b=new _0x378b1f();_0x42ae6b['text']=_0x995110;const _0x510e3f=new xt();_0x510e3f['content']=_0x21aead,_0x510e3f['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x59a9ff=new Nt(this['locale']);_0x59a9ff['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x3b6bea=new Nt(this['locale']);return _0x3b6bea['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x461b2e['set']({'label':_0x151dfc['label']+'\x20('+_0x995110+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x461b2e['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':[_0x377e85,_0x59a9ff,_0x510e3f,_0x42ae6b,_0x3b6bea],'on':{'mouseenter':_0x302fae['to'](()=>{this['_isSearchFocused']()||_0x461b2e['focus']();}),'click':_0x302fae['to'](()=>{_0x461b2e['fire']('execute');})}}),_0x461b2e['on']('execute',()=>{_0x33caa3['editing']['view']['focus'](),_0x33caa3['commands']['execute']('aiQuickAction',_0x151dfc);}),_0x3b8161['children']['add'](_0x461b2e),{'listItem':_0x3b8161,'highlightViews':[_0x377e85,_0x42ae6b]};}{const _0xe7fc6=new _0x153bc3(),_0x235e71=new vt(this['locale'],_0xe7fc6),_0x26ce6c=_0x235e71['bindTemplate'],_0x2fd4c4=_0x151dfc['icon']??_0x151dfc['parent']?.['icon'],_0x38600f=void 0x0!==_0x151dfc['icon'];return _0x235e71['set']({'label':_0x151dfc['label'],'withText':!0x0,'role':'menuitem','icon':_0x38600f?_0x2fd4c4??_0x50cf41:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x235e71['extendTemplate']({'on':{'mouseenter':_0x26ce6c['to'](()=>{this['_isSearchFocused']()||_0x235e71['focus']();})}}),_0x235e71['on']('execute',()=>{_0x33caa3['editing']['view']['focus'](),_0x33caa3['commands']['execute']('aiQuickAction',_0x151dfc);}),_0x3b8161['children']['add'](_0x235e71),{'listItem':_0x3b8161,'highlightViews':[_0xe7fc6]};}}['_createSearchResultActionButton'](_0x1d256b,_0x7bd995,_0x1cad6c,_0x5cf94e){return _0x1cad6c&&_0x5cf94e?this['_createSearchResultGroupedActionButton'](_0x1d256b,_0x7bd995,_0x1cad6c,_0x5cf94e):this['_createSearchResultIndividualActionButton'](_0x1d256b,_0x7bd995);}['_createSearchResultGroupedActionButton'](_0x1d1fd9,_0x57d975,_0x1af0b7,_0x3b8363){const _0x4f9200=new Pt(this['locale']),_0x1b9e83=new vt(this['locale']),_0x1b6c9b=_0x1b9e83['bindTemplate'],{view:_0x3556ce,highlightView:_0x354171}=this['_createSearchResultGroupRow'](_0x1af0b7,_0x3b8363),{view:_0x1712bc,highlightView:_0x581b4f}=this['_createSearchResultActionRow'](_0x57d975['label']),_0x1af02d=this['_createSearchResultContentView'](_0x3556ce,_0x1712bc);return _0x1b9e83['set']({'label':_0x57d975['label'],'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}),_0x1b9e83['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':[_0x1af02d],'on':{'mouseenter':_0x1b6c9b['to'](()=>{this['_isSearchFocused']()||_0x1b9e83['focus']();}),'click':_0x1b6c9b['to'](()=>{this['_handleSearchResultButtonClick'](_0x1b9e83);})}}),this['_setupActionButtonExecution'](_0x1b9e83,_0x1d1fd9,_0x57d975),_0x4f9200['children']['add'](_0x1b9e83),{'listItem':_0x4f9200,'highlightViews':[_0x354171,_0x581b4f]};}['_createSearchResultIndividualActionButton'](_0x35d300,_0x15781f){const _0x5779ab=new Pt(this['locale']),_0x539db4=new _0x153bc3(),_0x5cf601=new vt(this['locale'],_0x539db4),_0x4b5826=_0x5cf601['bindTemplate'];return _0x5cf601['set']({'label':_0x15781f['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x5cf601['extendTemplate']({'on':{'mouseenter':_0x4b5826['to'](()=>{this['_isSearchFocused']()||_0x5cf601['focus']();})}}),this['_setupActionButtonExecution'](_0x5cf601,_0x35d300,_0x15781f),_0x5779ab['children']['add'](_0x5cf601),{'listItem':_0x5779ab,'highlightViews':[_0x539db4]};}['_createSearchResultGroupRow'](_0x4f6bb8,_0x4b2981){const _0x47376e=new Nt(this['locale']),_0x1e7b1a=new xt();_0x1e7b1a['content']=_0x4b2981,_0x1e7b1a['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x149973=new _0x378b1f();return _0x149973['text']=_0x4f6bb8,_0x47376e['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x1e7b1a,_0x149973]}),{'view':_0x47376e,'highlightView':_0x149973};}['_createSearchResultActionRow'](_0x40dc91){const _0x594d97=new Nt(this['locale']),_0x5a02d5=new _0x378b1f();return _0x5a02d5['text']=_0x40dc91,_0x594d97['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x5a02d5]}),{'view':_0x594d97,'highlightView':_0x5a02d5};}['_createSearchResultContentView'](_0x3e0b80,_0x4323ad){const _0x472d1d=new Nt(this['locale']);return _0x472d1d['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x3e0b80,_0x4323ad]}),_0x472d1d;}['_setupActionButtonExecution'](_0x46bf4a,_0x596441,_0x429428){_0x46bf4a['on']('execute',()=>{_0x596441['editing']['view']['focus'](),_0x596441['commands']['execute']('aiQuickAction',_0x429428);});}['_createActionGroupButton'](_0x4a1dc4,_0x2e4c9f,_0x1bb0d7){const _0x5b3455=new Pt(this['locale']),_0x1ee6e0=new _0x153bc3(),_0x1749da=new DropdownMenuButtonWithHighlightView(this['locale'],_0x1ee6e0),_0x3195a6=_0x1749da['bindTemplate'],_0x35c36d=this['_getPanelKeystroke'](_0x1bb0d7),_0x3dbab6=this['_createGroupActionsList'](_0x4a1dc4,_0x2e4c9f['actions'],_0x1bb0d7);_0x1749da['set']({'label':_0x2e4c9f['label'],'withText':!0x0,'role':Pn,'icon':_0x2e4c9f['icon']??_0x50cf41,'isEnabled':_0x2e4c9f['actions']['some'](_0x1ed0d0=>_0x1ed0d0['isEnabled'])}),_0x1749da['extendTemplate']({'on':{'mouseenter':_0x3195a6['to'](()=>{this['_isSearchFocused']()||_0x1749da['focus']();})}});const _0x661e0a=new Xt(this['locale']);return _0x661e0a['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x3195a6['to'](_0xc11dcf=>{this['_handlePanelKeydown'](_0xc11dcf,_0x35c36d,_0x1749da,_0x661e0a);})}}),_0x1749da['bind']('isOn')['to'](_0x661e0a,'isVisible'),this['_bodyCollection']['add'](_0x661e0a),_0x661e0a['content']['add'](_0x3dbab6),this['_setupGroupMenuBehavior'](_0x1749da,_0x661e0a),_0x5b3455['children']['add'](_0x1749da),{'listItem':_0x5b3455,'highlightView':_0x1ee6e0};}['_createGroupActionsList'](_0x3ee9dc,_0x52fc45,_0x2ba45b){const _0x1e2eaf=new Dt(this['locale']);return _0x1e2eaf['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x52fc45['forEach'](_0x150819=>{const _0x1ea6b6=new Pt(this['locale']),_0x33103e=Dn({'editor':_0x3ee9dc,'action':_0x150819,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x1ea6b6['children']['add'](_0x33103e),_0x2ba45b['focusTracker']['add'](_0x33103e),_0x1e2eaf['items']['add'](_0x1ea6b6);}),_0x1e2eaf;}['_setupGroupMenuBehavior'](_0x15223b,_0x5e5b5f){const _0x135f6f=_0x15223b['bindTemplate'],_0x54a0cb=this['_getButtonKeystroke'](_0x15223b);_0x15223b['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x135f6f['to'](()=>{this['_showNestedPanel'](_0x5e5b5f,_0x15223b);}),'mouseleave':_0x135f6f['to'](_0x37282b=>{const _0x470b60=_0x37282b['relatedTarget'];this['_isMovingToNestedMenu'](_0x470b60,_0x5e5b5f)||this['_hideNestedPanel'](_0x5e5b5f);}),'keydown':_0x135f6f['to'](_0x2b344e=>{_0x2b344e['key']==_0x54a0cb&&(this['_showNestedPanel'](_0x5e5b5f,_0x15223b),_0x5e5b5f['content']['get'](0x0)['focus']());})}}),_0x5e5b5f['on']('render',()=>{_0x5e5b5f['element']?.['addEventListener']('mouseleave',_0x19f5be=>{const _0x3dcf3c=_0x19f5be['relatedTarget'];_0x15223b['element']?.['contains'](_0x3dcf3c)||this['_isMovingToNestedMenu'](_0x3dcf3c,_0x5e5b5f)||this['_hideNestedPanel'](_0x5e5b5f);});});}['_showNestedPanel'](_0x47f152,_0xa9a341){this['_openNestedPanels']['forEach'](_0x4d9150=>{_0x4d9150!==_0x47f152&&_0x4d9150['isVisible']&&_0x4d9150['hide']();}),_0x47f152['show'](),_0x47f152['pin']({'positions':[_0x17daa9['eastSouth']],'target':_0xa9a341['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x47f152);}['_hideNestedPanel'](_0x5d09c9){_0x5d09c9['hide'](),this['_openNestedPanels']['delete'](_0x5d09c9);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x2775ce=>_0x2775ce['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x5c5828,_0x47cf93){if(!_0x5c5828)return!0x1;if(_0x47cf93['element']?.['contains'](_0x5c5828))return!0x0;const _0x3c203c=_0x5c5828;return _0x3c203c['closest']&&(null!==_0x3c203c['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x3c203c['closest']('.ck-ai-quick-actions-group-list')||null!==_0x3c203c['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'](_0x1ffa08){return'rtl'===_0x1ffa08['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x16535c){return'rtl'===_0x16535c['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x483a8e,_0x4e7ac3,_0x169e9a,_0x118879){_0x483a8e['key']==_0x4e7ac3&&(_0x169e9a['focus'](),this['_hideNestedPanel'](_0x118879));}['_handleSearchResultButtonClick'](_0x55adca){_0x55adca['fire']('execute');}}function Hn(_0x465946){const {editor:_0x23594e,content:_0x1f4d58,buttonDefinition:_0x123852,bodyCollection:_0x149e06,hasSearch:_0x3c77c6=!0x1}=_0x465946;return()=>{const _0x3dce6b=_0x23594e['locale'],_0x12d86b=_0x23594e['commands']['get']('aiQuickAction'),_0x514b20=Gt(_0x3dce6b);_0x514b20['bind']('isEnabled')['to'](_0x12d86b),_0x514b20['buttonView']['set']({'icon':_0x123852['icon']??_0x50cf41,'label':_0x123852['label'],'tooltip':!0x0}),_0x514b20['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1b7120=new AIQuickActionsDropdownContentView(_0x23594e,_0x1f4d58,_0x514b20,_0x149e06,_0x3c77c6);return _0x514b20['panelView']['children']['add'](_0x1b7120),_0x3c77c6&&_0x514b20['on']('change:isOpen',(_0x2b83c3,_0x355f8b,_0x4aaa49)=>{if(_0x4aaa49){if(_0x23594e['plugins']['has']('AIEditing')){const _0x109e38=_0x23594e['plugins']['get'](AIEditing),_0x40d25d=_0x23594e['model']['document']['selection'],_0x9c7f48=Array['from'](_0x40d25d['getRanges']());_0x9c7f48['length']>0x0&&_0x109e38['showFakeVisualSelection']({'ranges':_0x9c7f48,'id':'quick-action','priority':0x14});}}else _0x23594e['plugins']['has']('AIEditing')&&_0x23594e['plugins']['get'](AIEditing)['hideFakeVisualSelection']('quick-action'),_0x1b7120['resetSearch']();}),_0x514b20;};}const Mn='<task>Explain\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x20plain,\x20simple\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).-\x20Avoid\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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20explanation,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant,\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Un='<task>Summarize\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x202–4\x20clear\x20sentences,\x20capturing\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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20summary,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Bn='<task>Extract\x20and\x20present\x20the\x20key\x20points\x20from\x20the\x20selected\x20part\x20of\x20the\x20document\x20as\x20a\x20concise\x20bulleted\x20list.</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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20key\x20points\x20list,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Gn=/* #__PURE__ -- @preserve */
28
- ((()=>({'chat':'AIChat','action':'AIActions'}))());class AIQuickActionsUI extends _0x53fc9f{static get['requires'](){return[_0x53d0e4,AIConnector];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x3242c3=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x3242c3),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x534573){return function(_0x4dcfbf){const _0x3ecc72=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x4dcfbf['uiLanguage']),_0x5bccb3=_0x3ecc72||'English',_0x11db27=[{'id':'ask-ai','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x4bc996},{'id':'chat-commands','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x4bc996,'actions':[{'id':'explain','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Mn['replace']('%0',_0x5bccb3),'type':'chat'},{'id':'summarize','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Un['replace']('%0',_0x5bccb3),'type':'chat'},{'id':'highlight-key-points','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Bn['replace']('%0',_0x5bccb3),'type':'chat'}]},{'id':'improve-writing','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x1f8e78},{'id':'continue','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x1c6602},{'id':'fix-grammar','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x1be793},{'id':'adjust-length','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x3c09f1,'actions':[{'id':'make-shorter','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x2ad21d,'actions':[{'id':'make-tone-casual','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x31db4a,'actions':[{'id':'translate-to-english','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':Hi(_0x4dcfbf,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x19a5b3,'actions':[]}];return _0x11db27;}(_0x534573);}async['_getDefaultAndCustomActions'](){const _0x75b230=AIQuickActionsUI['getDefaultQuickActions'](this['editor']['locale']),_0x5c7b80=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x183fb5,_0xec70b2=[];try{const _0x2e5545=new AIModels({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']});_0xec70b2=await _0x2e5545['getAll'](),_0x183fb5=(await _0x2e5545['getDefault']())?.['id'];}catch(_0x366dbe){const _0x486942=new at('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x366dbe});Ct(_0x486942['message']);}finally{const _0x1a85e7=_0x5c7b80['map'](_0x544811=>({..._0x544811,'type':'chat'===_0x544811['type']?'chat':'action','model':'chat'!==_0x544811['type']?_0x544811['model']||_0x183fb5:_0x544811['model'],'icon':void 0x0}));_0x75b230['find'](_0x10e856=>'other'===_0x10e856['id'])['actions']['push'](..._0x1a85e7),_0x75b230['forEach'](_0xbcf6db=>{if('actions'in _0xbcf6db)_0xbcf6db['actions']['forEach'](_0x25c8e2=>{if(_0x25c8e2['isEnabled']=!!_0xec70b2['find'](_0x792d18=>_0x792d18['id']===_0x25c8e2['model'])||void 0x0===_0x25c8e2['model'],!_0x25c8e2['isEnabled']){const _0x21a3f4=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x25c8e2['id'],'modelId':_0x25c8e2['model']});Ct(_0x21a3f4['message']);}});else{if(_0xbcf6db['isEnabled']=!!_0xec70b2['find'](_0x4d795c=>_0x4d795c['id']===_0xbcf6db['model'])||void 0x0===_0xbcf6db['model'],!_0xbcf6db['isEnabled']){const _0x9a5be1=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0xbcf6db['id'],'modelId':_0xbcf6db['model']});Ct(_0x9a5be1['message']);}}});}return _0x75b230;}['_initializeQuickActionsComponentsAndCommands'](){const _0x99f1c8=new Qt(this['editor']['locale']);_0x99f1c8['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x99f1c8),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x99f1c8);}['_initializeQuickActionsDropdown'](_0x57c1bf){const _0x3ae2a6=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Hn({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x50cf41,'label':Hi(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x57c1bf,'hasSearch':_0x3ae2a6}));}['_prepareQuickActionsDefinition'](_0xff84c3){this['_quickActionsDefinition']=_0xff84c3['map'](_0x39a7c9=>{if('actions'in _0x39a7c9){const _0x51a770=_0x39a7c9;return{..._0x51a770,'actions':_0x51a770['actions']['map'](_0x34a93f=>{const {actions:_0x8ffc79,..._0x2a7ae1}=_0x51a770;return{..._0x34a93f,'parent':_0x2a7ae1};})['filter'](_0x15fa6=>this['_shouldIncludeAction'](_0x15fa6))};}return _0x39a7c9;})['filter'](_0x3435b7=>'actions'in _0x3435b7?_0x3435b7['actions']['length']>0x0:this['_shouldIncludeAction'](_0x3435b7));}['_shouldIncludeAction'](_0x57ff9b){const _0x36ca95=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Gn[_0x57ff9b['type']])&&!_0x36ca95['includes'](_0x57ff9b['id'])&&!('chat'===_0x57ff9b['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x5e9364){this['_quickActionsDefinition']['forEach'](_0x1a1512=>{if('actions'in _0x1a1512){const _0xe75851=Hn({'editor':this['editor'],'content':_0x1a1512['actions'],'buttonDefinition':_0x1a1512,'bodyCollection':_0x5e9364});this['editor']['ui']['componentFactory']['add'](_0x1a1512['id'],_0xe75851),_0x1a1512['actions']['forEach'](_0x4d328e=>{const _0x4315fa=Dn({'editor':this['editor'],'action':_0x4d328e});this['editor']['ui']['componentFactory']['add'](_0x4d328e['id'],_0x4315fa);});}else{const _0x5595ff=Dn({'editor':this['editor'],'action':_0x1a1512,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x1a1512['id'],_0x5595ff);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x338fef=>{const _0x4bafa4=this['editor']['commands']['get']('aiQuickAction'),_0x4198d1=new Kt(_0x338fef),_0x5f1022=Hi(_0x338fef,'AI_QUICK_ACTIONS_HEADING');_0x4198d1['buttonView']['set']({'label':_0x5f1022,'icon':_0x50cf41});const _0x52e8f3=new $t(_0x338fef);return _0x52e8f3['set']({'ariaLabel':_0x5f1022,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x2ecd14=>{if('actions'in _0x2ecd14){const _0x5259aa=_0x2ecd14,_0x488252=new qt(_0x338fef,_0x4198d1),_0x3a44f3=new Kt(_0x338fef),_0x54c004=new $t(_0x338fef);_0x3a44f3['buttonView']['set']({'label':_0x5259aa['label'],'icon':_0x5259aa['icon']}),_0x5259aa['actions']['forEach'](_0x1641f4=>{const _0x564de8=new qt(_0x338fef,_0x3a44f3),_0x1119e3=new Wt(_0x338fef);_0x1119e3['set']({'label':_0x1641f4['label'],'icon':_0x1641f4['icon'],'role':'menuitem','isEnabled':_0x1641f4['isEnabled']}),_0x1119e3['on']('execute',()=>{this['_executeQuickAction'](_0x1641f4);}),_0x1119e3['delegate']('execute')['to'](_0x3a44f3),_0x564de8['children']['add'](_0x1119e3),_0x54c004['items']['add'](_0x564de8);}),_0x3a44f3['panelView']['children']['add'](_0x54c004),_0x488252['children']['add'](_0x3a44f3),_0x52e8f3['items']['add'](_0x488252);}else{const _0x41b524=_0x2ecd14,_0x23e09a=new qt(_0x338fef,_0x4198d1),_0x42fd13=new Wt(_0x338fef);_0x42fd13['set']({'label':_0x41b524['label'],'icon':_0x41b524['icon'],'role':'menuitem','isEnabled':_0x41b524['isEnabled']}),_0x42fd13['on']('execute',()=>{this['_executeQuickAction'](_0x41b524);}),_0x42fd13['delegate']('execute')['to'](_0x4198d1),_0x23e09a['children']['add'](_0x42fd13),_0x52e8f3['items']['add'](_0x23e09a);}}),(Object['values'](Gn)['some'](_0x30e757=>this['editor']['plugins']['has'](_0x30e757))?_0x4198d1['bind']('isEnabled')['to'](_0x4bafa4):_0x4198d1['set']({'isEnabled':!0x1}),_0x4198d1['panelView']['children']['add'](_0x52e8f3),_0x4198d1);});}['_executeQuickAction'](_0x4a4d8d){const _0xc07db2=this['editor'];_0xc07db2['editing']['view']['focus'](),_0xc07db2['commands']['execute']('aiQuickAction',_0x4a4d8d);const _0x5b71ea=_0xc07db2['ui']['view']['menuBarView'];_0x5b71ea&&_0x5b71ea['close']&&_0x5b71ea['close']();}}class AIQuickActionsCommand extends _0xae9ca1{['execute'](_0x325d11){switch(this['_expandSelectionIfCollapsed'](),_0x325d11['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x24ba17=Hi(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x24ba17});}this['_handleAIChatAction'](_0x325d11);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x13e691=Hi(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x13e691});}this['_handleAIActionsAction'](_0x325d11);}}async['_handleAIChatAction'](_0x1707d6){const _0x419bb3=this['editor']['plugins']['get']('AIChatController'),_0x392b22=this['editor']['plugins']['get']('AITabs')['view'];if(_0x392b22['isVisible']||(_0x392b22['isVisible']=!0x0),'chat'!==_0x392b22['activeTab']&&_0x392b22['activateTab']('chat'),'ask-ai'===_0x1707d6['id'])_0x419bb3['removeSelectionFromChatContext'](),_0x419bb3['addSelectionToChatContext'](),_0x419bb3['focusPromptInput']();else await _0x419bb3['startConversation']({'modelId':_0x1707d6['model']}),_0x419bb3['removeSelectionFromChatContext'](),_0x419bb3['addSelectionToChatContext'](),_0x419bb3['focusPromptInput'](),await _0x419bb3['sendMessage']({'message':_0x1707d6['prompt']||_0x1707d6['displayedPrompt']||_0x1707d6['label'],'attributes':{'quickActionData':{'id':_0x1707d6['id']},'displayedPrompt':_0x1707d6['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x139bc6=this['editor'],_0x4274d4=_0x139bc6['model']['document']['selection'];if(!_0x4274d4['isCollapsed'])return;const _0x109000=At(_0x4274d4['getSelectedBlocks']())||_0x139bc6['model']['schema']['getLimitElement'](_0x4274d4);_0x139bc6['model']['change'](_0x113028=>{_0x113028['setSelection'](_0x109000,'in');});}['_handleAIActionsActionLabel'](_0x3db04d){return _0x3db04d['parent']?.['label']&&'other'!==_0x3db04d['parent']?.['id']?_0x3db04d['parent']['label']+':\x20'+_0x3db04d['label']:_0x3db04d['label'];}async['_handleAIActionsAction'](_0x425b13){const _0x320e4d=this['editor']['plugins']['get']('AIActions'),_0x3ed4c7=_0x425b13['prompt']?{'userMessage':_0x425b13['prompt'],'model':_0x425b13['model']}:{'actionName':_0x425b13['actionName']||_0x425b13['id'],'args':_0x425b13['args']},_0x6e881a=this['_handleAIActionsActionLabel'](_0x425b13);await _0x320e4d['executeAction'](_0x3ed4c7,_0x6e881a,_0x425b13['icon']);}}class AIQuickActionsEditing extends _0x53fc9f{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1bea88=this['editor'],_0x464285=new AIQuickActionsCommand(this['editor']);if(_0x1bea88['commands']['add']('aiQuickAction',_0x464285),_0x1bea88['plugins']['has']('AIChat')){const _0x277152=this['editor']['plugins']['get']('AIChatController');_0x1bea88['model']['document']['selection']['on']('change:range',(_0xdd11a7,_0x13c887)=>{_0x13c887['directChange']&&_0x277152['removeSelectionFromChatContext']();});}}}class AIActionsReply extends AIReply{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x4bf4f7=this['documentContextContent']['children']['map'](_0x456826=>({'node':_0x456826,'id':$i(_0x456826,'data-id')})),_0x186fe9=this['parsedMergedContent']['children']['map'](_0x2222a6=>({'node':_0x2222a6,'id':$i(_0x2222a6,'data-id')||ot()})),_0x405a1a=_0x235976(_0x4bf4f7,_0x186fe9,{'comparator':(_0x52406f,_0x40f01c)=>_0x52406f['id']==_0x40f01c['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x405a1a['length']&&_0x405a1a[_0x405a1a['length']-0x1]['removed'];)_0x405a1a['pop']();}const _0x47e6fa=_0x405a1a['map'](_0x2c92a0=>{const _0x2ce5fc=_0x2c92a0['added']?'new':_0x2c92a0['removed']?'removed':'modified';return{'node':_0x2c92a0['value'][0x0]['node'],'type':_0x2ce5fc,'id':_0x2c92a0['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x47e6fa,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x159c02,_0x33cfa9){return _0x33cfa9;}}class AIActionsInteraction extends AIInteraction{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0xd3a84f){super(_0xd3a84f),this['content']=_0xd3a84f['content'],this['version']=_0xd3a84f['version'],this['actionName']=_0xd3a84f['actionName'],this['args']=_0xd3a84f['args'],this['userMessage']=_0xd3a84f['userMessage'],this['model']=_0xd3a84f['model'],this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}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':'text','content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x3c5374){const _0x2d83e3=new AIActionsReply({'locale':this['locale'],'documentContextContent':this['content'],..._0x3c5374});return this['replies']['push'](_0x2d83e3),_0x2d83e3['delegate'](...rs)['to'](this),this['fire']('replyCreated',_0x2d83e3),_0x2d83e3;}}class AIActionsBalloonToolbarView extends kt{constructor(_0x4633cc,_0x1b07a9=!0x0,_0x2ce379=!0x0){super(_0x4633cc),this['set']('isEnabled',!0x1),_0x1b07a9&&(this['applyButton']=this['_createButton'](Hi(_0x4633cc,'AI_BALLOON_APPLY_BUTTON'),Mi),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x2ce379&&(this['suggestButton']=this['_createButton'](Hi(_0x4633cc,'AI_BALLOON_SUGGEST_BUTTON'),_0x1b07a9?Ui:Mi),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x1b07a9,'showSuggestButton':_0x2ce379}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x24ad58,showSuggestButton:_0x15e219}){this['applyButton']&&(this['applyButton']['isVisible']=_0x24ad58),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x15e219);}['_createButton'](_0x23e9ae,_0x49becd){const _0x409c77=new vt(this['locale']);return _0x409c77['set']({'label':_0x23e9ae,'class':_0x49becd,'isVisible':!0x0,'withText':!0x0}),_0x409c77;}}class AIActionsBalloonDisclaimerView extends Nt{constructor(_0x474184){super(_0x474184),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':Hi(_0x474184,'AI_DISCLAIMER_TEXT')}]}]});}}class AISuggestionLoaderView extends Nt{constructor(_0xdb30c8){super(_0xdb30c8),this['set']('isVisible',!0x0);const _0x4bc6b7=new AISpinnerView('small');_0x4bc6b7['isVisible']=!0x0;const _0x424dd7=new Nt(this['locale']);_0x424dd7['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[Hi(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x23ecbb=>!_0x23ecbb)]},'children':[_0x4bc6b7,_0x424dd7]});}}class AIActionsBalloonView extends AIBalloonView{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x394ae5,_0x5be482){super(_0x394ae5),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x5be482,this['_focusTracker']=new _t(),this['_keystrokes']=new It(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x3127bc(),this['_addContentWrapper'](_0x5be482),this['_addDisclaimerView'](),this['_addToolbar'](_0x5be482),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'](_0x5be482);});}['render'](){super['render']();for(const _0x3736e8 of this['_focusables'])this['_focusTracker']['add'](_0x3736e8['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x1080f1){-0x1===_0x1080f1?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x2281c8){this['_isLoading']=_0x2281c8;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x46e036){super['showError'](_0x46e036),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x5727e8){super['showBlockingError'](_0x5727e8),this['setErrorState']();}['addMiniToolbarItem'](_0x5e356e){this['_miniToolbarView']['items']['has'](_0x5e356e)||this['_miniToolbarView']['items']['add'](_0x5e356e);}['removeMiniToolbarItem'](_0x365046){this['_miniToolbarView']['items']['has'](_0x365046)&&this['_miniToolbarView']['items']['remove'](_0x365046);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x393c47,showSuggestButton:_0x193328}){_0x393c47=_0x393c47&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x193328=_0x193328&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x393c47,'showSuggestButton':_0x193328});}async['updateContent'](_0x2c79ae){await this['_streamableContentView']['update'](_0x2c79ae);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x32f473){this['_contentWrapper']=new Nt(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'](_0x32f473['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new AIActionsBalloonDisclaimerView(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x3eb7ce,showSuggestButton:_0x259ba9}){this['_toolbarView']=new AIActionsBalloonToolbarView(this['locale'],_0x3eb7ce,_0x259ba9),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',(_0x5c59bd,_0x255bc5,_0x25e113)=>!(_0x5c59bd||_0x255bc5||_0x25e113)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x3eb7ce,'showSuggestButton':_0x259ba9}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x57ac77){return this['_miniToolbarView']=new AIMiniToolbarView(this['locale'],_0x57ac77),this['_miniToolbarView']['delegate'](...Cs)['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',(_0x488bec,_0x18185b)=>!(_0x488bec||_0x18185b)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new AISuggestionLoaderView(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new AISuggestionStreamableContentView(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x421de3=new vt(this['locale']),_0x232212=new vt(this['locale']),_0x20ad5=new AIActionsBalloonNavigationCounterView(this['locale']),_0x46f7e9=new vt(this['locale']);_0x421de3['set']({'icon':tt,'label':Hi(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+Bi}),_0x232212['set']({'icon':_0x3d9913,'tooltip':Hi(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+Bi}),_0x46f7e9['set']({'icon':et,'tooltip':Hi(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+Bi}),_0x421de3['bind']('isEnabled')['to'](this,'isBusy',_0x48fd79=>!_0x48fd79),_0x421de3['on']('execute',()=>{this['fire']('tryAgain');}),_0x232212['bind']('isEnabled')['to'](this,'isBusy',_0x2baed6=>!_0x2baed6),_0x232212['on']('execute',()=>{this['fire']('showPrevious');}),_0x46f7e9['bind']('isEnabled')['to'](this,'isBusy',_0x14bf3d=>!_0x14bf3d),_0x46f7e9['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x232212,this['_navigationCounter']=_0x20ad5,this['_navigationNextButton']=_0x46f7e9,this['_navigationTryAgainButton']=_0x421de3;}['updateMiniToolbarButtons'](_0x5b6de8,_0x4dbc1c){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x2b46c1=_0x5b6de8>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x2b46c1){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x5753b7=_0x5b6de8-_0x4dbc1c;this['_navigationCounter']['setInteractionCount'](_0x5753b7+'/'+_0x5b6de8),this['_navigationPreviousButton']['isEnabled']=_0x4dbc1c<_0x5b6de8-0x1,this['_navigationNextButton']['isEnabled']=_0x4dbc1c>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'](_0x5c903b){this['_isLoading']=_0x5c903b;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x3b4d69=this['_getScrollableElement']();_0x3b4d69&&!this['_scrollManager']&&(this['_scrollManager']=new ScrollManager(_0x3b4d69));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class AIActionsBalloonNavigationCounterView extends Nt{constructor(_0x4535d5){super(_0x4535d5);const _0x19d00a=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x19d00a['to']('interactionCount')}]});}['setInteractionCount'](_0x50d4af){this['set']('interactionCount',_0x50d4af);}}class AIActions extends _0x53fc9f{static get['requires'](){return[AIConnector,Bt,AIEditing,AIBalloon,_0x490f88];}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(_0x1457c5){super(_0x1457c5),this['_bodyCollection']=new Qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new PromiseQueue();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x3941be,_0x171822,_0x30b787){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x26ae82,anchorData:_0x4082d9,root:_0x472aed}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x3941be,_0x26ae82,_0x4082d9,_0x472aed,_0x171822,_0x30b787);}}const {modelFragment:_0x2be86b,anchorData:_0x1d3a0f,root:_0x4b35db}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x3941be,_0x2be86b,_0x1d3a0f,_0x4b35db,_0x171822,_0x30b787);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x285912=this['editor']['plugins']['has']('TrackChanges');let _0x1718f7=this['editor']['config']['get']('ai.availableReplyActions')||[...bs];_0x285912||(_0x1718f7=_0x1718f7['filter'](_0x158c24=>'insertSuggestion'!=_0x158c24));const _0x3edef6=this['editor']['commands']['get']('trackChanges'),_0x1d6a77=new AIActionsBalloonView(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x285912,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x1718f7});return _0x1d6a77['bind']('isBusy')['to'](this),_0x3edef6&&_0x1d6a77['bind']('isTrackChangesOn')['to'](_0x3edef6,'value'),_0x1d6a77['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x1d6a77['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x1d6a77['on']('showNext',()=>{this['_navigateToNext']();}),_0x1d6a77;}['_getExecuteDataRegular'](){const _0x22cc3f=this['editor']['model']['document']['selection'],_0x4fb043=_0x22cc3f['getFirstRange']()['start']['root'];if(_0x22cc3f['isCollapsed']){const _0xd1090f=At(_0x22cc3f['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x22cc3f);this['editor']['model']['change'](_0x5cd2cd=>{_0x5cd2cd['setSelection'](_0xd1090f,'in');});}const _0x2b8ebc=_0x22cc3f['getFirstRange'](),_0x431bff=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x22cc3f),_0x2b8ebc['start'],_0x2b8ebc['end']);this['_copyMarkersToFragment'](_0x431bff,_0x22cc3f,{'isTableSelection':!0x1});const _0x404281=_0x22cc3f['getFirstRange']()['start'],_0x22049b=new Map();let _0x34e93a=_0x431bff;for(let _0x4ffa4b=0x0;_0x4ffa4b<_0x404281['path']['length'];_0x4ffa4b++)_0x22049b['set'](_0x34e93a,_0x404281['path'][_0x4ffa4b]),_0x34e93a=_0x34e93a['getChild'](0x0);return{'modelFragment':_0x431bff,'anchorData':_0x22049b,'root':_0x4fb043};}['_getExecuteDataInTable'](){const _0x260463=this['editor']['model']['document']['selection'],_0x4b6122=this['editor']['plugins']['get']('TableSelection'),_0x2be3ae=_0x260463['getFirstRange']()['start']['root'],_0x141cbd=_0x4b6122['getSelectionAsFragment'](),_0x2d3f27=_0x260463['getFirstRange']()['start']['parent']['parent'],_0x24f42=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x2d3f27),this['editor']['model']['createPositionAfter'](_0x2d3f27)),_0x16f194=this['_wrapWithCommonAncestors'](_0x141cbd,_0x24f42['start'],_0x24f42['end']);this['_copyMarkersToFragment'](_0x16f194,_0x260463,{'isTableSelection':!0x0});const _0x249509=_0x260463['getFirstRange']()['start'],_0x37d9f9=new Map();let _0x4b4583=_0x16f194;for(let _0x429efd=0x0;_0x429efd<_0x249509['path']['length'];_0x429efd++)if(_0x37d9f9['set'](_0x4b4583,_0x249509['path'][_0x429efd]),_0x429efd<_0x249509['path']['length']-0x1)_0x4b4583=_0x4b4583['getChild'](0x0);else{let _0x343c69=_0x4b4583['nextSibling'];for(;_0x343c69;)_0x37d9f9['set'](_0x343c69,_0x249509['path'][_0x429efd]),_0x343c69=_0x343c69['nextSibling'];}return{'modelFragment':_0x16f194,'anchorData':_0x37d9f9,'root':_0x2be3ae};}async['_executeAction'](_0xe2fffb,_0x240ac5,_0x29abab,_0x5d5596,_0x41c8f0,_0x103591){const _0x17b88f=this['editor']['plugins']['get'](AIEditing),_0x4270e7=this['editor']['plugins']['get'](AIBalloon),_0x47eaf2=this['editor']['model']['document']['selection'],_0xae7f39=await _0x17b88f['modelToDataWithIds'](_0x240ac5),_0x1394f0=this['editor']['model']['document']['version'],_0x4b6110=[..._0x47eaf2['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x4270e7['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x41c8f0,'icon':_0x103591||_0x50cf41,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x4b6110,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x4270e7),this['_interactionParams']={'action':_0xe2fffb,'content':_0xae7f39,'version':_0x1394f0,'aiBalloon':_0x4270e7,'modelFragment':_0x240ac5,'anchorData':_0x29abab,'root':_0x5d5596},this['_setupApplyListeners'](),this['listenTo'](_0x4270e7,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x4270e7,'dialogClosed',(_0x50cd03,{id:_0x191cd5})=>{if('aiActionsBalloon'===_0x191cd5){for(const _0x26d502 of this['_interactions']){if(0x0===_0x26d502['replies']['length']||_0x26d502['stoppedExplicitly'])continue;const _0xb2992e=_0x26d502['replies'][_0x26d502['replies']['length']-0x1],_0x3dadf7=_0xb2992e['changeGroups'][0x0];_0x3dadf7&&'pending'===_0x3dadf7['state']&&_0xb2992e['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x4270e7);}}),this['_createInteraction'](_0xae7f39,_0x1394f0,_0x4270e7,_0xe2fffb);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x58b63a,anchorData:_0x2dc970,root:_0x1590f0}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x58b63a,_0x2dc970,_0x1590f0,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x58b63a,_0x2dc970,_0x1590f0,!0x0);});}['_wrapWithCommonAncestors'](_0x1d4a01,_0x38f8ea,_0x88aec){const _0x2227d1=this['editor']['model']['createRange'](_0x38f8ea,_0x88aec)['getCommonAncestor'](),_0x174da1=_0x2227d1['is']('documentFragment')?[]:_0x2227d1['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x174da1['length']){const _0x40a387=_0x174da1['map'](_0x2f01ee=>_0x2f01ee['_clone'](!0x1));for(let _0x28fce9=0x1;_0x28fce9<_0x40a387['length'];_0x28fce9++)_0x40a387[_0x28fce9-0x1]['_appendChild'](_0x40a387[_0x28fce9]);return _0x40a387[_0x40a387['length']-0x1]['_appendChild'](_0x1d4a01),new _0xd8720b(_0x40a387[0x0]);}return _0x1d4a01;}['_copyMarkersToFragment'](_0x59ca0e,_0x439989,_0x3d7e26={'isTableSelection':!0x1}){const _0x4524e7=this['editor']['model'],_0x11ebf6=Array['from'](_0x439989['getRanges']()),_0x1b4ced=_0x439989['getFirstRange']()['start'];for(const _0xee3441 of _0x4524e7['markers']){if(_0xee3441['name']['startsWith'](As)||!_0xee3441['affectsData'])continue;const _0x1a355a=_0xee3441['getRange']();if(!_0x11ebf6['some'](_0xe7d64e=>_0xe7d64e['containsRange'](_0x1a355a,!0x0)))continue;const _0x5e7483=this['_regularCalculateMarkerPath'](_0x1a355a['start'],_0x1b4ced,_0x3d7e26['isTableSelection']),_0xda2d58=this['_regularCalculateMarkerPath'](_0x1a355a['end'],_0x1b4ced,_0x3d7e26['isTableSelection']),_0x342cb4=_0x4524e7['createPositionFromPath'](_0x59ca0e,_0x5e7483),_0x4122d0=_0x4524e7['createPositionFromPath'](_0x59ca0e,_0xda2d58);if(!_0x342cb4['isEqual'](_0x4122d0)){const _0x333ee7=_0x4524e7['createRange'](_0x342cb4,_0x4122d0);_0x59ca0e['markers']['set'](_0xee3441['name'],_0x333ee7);}}}['_regularCalculateMarkerPath'](_0x5befa9,_0xfd8398,_0x58cda9=!0x1){const _0x2b7f3d=[..._0x5befa9['path']['slice']()];for(let _0x7e0bbd=0x0;_0x7e0bbd<Math['max'](_0xfd8398['path']['length'],_0x5befa9['path']['length']);_0x7e0bbd++){const _0x4c9f41=_0xfd8398['path'][_0x7e0bbd]||0x0,_0x4904a9=(_0x5befa9['path'][_0x7e0bbd]||0x0)-_0x4c9f41;if(_0x2b7f3d[_0x7e0bbd]=_0x4904a9,0x0!==_0x4904a9&&!_0x58cda9)break;}return _0x2b7f3d;}async['_createInteraction'](_0x4c8643,_0x283a60,_0x40f4d1,_0xef5d02){const _0x2bfd07=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0xef5d02,'content':_0x4c8643,'version':_0x283a60,'aiBalloon':_0x40f4d1,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':this['editor']['model']['document']['selection']['getFirstRange']()['start']['root']});const _0x288ab3=new AIActionsInteraction({'connector':this['_aiConnector'],'locale':_0x2bfd07['locale'],'content':_0x4c8643,'version':_0x283a60,..._0xef5d02});this['_interactions']['push'](_0x288ab3);const _0x2cd550=(_0x13b8d2,_0x3449f5=!0x1,_0x2401dd='streaming')=>this['_promiseQueue']['enqueue'](async _0x3f352e=>{try{const _0x368c08=Zi({'editor':_0x2bfd07,'changeGroups':_0x13b8d2['changeGroups'],'documentContextContent':_0x13b8d2['documentContextContent'],'showDiff':_0x3449f5,'trimUnchanged':!0x1});_0x368c08['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x368c08[0x0],'renderingStrategy':_0x2401dd,'abortSignal':_0x3f352e});}catch(_0x2d957b){if(this['_isAbortError'](_0x2d957b))return;throw _0x2d957b;}});_0x288ab3['on']('replyCreated',(_0x276738,_0x3b1c13)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x2cd550(_0x3b1c13)['catch'](_0x2f0250=>{this['_isAbortError'](_0x2f0250)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x2f0250),this['_setErrorState'](_0x288ab3));});}),_0x288ab3['on']('replyContentUpdated',(_0x1fcb66,_0x36d9b2)=>{_0x2cd550(_0x36d9b2)['catch'](_0x149da9=>{this['_isAbortError'](_0x149da9)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x149da9),this['_setErrorState'](_0x288ab3));});}),_0x288ab3['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x45f40a){this['_isAbortError'](_0x45f40a)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x45f40a),this['_setErrorState'](_0x288ab3));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x1b1970,{showDiff:_0xdfef22})=>{try{this['_balloonShowDiff']=_0xdfef22;const _0xf300e8=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0xf300e8&&await _0x2cd550(_0xf300e8,_0xdfef22,'static');}catch(_0x6970bb){this['_isAbortError'](_0x6970bb)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x6970bb),this['_setErrorState'](_0x288ab3));}}),_0x288ab3['on']('replyChangeGroupStateUpdated',()=>{const _0x2541a8={'positiveCount':_0x288ab3['replies']['reduce']((_0x4ada1e,_0xd64df3)=>_0x4ada1e+_0xd64df3['changeGroups']['filter'](_0x419049=>'accepted'===_0x419049['state'])['length'],0x0),'totalCount':_0x288ab3['replies']['reduce']((_0x3376c5,_0x1b0ab9)=>_0x3376c5+_0x1b0ab9['changeGroups']['length'],0x0)},_0x52ecd8=_0x288ab3['actionCallId'],_0x5f23ae=_0x288ab3['actionName'];_0x5f23ae?this['_aiConnector']['upsertAIActionRating'](_0x5f23ae,_0x52ecd8,_0x2541a8):this['_aiConnector']['upsertCustomAIActionRating'](_0x52ecd8,_0x2541a8);}),this['_setLoadingState']();try{const _0x2c2503=await _0x288ab3['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x2c2503;}catch(_0xacc69c){if(this['_isAbortError'](_0xacc69c))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x288ab3);}}['_applyChanges'](_0x53f885,_0x26dcfd,_0x406c37,_0x557d0d){const _0x445106=this['editor'];if(_0x557d0d&&!_0x445106['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x199bdc=this['editor']['plugins']['get'](_0x490f88),_0x192913=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x192913||!_0x192913['replies']['length'])return;const _0xf342c8=_0x192913['replies'][_0x192913['replies']['length']-0x1],_0x395221=_0xf342c8['changeGroups'];_0xf342c8['setChangeGroupState'](0x0,'accepted');let _0x2dac03=_s({'editor':_0x445106,'reply':_0xf342c8,'interaction':_0x192913,'groups':_0x395221,'transform':!0x1,'documentCompare':_0x199bdc,'documentCompareOptions':{'anchor':_0x445106['model']['createPositionAt'](_0x53f885,0x0),'markDeletions':_0x557d0d}});_0x2dac03=this['_filterOperationsOutsideRange'](_0x2dac03,_0x26dcfd);for(const _0xf547f4 of _0x2dac03)this['_anchorOperation'](_0x26dcfd,_0xf547f4,_0x406c37);const _0x221fb0=_0x192913['getDocumentContext']()['version'],_0x438995=_0x445106['model']['document']['history']['getOperations'](_0x221fb0),_0x487017={'document':_0x445106['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x3effdc=_0x2d44f8(_0x2dac03,_0x438995,_0x487017)['operationsA'];_0x445106['model']['change'](_0x3d3899=>{if(_0x3d3899['setSelection'](_0x445106['model']['document']['selection']['focus']),_0x557d0d)_0x445106['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3effdc);else{for(const _0x9f72d6 of _0x3effdc)_0x9f72d6['baseVersion']=_0x445106['model']['document']['version'],Is(_0x445106,_0x9f72d6),_0x3d3899['batch']['addOperation'](_0x9f72d6),_0x445106['model']['applyOperation'](_0x9f72d6);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x445dd3,_0x340248){return _0x445dd3['filter'](_0xe7635f=>{if('rename'==_0xe7635f['type']){const _0xc0d017=_0xe7635f['position']['nodeAfter'];return!_0x340248['has'](_0xc0d017);}if(_0xe7635f['type']['indexOf']('Attribute')>-0x1){const _0x2e4cc6=_0xe7635f['range']['start']['nodeAfter'];return!_0x340248['has'](_0x2e4cc6);}return!0x0;});}['_anchorOperation'](_0x532782,_0x358182,_0x44dc6c){const _0x1079a9=_0x358182['clone']();for(const _0x380389 in _0x358182){const _0x2ac24c=_0x358182[_0x380389];_0x2ac24c instanceof _0x5d6ed6?_0x358182[_0x380389]=new _0x5d6ed6(_0x1107af(_0x2ac24c['start']),_0x1107af(_0x2ac24c['end'])):_0x2ac24c instanceof _0x554d31&&(_0x358182[_0x380389]=_0x1107af(_0x2ac24c));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x1079a9['type'])){if(_0x1079a9['isDocumentOperation']=!0x1,_0x1079a9['baseVersion']=null,'remove'==_0x1079a9['type']){const _0x4dac68=_0x1079a9['sourcePosition'],_0x3b273d=_0x1079a9['howMany'];new _0x42f63b(_0x4dac68,_0x3b273d)['_execute']();}else _0x1079a9['_execute']();}function _0x1107af(_0x5e0ff2){if('$graveyard'==_0x5e0ff2['root']['rootName'])return _0x5e0ff2;const _0x47bb7f=[];let _0x12a896=_0x5e0ff2['root'];for(let _0x4d3484=0x0;_0x4d3484<_0x5e0ff2['path']['length'];_0x4d3484++){const _0x1691d9=_0x532782['get'](_0x12a896)||0x0;_0x47bb7f[_0x4d3484]=_0x5e0ff2['path'][_0x4d3484]+_0x1691d9,_0x12a896=_0x12a896['getChildAtOffset'](_0x5e0ff2['path'][_0x4d3484]);}return new _0x554d31(_0x44dc6c,_0x47bb7f,_0x5e0ff2['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0xa3895a,content:_0x5d98ea,version:_0x18eb79,aiBalloon:_0x201171}=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'](_0x5d98ea,_0x18eb79,_0x201171,_0xa3895a)['catch'](_0x2a0c44=>{this['_isAbortError'](_0x2a0c44)||console['error']('Error\x20refreshing\x20interaction:',_0x2a0c44);});}['_isAbortError'](_0x4a6acc){return!!_0x4a6acc['message']&&_0x4a6acc['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 _0x4ba288=this['_interactions']['length'];this['_currentInteractionIndex']<_0x4ba288-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x49518e){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x49518e;const _0x2b3759=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x2b3759)return;if(_0x2b3759['hasError'])return this['_setErrorState'](_0x2b3759),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x2b3759['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x908678=_0x2b3759['replies'][_0x2b3759['replies']['length']-0x1];if(_0x908678){const _0x42e4ee=this['editor'];try{const _0x59d711=Zi({'editor':_0x42e4ee,'changeGroups':_0x908678['changeGroups'],'documentContextContent':_0x908678['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x303319=>setTimeout(_0x303319,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x59d711[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x8966bb){this['_isAbortError'](_0x8966bb)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x8966bb);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x3468db){const _0x446691=Hi(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x446691),_0x3468db['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 AIQuickActions extends _0x53fc9f{static get['requires'](){return[AIQuickActionsUI,AIQuickActionsEditing,AIActions];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x52d141){super(_0x52d141),_0x52d141['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class AIReviewCoreReviewCheckListItemResultsView extends Nt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x86dcac,_0xdffe25){super(_0x86dcac),this['id']=_0xdffe25,this['set']('status','pending'),this['set']('changeId',_0xdffe25),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',(_0x2aed59,_0x419668)=>{_0x419668&&_0x419668['target']&&'A'===_0x419668['target']['tagName']&&_0x419668['preventDefault'](),this['fire']('activateChange',{'id':_0xdffe25,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0xdffe25,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0xdffe25,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x3c2e6a=new Nt(this['locale']);return _0x3c2e6a['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',_0x27db1e=>!_0x27db1e)]}}),_0x3c2e6a;}['_createAcceptButtonView'](){const _0x3be01a=new vt(this['locale']);return _0x3be01a['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x3be01a['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x149047=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x149047['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x3b4be7=>'pending'!==_0x3b4be7&&'accepted'!==_0x3b4be7),this['bindTemplate']['if']('status',Ui,_0xcdd623=>'pending'===_0xcdd623),this['bindTemplate']['if']('status',Bi,_0x42d7d3=>'pending'!==_0x42d7d3),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x550fd3=>'accepted'===_0x550fd3)]}}),this['on']('change:status',(_0x5892e5,_0x15067b,_0x4b95f4)=>{_0x3be01a['isEnabled']='pending'===_0x4b95f4,'accepted'===_0x4b95f4&&(_0x3be01a['label']=Hi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x3be01a['icon']=_0x489882);}),_0x3be01a;}['_createDismissButtonView'](){const _0x121936=new vt(this['locale']);return _0x121936['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x121936['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xb3b13=>{this['fire']('dismissChange',{'id':this['changeId']}),_0xb3b13['stopPropagation']();})},'attributes':{'class':[Bi,this['bindTemplate']['if']('status','ck-hidden',_0x2bce66=>'pending'!==_0x2bce66&&'rejected'!==_0x2bce66),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x1923b6=>'pending'===_0x1923b6),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x4f43be=>'rejected'===_0x4f43be)]}}),this['on']('change:status',(_0x4a4ef6,_0x49db05,_0x2940e2)=>{_0x121936['isEnabled']='pending'===_0x2940e2,'rejected'===_0x2940e2&&(_0x121936['label']=Hi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x121936['icon']=_0x5777e9);}),_0x121936;}['_createInfoButtonView'](){const _0x15625d=new vt(this['locale']);return _0x15625d['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x467df0,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':Bi+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x15625d['bind']('isOn')['to'](this,'isInfoToggleOn',_0x4f2b1a=>_0x4f2b1a),_0x15625d['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x15625d;}['_createOutdatedButtonView'](){const _0x29d590=new vt(this['locale']);return _0x29d590['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x29d590['extendTemplate']({'attributes':{'class':[Bi,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x406bbe=>'outdated'!==_0x406bbe)],'disabled':'disabled'}}),_0x29d590;}}class AIReviewCoreBalloonSuggestionItemView extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x3398d7,_0x434f0c){super(_0x3398d7),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']()),_0x434f0c['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x1fccff){this['resultItemView']['changeId']=_0x1fccff['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x1fccff['contentDiffed'];}['showBalloon'](_0x2425c7,_0x40d0bc,_0xbd1430,_0x5729cc,_0x42642d,_0x35b411){const _0x3288d2=_0x40d0bc();if(!_0x3288d2)return;this['updateContent'](_0x2425c7),this['show']();const _0x3940c3=Array['from'](_0x3288d2['getClientRects']())['reverse'](),_0x45b19c=this['_getPointedRectIndexFromEvent'](_0xbd1430,_0x3940c3),_0xb1a969=_0x3940c3[_0x45b19c??0x0];'click'===_0x5729cc?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x40d0bc(),_0x45b19c,_0x2425c7['id'],_0x42642d,_0x35b411)||_0xb1a969})):'hover'===_0x5729cc&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x40d0bc(),_0x45b19c,_0x2425c7['id'])||_0xb1a969}));}['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'](){zt({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x85ac6d=[this['element']];return this['_pinnedTargetElement']&&_0x85ac6d['push'](this['_pinnedTargetElement']),_0x85ac6d;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x44b073=new Nt();return this['resultItemView']=new AIReviewCoreReviewCheckListItemResultsView(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x44b073['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']]}]}),_0x44b073;}['_getBestRectPositionOnClick'](_0x37b102,_0x24894f,_0x957aab,_0x1619cf,_0x2db323){if(!_0x37b102)return null;const _0x5887db=this['position']['replace']('arrow_',''),_0x4eb100=Array['from'](_0x37b102['getClientRects']());let _0x557d98,_0x96dd59=_0x4eb100['reverse']();return void 0x0!==_0x24894f&&this['_isPinnedRectVisible'](_0x96dd59[_0x24894f],_0x1619cf,_0x2db323)?(_0x557d98=_0x96dd59[_0x24894f],this['_pinnedRectIndex']=_0x24894f):this['_isPinnedRectVisible'](_0x96dd59[0x0],_0x1619cf,_0x2db323)&&void 0x0===_0x24894f?_0x557d98=_0x96dd59[0x0]:(_0x96dd59='s'==_0x5887db[0x0]?[..._0x4eb100]['reverse']():_0x4eb100,_0x96dd59['forEach'](_0x7c91c2=>{this['_isPinnedRectVisible'](_0x7c91c2,_0x1619cf,_0x2db323)&&(_0x557d98=_0x7c91c2);})),this['_pinnedTargetChangeId']=_0x957aab,this['_pinnedTargetElement']=_0x37b102,_0x557d98||_0x37b102['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x4c2600,_0x287639,_0x5c8c5e){if(!_0x4c2600)return null;const _0x508d5d=Array['from'](_0x4c2600['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x287639&&this['_pinnedTargetChangeId']!==_0x5c8c5e)return this['_pinnedRectIndex']=_0x287639,this['_pinnedTargetElement']=_0x4c2600,this['_pinnedTargetChangeId']=_0x5c8c5e,_0x508d5d[_0x287639];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x5c8c5e){if(_0x4c2600!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x508d5d[this['_pinnedRectIndex']];}return void 0x0!==_0x287639&&this['_pinnedTargetChangeId']!==_0x5c8c5e?(this['_pinnedRectIndex']=_0x287639,this['_pinnedTargetElement']=_0x4c2600,this['_pinnedTargetChangeId']=_0x5c8c5e,_0x508d5d[_0x287639]):_0x4c2600['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x502b3b,_0x3b2b25){if(_0x502b3b)for(let _0x1d6695=0x0;_0x1d6695<_0x3b2b25['length'];_0x1d6695++){const _0x423944=_0x3b2b25[_0x1d6695];if(_0x502b3b['clientX']>=_0x423944['left']-0x3&&_0x502b3b['clientX']<=_0x423944['right']+0x3&&_0x502b3b['clientY']>=_0x423944['top']-0x3&&_0x502b3b['clientY']<=_0x423944['bottom']+0x3)return _0x1d6695;}}['_isPinnedRectVisible'](_0xf40ac2,_0x2a86da,_0x17559a){const _0x5a386c=new ut(_0xf40ac2),_0x2b6034=_0x2a86da||document['documentElement'],_0x24d5cf=_0x5a386c['getIntersection'](bt(_0x17559a)),_0x1ac5b1=new ut(_0x2b6034)['getIntersection'](_0x5a386c);return!!(_0x24d5cf&&_0x1ac5b1&&_0x5a386c['width']>0x0);}}const Fn=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class AIReviewCoreUI extends _0x3cc0e4{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[AITabs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x52115c){super(_0x52115c),this['_bodyCollection']=new Qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...Fn)['to'](this),this['_balloonSuggestionView']=new AIReviewCoreBalloonSuggestionItemView(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x3f625e=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x3f625e);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x32add0){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x5d858a=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x32add0,_0x5d858a);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x1a97b4){_0x1a97b4&&('error-general'!==_0x1a97b4['status']?'error-chunk'!==_0x1a97b4['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x50462b){this['_mainView']['addCheckRunResult'](_0x50462b);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x467b62){this['_mainView']['showGeneralReviewCoreErrorView'](_0x467b62??Hi(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x19902d,_0x58dbc1){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x19902d,_0x58dbc1);}['setActiveStateInResults'](_0x2cc071){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x1a0327=>{_0x1a0327['id']===_0x2cc071&&_0x1a0327['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x15ef89=>_0x15ef89['setItemAsInactive']());}['updateChangeState'](_0x5a1acd,_0x480b57){'accepted'===_0x480b57||'rejected'===_0x480b57||'outdated'===_0x480b57?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x5a1acd,_0x480b57):this['_mainView']['reviewCheckResultsView']['showResult'](_0x5a1acd,_0x480b57);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x531686,_0x23be43,_0x490116,_0x1aa805,_0x14096b,_0x3262c5){this['_balloonSuggestionView']['showBalloon'](_0x531686,_0x23be43,_0x490116,_0x1aa805,_0x14096b,_0x3262c5);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x221a23){const _0x2add1d=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x16f6f1=>_0x16f6f1['id']===_0x221a23);return _0x2add1d?_0x2add1d['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class AIReviewCoreGeneralErrorView extends Nt{constructor(_0x40ac09){super(_0x40ac09),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x2b91d2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x2b91d2['if']('isVisible','ck-hidden',_0x3adcfa=>!_0x3adcfa)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x2b91d2['to']('errorMessage')}]}]});}}class AIReviewCoreView extends Nt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0xce1dcc,_0x296b4c){super(_0xce1dcc),this['reviewCoreHeader']=_0x296b4c['header'],this['generalErrorView']=new AIReviewCoreGeneralErrorView(_0xce1dcc),this['reviewCheckListView']=_0x296b4c['list'],this['reviewCheckListView']['delegate'](...Fn)['to'](this),this['reviewCheckResultsView']=_0x296b4c['results'],this['reviewCheckResultsView']['delegate'](...Fn)['to'](this),this['reviewCompletedView']=_0x296b4c['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'](_0x40265a){this['reviewCheckResultsView']['addResult'](_0x40265a),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'](_0x446225){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x446225;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class AIReviewCoreFinishReviewButtonView extends vt{constructor(_0x57b5b6,_0x25ba1a){super(_0x25ba1a),this['set']({'label':_0x57b5b6,'withText':!0x0,'class':Mi}),this['on']('execute',()=>{this['fire']('finishReview');});}}class AIReviewCoreUICheckResultsView extends Pt{['_resultViews'];['_resultsHeader'];['_resultsBody'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x1a3962,_0x17733b){super(_0x1a3962),this['_contents']=_0x17733b,this['_resultViews']=new _0x3127bc(),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['_resultsBody']=this['_createResultsBodyView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new AIDisclaimerView(_0x1a3962),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 _0x30c0c6=this['_createCombinedSkeletonLoader'](),_0x38c202=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x38c202['if']('isLoading','ck-ai_review__check-run_loading',_0x1448c7=>_0x1448c7),_0x38c202['if']('isResultReady','ck-ai_review__check-run_ready',_0x261bf0=>_0x261bf0),_0x38c202['if']('isVisible','ck-hidden',_0x4addd4=>!_0x4addd4)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x30c0c6,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0x3f661e){const _0x5970e9=new AIReviewCoreReviewCheckListItemResultsView(this['locale'],_0x3f661e['id']);_0x5970e9['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x5970e9),_0x5970e9['resultResponseView']['element']['innerHTML']=_0x3f661e['contentDiffed'];}['hideResult'](_0x388d30,_0x2399cb){if('pending'===_0x2399cb)return;const _0x38eea6=this['_resultViews']['find'](_0x205095=>_0x205095['id']===_0x388d30);_0x38eea6&&(_0x38eea6['status']=_0x2399cb,_0x38eea6['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0xdb0081,_0x53e71b){if('pending'!==_0x53e71b)return;const _0x51eb42=this['_resultViews']['find'](_0x575f26=>_0x575f26['id']===_0xdb0081);_0x51eb42&&(_0x51eb42['status']=_0x53e71b,_0x51eb42['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x444457,_0x56b0a1){this['headerTitle']=_0x444457,this['headerSubtitle']=_0x56b0a1||'';}['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 AISkeletonView(this['locale'],Ss['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x2f69f0=new Nt(this['locale']),_0x2ac27f=[];for(let _0x59343f=0x0;_0x59343f<0x10;_0x59343f++){const _0x463abd=this['_createSkeletonLoader']();_0x463abd['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x2ac27f['push'](_0x463abd);}return _0x2f69f0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x703c2f=>!_0x703c2f)]},'children':_0x2ac27f}),_0x2f69f0;}['_createResultsBodyView'](){const _0x9263cb=new Nt(this['locale']);return _0x9263cb['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x5a4069=>_0x5a4069)]},'children':this['_resultViews']}),_0x9263cb;}['_createErrorView'](){const _0x48a697=new Nt(this['locale']),_0x55ce30=new vt(this['locale']),t=this['locale']['t'];return _0x48a697['delegate']('retryReview')['to'](this),_0x55ce30['set']({'label':t('Try\x20again'),'withText':!0x0,'class':Ui+'\x20ck-ai_review__check-run-error-retry-button'}),_0x55ce30['on']('execute',()=>{this['fire']('retryReview');}),_0x48a697['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x297629=>!_0x297629),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x4924bf=>'chunk'===_0x4924bf)]},'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',_0x370648=>'chunk'===_0x370648)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x12a1ec=>'general'!==_0x12a1ec)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0xc7cac0=>'chunk'!==_0xc7cac0)]},'children':[{'text':Hi(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x55ce30]}),_0x48a697;}['_createCancelButtonView'](){const _0x391bea=new vt(this['locale']);return _0x391bea['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[Ui+'\x20ck-ai-button-stop-generating'],'icon':_0xdb5f07}),_0x391bea['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2c5b69=>_0x2c5b69),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x427e21=>_0x427e21)]}}),_0x391bea['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x391bea;}['_createToggleDiffButtonView'](){const _0xcec806=new vt(this['locale']);_0xcec806['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0xcec806['bind']('isEnabled')['to'](this,'isError',_0x1d20b6=>!_0x1d20b6),_0xcec806['extendTemplate']({'attributes':{'class':[Ui,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x897891=>!_0x897891),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x46d42a=>_0x46d42a)]}});const _0x4b08ce=Hi(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x15080b=Hi(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0xcec806['bind']('isOn')['to'](this,'isToggleDiffOn',_0x5db7c5=>_0x5db7c5),_0xcec806['bind']('icon')['to'](this,'isToggleDiffOn',_0x5be895=>_0x5be895?st:nt),_0xcec806['bind']('label')['to'](this,'isToggleDiffOn',_0xd05b49=>_0xd05b49?_0x4b08ce:_0x15080b),_0xcec806['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0xcec806;}['_createAcceptAllButtonView'](){const _0x3fdd5b=new vt(this['locale']);return _0x3fdd5b['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x3fdd5b['bind']('isEnabled')['to'](this,'isError',_0x56efc9=>!_0x56efc9),_0x3fdd5b['extendTemplate']({'attributes':{'class':[Mi,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x559bec=>!_0x559bec),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xe4d4e2=>_0xe4d4e2)]}}),_0x3fdd5b['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x3fdd5b;}['_createExitReviewButtonView'](){const _0xa6afd4=new vt(this['locale']);return _0xa6afd4['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0xa6afd4['extendTemplate']({'attributes':{'class':[Bi,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2f4d44=>!_0x2f4d44),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5e4778=>_0x5e4778)]}}),_0xa6afd4['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0xa6afd4;}['_createResultHeaderView'](){const _0x2724f3=new Nt(this['locale']),_0x956113=this['_createTitleView']();return _0x2724f3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x554bbe=>_0x554bbe)]},'children':[_0x956113,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x2724f3;}['_createTitleView'](){const _0x16cef7=new Nt(this['locale']),_0x4e46ea=new AISpinnerView();return _0x4e46ea['bind']('isVisible')['to'](this,'isResultReady',_0x5ef7bc=>!_0x5ef7bc),_0x16cef7['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x4e46ea,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4da6ac=>_0x4da6ac)]},'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',_0x98f4d1=>!_0x98f4d1)]},'children':[{'text':Hi(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x16cef7;}['_createFinishReviewButtonView'](){const _0x322a38=new AIReviewCoreFinishReviewButtonView(Hi(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x322a38['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x256e2c=>!_0x256e2c)]}}),_0x322a38['delegate']('finishReview')['to'](this),_0x322a38;}}class AIReviewCoreReviewCompletedView extends Pt{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x3f2636,_0x3b4fc0){super(_0x3f2636),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x3b4fc0['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x3b4fc0['headerText']);const _0x219ba7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x219ba7['if']('isVisible','ck-hidden',_0x186b4f=>!_0x186b4f)]},'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':_0x3b4fc0['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x5a24f5){const _0x54f7e3=new AIReviewCoreFinishReviewButtonView(_0x5a24f5,this['locale']);return _0x54f7e3['delegate']('finishReview')['to'](this),_0x54f7e3;}['_createResultHeaderView'](_0x47f9de){const _0x562d2f=new Nt(this['locale']);return _0x562d2f['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':_0x47f9de}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x562d2f;}}class AIReviewCoreFormDropdownView extends Nt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x26b920,_0x5a1a0e){super(_0x26b920),this['_defaultValue']=_0x5a1a0e['default']||(_0x5a1a0e['data']['length']>0x0?_0x5a1a0e['data'][0x0]['id']:''),this['_defaultLabel']=_0x5a1a0e['data']['find'](_0x46ba10=>_0x46ba10['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x7554a9=this['_prepareListOptions'](_0x5a1a0e['data']);jt(this['_dropdownView'],_0x7554a9,{'role':'menu','ariaLabel':_0x5a1a0e['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x25d0d4=>{_0x25d0d4['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x542668=>{this['formValue']=_0x542668['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x542668['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'](_0x15f067=[]){const _0x253939=new dt();this['resetToDefault']();for(const _0xa46e67 of _0x15f067){const _0x596b8e=new Jt({'label':_0xa46e67['label'],'withText':!0x0,'role':'menuitemradio','id':_0xa46e67['id'],'model':_0xa46e67});_0x596b8e['bind']('isOn')['to'](this,'formValue',_0x2beae3=>_0x2beae3===_0x596b8e['id']);const _0x1c1081={'type':'button','model':_0x596b8e};_0x253939['add'](_0x1c1081);}return _0x253939;}}class AIReviewCoreFormManagerView extends Pt{['_formItem']=null;constructor(_0x3e04e6,_0x527843,_0x213d3d){super(_0x3e04e6),this['argsKey']=_0x527843?.['argsKey'];if('dropdown'===_0x527843['formType'])this['_formItem']=new AIReviewCoreFormDropdownView(this['locale'],_0x527843);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x444dd5=new _0x6cbb85(this['locale'],{'children':[this['_formItem']],'class':[_0x213d3d?'ck-form__row_with-submit':'']});_0x213d3d&&_0x444dd5['children']['add'](_0x213d3d),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x444dd5]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class AIReviewCorePromptInputView extends _0x23272a{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x15f60e){super(_0x15f60e),this['set']('isEmpty',!0x0),this['keystrokes']=new It(),this['minRows']=AIReviewCorePromptInputView['MIN_ROWS'],this['maxRows']=AIReviewCorePromptInputView['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 AIReviewCoreCustomCheckView extends Nt{['focusTracker']=new _t();['keystrokes']=new It();['focusCycler'];['_focusables']=new _0x3127bc();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x2d7e0b,_0x3f9e5c,_0x12dcd1=!0x1){super(_0x2d7e0b),this['_check']=_0x3f9e5c,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x3f9e5c['defaultModel']?_0x3f9e5c['defaultModel']['id']:'',this['_defaultLabel']=_0x3f9e5c['defaultModel']?_0x3f9e5c['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new AIReviewCorePromptInputView(_0x2d7e0b)),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 dt(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x12dcd1),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x6cbb85(this['locale'],{'children':[this['promptInputView']]}),new _0x6cbb85(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0xc7a82e,_0xdf9261)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0xdf9261()):_0xdf9261();}),this['focusCycler']=new Mt({'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'](_0x110b47=>{this['_focusables']['add'](_0x110b47),this['focusTracker']['add'](_0x110b47['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 _0x26cc81 of this['_getFormValidators']()){const _0x1935e3=_0x26cc81();if(_0x1935e3)return this['promptInputView']['errorText']=_0x1935e3,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return Hi(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x195a9e=new vt(this['locale']),t=this['locale']['t'];return _0x195a9e['set']({'label':t('Submit'),'withText':!0x0,'class':Mi}),_0x195a9e['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x195a9e;}['_createCancelButtonView'](){const _0x11846b=new vt(this['locale']),t=this['locale']['t'];return _0x11846b['set']({'label':t('Cancel'),'withText':!0x0,'class':Bi}),_0x11846b['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x17fa3e=>{_0x17fa3e['stopPropagation']();})}}),_0x11846b['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x11846b;}['_setModelList'](_0x11494c){this['_modelSelectionDropdownItems']['clear']();const _0x3a56a3=this['_check']['models'];if(_0x11494c)this['set']('modelDisplayMode','hidden');else{const _0x3503bf=0x1===_0x3a56a3['length'];this['set']('modelDisplayMode',_0x3503bf?'name':'selector');}if(this['resetToDefault'](),_0x3a56a3?.['length']){0x1===_0x3a56a3['length']&&this['set']('activeModelName',_0x3a56a3[0x0]['name']||_0x3a56a3[0x0]['id']);for(const _0x3ceb61 of _0x3a56a3){const _0x37eef0=new Jt({'label':_0x3ceb61['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3ceb61['id'],'model':_0x3ceb61});_0x37eef0['bind']('isOn')['to'](this,'modelId',_0x37983f=>_0x37983f===_0x3ceb61['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x37eef0,'labelView':new ModelButtonLabelView(this['locale'],_0x3ceb61)});}}}['_createModelSelectionDropdown'](){const _0xec1ecb=Gt(this['locale']);return _0xec1ecb['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0xec1ecb['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':Bi}),_0xec1ecb['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x54d2a6=>'selector'===_0x54d2a6),this['listenTo'](_0xec1ecb,'execute',_0x800bfd=>{this['modelId']=_0x800bfd['source']['model']['id'],_0xec1ecb['buttonView']['label']=_0x800bfd['source']['label'];}),_0xec1ecb;}['_createModelNameView'](){const _0x4a5f32=new ModelNameView(this['locale']);return _0x4a5f32['bind']('text')['to'](this,'activeModelName',_0x26d374=>_0x26d374??''),_0x4a5f32['bind']('isVisible')['to'](this,'modelDisplayMode',_0x3311c4=>'name'===_0x3311c4),_0x4a5f32;}['_createActionsFooterView'](){const _0x1c7ec2=new Nt(this['locale']);return _0x1c7ec2['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']]}]}),_0x1c7ec2;}}class ModelNameView extends Nt{constructor(_0x63e8d9){super(_0x63e8d9),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x58e54b=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x58e54b['if']('isVisible','ck-hidden',_0x52d821=>!_0x52d821)]},'children':[{'text':_0x58e54b['to']('text')}]});}}class ModelButtonLabelView extends Ht{constructor(_0x4a2788,_0x2aad77){super();const _0x708b8a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x708b8a['to']('style'),'id':_0x708b8a['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x708b8a['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x2aad77['description']||'']}]}]});}}class AIReviewCoreReviewCommandListItemView extends Pt{['_formItemsCollection']=new _0x3127bc();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x476663,_0x1902c9,_0x58c444,_0x487361=!0x1){super(_0x476663),this['_hideModels']=_0x487361,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x1902c9['isParameterized']);const _0x6510e9=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',_0x4e7e02=>_0x4e7e02),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x5c41a6=>_0x5c41a6)],'style':{'--ck-ai-review-check-list-item-index':_0x58c444}},'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':_0x1902c9['title']}]},_0x6510e9]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x1902c9['description']?[{'text':_0x1902c9['description']}]:[]}]}]},..._0x1902c9['isParameterized']?[this['_createParameterizedView'](_0x1902c9)]:[],...'custom'===_0x1902c9['id']?[this['_createCustomView'](_0x1902c9,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x1902c9['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x1902c9['id'],'args':_0x1902c9['useArgs']?_0x1902c9['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&zt({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x15ae3a=>{_0x15ae3a['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x17d630=new xt();return _0x17d630['content']=rt,_0x17d630['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x17d630;}['_createParameterizedView'](_0x2ca8b7){const _0x7c010b=new Nt(),_0x519fb4=this['_createFormView'](_0x2ca8b7);return _0x7c010b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x11e1b6=>!_0x11e1b6)]},'children':[_0x519fb4]}),_0x7c010b;}['_createFormView'](_0xb4e54a){const _0x12bfb7=new Nt(),_0x5701bd=Array['isArray'](_0xb4e54a['options'])?_0xb4e54a['options']:[],_0x3c52e7=new vt(this['locale']),t=this['locale']['t'];_0x3c52e7['set']({'label':t('Submit'),'withText':!0x0,'class':Mi}),_0x3c52e7['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x34b15d=>{_0x34b15d['stopPropagation']();})}}),_0x3c52e7['on']('execute',()=>{const _0x21c035=[],_0x14a63c={};this['_formItemsCollection']['forEach'](_0xf253f4=>{_0x21c035['push'](_0xf253f4['value']),_0xb4e54a['useArgs']&&_0xb4e54a['options']&&(_0x14a63c[_0xf253f4['argsKey']]=_0xf253f4['value']);}),this['fire']('runReviewCheck',{'id':_0xb4e54a['id'],'params':_0x21c035['length']?_0x21c035:void 0x0,'args':Object['keys'](_0x14a63c)['length']?_0x14a63c:void 0x0});});const _0x25ffce=_0x5701bd['length'];return _0x5701bd['forEach']((_0x54bade,_0x2a430e)=>{const _0x5c2e03=_0x2a430e===_0x25ffce-0x1;this['_formItemsCollection']['add'](new AIReviewCoreFormManagerView(this['locale'],_0x54bade,_0x5c2e03?_0x3c52e7:null));}),_0x12bfb7['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x12bfb7;}['_createCustomView'](_0x213618,_0x11890f=!0x1){return this['_customCheckView']=new AIReviewCoreCustomCheckView(this['locale'],_0x213618,_0x11890f),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',_0x48109c=>!_0x48109c)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x49fc6a,_0x313781,_0x34a87d)=>{_0x34a87d||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class AIReviewCoreReviewCheckListView extends Pt{['_checkViews'];constructor(_0x35d28f){super(_0x35d28f),this['_checkViews']=new _0x3127bc(),this['_setupTemplate']();}['setChecks'](_0x23a96d,_0x2b77b2=!0x1){this['_checkViews']['clear']();for(const [_0x1ab49f,_0x49c312]of _0x23a96d['entries']()){const _0x4981a9=new AIReviewCoreReviewCommandListItemView(this['locale'],_0x49c312,_0x1ab49f,_0x2b77b2);_0x4981a9['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x4981a9);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x10299e of this['_checkViews'])_0x10299e instanceof AIReviewCoreReviewCommandListItemView&&_0x10299e['resetToDefault']();}['_setupTemplate'](){const _0x3cfadd=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x3cfadd['if']('isVisible','ck-hidden',_0x3d90b1=>!_0x3d90b1)]},'children':this['_checkViews']});}}class AIReviewModeUI extends AIReviewCoreUI{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x4f5b00=this['context']['plugins']['get']('AITabs'),_0x5ca732=this['context']['locale'],_0x364f82=new AIHeaderView(_0x5ca732,{'label':Hi(_0x5ca732,'AI_REVIEW_MODE'),'icon':_0xc8a0b9,'class':'ck-ai-header_review','showResizeButton':_0x4f5b00['showResizeButton']});return _0x364f82['delegate']('resizeTabs')['to'](_0x4f5b00),_0x364f82['bind']('isMaximized')['to'](_0x4f5b00['view'],'isMaximized',_0x4ce02b=>_0x4ce02b),new AIReviewCoreView(this['context']['locale'],{'header':_0x364f82,'list':new AIReviewCoreReviewCheckListView(_0x5ca732),'results':new AIReviewCoreUICheckResultsView(_0x5ca732,{'generalErrorText':Hi(_0x5ca732,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new AIReviewCoreReviewCompletedView(_0x5ca732,{'headerText':Hi(_0x5ca732,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':Hi(_0x5ca732,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':Hi(_0x5ca732,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x53ecb1=this['context']['plugins']['get']('AITabs');_0x53ecb1['view']['on']('activateTab',(_0x47326b,{newTab:_0xa0c324,oldTab:_0x147c3f})=>{'reviewMode'===_0xa0c324?this['fire']('getReviewCheckList'):'reviewMode'===_0x147c3f&&this['fire']('leaveReview');}),_0x53ecb1['view']['addTab']({'id':'reviewMode','buttonLabel':Hi(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0xc8a0b9,'order':0x0,'content':this['_mainView']});}}const Kn='review-',Wn=['softBreak'];class AIReviewCoreEditing extends _0x3cc0e4{static get['requires'](){return[_0x490f88,AIEditing];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];['_reviewEditingAttachedEditors']=new WeakSet();['_boundEditables']=new WeakMap();constructor(_0x211989){super(_0x211989),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(Et())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x24a3b1=_0x2dd930=>this['_scheduleAttachReviewEditingToEditor'](_0x2dd930);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x3cd9d5)return void _0x24a3b1(this['context']);const _0x16e005=this['context'];for(const _0x1cf74d of _0x16e005['editors'])_0x24a3b1(_0x1cf74d);this['listenTo'](_0x16e005['editors'],'add',(_0x1eeb71,_0x49ef83)=>{_0x24a3b1(_0x49ef83);}),this['listenTo'](_0x16e005['editors'],'remove',(_0x3ee03e,_0x15ca85)=>{for(const [_0x209aa2,_0x1234fb]of this['_markers'])_0x1234fb['editor']===_0x15ca85&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x209aa2,'changeId':_0x1234fb['groupId']}),this['_markers']['delete'](_0x209aa2));});}['_scheduleAttachReviewEditingToEditor'](_0x3a7408){const _0x3926cb=()=>{'destroyed'!==_0x3a7408['state']&&_0x3a7408['conversion']&&this['_attachReviewEditingToEditor'](_0x3a7408);};if('ready'===_0x3a7408['state'])return void _0x3926cb();const _0x33a009=()=>{this['stopListening'](_0x3a7408,'ready',_0x33a009),_0x3926cb();};this['listenTo'](_0x3a7408,'ready',_0x33a009);}['_attachReviewEditingToEditor'](_0x1c2003){this['_reviewEditingAttachedEditors']['has'](_0x1c2003)||(_0x1c2003['conversion']['for']('editingDowncast')['markerToElement']({'model':Kn+'insert','view':(_0x257c7a,{writer:_0x2f5845})=>{const _0xa3474d=this['_markers']['get'](_0x257c7a['markerName']),_0x164e6e={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0xa3474d?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x257c7a['markerName']};return _0x2f5845['createUIElement']('span',_0x164e6e,function(_0x57a7d4){const _0x2a7059=this['toDomElement'](_0x57a7d4);return _0x2a7059['innerHTML']=_0xa3474d?.['content']?.['asString']||'',_0x2a7059;});}}),_0x1c2003['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Kn+'remove-only','view':_0x5362bc=>{const _0x4ec4f9=this['_markers']['get'](_0x5362bc['markerName']),_0x2592d6=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x4ec4f9?.['id']||'')&&_0x2592d6['push']('ck-ai_review__change_active'),{'classes':_0x2592d6,'attributes':{'data-marker-id':_0x5362bc['markerName']}};}}),_0x1c2003['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Kn+'remove-context','view':_0x102708=>{const _0x12182b=this['_markers']['get'](_0x102708['markerName']),_0x482c61=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x12182b?.['id']||'')&&_0x482c61['push']('ck-ai_review__change_active'),{'classes':_0x482c61,'attributes':{'data-marker-id':_0x102708['markerName']}};}}),_0x1c2003['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Kn+'remove-text','view':_0x405e59=>{const _0x907108=this['_markers']['get'](_0x405e59['markerName']),_0x141eea=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x907108?.['id']||'')&&_0x141eea['push']('ck-ai_review__change_active'),{'classes':_0x141eea,'attributes':{'data-marker-id':_0x405e59['markerName']}};}}),_0x1c2003['conversion']['for']('dataDowncast')['markerToElement']({'model':Kn+'suggestion-context','view':(_0x3ce234,{writer:_0x376ac8})=>_0x376ac8['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x3ce234['isOpening']?'start':'end')})}),_0x1c2003['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x34af8c,'view':_0x1053a9}),this['_updateMouseMarkerInteractionListeners'](_0x1c2003),this['listenTo'](_0x1c2003,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x1c2003),{'priority':'lowest'}),this['listenTo'](_0x1c2003,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x1c2003),{'priority':'lowest'}),_0x1c2003['model']['document']['registerPostFixer'](_0x4c0ebc=>this['_validateMarkers'](_0x1c2003,_0x4c0ebc)),_0x1c2003['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x1c2003)),this['_reviewEditingAttachedEditors']['add'](_0x1c2003));}['_updateMouseMarkerInteractionListeners'](_0x32980e){let _0x430bae=this['_boundEditables']['get'](_0x32980e);_0x430bae||(_0x430bae=new Map(),this['_boundEditables']['set'](_0x32980e,_0x430bae));const _0x483f97=new Set(_0x32980e['ui']['getEditableElementsNames']());for(const _0x27b32c of _0x483f97){if(_0x430bae['has'](_0x27b32c))continue;const _0x415ce4=_0x32980e['ui']['getEditableElement'](_0x27b32c);_0x430bae['set'](_0x27b32c,_0x415ce4),this['_attachMouseMarkerInteractionListeners'](_0x415ce4);}for(const [_0x18892c,_0x18eac4]of _0x430bae)_0x483f97['has'](_0x18892c)||(_0x430bae['delete'](_0x18892c),this['_domEmitter']['stopListening'](_0x18eac4));}['_attachMouseMarkerInteractionListeners'](_0x51909e){this['_domEmitter']['listenTo'](_0x51909e,'mouseup',(_0x59b281,_0x2acabe)=>{const _0x5a2f39=_0x2acabe['target'],_0x5f3b81=this['_findMarkerElement'](_0x5a2f39);if(!_0x5f3b81)return;const _0x194bc0=_0x5f3b81['getAttribute']('data-marker-id'),_0x230349=_0x194bc0['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x194bc0,'changeId':_0x230349,'markerElement':()=>this['_findMarkerElementById'](_0x194bc0),'domEvent':_0x2acabe});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x51909e,'mouseover',(_0x47f041,_0x191001)=>{const _0x3413a7=_0x191001['target'],_0x14af61=_0x191001['relatedTarget'];let _0xde3afe=this['_findMarkerElement'](_0x3413a7);if(!_0xde3afe&&_0x14af61&&(_0xde3afe=this['_findMarkerElement'](_0x14af61)),!_0xde3afe)return;const _0x1e66a9=_0xde3afe['getAttribute']('data-marker-id'),_0x2b8a4c=_0x1e66a9['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x2b8a4c,'markerElement':()=>this['_findMarkerElementById'](_0x1e66a9),'domEvent':_0x191001});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0xc92ffd((_0x12cb02,_0x15cef4)=>{const _0x3e4e75=_0x15cef4['target'];if(this['_findMarkerElement'](_0x3e4e75))return;_0x3e4e75['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x1c7290=this['context']['plugins']['get']('AIEditing'),_0x49e6a0=ls(this['context']);if(!_0x49e6a0['length'])throw new at('ai-get-editor-from-context-no-editor',this);const _0x2eee94=new Set(),_0x1771ac=[],_0xc41f78=new Map();for(const _0x242b57 of _0x49e6a0)for(const _0x1c4be1 of _0x242b57['model']['document']['getRoots']()){if('$graveyard'===_0x1c4be1['rootName'])continue;const _0x4c9d78=this['_buildDocumentDataSliceForRoot'](_0x242b57,_0x1c4be1,_0x1c7290,_0x2eee94);_0x1771ac['push'](_0x4c9d78['content']);for(const [_0x377379,_0x505ccb]of _0x4c9d78['elements'])_0xc41f78['set'](_0x377379,_0x505ccb);}return{'elements':_0xc41f78,'content':_0x1771ac['join']('')};}['_buildDocumentDataSliceForRoot'](_0x33347a,_0x37f1fc,_0xd28de2,_0x5c84d5){const _0x27eab4=_0x33347a['model'],_0x8230bf=new _0xd8720b();for(const _0x3e8a6a of _0x37f1fc['getChildren']())_0x8230bf['_appendChild'](_0x3e8a6a['_clone'](!0x0));for(const _0x58e6ff of _0x27eab4['markers']){const _0x272e82=_0x58e6ff['getRange']();_0x272e82&&_0x272e82['root']['rootName']===_0x37f1fc['rootName']&&_0x8230bf['markers']['set'](_0x58e6ff['name'],this['_changeRangeOwnerDocument'](_0x272e82['clone'](),_0x8230bf));}const _0xd3741d=new Map(),_0x1cd989=_0x27eab4['document']['version'],_0x4a9db5=new _0x5ae065({'ignoreElementEnd':!0x0,'startPosition':_0x27eab4['createPositionAt'](_0x8230bf,0x0)});for(const {item:_0x1578de}of _0x4a9db5){if(!_0x1578de['is']('$textProxy'))continue;const _0x1ba977=_0x1578de['parent'];if(!_0x1ba977||!_0x1ba977['is']('element'))continue;const _0x12ccb4=this['_upsertDataId'](_0x1ba977,()=>_0xd28de2['_nextDataId'](_0x5c84d5));_0x5c84d5['add'](_0x12ccb4);for(const _0x28d502 of _0x1ba977['getChildren']())_0x28d502['is']('element')&&(_0x28d502['name']&&Wn['includes'](_0x28d502['name'])||_0x5c84d5['add'](this['_upsertDataId'](_0x28d502,()=>_0xd28de2['_nextDataId'](_0x5c84d5))));let _0xca0f59=_0x1ba977;for(;_0xca0f59['parent']&&!_0xca0f59['parent']['is']('documentFragment');)_0xca0f59=_0xca0f59['parent'],_0xca0f59['hasAttribute'](_0x34af8c)&&_0xca0f59['_removeAttribute'](_0x34af8c);_0xd3741d['set'](_0x12ccb4,{'editor':_0x33347a,'rootName':_0x37f1fc['rootName'],'path':_0x1ba977['getPath'](),'documentVersion':_0x1cd989,'getContent':this['_createGetContentUsingDataIdFn'](_0xca0f59['_clone'](!0x0),_0x12ccb4,_0x33347a['data'])}),_0x4a9db5['jumpTo'](_0x27eab4['createPositionAfter'](_0x1ba977));}return{'content':_0x33347a['data']['processor']['toData'](_0x33347a['data']['toView'](_0x8230bf)),'elements':_0xd3741d};}['diffContent'](_0x28e906,_0x21fe3e,_0x5c5003,_0x5dab05=!0x1){const _0x4f6f64=[],_0x4b8959=_0x28e906['data']['parse'](_0x5c5003,'$documentFragment'),_0x38aa10=_0x28e906['data']['parse'](_0x21fe3e,'$documentFragment'),_0x51abf6=_0x28e906['model']['createPositionAt'](_0x38aa10,0x0);if(this['_haveSingleTopLevelElement'](_0x4b8959)){if(!this['_hasSameTopLevelElement'](_0x38aa10,_0x4b8959))return _0x4f6f64;}else{const _0x2e771e=_0x28e906['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x38aa10,_0x2e771e)||!this['_haveOnlyInlineContent'](_0x4b8959,_0x2e771e))return _0x4f6f64;}const _0x241216=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x21fe3e,_0x5c5003,{'targetEditor':_0x28e906,'anchor':_0x51abf6,'markDeletions':!0x0})['getOperations']()['filter'](_0x5e0c30=>'insert'===_0x5e0c30['type']||'marker'===_0x5e0c30['type']&&_0x5e0c30['name']['startsWith']('$markedRemove')),_0x3e813f=this['_groupAdjacentOperations'](_0x241216),_0x2697ff=[];if(_0x5dab05){if(_0x3e813f['length']){const _0x27cda7=_0x3e813f[0x0]['operations'][0x0],_0xd5788b='insert'===_0x27cda7['type']?_0x27cda7['position']:_0x27cda7['newRange']['start'],_0x3de767=this['_getPositionLimitingRange'](_0xd5788b,_0x28e906,'inside'),_0x37d92c=_0x3de767?_0x4b8959['getChild'](0x0)['getChildren']():_0x4b8959['getChildren'](),_0x4b3c65=_0x3de767||_0x28e906['model']['createRangeIn'](_0x38aa10),_0x2df28f=[new _0x1cab42('$markedRemove:synthetic'+ot(),null,_0x4b3c65,_0x28e906['model']['document']['model']['markers'],!0x0,_0x28e906['model']['document']['version']+0x1),new _0x32f2fc(_0x4b3c65['end'],_0x37d92c,_0x28e906['model']['document']['version']+0x2)];_0x2697ff['push']({'operations':_0x2df28f,'operationsIsolated':_0x2df28f,'groupOffset':0x0});}}else _0x2697ff['push'](..._0x3e813f);let _0x4bbccf=0x0;return _0x28e906['model']['change'](_0x4dde13=>{for(let _0x1183df=0x0;_0x1183df<_0x2697ff['length'];_0x1183df++){const _0x19f03d=_0x2697ff[_0x1183df],_0x56f728=_0x4dde13['createDocumentFragment']();for(const _0x3b1c2b of _0x38aa10['getChildren']())_0x4dde13['append'](_0x3b1c2b['_clone'](!0x0),_0x56f728);for(const _0x48a638 of _0x19f03d['operationsIsolated'])if('insert'===_0x48a638['type']){const _0x4bbdb0=_0x48a638;_0x4bbdb0['baseVersion']=null,_0x4bbdb0['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x4bbdb0,_0x56f728),_0x4dde13['batch']['addOperation'](_0x48a638),_0x28e906['model']['applyOperation'](_0x48a638);const _0x4ebd7a='suggestion:insertion:id:authorId:'+_0x4bbccf++,_0x1e166a=_0x28e906['model']['createRange'](_0x4bbdb0['position'],_0x4bbdb0['position']['getShiftedBy'](_0x4bbdb0['howMany']));_0x56f728['markers']['set'](_0x4ebd7a,_0x1e166a);}else{if('marker'===_0x48a638['type']&&_0x48a638['name']['startsWith']('$markedRemove')){const _0x3241b3=_0x48a638,_0x628fbf='suggestion:deletion:id:authorId:'+_0x4bbccf++;this['_changeOperationOwnerDocument'](_0x3241b3,_0x56f728),_0x56f728['markers']['set'](_0x628fbf,_0x3241b3['newRange']);}}if(_0x5dab05)_0x4f6f64['push']({..._0x19f03d,'context':this['_createGetContentFn'](_0x38aa10,_0x28e906['data']),'content':this['_createGetContentFn'](_0x38aa10,_0x28e906['data'])});else{const _0x4ce986=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x19f03d['operationsIsolated'][0x0]),_0x56f728),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x19f03d['operationsIsolated'][_0x19f03d['operationsIsolated']['length']-0x1]),_0x56f728),_0x28e906);_0x56f728['markers']['set'](Kn+'suggestion-context',new _0x5d6ed6(_0x4ce986['start'],_0x4ce986['end'])),_0x4f6f64['push']({..._0x19f03d,'context':this['_createGetContextFn'](_0x56f728,_0x28e906['data'],{'ellipsisBefore':_0x4ce986['hasContentBefore'],'ellipsisAfter':_0x4ce986['hasContentAfter']}),'content':this['_createGetContentFn'](_0x56f728,_0x28e906['data'])});}}}),_0x4f6f64;}['markChangePositionInEditorContent'](_0x3571a6,_0x15a6a4){if(!_0x3571a6['length'])return;const _0x176f3d=_0x3571a6[0x0]['parent']['id'],_0x3e3636=_0x15a6a4['elements']['get'](_0x176f3d);if(!_0x3e3636)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x176f3d);const _0x122c83=_0x3e3636['path'],_0x454409=_0x3e3636['editor'],_0x43ab6d=_0x454409['model']['document']['getRoot'](_0x3e3636['rootName']);if(!_0x43ab6d)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x3e3636['rootName']);const _0x22629a=_0x454409['model']['document']['history']['getOperations'](_0x3e3636['documentVersion']),_0x13d515=[];for(const _0x552c88 of _0x3571a6){const _0x350a03=_0x552c88['operationsIsolated']['map'](_0x1f114b=>this['_translateOperationToEditorContent'](_0x1f114b,_0x122c83,_0x43ab6d));if(!_0x350a03||!_0x350a03['length'])continue;const _0x3aafeb=_0x350a03['every'](_0xc08371=>'marker'===_0xc08371['type']&&_0xc08371['name']['startsWith']('$markedRemove')),_0x1f4a9d={'document':_0x454409['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x13d142=_0x2d44f8(_0x350a03,_0x22629a,_0x1f4a9d)['operationsA'];for(const _0x56d85a of _0x13d142)if('insert'===_0x56d85a['type']){const _0x503fe7=_0x56d85a,_0x2f7d6a=_0x503fe7['nodes'];_0x454409['model']['change'](_0x2124bc=>{const _0x2e6b1b=_0x2124bc['createDocumentFragment']();for(const _0x1e86ca of _0x2f7d6a)_0x2124bc['append'](_0x1e86ca['_clone'](!0x0),_0x2e6b1b);_0x13d515['push']({'start':_0x503fe7['position'],'end':_0x503fe7['position'],'type':'insert','groupId':_0x552c88['id'],'content':{'asString':this['_createGetContentFn'](_0x2e6b1b,_0x454409['data'])(),'asFragment':_0x2e6b1b}});});}else{if('marker'===_0x56d85a['type']&&_0x56d85a['name']['startsWith']('$markedRemove')){const _0x3f6a1f=_0x56d85a;let _0x54d4bc='remove-text';if(_0x3aafeb){const _0x5c35d0=this['_findAdjacentContextDistance'](_0x3f6a1f['newRange']['start'],'backward',_0x454409['model']['schema']),_0x5037e1=this['_findAdjacentContextDistance'](_0x3f6a1f['newRange']['end'],'forward',_0x454409['model']['schema']);if(_0x5c35d0||_0x5037e1){const _0x5b1214=_0x3f6a1f['newRange']['start']['getShiftedBy'](-_0x5c35d0),_0x30fb97=_0x3f6a1f['newRange']['end']['getShiftedBy'](_0x5037e1);_0x13d515['push']({'start':_0x5b1214,'end':_0x30fb97,'groupId':_0x552c88['id'],'type':'remove-context'});}else _0x54d4bc='remove-only';}_0x13d515['push']({'start':_0x3f6a1f['newRange']['start'],'end':_0x3f6a1f['newRange']['end'],'groupId':_0x552c88['id'],'type':_0x54d4bc});}}}this['_insertMarkers'](_0x13d515,_0x454409);}['clearAllMarkers'](){const _0x96dc57=new Map();for(const _0x222877 of this['_markers']['keys']()){const _0x479df9=this['_markers']['get'](_0x222877);_0x479df9?.['editor']&&(_0x96dc57['has'](_0x479df9['editor'])||_0x96dc57['set'](_0x479df9['editor'],[]),_0x96dc57['get'](_0x479df9['editor'])['push'](_0x222877));}for(const [_0x2b99f2,_0x262ac5]of _0x96dc57)_0x2b99f2['model']['change'](_0x2dcfb6=>{for(const _0x26eaaf of _0x262ac5)_0x2b99f2['model']['markers']['get'](_0x26eaaf)&&_0x2dcfb6['removeMarker'](_0x26eaaf);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0x5aa289 of ls(this['context']))_0x5aa289['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0xe99b44 of ls(this['context']))_0xe99b44['disableReadOnlyMode']('ai-review');}['applyChange'](_0x45ace0){const _0x359a1e=_0x45ace0['map'](_0x2f12de=>this['_getMarkersDataForGroup'](_0x2f12de))['flat'](),_0x23cc87=new Map();for(const _0x200f1d of _0x359a1e)_0x23cc87['has'](_0x200f1d['editor'])||_0x23cc87['set'](_0x200f1d['editor'],[]),_0x23cc87['get'](_0x200f1d['editor'])['push'](_0x200f1d);for(const [_0x29434a,_0x3d7c26]of _0x23cc87){const _0x1546ff=_0x29434a['model'];_0x1546ff['change'](_0x24a3dc=>{for(const _0x585c54 of _0x3d7c26){const _0xd68137=_0x29434a['model']['markers']['get'](_0x585c54['id']);if(_0xd68137){if('insert'===_0x585c54['type']){if(!_0x585c54['content'])continue;_0x1546ff['insertContent'](_0x585c54['content']['asFragment']||null,_0xd68137['getRange']()['start']);}else'remove-text'!==_0x585c54['type']&&'remove-only'!==_0x585c54['type']||_0x1546ff['deleteContent'](_0x1546ff['createSelection'](_0xd68137['getRange']()));_0x24a3dc['removeMarker'](_0x585c54['id']),this['_markers']['delete'](_0x585c54['id']);}}});}}['rejectChange'](_0x451dcd){const _0x6250f2=this['_getMarkersDataForGroup'](_0x451dcd),_0x19de02=new Map();for(const _0x22bd74 of _0x6250f2)_0x19de02['has'](_0x22bd74['editor'])||_0x19de02['set'](_0x22bd74['editor'],[]),_0x19de02['get'](_0x22bd74['editor'])['push'](_0x22bd74);for(const [_0x1b1b7a,_0x2f80fc]of _0x19de02)_0x1b1b7a['model']['change'](_0x4c6f60=>{for(const _0x37b201 of _0x2f80fc)_0x4c6f60['removeMarker'](_0x37b201['id']),this['_markers']['delete'](_0x37b201['id']);});}['getEditor'](){return ds(this['context']);}['getEditors'](){return ls(this['context']);}['getEditorForChange'](_0xf77b94){const _0x48c50f=this['_getMarkersDataForGroup'](_0xf77b94);return _0x48c50f[0x0]?.['editor'];}['getMarkerElementForChange'](_0x32e109){const _0x2a7134=Array['from'](this['_markers']['values']())['filter'](_0xe77ffe=>_0xe77ffe['groupId']===_0x32e109);if(!_0x2a7134['length'])return null;const _0x232c59=0x1===_0x2a7134['length']?_0x2a7134[0x0]:this['_sortMarkers'](_0x2a7134)[0x0],_0x4489db=_0x232c59['editor']['model']['markers']['get'](_0x232c59['id']);if(!_0x4489db)return null;return{'modelRange':_0x4489db['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x232c59['id'])};}['getContentElementForChange'](_0x3cfd41){const _0x2fa25a=Array['from'](this['_markers']['values']())['filter'](_0x40b4b3=>_0x40b4b3['groupId']===_0x3cfd41);if(!_0x2fa25a['length'])return null;const _0x217f27=0x1===_0x2fa25a['length']?_0x2fa25a[0x0]:this['_sortMarkers'](_0x2fa25a)[0x0],_0x1de3af=_0x217f27['editor'],_0x1253b1=_0x1de3af['model']['markers']['get'](_0x217f27['id']);if(!_0x1253b1)return null;const _0x419b55=_0x1253b1['getRange'](),_0x314802=_0x1de3af['editing']['view']['getDomRoot'](_0x419b55['root']['rootName'])||_0x1de3af['editing']['view']['getDomRoot']();if(!_0x314802||!_0x419b55)return null;let _0x455575=_0x419b55['start']['parent'];for(;_0x455575['parent']&&'$root'!==_0x455575['parent']['name'];)_0x455575=_0x455575['parent'];if(!_0x455575||!_0x455575['name'])return null;const _0x31a2e4=_0x314802['querySelector']('[data-marker-id=\x22'+_0x217f27['id']+'\x22]');if(!_0x31a2e4)return null;let _0x2e4ad3=null;_0x1de3af['model']['change'](_0x29d1b0=>{_0x2e4ad3=_0x29d1b0['createDocumentFragment'](),_0x29d1b0['append'](_0x455575['_clone'](!0x0),_0x2e4ad3);});const _0x22f00f=_0x1de3af['data']['toView'](_0x2e4ad3)['getChild'](0x0);return _0x31a2e4['closest'](_0x22f00f['name']);}['reactivateMarkers'](_0x19a68b){const _0x51fc12=this['_getMarkersDataForGroup'](_0x19a68b);if(!_0x51fc12['length'])return;const _0x24c591=Array['from'](this['_activeMarkers'])['sort'](),_0x367cbe=Array['from'](new Set(_0x51fc12['map'](_0x45f637=>_0x45f637['id'])))['sort']();_0x24c591['join']('|')!==_0x367cbe['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x19a68b));}['setMarkersInElementAsActive'](_0xb30821){const _0x4edf03=this['_getMarkersDataForGroup'](_0xb30821);if(!_0x4edf03['length'])return;const _0x3a06a2=_0x4edf03[0x0]['editor'],_0x1aa917=new Set(_0x4edf03['map'](_0x22f0cd=>_0x22f0cd['id'])),_0x4e920b=Array['from'](_0x1aa917['values']())['map'](_0x12bc11=>_0x3a06a2['model']['markers']['get'](_0x12bc11))['filter'](_0x416859=>!!_0x416859);_0x1aa917['forEach'](_0x5f20d1=>{this['_activeMarkers']['add'](_0x5f20d1);}),_0x3a06a2['model']['change'](()=>{_0x4e920b['forEach'](_0x260a92=>{_0x3a06a2['editing']['reconvertMarker'](_0x260a92);});});}['setAllMarkersAsInactive'](){const _0x363af1=Array['from'](this['_activeMarkers']);if(!_0x363af1['length'])return;this['_activeMarkers']['clear']();const _0x4ff6a6=new Map();for(const _0x3005b0 of _0x363af1){const _0x24954a=this['_markers']['get'](_0x3005b0);if(!_0x24954a)continue;const _0x40ba97=_0x24954a['editor'],_0xe869d0=_0x40ba97['model']['markers']['get'](_0x3005b0);_0xe869d0&&(_0x4ff6a6['has'](_0x40ba97)||_0x4ff6a6['set'](_0x40ba97,[]),_0x4ff6a6['get'](_0x40ba97)['push'](_0xe869d0));}for(const [_0x2c1ce9,_0xc7d492]of _0x4ff6a6)_0x2c1ce9['model']['change'](()=>{_0xc7d492['forEach'](_0x1f0135=>{_0x2c1ce9['editing']['reconvertMarker'](_0x1f0135);});});}['_getPositionLimitingRange'](_0x27c7a5,_0x116ff3,_0x1e59f8='outside'){if(!_0x27c7a5)return null;let _0x20c341=_0x27c7a5['parent'];for(;_0x20c341&&_0x20c341['parent']&&'$root'!==_0x20c341['parent']['name']&&!_0x116ff3['model']['schema']['isLimit'](_0x20c341)&&!_0x116ff3['model']['schema']['isBlock'](_0x20c341);)_0x20c341=_0x20c341['parent'];if(!_0x20c341||!_0x20c341['name']||'$root'===_0x20c341['name'])return null;let _0x1a81af=null;return _0x116ff3['model']['change'](_0x377d5d=>{_0x1a81af='inside'===_0x1e59f8?_0x377d5d['createRangeIn'](_0x20c341):_0x377d5d['createRangeOn'](_0x20c341);}),_0x1a81af;}['_validateMarkers'](_0x238801,_0xef1420){const _0xc456d0=Array['from'](this['_markers']['keys']()),_0x57d394=new Map();for(const _0x143d87 of _0xc456d0){const _0x224cfb=_0x238801['model']['markers']['get'](_0x143d87);if(!_0x224cfb)continue;const _0x2c37da=_0x224cfb['getStart']()['root']['rootName']+':'+_0x224cfb['getStart']()['path'][0x0];_0x57d394['has'](_0x2c37da)||_0x57d394['set'](_0x2c37da,[]),_0x57d394['get'](_0x2c37da)['push'](_0x224cfb);}const _0x56d22b=new Set();for(const _0x4f3cf5 of _0x238801['model']['document']['differ']['getChanges']()){let _0x1ed72d='',_0x3065d8=null;if('insert'===_0x4f3cf5['type'])_0x3065d8=new _0x5d6ed6(_0x4f3cf5['position'],_0x4f3cf5['position']['getShiftedBy'](_0x4f3cf5['length'])),_0x1ed72d=_0x4f3cf5['position']['root']['rootName']+':'+_0x4f3cf5['position']['path'][0x0];else{if('remove'!==_0x4f3cf5['type'])continue;_0x3065d8=new _0x5d6ed6(_0x4f3cf5['position']),_0x1ed72d=_0x4f3cf5['position']['root']['rootName']+':'+_0x4f3cf5['position']['path'][0x0];}const _0x253a95=_0x57d394['get'](_0x1ed72d)||[];if(_0x253a95['length']){for(const _0x112d04 of _0x253a95)if(_0x3065d8['root']['rootName']===_0x112d04['getRange']()['root']['rootName']&&('insert'!==_0x4f3cf5['type']||!_0x3065d8['containsRange'](_0x112d04['getRange']()))&&(_0x3065d8['isIntersecting'](_0x112d04['getRange']())||_0x3065d8['start']['isTouching'](_0x112d04['getRange']()['end'])||_0x3065d8['end']['isTouching'](_0x112d04['getRange']()['start']))){const _0xae37e4=this['_parseMarkerName'](_0x112d04['name']);Array['from'](this['_markers']['values']())['filter'](_0x552ca0=>_0x552ca0['groupId']===_0xae37e4['groupId'])['forEach'](_0x4db039=>_0x56d22b['add'](_0x4db039['id']));}}}if(_0x56d22b['size']){for(const _0x2ebd09 of _0x56d22b)_0xef1420['removeMarker'](_0x2ebd09);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x45b654){for(const {name:_0x4eeb7a,data:_0x35cc0b}of _0x45b654['model']['document']['differ']['getChangedMarkers']()){if(!_0x4eeb7a['startsWith'](Kn))continue;const _0x3e57c5=_0x35cc0b['oldRange'],_0x3ac7fd=_0x35cc0b['newRange'],_0x3aa1b5=_0x3e57c5&&'$graveyard'===_0x3e57c5['root']['rootName'],_0x5219f3=_0x3ac7fd&&'$graveyard'===_0x3ac7fd['root']['rootName'];if(_0x3aa1b5&&_0x5219f3)continue;const _0x27ab7d=this['_parseMarkerName'](_0x4eeb7a);this['_markers']['get'](_0x4eeb7a)&&(_0x5219f3||!_0x3ac7fd?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x4eeb7a,'changeId':_0x27ab7d['groupId']}):_0x3aa1b5&&_0x3ac7fd&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x4eeb7a,'changeId':_0x27ab7d['groupId']}));}}['_parseMarkerName'](_0x3d5cb5){const _0x497bc3=_0x3d5cb5['split'](':'),_0x187286=(_0x497bc3[0x1]||'')['split']('_');return{'prefix':_0x497bc3[0x0],'groupId':_0x187286[0x0],'suffix':_0x187286[0x1]};}['_translateOperationToEditorContent'](_0xaf7d2,_0x3a9532,_0x4b2f85){if('insert'===_0xaf7d2['type']){const _0x3fc42b=_0xaf7d2;return new _0x32f2fc(this['_changePosition'](_0x3a9532['concat'](_0x3fc42b['position']['offset']),_0x4b2f85),_0x3fc42b['nodes'],_0x3fc42b['baseVersion']);}if('marker'===_0xaf7d2['type']&&_0xaf7d2['name']['startsWith']('$markedRemove')){const _0x3d9676=_0xaf7d2;return new _0x1cab42(_0x3d9676['name'],_0x3d9676['oldRange'],this['_changeRange'](_0x3d9676['newRange'],_0x3a9532['concat'](_0x3d9676['newRange']['start']['offset']),_0x3a9532['concat'](_0x3d9676['newRange']['end']['offset']),_0x4b2f85),_0x3d9676['_markers'],_0x3d9676['affectsData'],_0x3d9676['baseVersion']);}return _0xaf7d2;}['_groupAdjacentOperations'](_0x3e7012){if(!_0x3e7012['length'])return[];const _0x174bf5=[];let _0x124f23=0x0,_0x24da0c=0x0,_0x71d804=[];for(let _0x11667b=0x0;_0x11667b<=_0x3e7012['length'];_0x11667b++){const _0x3b6524=_0x3e7012[_0x11667b],_0x199df1=_0x3e7012[_0x11667b-0x1];!_0x3b6524||_0x199df1&&!this['_getOperationEnd'](_0x199df1)['isTouching'](this['_getOperationStart'](_0x3b6524))?(_0x174bf5['push']({'operations':_0x71d804,'operationsIsolated':_0x71d804['map'](_0x4464aa=>this['_shiftOperation'](_0x4464aa['clone'](),-_0x24da0c)),'groupOffset':_0x124f23}),_0x71d804=_0x3b6524?[_0x3b6524]:[],_0x24da0c+=_0x124f23,_0x124f23=0x0):_0x71d804['push'](_0x3b6524),_0x3b6524&&'insert'===_0x3b6524['type']&&(_0x124f23+=_0x3b6524['howMany']);}return _0x174bf5;}['_findAdjacentContextDistance'](_0x2175fe,_0x437c25,_0x155f00,_0x24c9ab=0x1){const _0x27c850=new _0x5ae065({'startPosition':_0x2175fe,'direction':_0x437c25});let _0x540449=0x0;for(let _0x106aeb=0x0;_0x106aeb<_0x24c9ab;_0x106aeb++){let _0x1cd800=0x0,_0x523680=!0x1,_0x1563e6='forward'===_0x437c25?/^\W*\w+/:/\w+\W*$/;for(const {item:_0xf1cc5a}of _0x27c850)if(_0xf1cc5a['is']('$textProxy')){const _0x3bab55=_0x1563e6['exec'](_0xf1cc5a['data']);if(_0x3bab55&&_0x3bab55['length']){if(_0x1cd800+='forward'===_0x437c25?_0x3bab55['index']+_0x3bab55[0x0]['length']:_0xf1cc5a['data']['length']-_0x3bab55['index'],_0x3bab55[0x0]['length']!==_0xf1cc5a['data']['length'])break;_0x523680=!0x0,_0x1563e6='forward'===_0x437c25?/^\w+/:/\w+$/;}else{if(_0x523680)break;_0x1cd800+=_0xf1cc5a['offsetSize'];}}else{if(_0xf1cc5a['is']('element')){_0x155f00['isInline'](_0xf1cc5a)&&!_0x523680&&(_0x1cd800+=0x1);break;}}_0x540449+=_0x1cd800,_0x27c850['jumpTo'](_0x2175fe['getShiftedBy']('forward'===_0x437c25?_0x540449:-_0x540449));}return _0x540449;}['_getChangeContext'](_0x51b821,_0x2ac5ea,_0x2f3c72){const _0x325931=_0x2f3c72['model']['schema'],_0x25ee48=this['_findAdjacentContextDistance'](_0x51b821,'backward',_0x325931,0x6),_0x3c1beb=this['_findAdjacentContextDistance'](_0x2ac5ea,'forward',_0x325931,0x6),_0x2f8bb4=_0x51b821['getShiftedBy'](-_0x25ee48),_0x287817=_0x2ac5ea['getShiftedBy'](_0x3c1beb);return{'start':_0x2f8bb4,'end':_0x287817,'hasContentBefore':!_0x2f8bb4['isAtStart'],'hasContentAfter':!_0x287817['isAtEnd']};}['_insertMarkers'](_0x48e623,_0x119d1b){const _0x27f609=this['context']['plugins']['get']('AIEditing'),_0x1f2df6=new Set();_0x119d1b['model']['change'](_0x1acb05=>{for(const _0x52c743 of _0x48e623){const _0x2f9f64=''+Kn+_0x52c743['type']+':'+_0x52c743['groupId']+'_'+_0x27f609['_nextDataId'](_0x1f2df6);this['_markers']['set'](_0x2f9f64,{'id':_0x2f9f64,'groupId':_0x52c743['groupId'],'type':_0x52c743['type'],'content':_0x52c743['content'],'editor':_0x119d1b}),_0x1acb05['addMarker'](_0x2f9f64,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1acb05['createRange'](_0x52c743['start'],_0x52c743['end'])});}});}['_createGetContextFn'](_0x4cb6d2,_0x1854fa,_0x19ab59){let _0x441edc='';return()=>{if(!_0x441edc){const _0x439170=_0x1854fa['toView'](_0x4cb6d2,{'showSuggestionHighlights':!0x0});let _0x41a0a4=_0x439170['getChild'](0x0);if(_0x41a0a4['is']('containerElement')||(_0x41a0a4=_0x439170),!_0x41a0a4)return'';let _0x3ffe4d=!0x1;const _0x11a9f4=[];for(const _0x16c5d8 of _0x41a0a4['getChildren']())_0x16c5d8['is']('element','span')&&_0x16c5d8['hasClass']('ck-ai_review-marker_context-end')&&(_0x3ffe4d=!0x1),_0x3ffe4d&&_0x11a9f4['push'](_0x16c5d8),_0x16c5d8['is']('element','span')&&_0x16c5d8['hasClass']('ck-ai_review-marker_context-start')&&(_0x3ffe4d=!0x0);_0x41a0a4['_removeChildren'](0x0,_0x41a0a4['childCount']),_0x19ab59?.['ellipsisBefore']&&_0x41a0a4['_appendChild']('…'),_0x41a0a4['_appendChild'](_0x11a9f4),_0x19ab59?.['ellipsisAfter']&&_0x41a0a4['_appendChild']('…');const _0x1e2e49=_0x1854fa['htmlProcessor']['domConverter']['viewToDom'](_0x439170),_0x563a95=_0x1854fa['htmlProcessor']['htmlWriter']['getHtml'](_0x1e2e49);_0x441edc=_0x563a95;}return _0x441edc;};}['_createGetContentFn'](_0x4803c6,_0x25b684){let _0x55f2c0='';return()=>(_0x55f2c0||(_0x55f2c0=_0x25b684['stringify'](_0x4803c6,{'showSuggestionHighlights':!0x0})),_0x55f2c0);}['_createGetContentUsingDataIdFn'](_0x136f4d,_0xcc48b2,_0x37a814){let _0x59add1='';return()=>{if(!_0x59add1){const _0x2ddd83=_0x37a814['toView'](new _0xd8720b(_0x136f4d)),_0x245f6b=_0x37a814['htmlProcessor']['domConverter']['viewToDom'](_0x2ddd83)['querySelector']('[data-id=\x22'+_0xcc48b2+'\x22]');_0x59add1=_0x245f6b?.['outerHTML']||'';}return _0x59add1;};}['_findMarkerElement'](_0xf3c569,_0x46768f=0x5){let _0x127359=_0xf3c569,_0x2ccc71=null;for(let _0x4e52f6=0x0;_0x4e52f6<_0x46768f&&_0x127359;_0x4e52f6++){if(!_0x127359['className']){_0x127359=_0x127359['parentElement'];continue;}if(!(''+_0x127359['className'])['includes']('ck-ai_review-marker_')){_0x127359=_0x127359['parentElement'];continue;}if(!_0x127359['getAttribute']('data-marker-id'))break;_0x2ccc71=_0x127359;break;}return _0x2ccc71;}['_findMarkerElementById'](_0x5a1e69){const _0x14b16b=this['_markers']['get'](_0x5a1e69),_0xe9ad67=_0x14b16b?.['editor']??ds(this['context']),_0x5c450f=_0xe9ad67['model']['markers']['get'](_0x5a1e69);return _0x5c450f?_0x3d8b1f(_0xe9ad67['editing'],_0x5c450f):null;}['_getMarkersDataForGroup'](_0x1ad616){return Array['from'](this['_markers']['values']())['filter'](_0x5a90dc=>_0x5a90dc['groupId']===_0x1ad616);}['_getOperationStart'](_0xd62dbf){return'insert'===_0xd62dbf['type']?_0xd62dbf['position']:_0xd62dbf['newRange']['start'];}['_getOperationEnd'](_0x234cad,_0x326e9e=!0x1){return'insert'===_0x234cad['type']?_0x326e9e?_0x234cad['position']:_0x234cad['position']['getShiftedBy'](_0x234cad['howMany']):_0x234cad['newRange']['end'];}['_shiftOperation'](_0x3e8abf,_0x3a2a5a){return'insert'===_0x3e8abf['type']?_0x3e8abf['position']=_0x3e8abf['position']['getShiftedBy'](_0x3a2a5a):'marker'===_0x3e8abf['type']&&_0x3e8abf['newRange']&&(_0x3e8abf['newRange']=new _0x5d6ed6(_0x3e8abf['newRange']['start']['getShiftedBy'](_0x3a2a5a),_0x3e8abf['newRange']['end']['getShiftedBy'](_0x3a2a5a))),_0x3e8abf;}['_changeOperationOwnerDocument'](_0x2b7cd4,_0xec9cdf){'insert'===_0x2b7cd4['type']?_0x2b7cd4['position']=this['_changePositionOwnerDocument'](_0x2b7cd4['position'],_0xec9cdf):'marker'===_0x2b7cd4['type']&&_0x2b7cd4['newRange']&&(_0x2b7cd4['newRange']=this['_changeRangeOwnerDocument'](_0x2b7cd4['newRange'],_0xec9cdf));}['_changePositionOwnerDocument'](_0x2aabea,_0x1b7d23){return new _0x554d31(_0x1b7d23,_0x2aabea['path']);}['_changeRangeOwnerDocument'](_0x380522,_0x41952b){return new _0x5d6ed6(this['_changePositionOwnerDocument'](_0x380522['start'],_0x41952b),this['_changePositionOwnerDocument'](_0x380522['end'],_0x41952b));}['_changePosition'](_0x25a548,_0x12cf5a){return new _0x554d31(_0x12cf5a,[..._0x25a548]);}['_changeRange'](_0x149956,_0x3cf5e7,_0x3d3b36,_0x570e82){return new _0x5d6ed6(this['_changePosition'](_0x3cf5e7,_0x570e82),this['_changePosition'](_0x3d3b36,_0x570e82));}['_sortMarkers'](_0x163217){const _0x577923=_0x3262d6=>{switch(_0x3262d6){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x163217['sort']((_0x4988a6,_0x4c6e90)=>_0x577923(_0x4988a6['type'])-_0x577923(_0x4c6e90['type']));}['_hasSameTopLevelElement'](_0x56c2b2,_0x40751f){const _0x268154=_0x56c2b2['getChild'](0x0),_0x4258bf=_0x40751f['getChild'](0x0);return!(!_0x268154||!_0x4258bf)&&((!_0x268154['is']('element')||!_0x4258bf['is']('element')||_0x268154['name']===_0x4258bf['name'])&&!(_0x268154['is']('element')&&!_0x4258bf['is']('element')||!_0x268154['is']('element')&&_0x4258bf['is']('element')));}['_haveSingleTopLevelElement'](_0x4a29f0){return 0x1===_0x4a29f0['childCount'];}['_haveOnlyInlineContent'](_0x3f2089,_0x3f3829){for(const _0x476e52 of _0x3f2089['getChildren']())if(_0x476e52['is']('element')&&!_0x3f3829['isInline'](_0x476e52))return!0x1;return!0x0;}['_upsertDataId'](_0x49aa90,_0x2f08db){let _0x31d642=_0x49aa90['getAttribute'](_0x34af8c);return _0x31d642||(_0x31d642=_0x2f08db(),_0x49aa90['_setAttribute'](_0x34af8c,_0x31d642)),_0x31d642;}}class AIReviewCheckResult extends Et(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x37718c,contentNew:_0x1a8905,contentInitial:_0x16f11f,documentVersion:_0x27b14b}){super(),this['id']=_0x37718c,this['contentNew']=_0x1a8905,this['contentInitial']=_0x16f11f,this['documentVersion']=_0x27b14b;}}class AIReviewCheckResultChange extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x44da7d,_0x3d852c,_0x3d7f3a){super(),this['id']=_0x44da7d,this['parent']=_0x3d7f3a,this['_data']=_0x3d852c,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 AIReviewCheckRun extends ht(){['id']=ot();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x46044d,_0x2a03a6,_0x58b10a,_0x461994,_0x310334){super(),this['_sourceCheck']=_0x2a03a6,this['_documentData']=_0x46044d,this['_aiConnector']=_0x58b10a,this['_reviewParams']=_0x461994,this['_reviewArgs']=_0x310334,this['on']('change:status',(_0x1e83c3,_0x5ea5c5,_0x2a6ab0)=>{'aborted'==_0x2a6ab0&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x2a6ab0,'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'](_0x27ca3a=>'pending'===_0x27ca3a['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x46b4cb){this['_documentData']=_0x46b4cb;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x168d31=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x425c40 of _0x168d31)'unmodified'!==_0x425c40['data']['operation']&&('error'!==_0x425c40['data']['operation']?'review-metadata'!==_0x425c40['event']?this['_addReviewCheckResult'](_0x425c40['data']['dataId'],_0x425c40['data']['textDelta']):this['callId']=_0x425c40['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(_0x2a5800){this['_currentError']=_0x2a5800,_0x2a5800 instanceof Error&&_0x2a5800['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'](_0x2061bf,_0x428a05){const _0x102fa6=this['_results']['get'](_0x2061bf);if(!_0x102fa6)return;if(0x0===_0x428a05['length'])return;const _0x37369d=[];_0x428a05['forEach']((_0x5537ba,_0x3c1f70)=>{const _0x189e2a=new AIReviewCheckResultChange(_0x102fa6['id']+'-'+_0x3c1f70,_0x5537ba,_0x102fa6);_0x189e2a['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x189e2a,'status':_0x189e2a['status']});}),_0x189e2a['on']('change:isActivated',()=>{_0x189e2a['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x189e2a}):this['fire']('reviewCheckResultDeactivated',{'change':_0x189e2a});}),this['_changes']['push'](_0x189e2a),_0x37369d['push'](_0x189e2a);}),this['fire']('reviewCheckResultReady',{'changes':_0x37369d,'result':_0x102fa6,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x430842){const _0x3fbfcf=this['_changes']['find'](_0x4709dd=>_0x4709dd['id']===_0x430842);return!(!_0x3fbfcf||'pending'!==_0x3fbfcf['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x1fa7c3=>!0x0===_0x1fa7c3['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0xcf9a63=>'pending'===_0xcf9a63['status']);}['getChangeById'](_0x220204){return this['_changes']['find'](_0x3b22e3=>_0x3b22e3['id']===_0x220204);}['markAllChangesAsAccepted'](){for(const _0x1f8fd8 of this['_changes'])'pending'===_0x1f8fd8['status']&&(_0x1f8fd8['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x458648){const _0x49a66e=this['_changes']['find'](_0x547cbc=>_0x547cbc['id']===_0x458648);_0x49a66e&&'pending'===_0x49a66e['status']&&(_0x49a66e['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0xb4697f){const _0x3cc7c8=this['_changes']['find'](_0x4c1b0c=>_0x4c1b0c['id']===_0xb4697f);_0x3cc7c8&&'pending'===_0x3cc7c8['status']&&(_0x3cc7c8['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x5ad0fe){const _0x4ab34c=this['_changes']['find'](_0x1c1aad=>_0x1c1aad['id']===_0x5ad0fe);_0x4ab34c&&'pending'===_0x4ab34c['status']&&(_0x4ab34c['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x2e6ee7){const _0x3ad427=this['_changes']['find'](_0x450c28=>_0x450c28['id']===_0x2e6ee7);_0x3ad427&&'outdated'===_0x3ad427['status']&&(_0x3ad427['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x37f67f){this['_changes']['filter'](_0x251274=>_0x251274['isActivated']&&_0x251274['id']!==_0x37f67f)['forEach'](_0x4c3e65=>{_0x4c3e65['isActivated']=!0x1;});const _0x518572=this['_changes']['find'](_0x3db1a4=>_0x3db1a4['id']===_0x37f67f);_0x518572&&'pending'===_0x518572['status']&&(_0x518572['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x17e52a=>_0x17e52a['isActivated'])['forEach'](_0x21e59c=>{_0x21e59c['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x311025){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x30047d;if(_0x311025){const _0x4a83a9=this['_changes']['find'](_0x50e59a=>_0x50e59a['id']===_0x311025);if(_0x4a83a9&&_0x4a83a9['isRated'])return;_0x4a83a9&&(_0x30047d=_0x4a83a9['parent']['id'],_0x4a83a9['isRated']=!0x0);}const _0x575816={'positiveCount':this['_changes']['filter'](_0x48c44b=>'accepted'===_0x48c44b['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x575816,this['callId'],_0x30047d);}['_addReviewCheckResult'](_0x2ab4ca,_0x5a85db){const _0x2055d2=this['_documentData']['elements']['get'](_0x2ab4ca);if(!_0x2055d2)return;const _0x4777dd=_0x2055d2['getContent']();if(_0x4777dd===_0x5a85db)return;const _0x548a14=new AIReviewCheckResult({'id':_0x2ab4ca,'contentInitial':_0x4777dd,'contentNew':_0x5a85db,'documentVersion':_0x2055d2['documentVersion']});this['_results']['set'](_0x548a14['id'],_0x548a14),this['fire']('reviewCheckResultAdded',{'result':_0x548a14,'source':this,'editor':_0x2055d2['editor']});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x234451=>'pending'===_0x234451['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x3ea9a9=>'pending'===_0x3ea9a9['status'])['length']&&(this['status']='finished'));}}class AIReviewSystemCheckRun extends AIReviewCheckRun{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x3c1542=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x1aa990=0x0;_0x1aa990<this['_reviewParams']['length'];_0x1aa990++){if(!this['_reviewParams'][_0x1aa990]||!this['_sourceCheck']['options'][_0x1aa990])continue;const _0xbcb101=this['_sourceCheck']['options'][_0x1aa990],_0x8c077a=_0xbcb101['data']?.['find'](_0x1fbb96=>_0x1fbb96['id']===this['_reviewParams'][_0x1aa990]);_0x8c077a&&_0x3c1542['push'](_0x8c077a['label']);}return _0x3c1542['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x371900,_0x1281e2,_0x9d9e06){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x1281e2,_0x371900,_0x9d9e06);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class AIReviewCoreController extends _0x3cc0e4{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[AIConnector];}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(_0x5cbdf1,_0x2ad819)=>{const _0xf5cdfb=this['_aiReviewCheckList']['getCheckById'](_0x2ad819['id']);if(_0xf5cdfb){this['_onReviewCheckRun'](_0x2ad819),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x2ad819,_0xf5cdfb),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x2b5812,_0x5ce926)=>{switch(_0x5ce926['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x5ce926);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 at('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new at('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'!==_0x5ce926['status']&&'error-chunk'!==_0x5ce926['status']&&'error-general'!==_0x5ce926['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x36221e,_0x487d53)=>{if(!this['_currentReviewCheckRun'])throw new at('ai-review-mode-no-current-check-run',this);const _0x2ff33b=this['_diffContent'](_0x487d53['editor'],_0x487d53['result']['contentInitial'],_0x487d53['result']['contentNew']);_0x487d53['source']['addResultChanges'](_0x487d53['result']['id'],_0x2ff33b);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x2f699c,_0xa49b3d)=>{for(const _0x5760e7 of _0xa49b3d['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x5760e7);this['_markChangePositionInEditorContent'](_0xa49b3d['changes'],_0xa49b3d['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x1900de,_0x8eafb4)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x8eafb4['change']['id'],_0x8eafb4['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x351790,_0xd412d4)=>{this['_onReviewCheckResultActivated'](_0xd412d4);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x4c30a9){_0x4c30a9 instanceof Error&&_0x4c30a9['message']['includes']('ai-request-aborted')||(_0x4c30a9 instanceof at?this['_logError'](_0x4c30a9):this['_logError'](new at('ai-review-mode-check-run-failed',this,void 0x0,_0x4c30a9)));}}else this['_logError'](new at('ai-review-mode-source-check-not-found',this,{'checkId':_0x2ad819['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 _0x7c4f2d=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x7c4f2d['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x7c4f2d['map'](_0x2faadb=>_0x2faadb['id']));const _0x5601f7=this['_currentReviewCheckRun'];_0x5601f7['markAllChangesAsAccepted'](),_0x5601f7['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x57ff64,_0x1dcc0a)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1dcc0a['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x1dcc0a['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x1dcc0a['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x1dcc0a['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x3ddc82,_0x21e029)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x21e029['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x21e029['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x21e029['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x21e029['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',(_0x416db1,_0x35c64d)=>{this['_onActivateChange'](_0x35c64d);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x4456a8,_0x3a6380)=>{this['_onDeactivateChange'](_0x3a6380);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x56365d,_0x3918c2)=>{this['_onChangeMarkerClicked'](_0x56365d,_0x3918c2);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x1b2239,_0x47e356)=>{this['_onChangeMarkerHovered'](_0x1b2239,_0x47e356);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0xf66c73,_0x2221bd)=>{this['_onChangeMarkerRemoved'](_0xf66c73,_0x2221bd);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x36d9bd,_0x38d1aa)=>{this['_onChangeMarkerRestored'](_0x36d9bd,_0x38d1aa);});}['_createReviewCheckRun'](_0x5ddc9c,_0x455dbe){return new AIReviewSystemCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x455dbe,this['_aiConnector'],_0x5ddc9c['params'],_0x5ddc9c['args']);}['_onChangeMarkerRemoved'](_0x423fb6,_0x19ddcd){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x19ddcd['changeId']);}['_onChangeMarkerRestored'](_0x1e5c58,_0x30a647){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x30a647['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x1e5c98=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x1e5c98&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x32cca8 of this['_aiReviewCoreEditing']['getEditors']())_0x32cca8['editing']['view']['change'](_0x4cf34f=>{for(const _0x44a341 of _0x32cca8['editing']['view']['document']['getRoots']())_0x4cf34f['removeClass']('ck-ai_review-diff',_0x44a341),_0x4cf34f['removeClass']('ck-ai_review-highlights',_0x44a341),_0x4cf34f['removeClass']('ck-ai-translate-mode-content',_0x44a341);});}['_getTranslationWithDefault'](_0x44fa24,_0x10f226){const _0x445f9c=Hi(this['context']['locale'],_0x44fa24);return _0x445f9c===_0x44fa24?_0x10f226:_0x445f9c;}['_logError'](_0x2f0073,_0x45f087=!0x1){Ct(_0x2f0073['message']),_0x45f087||(_0x2f0073['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x12b2bb){if('content'===this['_changeActivationSource']){const _0x44b7d1=this['_aiReviewCoreUi']['getChangeElement'](_0x12b2bb);_0x44b7d1&&ft(_0x44b7d1['closest']('.ck-ai_review__check-run-result')||_0x44b7d1);}else{if('panel'===this['_changeActivationSource']){const _0x5c9e81=this['_getChangeContentElement'](_0x12b2bb);if(!_0x5c9e81)return;wt({'target':_0x5c9e81,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const Yn=[{'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 AIReviewCheck{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x1481ee){this['id']=_0x1481ee['id'],this['commandId']=_0x1481ee['commandId'],this['title']=_0x1481ee['title'],this['description']=_0x1481ee['description'],this['isParameterized']=_0x1481ee['isParameterized'],this['useArgs']=_0x1481ee['useArgs'],this['options']=_0x1481ee['options'],this['args']=_0x1481ee['args'];}}class AIReviewCheckList extends ht(){['_checks']=[];['setupChecks'](_0x262646){this['_checks']=_0x262646['map'](_0x1ad043=>new AIReviewCheck(_0x1ad043));}get['checks'](){return this['_checks'];}['getCheckById'](_0x406a8f){return this['checks']['find'](_0x10d130=>_0x10d130['id']===_0x406a8f);}['removeCheckById'](_0x2757f9){this['_checks']=this['_checks']['filter'](_0x35c47c=>_0x35c47c['id']!==_0x2757f9);}}class AIReviewCheckCustom extends AIReviewCheck{['_models']=[];['_defaultModel']=null;constructor(_0x201949,_0x5ca7a0,_0x3caf33){super(_0x201949),this['_models']=_0x5ca7a0,this['_defaultModel']=_0x3caf33;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class AIReviewCheckExtra extends AIReviewCheck{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x240ab7,_0x831723,_0x52c4e9){super(_0x240ab7),this['prompt']=_0x240ab7['prompt'],this['model']=_0x240ab7['model'],this['model']?this['_defaultModel']=_0x831723['find'](_0x3eb5a9=>_0x3eb5a9['id']===this['model'])||null:this['_defaultModel']=_0x52c4e9;}get['defaultModel'](){return this['_defaultModel'];}}class AIReviewModeCheckList extends AIReviewCheckList{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x345de3,_0x5cebd4,_0x28e1c8){super(),this['_allModels']=_0x345de3,this['_recommendedModels']=_0x5cebd4,this['_defaultModel']=_0x28e1c8;}['setupChecks'](_0x16f49f){this['_checks']=_0x16f49f['map'](_0x40473d=>!0x0===_0x40473d['isExtra']?new AIReviewCheckExtra(_0x40473d,this['_allModels'],this['_defaultModel']):'custom'===_0x40473d['id']?new AIReviewCheckCustom(_0x40473d,this['_recommendedModels'],this['_defaultModel']):new AIReviewCheck(_0x40473d));}}class AIReviewCustomCheckRun extends AIReviewCheckRun{['_prompt'];['_model'];constructor(_0x40afca,_0x2f61c6,_0x54b1f4,_0x44e4ab,_0x43392c){super(_0x54b1f4,_0x44e4ab,_0x43392c),this['_prompt']=_0x40afca,this['_model']=_0x2f61c6;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0xac723f,_0x4bb652,_0x523d8f){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x4bb652,_0xac723f,_0x523d8f);}}class AIReviewExtraCheckRun extends AIReviewCustomCheckRun{get['subTitle'](){return'';}set['prompt'](_0x81e2a2){this['_prompt']=_0x81e2a2;}set['model'](_0x53ad37){this['_model']=_0x53ad37;}}class AIReviewModeController extends AIReviewCoreController{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x102172){super(_0x102172),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',Yn['map'](_0x2b6d57=>_0x2b6d57['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x3a036f,_0x121ceb)=>{this['_isDiffOn']=_0x121ceb['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x86e0be,_0x226265){return _0x86e0be['isCustom']?new AIReviewCustomCheckRun(_0x86e0be['args']['prompt'],_0x86e0be['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x226265,this['_aiConnector']):_0x226265['isExtra']?new AIReviewExtraCheckRun(_0x226265['prompt'],_0x226265['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x226265,this['_aiConnector']):new AIReviewSystemCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x226265,this['_aiConnector'],_0x86e0be['params'],_0x86e0be['args']);}['_onReviewCheckResultActivated'](_0x5c96ee){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x5c96ee['change']['id']),this['_scrollToChange'](_0x5c96ee['change']['id']);const _0x161a1f=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x5c96ee['change']['id']);if(!_0x161a1f)return;const _0x588533=this['_aiReviewCoreEditing']['getEditorForChange'](_0x5c96ee['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x5c96ee['change'],()=>_0x161a1f['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x588533,_0x161a1f['modelRange']['root']['rootName']),_0x588533?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x5c96ee['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x261408){this['_currentReviewCheckRun']&&'click'===_0x261408['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x261408['id']));}['_onDeactivateChange'](_0x120aa9){this['_currentReviewCheckRun']&&'balloon'===_0x120aa9['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x27be06,_0x426c76){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x426c76['changeId']);const _0x113007=this['_currentReviewCheckRun']['getChangeById'](_0x426c76['changeId']);if(!_0x113007)return;const _0x429767=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x426c76['changeId']),_0x147b1e=this['_aiReviewCoreEditing']['getEditorForChange'](_0x426c76['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x113007,_0x426c76['markerElement'],_0x426c76['domEvent'],'click',this['_getBalloonDomRoot'](_0x147b1e,_0x429767?.['modelRange']['root']['rootName']),_0x147b1e?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x487fe3,_0x1cf487){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x236fa8=this['_currentReviewCheckRun']['getChangeById'](_0x1cf487['changeId']);if(!_0x236fa8)return;const _0x5483e9=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1cf487['changeId']),_0x23a2ba=this['_aiReviewCoreEditing']['getEditorForChange'](_0x1cf487['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x236fa8,_0x1cf487['markerElement'],_0x1cf487['domEvent'],'hover',this['_getBalloonDomRoot'](_0x23a2ba,_0x5483e9?.['modelRange']['root']['rootName']),_0x23a2ba?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x3f5478){const _0x52f728=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x3f5478);return _0x52f728?_0x52f728['getElement']():null;}['_markChangePositionInEditorContent'](_0x139f30,_0x4b326b){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x139f30,_0x4b326b);}['_diffContent'](_0x349662,_0x4bf2ec,_0x20ed93){return this['_aiReviewCoreEditing']['diffContent'](_0x349662,_0x4bf2ec,_0x20ed93,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x25f122){_0x25f122?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0x401780 of this['_aiReviewCoreEditing']['getEditors']())_0x401780['editing']['view']['change'](_0x1a67d6=>{for(const _0x2ce202 of _0x401780['editing']['view']['document']['getRoots']()){for(const _0x5515c6 of _0x2ce202['getClassNames']())_0x5515c6['startsWith']('ck-ai_review-')&&_0x1a67d6['removeClass'](_0x5515c6,_0x2ce202);_0x1a67d6['addClass'](_0x25f122?'ck-ai_review-diff':'ck-ai_review-highlights',_0x2ce202);}});}['_getBalloonDomRoot'](_0x49a61b,_0x1c386b){const _0x8c36e0=_0x49a61b['editing']['view'];if(_0x1c386b){const _0xb1babb=_0x8c36e0['getDomRoot'](_0x1c386b);if(_0xb1babb)return _0xb1babb;}return _0x8c36e0['getDomRoot']()??void 0x0;}async['_getChecksList'](){const _0x154f6e=[...Yn,...this['_getExtraChecks']()],_0x1ffa8b=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x1ffa8b,_0x154f6e);let _0x575b89=_0x154f6e;this['_hasDefaultAvailableCommands']||(_0x575b89=_0x1ffa8b['map'](_0x3321f4=>_0x154f6e['find'](_0x484aa1=>_0x484aa1['id']===_0x3321f4))['filter'](_0x3a7263=>!!_0x3a7263)),_0x575b89=_0x575b89['map'](_0x10c96f=>_0x10c96f['isExtra']?_0x10c96f:this['_translateReviewCheck'](_0x10c96f));const _0x424d14=_0x575b89['some'](_0x2fb80a=>_0x2fb80a['isExtra']||'custom'===_0x2fb80a['id']);let _0xd64c29=[],_0x1e76c0=[],_0x5ca5be=null;if(_0x424d14){const _0x2922c7=await this['_getModels']();_0xd64c29=_0x2922c7['all'],_0x1e76c0=_0x2922c7['recommended'],_0x5ca5be=_0x2922c7['default'];}const _0x2969a2=new AIReviewModeCheckList(_0xd64c29,_0x1e76c0,_0x5ca5be);return _0x2969a2['setupChecks'](_0x575b89),_0x424d14&&this['_filterChecksWithMissingModel'](_0x2969a2),_0x2969a2;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x49a193=>({'id':_0x49a193['id'],'commandId':_0x49a193['id'],'title':_0x49a193['label'],'description':_0x49a193['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x49a193['prompt'],'model':_0x49a193['model']}));}['_logErrorForNonExistentChecks'](_0x29cd8d,_0x30b6e4){const _0x10d52b=_0x29cd8d['filter'](_0x4852b2=>!_0x30b6e4['some'](_0x1c9843=>_0x1c9843['id']===_0x4852b2));_0x10d52b['length']&&this['_logError'](new at('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x10d52b['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x1d5532=new AIModels({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x1d5532['getAll'](),'recommended':await _0x1d5532['getAvailableModels'](),'default':await _0x1d5532['getDefault']()};}catch(_0x2462b8){return this['_logError'](new at('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x2462b8)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x2ee95f){const _0x5f3b30='AI_REVIEW_CHECK_'+_0x2ee95f['id']['toUpperCase']()['replaceAll']('-','_'),_0x253026={..._0x2ee95f,'title':this['_getTranslationWithDefault'](_0x5f3b30+'_TITLE',_0x2ee95f['title']),'description':this['_getTranslationWithDefault'](_0x5f3b30+'_DESCRIPTION',_0x2ee95f['description'])};return _0x2ee95f['options']&&(_0x253026['options']=_0x2ee95f['options']['map'](_0x421989=>({..._0x421989,'label':this['_getTranslationWithDefault'](_0x5f3b30+'_OPTIONS_LABEL',_0x421989['label']||''),'data':_0x421989['data']?_0x421989['data']['map'](_0x54733f=>({..._0x54733f,'label':this['_getTranslationWithDefault'](_0x5f3b30+'_OPTIONS_DATA_'+_0x54733f['id']['toUpperCase'](),_0x54733f['label'])})):void 0x0}))),_0x253026;}['_filterChecksWithMissingModel'](_0x176c8d){const _0x35478b=[];_0x176c8d['checks']['forEach'](_0x11261b=>{(_0x11261b instanceof AIReviewCheckExtra&&!_0x11261b['defaultModel']||_0x11261b instanceof AIReviewCheckCustom&&!_0x11261b['models']['length'])&&_0x35478b['push'](_0x11261b['id']);}),_0x35478b['length']&&_0x35478b['forEach'](_0x514af1=>{_0x176c8d['removeCheckById'](_0x514af1),this['_logError'](new at('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x514af1}),!0x0);});}}class AIReviewMode extends _0x3cc0e4{static get['requires'](){return[AIReviewModeController,AIReviewModeUI,AIReviewCoreEditing];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class AITranslateCheck extends AIReviewCheck{get['apiId'](){return'translate';}}class AITranslateCheckList extends AIReviewCheckList{['setupChecks'](_0x4276a0){this['_checks']=_0x4276a0['map'](_0x131d5a=>new AITranslateCheck(_0x131d5a));}}class AITranslateCheckRun extends AIReviewSystemCheckRun{['_title'];constructor(_0x5a4d30,_0x2c145d,_0x588c6b,_0x2fa32b,_0x160127,_0x44b394){super(_0x5a4d30,_0x2c145d,_0x588c6b,_0x160127,_0x44b394),this['_title']=_0x2fa32b;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class AITranslateController extends AIReviewCoreController{static get['pluginName'](){return'AITranslateController';}constructor(_0x451f6d){super(_0x451f6d),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'](_0x3c8190,_0x5b2585){return new AITranslateCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5b2585,this['_aiConnector'],Hi(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x3c8190['params'],_0x3c8190['args']);}['_onReviewCheckResultActivated'](_0x4d6df5){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x4d6df5['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x4d6df5['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x32ab3d){this['_currentReviewCheckRun']&&('hover'===_0x32ab3d['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x32ab3d['id'])),'click'===_0x32ab3d['uiInteraction']&&this['_scrollToChange'](_0x32ab3d['id']));}['_onDeactivateChange'](_0x1bd20b){this['_currentReviewCheckRun']&&'panel'===_0x1bd20b['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x45c592,_0x36dfd0){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x36dfd0['changeId']),this['_scrollToChange'](_0x36dfd0['changeId']));}['_onChangeMarkerHovered'](_0x7553ab,_0x5027bf){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5027bf['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x5027bf['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x41bab2){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x41bab2);}['_markChangePositionInEditorContent'](_0x227d85,_0x4f3c31){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x227d85,_0x4f3c31);}['_diffContent'](_0x230783,_0x3873d9,_0x50cf42){return this['_aiReviewCoreEditing']['diffContent'](_0x230783,_0x3873d9,_0x50cf42,!0x0);}['_onReviewCheckRun'](){for(const _0x5515b2 of this['_aiReviewCoreEditing']['getEditors']())_0x5515b2['editing']['view']['change'](_0xf01557=>{for(const _0x3117e3 of _0x5515b2['editing']['view']['document']['getRoots']())_0xf01557['addClass']('ck-ai-translate-mode-content',_0x3117e3);});}async['_getChecksList'](){const _0x2e80c0=[],_0x5550ed=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x1d3f11 of _0x5550ed)_0x2e80c0['push']({'title':_0x1d3f11['label'],'id':_0x1d3f11['id'],'commandId':_0x1d3f11['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x1d3f11['id']}});const _0x17fda7=new AITranslateCheckList();return _0x17fda7['setupChecks'](this['_translateChecks'](_0x2e80c0)),_0x17fda7;}['_translateChecks'](_0x43eada){return _0x43eada['map'](_0x515f36=>{const _0x197e60='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x515f36['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x515f36,'title':this['_getTranslationWithDefault'](_0x197e60,_0x515f36['title'])};});}}class AITranslateCheckResultsView extends AIReviewCoreUICheckResultsView{constructor(_0x1d9af5,_0x2846be){super(_0x1d9af5,_0x2846be),this['on']('set:isLoading',(_0x5386b2,_0x2d4681,_0x4417dc)=>{_0x4417dc&&(this['headerTitle']=Hi(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x25d912,_0x4103cd,_0x905ae4)=>{_0x905ae4&&(this['headerTitle']=Hi(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x31278d=super['_createAcceptAllButtonView']();return _0x31278d['set']('label',Hi(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x31278d;}['_createExitReviewButtonView'](){const _0x58813d=super['_createExitReviewButtonView']();return _0x58813d['set']('label',Hi(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x58813d;}}class AITranslateCheckListView extends AIReviewCoreReviewCheckListView{['_setupTemplate'](){const _0x116a8b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x116a8b['if']('isVisible','ck-hidden',_0x3132b1=>!_0x3132b1)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':Hi(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':Hi(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x116a8b['if']('isVisible','ck-hidden',_0x420c65=>!_0x420c65)]},'children':this['_checkViews']}]});}}class AITranslateUI extends AIReviewCoreUI{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x4587ee=this['context']['plugins']['get']('AITabs'),_0x481c83=this['context']['locale'],_0x586239=new AIHeaderView(_0x481c83,{'label':Hi(_0x481c83,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x31db4a,'class':'ck-ai-header_review-translate','showResizeButton':_0x4587ee['showResizeButton']});_0x586239['delegate']('resizeTabs')['to'](_0x4587ee),_0x586239['bind']('isMaximized')['to'](_0x4587ee['view'],'isMaximized',_0x47f932=>_0x47f932);const _0x43ee6c=new AIReviewCoreView(_0x481c83,{'header':_0x586239,'list':new AITranslateCheckListView(_0x481c83),'results':new AITranslateCheckResultsView(_0x481c83,{'generalErrorText':Hi(_0x481c83,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new AIReviewCoreReviewCompletedView(_0x481c83,{'headerText':Hi(_0x481c83,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':Hi(_0x481c83,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':Hi(_0x481c83,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x43ee6c['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x43ee6c;}['registerTab'](){const _0x3316d7=this['context']['plugins']['get']('AITabs');_0x3316d7['view']['on']('activateTab',(_0x4f8552,{newTab:_0x18db04,oldTab:_0x43368a})=>{'translate'===_0x18db04?this['fire']('getReviewCheckList'):'translate'===_0x43368a&&this['fire']('leaveReview');}),_0x3316d7['view']['addTab']({'id':'translate','buttonLabel':Hi(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x31db4a,'order':0x0,'content':this['_mainView']});}}class AITranslate extends _0x3cc0e4{static get['requires'](){return[AITranslateController,AITranslateUI,AIReviewCoreEditing];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{AIActions,AIAdapter,AIAssistant,AIAssistantUI,AIBalloon,AIChat,AIChatController,AIChatFeedCustomElementView,AIChatHistory,AIChatHistoryController,AIChatHistoryUI,AIChatInteraction,AIChatShortcuts,AIChatUI,AIConnector,AIEditing,AIEditorIntegration,AIInteraction,AIQuickActions,AIQuickActionsUI,AIReply,AIRequestError,AIReviewCheck,AIReviewCheckResult,AIReviewCheckResultChange,AIReviewCheckRun,AIReviewMode,AIReviewCoreController as AIReviewModeController,AIReviewCoreEditing as AIReviewModeEditing,AIReviewModeUI,AITabs,AITabsMainView,AITabsView,AITextAdapter,AIToggleButtonUI,AITranslate,AITranslateController,AITranslateUI,AWSTextAdapter,OpenAITextAdapter,ShowAIAssistantCommand,ToggleAICommand,Gi as createResizeButton,Di as getDefaultAICommands};
23
+ import{Command as _0x3f0a57,ContextPlugin as _0x4cd5fc,Editor as _0x553634,Plugin as _0x158c3f,rootAcceptsBlocks as _0x598751}from'@ckeditor/ckeditor5-core';import{IconAIAdjustLength as _0x435456,IconAIAskAI as _0x4745fe,IconAIChangeTone as _0x59af22,IconAIChat as _0x2024d5,IconAIChatCommands as _0x1e0a0c,IconAIContinueWriting as _0x21f936,IconAIGrammarCheck as _0x2315ac,IconAIHistory as _0x23e734,IconAIImproveWriting as _0x6ea41f,IconAIOther as _0xd0155a,IconAIQuickActions as _0x957fd2,IconAIReview as _0x2c00e7,IconAITranslate as _0x46b415,IconBoxWithCheck as _0x4e0bfc,IconBoxWithCross as _0x28a335,IconBoxWithMarker as _0x32dbd8,IconBrowseFiles as _0x43cd6e,IconBulb as _0x44fd08,IconCancel as _0x29be46,IconCheck as _0x42448e,IconChevronDown as _0xcedfde,IconChevronLeft as _0x33c89a,IconChevronRight as _0x4273a3,IconChevronUp as _0x6b5523,IconCopy as _0x21a060,IconDocument as _0x5e85dd,IconDocumentOutline as _0x1052b8,IconDropdownArrow as _0x4e5c52,IconError as _0x1797f9,IconEye as _0x508a5c,IconEyeCrossedOut as _0x41fd30,IconFileUpload as _0x105dd2,IconImage as _0x3c70a7,IconInfo as _0x14d28a,IconLink as _0x3bcbd8,IconLock as _0x61b11,IconLoupe as _0x432e10,IconMagicWand as _0x3e186b,IconMaximize as _0x1ab7e1,IconMinimize as _0x2a01f5,IconOutdated as _0x230d59,IconPaperClip as _0x4245d8,IconPencil as _0x4e1016,IconPin as _0x5ad74f,IconPlus as _0x293553,IconPreviousArrow as _0x9f5b9e,IconRefresh as _0x34fe5e,IconRemove as _0x173e6f,IconRevisionHistory as tt,IconRobotPencil as et,IconSelection as it,IconShowChangesOff as st,IconShowChangesOn as nt,IconStop as rt,IconStopCircle as ot,IconSubmit as at,IconThreeHorizontalDots as ht,IconThumbDown as ct,IconThumbUp as lt,IconWeb as ut}from'@ckeditor/ckeditor5-icons';import{CKEditorError as dt,Collection as _t,DomEmitterMixin as gt,EmitterMixin as It,EventInfo as At,FocusTracker as Et,KeystrokeHandler as pt,ObservableMixin as mt,Rect as Tt,ResizeObserver as wt,ShadowRootRegistry as Ct,_isMotionReduced as ft,containsNode as Rt,decodeLicenseKey as bt,findClosestScrollableAncestor as St,first as Ot,getActiveElement as vt,getConstrainedViewportRect as yt,getElementFromPoint as Nt,getLayoutParentElement as kt,getOverlayMountRoot as xt,getParentElement as Lt,getParentNode as Dt,getSelection as Pt,getShadowRoots as Mt,global as Vt,insertToPriorityArray as Ht,isFeatureBlockedByLicenseKey as Ut,isVisible as Bt,listenToShadowRoots as Gt,logError as Wt,logWarning as Ft,priorities as Kt,scrollAncestorsToShowTarget as $t,scrollViewportToShowTarget as Yt,toArray as qt,trustedHtml as Qt,uid as Xt,version as zt}from'@ckeditor/ckeditor5-utils';import{AutocompleteView as jt,BalloonPanelView as Jt,BalloonToolbar as Zt,ButtonLabelView as te,ButtonLabelWithHighlightView as _0x4bbfbe,ButtonView as _0x1a9216,Dialog as _0x3fa2e4,DialogViewPosition as _0x4abac9,DropdownMenuPanelPositioningFunctions as _0x592d61,FileDialogListItemButtonView as _0x193b34,FocusCycler as _0x17323b,FormHeaderView as _0x105865,FormRowView as _0x57ecc8,HighlightedTextView as _0x2d3d45,IconView as _0x5e3c18,InputTextView as _0x3a21ad,LabeledFieldView as _0x187ed8,ListItemButtonView as _0x4bbb4c,ListItemGroupView as _0x340eed,ListItemView as _0xf665cb,ListView as _0x4e6fd6,MenuBarMenuListItemButtonView as _0x410c15,MenuBarMenuListItemView as _0x5d5b51,MenuBarMenuListView as _0x1969ff,MenuBarMenuView as _0x5e7fd5,OverlayHost as _0x5c12c0,SearchTextView as _0x2750eb,SpinnerView as _0x407319,TabButtonView as _0x5207ba,TabPanelView as _0x224963,Template as _0x4e263f,TextareaView as _0x1e334c,ToolbarView as _0x20288e,UIModel as _0x13bdb1,View as _0x2df458,ViewCollection as _0x15c4c2,addListToDropdown as _0x34e876,addMenuToDropdown as _0x318cd1,clickOutsideHandler as _0x314252,createDropdown as _0x4c754a,createLabeledInputText as _0x31f20c,createLabeledTextarea as _0x3e1b5a,submitHandler as _0x32c7ed}from'@ckeditor/ckeditor5-ui';import{ClipboardMarkersUtils as _0x5aeead,ClipboardPipeline as _0x438fad}from'@ckeditor/ckeditor5-clipboard';import{AttributeOperation as _0x3d87a4,InsertOperation as _0x38210e,MarkerOperation as _0x2070bd,Matcher as _0x3c66f4,MergeOperation as _0xfcd33f,ModelDocumentFragment as _0x1f9306,ModelPosition as _0x265910,ModelRange as _0x3aaa22,ModelText as _0x55e0d0,ModelTreeWalker as _0x3d1b58,MoveOperation as _0x155687,RenameOperation as _0x127e1f,RootAttributeOperation as ti,RootOperation as _0x285c43,SplitOperation as _0xe7e0e0,ViewDataTransfer as _0x416400,ViewDocumentDomEventData as _0x594118,ViewDowncastWriter as _0x1cc48b,ViewUpcastWriter as _0x1617d1,_DetachOperation as _0x500e5d,_insertIntoModelNodeList as _0x53f0c6,_removeFromModelNodeList as _0x3922ec,transformOperationSets as _0x3e782f}from'@ckeditor/ckeditor5-engine';import{cloneDeep as _0x30d267,debounce as _0x2fd977,escape as _0x369484,escapeRegExp as _0x3df188,isElement as _0x106ca2,omit as _0x35ebf4,throttle as _0x467982,unescape as _0x2e6a78}from'es-toolkit/compat';import{createParser as _0x252d62}from'eventsource-parser';import{CloudServices as _0x1e4e62}from'@ckeditor/ckeditor5-cloud-services';import{parseDocument as _0x15b430}from'htmlparser2';import{append as _0x4fa086,appendChild as _0x4e05c7,find as _0x55659d,findAll as _0x457f76,findOne as _0x1b0303,getChildren as _0x4fdaaa,getParent as _0x294335,isComment as _0x1800e7,isTag as _0x58049c,prepend as _0x1e83fe,prependChild as _0x18efcf,removeElement as _0x15340f,replaceElement as _0x418ed2,textContent as _0x42359b}from'domutils';import _0x24a162 from'dom-serializer';import{Document as _0x47233a,Element as _0x3cf04b,NodeWithChildren as _0x2ba83d,Text as _0x3978f9,cloneNode as _0x950ff,isDocument as _0x2388bd,isText as _0x4f3ed2}from'domhandler';import{diffArrays as _0x3874b5}from'diff';import{ConfirmMixin as _0x15c985,PillView as _0x286f6b,SuggestionsConversion as _0x33c035,fixElementSuggestionRange as _0x236d37,getAllMarkersDomElementsSorted as _0x4337d7,getMarkerDomElement as _0x4e2022,hashObject as _0xab9059,isInvalidAttributeOperation as _0x3463ba,isPointerStillOver as _0x299f8c,reRootOperation as ts,splitSuggestionMarkerName as _0x3940d0}from'@ckeditor/ckeditor5-collaboration-core';import{MarkdownGfmMdToHtml as _0x329971,MarkdownGfmMdToHtmlDefaultPlugins as _0x229e08}from'@ckeditor/ckeditor5-markdown-gfm';import _0x100e8b from'rehype-sanitize';import _0x163546 from'morphdom';const os='_ungrouppedCommands';function as(_0x37b73b,_0x372318){const _0x3a08da=(0x0,_0x372318['t'])('Other');return _0x37b73b['length']?'groupId'in _0x37b73b[0x0]?_0x37b73b:[{'groupId':os,'groupLabel':_0x3a08da,'order':0x1/0x0,'commands':_0x37b73b}]:[{'groupId':os,'groupLabel':_0x3a08da,'order':0x1/0x0,'commands':[]}];}const hs=globalThis['DataTransfer'],cs='ai-ui';var ls=class extends _0x158c3f{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {editor:_0x3fdc90}=this;_0x3fdc90['conversion']['for']('editingDowncast')['markerToHighlight']({'model':cs,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x3fdc90['conversion']['for']('editingDowncast')['markerToElement']({'model':cs,'view':(_0x146158,{writer:_0x5b1a9e})=>{if(!_0x146158['markerRange']['isCollapsed'])return null;const _0x21c802=_0x5b1a9e['createUIElement']('span');return _0x5b1a9e['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x21c802),_0x21c802;}});}afterInit(){this['_blockIfRemovedByLicenseKey'](),async function(_0x17343c){const _0x3e276e='nA7yurgOHbZvDplRkJscdICm86oPWx92f1qF0LaSX3NGwTMK4jVtYUBQi5zheE',_0x5ab890=0x79710,_0x111f6a={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0xf900da(_0x5dc9d9){const _0x49fa9e=new window['Promise'](_0x276559=>{_0x5dc9d9['once']('ready',_0x276559);}),_0x360ec9=window['Date']['now'](),_0x2c842d=_0x5dc9d9['config']['get']('licenseKey');async function _0x4e75f7(){let _0x3db1ac,_0x5e932a=null,_0x2f2d8f=null;try{return'GPL'==_0x2c842d?'NotAllowed':(_0x3db1ac=_0x2f353f(),_0x3db1ac?(_0x3db1ac['usageEndpoint']&&(_0x2f2d8f=_0x509a9e(_0x3db1ac['usageEndpoint'],_0x3db1ac['jti'])),await _0x2bcd7b()?_0x444b7e()?_0x257564()?'Expired':_0x46163f()?('evaluation'==_0x3db1ac['licenseType']&&(_0x5e932a=_0x2ee05f('EvaluationLimit')),await _0x1dc69b()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x257564(){const _0x7d2d2a=['evaluation','trial']['includes'](_0x3db1ac['licenseType'])?_0x360ec9/0x3e8:0xe10*_0x5ab890;return _0x3db1ac['exp']<_0x7d2d2a;}function _0x444b7e(){const _0x44f1c4=_0x3db1ac['features'];return!!_0x44f1c4&&(!!_0x44f1c4['includes']('*')||!!_0x44f1c4['includes']('AI'));}function _0x46163f(){const _0x1d91cc=_0x3db1ac['licensedHosts'];if(!_0x1d91cc||0x0==_0x1d91cc['length'])return!0x0;const {hostname:_0x4cd3f6}=new URL(window['location']['href']);if(_0x1d91cc['includes'](_0x4cd3f6))return!0x0;const _0xbed7ca=_0x4cd3f6['split']('.');return _0x1d91cc['filter'](_0x19f1ff=>_0x19f1ff['includes']('*'))['map'](_0x58bda3=>_0x58bda3['split']('.'))['filter'](_0x1a1f89=>_0x1a1f89['length']<=_0xbed7ca['length'])['map'](_0x27e6d5=>Array(_0xbed7ca['length']-_0x27e6d5['length'])['fill']('*'===_0x27e6d5[0x0]?'*':'')['concat'](_0x27e6d5))['some'](_0x49922d=>_0xbed7ca['every']((_0x2a46e2,_0x535f1e)=>_0x49922d[_0x535f1e]===_0x2a46e2||'*'===_0x49922d[_0x535f1e]));}function _0x1dc69b(){return _0x5e932a&&_0x2f2d8f?new window['Promise']((_0xbe078b,_0x52f415)=>{_0x5e932a['then'](_0xbe078b,_0x52f415),_0x2f2d8f['then'](_0x366e48=>{'Valid'!=_0x366e48&&_0xbe078b(_0x366e48);},_0x52f415);}):_0x5e932a||_0x2f2d8f||'Valid';}}function _0x509a9e(_0x39f7ff,_0x54b3f2){return new window['Promise'](_0x2c8bb2=>{if(_0x1b70a6())return _0x2c8bb2('Valid');_0x40f6d8(),_0x5dc9d9['decorate']('_sendUsageRequest');let _0x963eaf=!0x1;const _0x595347=Xt();function _0x215173(_0xbc351){return!!_0xbc351&&('object'==typeof _0xbc351||'function'==typeof _0xbc351)&&'function'==typeof _0xbc351['then']&&'function'==typeof _0xbc351['catch'];}function _0xee8e62(_0x2eb94e){_0x5c8fc4(_0x2eb94e)['then'](_0x29bad4=>_0x29bad4&&'ok'==_0x29bad4['status']?_0xfee174(_0x2c57d7(_0x595347+_0x54b3f2))!=_0x29bad4['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x116aa8=>(_0x4f6b52(),_0x116aa8),()=>{const _0x573368=_0x495ce0();return null==_0x573368?(_0x4f6b52(),'Valid'):_0x360ec9-_0x573368>0x240c8400?'UsageLimit':'Valid';})['then'](_0x2c8bb2)['catch'](()=>{_0x2c8bb2('UsageLimit');});const _0x13261e=0x36ee80;function _0x4f6b52(){const _0x427bd8='llct-'+_0xfee174(_0x2c57d7(_0x39f7ff)),_0xfb41fa=_0x3d8723(_0xfee174(window['Math']['ceil'](_0x360ec9/_0x13261e)));window['localStorage']['setItem'](_0x427bd8,_0xfb41fa);}function _0x495ce0(){const _0x4b1d7c='llct-'+_0xfee174(_0x2c57d7(_0x39f7ff)),_0x408a76=window['localStorage']['getItem'](_0x4b1d7c);return _0x408a76?window['parseInt'](_0x3d8723(_0x408a76),0x10)*_0x13261e:null;}function _0x5c8fc4(_0x11297e){return new window['Promise']((_0x2010d9,_0x57549d)=>{_0x11297e['then'](_0x2010d9,_0x57549d),window['setTimeout'](_0x57549d,0x1d4c0);});}}_0x5dc9d9['on']('_sendUsageRequest',(_0xb99de1,_0xe792bd)=>{if(_0xe792bd[0x0]!=_0x39f7ff)return _0x2c8bb2('UsageLimit');_0xe792bd[0x1]={..._0xe792bd[0x1],'requestId':_0x595347};},{'priority':'high'}),_0x5dc9d9['on']('_sendUsageRequest',_0x4491da=>{_0x215173(_0x4491da['return'])&&(_0x963eaf=!0x0,_0xee8e62(_0x4491da['return']));},{'priority':'low'}),_0x49fa9e['then'](()=>{_0x963eaf||_0x2c8bb2('UsageLimit');});});function _0x1b70a6(){return'auto'==_0x5dc9d9['editing']['view']['_overlayModeHint'];}function _0x40f6d8(){_0x5dc9d9['editing']['view']['_overlayModeHint']='auto';}}function _0x2ee05f(_0x448e00){const _0x232b40=[new window['Promise'](_0x38c2e1=>setTimeout(_0x38c2e1,0x93ecc)),_0x49fa9e['then'](()=>new window['Promise'](_0x31832f=>{let _0x2c29c4=0x0;_0x5dc9d9['model']['on']('applyOperation',(_0x12e1c8,_0x38e211)=>{_0x38e211[0x0]['isDocumentOperation']&&_0x2c29c4++,0x5e8==_0x2c29c4&&(_0x31832f(),_0x12e1c8['off']());});}))];return window['Promise']['race'](_0x232b40)['then'](()=>_0x448e00);}async function _0x50a84f(){await _0x49fa9e,_0x5dc9d9['model']['change']=_0x37b587,_0x5dc9d9['model']['enqueueChange']=_0x37b587,_0x5dc9d9['enableReadOnlyMode']('model');}function _0x29419a(_0x2e8355){const _0x2c2560=_0xc2d05c();_0x5dc9d9[_0x2c2560]='aiLicenseKey'+_0x2e8355,'Valid'!=_0x2e8355&&_0x50a84f();}function _0xc2d05c(){const _0x3f4635=window['String'](window['performance']['now']())['replace']('.','');let _0x30e2ae='n';for(let _0x3e7cfb=0x0;_0x3e7cfb<_0x3f4635['length'];_0x3e7cfb+=0x2){let _0x3628ed=window['parseInt'](_0x3f4635['substring'](_0x3e7cfb,_0x3e7cfb+0x2));_0x3628ed>=0x3e&&(_0x3628ed-=0x3e),_0x30e2ae+=_0x3e276e[_0x3628ed];}return _0x30e2ae;}function _0x2f353f(){const _0x26cfdc=_0x2c842d['split']('.');if(0x3!=_0x26cfdc['length'])return null;return _0x2e2624(_0x26cfdc[0x1]);function _0x2e2624(_0x4a1404){const _0x45edac=_0x3b260c(_0x4a1404);return _0x45edac&&_0x559cf0()?_0x45edac:null;function _0x559cf0(){const _0x547f91=_0x45edac['jti'],_0x26bc54=window['parseInt'](_0x547f91['substring'](_0x547f91['length']-0x8),0x10),_0x10c5be={..._0x45edac,'jti':_0x547f91['substring'](0x0,_0x547f91['length']-0x8)};return delete _0x10c5be['vc'],_0x2c57d7(_0x10c5be)==_0x26bc54;}}}async function _0x2bcd7b(){let _0xb5a00d=!0x0;try{const [_0x3a78c1,_0x35af3c,_0x2d106b]=_0x2c842d['split']('.');return _0x5b2aeb(_0x3a78c1),await _0xbda98c(_0x3a78c1,_0x35af3c,_0x2d106b),_0xb5a00d;}catch{return!0x1;}function _0x5b2aeb(_0x5ae1e9){const _0x3f07a9=_0x3b260c(_0x5ae1e9);_0x3f07a9&&'ES256'==_0x3f07a9['alg']||(_0xb5a00d=!0x1);}async function _0xbda98c(_0x1b7045,_0x327ce2,_0x418bda){const _0x8367dd=window['Uint8Array']['from'](_0x46438b(_0x418bda),_0x5940bd=>_0x5940bd['charCodeAt'](0x0)),_0x421acf=new window['TextEncoder']()['encode'](_0x1b7045+'.'+_0x327ce2),_0x4a2d7f=window['crypto']['subtle'];if(!_0x4a2d7f)return;const _0x819f74=await _0x4a2d7f['importKey']('jwk',_0x111f6a,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x4a2d7f['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x819f74,_0x8367dd,_0x421acf)||(_0xb5a00d=!0x1);}}function _0x3b260c(_0x4be376){return _0x4be376['startsWith']('ey')?JSON['parse'](_0x46438b(_0x4be376)):null;}function _0x46438b(_0x11d621){return window['atob'](_0x11d621['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x2c57d7(_0x214ac1){let _0xc8ab5=0x1505;function _0x5e9a9c(_0x92ae5b){for(let _0x1dd925=0x0;_0x1dd925<_0x92ae5b['length'];_0x1dd925++){const _0x5a8f91=_0x92ae5b['charCodeAt'](_0x1dd925);_0xc8ab5=(_0xc8ab5<<0x5)+_0xc8ab5+_0x5a8f91,_0xc8ab5&=_0xc8ab5;}}function _0x16f422(_0x58f474){Array['isArray'](_0x58f474)?_0x58f474['forEach'](_0x16f422):_0x58f474&&'object'==typeof _0x58f474?Object['entries'](_0x58f474)['sort']()['forEach'](([_0x4c54d0,_0x21c304])=>{_0x5e9a9c(_0x4c54d0),_0x16f422(_0x21c304);}):_0x5e9a9c(window['String'](_0x58f474));}return _0x16f422(_0x214ac1),_0xc8ab5>>>0x0;}function _0xfee174(_0x2f1de1){return _0x2f1de1['toString'](0x10)['padStart'](0x8,'0');}function _0x3d8723(_0x396178){return _0x396178['split']('')['reverse']()['join']('');}function _0x37b587(){}_0x29419a(await _0x4e75f7());}_0xf900da(_0x17343c['editor']);}(this);}['_blockIfRemovedByLicenseKey'](){const _0x59b6fd=this['editor'],_0x12c1bc=bt(_0x59b6fd['config']['get']('licenseKey'));_0x12c1bc&&Ut(_0x12c1bc,'AI')&&(_0x59b6fd['enableReadOnlyMode'](Symbol('invalidLicense')),_0x59b6fd['_showLicenseError']('featureNotAllowed','AIAssistant'));}showFakeVisualSelection(){const _0xd222d=this['editor']['model'];_0xd222d['change'](_0x2dbad8=>{const _0x103863=_0xd222d['document']['selection']['getRanges']();let _0x48c489=0x0;for(const _0x5ca77f of _0x103863){const _0x43e75e=cs+':'+_0x48c489;if(_0xd222d['markers']['has'](_0x43e75e))_0x2dbad8['updateMarker'](_0x43e75e,{'range':_0x5ca77f});else{if(_0x5ca77f['start']['isAtEnd']){const _0x1a9e30=_0x5ca77f['start']['getLastMatchingPosition'](({item:_0x3aab72})=>!_0xd222d['schema']['isContent'](_0x3aab72),{'boundaries':_0x5ca77f});_0x2dbad8['addMarker'](_0x43e75e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2dbad8['createRange'](_0x1a9e30,_0x5ca77f['end'])});}else _0x2dbad8['addMarker'](_0x43e75e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5ca77f});}_0x48c489++;}});}hideFakeVisualSelection(){const _0x398e0d=this['editor']['model'],_0x33c876=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](cs));_0x33c876['length']&&_0x398e0d['change'](_0xd6310b=>{_0x33c876['forEach'](_0x6781f0=>{_0xd6310b['removeMarker'](_0x6781f0);});});}insertContent(_0x20295d,_0x17c478){const _0x580a49=this['_getAISelection'](),_0x634de2=_0x17c478||_0x580a49['getFirstRange']();this['editor']['model']['canEditAt'](_0x634de2)&&this['editor']['model']['change'](_0x51f901=>{this['hideFakeVisualSelection'](),_0x17c478||this['_resetContentOfSelectedTableCells'](_0x51f901,_0x580a49),this['_pasteHTMLUsingClipboard']({'insertAt':_0x634de2,'writer':_0x51f901,'html':_0x20295d});});}insertContentBelow(_0x539649){const {model:_0x111b5e}=this['editor'],_0x51fec1=this['_getAISelection']();_0x111b5e['change'](()=>{const _0x30b929=this['_prepareTableInsertBelowPosition'](_0x539649,_0x51fec1)||this['_getDefaultInsertBelowPosition'](_0x51fec1);this['insertContent'](_0x539649,_0x30b929);});}_getAISelection(){const _0x4c399a=this['editor']['model'],_0x3029d4=Array['from'](_0x4c399a['markers']['getMarkersGroup'](cs))['map'](_0x9586ca=>_0x9586ca['getRange']());return _0x4c399a['createSelection'](_0x3029d4);}_pasteHTMLUsingClipboard({writer:_0x202fd5,html:_0x4aa633,insertAt:_0x18524c}){const {view:_0x7c2a7f}=this['editor']['editing'],_0x38c046=this['editor']['plugins']['get'](_0x438fad),_0xe4ba8a=new hs();_0xe4ba8a['setData']('text/html',_0x4aa633);const _0x3abc82=new ClipboardEvent('paste',{'clipboardData':_0xe4ba8a}),_0x3c0680=new _0x594118(_0x7c2a7f,_0x3abc82,{'dataTransfer':new _0x416400(_0xe4ba8a)});_0x202fd5['setSelection'](_0x18524c);const _0x12ea5b=(_0x1af68c,_0x10faf4)=>{_0x10faf4['resultRange']&&_0x202fd5['setSelection'](_0x10faf4['resultRange']);};_0x38c046['once']('contentInsertion',_0x12ea5b,{'priority':'lowest'}),_0x7c2a7f['document']['fire']('paste',_0x3c0680),_0x38c046['off']('contentInsertion',_0x12ea5b);}_getDefaultInsertBelowPosition(_0x1edef6){const {model:_0x191be1}=this['editor'],_0x4579d9=Array['from'](_0x1edef6['getSelectedBlocks']());return _0x4579d9['length']?_0x191be1['createPositionAfter'](_0x4579d9['pop']()):_0x1edef6['getLastPosition']();}_prepareTableInsertBelowPosition(_0x30473b,_0x4829e6){const {model:_0x33fb4e,plugins:_0x19438c}=this['editor'];if(_0x19438c['has']('TableUtils')){const _0x41c5d1=_0x19438c['get']('TableUtils')['getSelectedTableCells'](_0x4829e6);if(_0x41c5d1['length']){const _0x10af28=this['_getTableRowCountFromContent'](_0x30473b),_0x42656e=this['_createEmptyTableRows'](_0x41c5d1,_0x10af28);return _0x33fb4e['createPositionAt'](_0x42656e,0x0);}}return null;}_getTableRowCountFromContent(_0x51b0bc){const _0x4fb462=this['editor']['plugins']['get']('TableUtils'),_0x120c06=this['editor']['data']['parse'](_0x51b0bc,'$documentFragment'),_0x2d1b61=Array['from'](_0x120c06['getChildren']())['filter'](_0x5feca4=>_0x5feca4['is']('element','table'));let _0x4dc58f=0x0;return _0x2d1b61['forEach'](_0x109b00=>{_0x4dc58f+=_0x4fb462['getRows'](_0x109b00);}),_0x4dc58f;}_createEmptyTableRows(_0x790186,_0x44f09e){const _0x1367b3=this['editor']['plugins']['get']('TableUtils'),_0x1adb4b=_0x1367b3['getRowIndexes'](_0x790186),_0x15fac7=_0x1367b3['getColumnIndexes'](_0x790186),_0x4596c3=_0x1adb4b['last']+0x1,_0x489d32=_0x15fac7['first'],_0x8d78d2=_0x790186[0x0]['findAncestor']('table');for(let _0x1e0cab=0x0;_0x1e0cab<_0x44f09e;_0x1e0cab++)_0x1367b3['insertRows'](_0x8d78d2,{'at':_0x4596c3});return _0x8d78d2['getChild'](_0x4596c3)['getChild'](_0x489d32);}_resetContentOfSelectedTableCells(_0x5b4fd8,_0x35388b){const {plugins:_0x1e5bf9}=this['editor'],{model:_0x364f20}=_0x5b4fd8;_0x1e5bf9['has']('TableUtils')&&_0x1e5bf9['get']('TableUtils')['getSelectedTableCells'](_0x35388b)['length']&&_0x364f20['deleteContent'](_0x35388b);}},us=class extends _0x158c3f{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}afterInit(){if(!this['textAdapter'])throw new dt('aiadapter-text-adapter-not-set',null);}},ds=class extends Error{constructor(_0xd638bd){super(_0xd638bd),this['name']='AIRequestError';}};function _s(_0xf8c6a1,_0x2c8721,_0x56e35b){const t=_0xf8c6a1['t'];switch(_0x2c8721){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',_0x56e35b);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x56e35b);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'},_0x56e35b);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 _0x2c8721;}}var gs=class extends _0x3f0a57{_commandDefinitions;constructor(_0x5f3852,_0x145fc1){super(_0x5f3852),this['_commandDefinitions']=_0x145fc1,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x4c5e0f,_0xecc934,_0x316d83)=>{this['isEnabled']&&(this['enabledCommandsIds']=Is(this['_commandDefinitions'],_0x316d83));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x5b5e28,_0x5ca57e,_0x59d206)=>{this['enabledCommandsIds']=_0x59d206?Is(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x4c2bb0=this['editor']['model'];this['_hasContext']=function(_0xc5a901){const _0x13a02a=_0xc5a901['document']['selection'];return _0x13a02a['isCollapsed']?0x0!==[..._0x13a02a['getSelectedBlocks']()]['length']&&![..._0x13a02a['getSelectedBlocks']()][0x0]['isEmpty']:!!_0xc5a901['hasContent'](_0x13a02a['getFirstRange']());}(_0x4c2bb0);const _0x17ab13=_0x4c2bb0['document']['selection'],_0x3ef741=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x4cf06e of _0x17ab13['getRanges']())for(const _0x141284 of _0x4cf06e['getItems']())if(_0x141284['is']('element')&&_0x3ef741['includes'](_0x141284['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}execute(_0x5a9a7a='',_0x1724e4='',_0x478430='custom'){this['editor']['plugins']['get'](xs)['showUI'](_0x5a9a7a,_0x1724e4,_0x478430);}};function Is(_0x203638,_0x4f45a8){const _0x49ad96=new Set();for(const _0x3b8dbd of _0x203638['values']())(_0x4f45a8||!0x1===_0x3b8dbd['requiresContent'])&&_0x49ad96['add'](_0x3b8dbd['id']);return Array['from'](_0x49ad96);}const As=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is'),Es=/* #__PURE__ -- @preserve */
24
+ mt();var ps=class extends Es{editor;textAdapter;['view'];_sanitizationContainer;['_domParser'];['_xmlSerializer'];constructor(_0x378d91,_0x13bb32,_0x388108){super(),this['editor']=_0x378d91,this['textAdapter']=_0x13bb32,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x388108,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x141d48,_0x5bf4d6,_0x928e18)=>{this['view']['value']=this['_sanitizeHTML'](_0x928e18);}),this['listenTo'](this['view'],'submitPrompt',(_0x57a648,_0x5222f7)=>{const _0x10a478=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x5222f7,_0x10a478,'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:_0x11dbda,query:_0x3de517,htmlContent:_0x70d15f,label:_0x365925,mainActionLabel:_0x471a98}){this['view']['prompt']=_0x365925,this['view']['mainAction']=_0x471a98,this['initialContext']=_0x70d15f,_0x3de517&&(this['view']['isRendered']?this['_handleQuery'](_0x3de517,_0x70d15f,_0x11dbda,_0x365925):this['view']['once']('render',()=>{this['_handleQuery'](_0x3de517,_0x70d15f,_0x11dbda,_0x365925);}));}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'](_0x2bcca0,_0x3c30f5,_0xe5baf9,_0x2b7e9b){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3c30f5,this['previousQuery']=_0x2bcca0,this['previousLabel']=_0x2b7e9b||_0x2bcca0,this['previousActionId']=_0xe5baf9,new Promise(_0x28c3e1=>{this['textAdapter']['makeRequest']({'query':_0x2bcca0,'context':_0x3c30f5,'onData':_0x5c00c1=>{this['currentResponse']=_0x5c00c1,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0xe5baf9})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x2223f2=>{_0x2223f2 instanceof ds?this['view']['handleError'](_0x2223f2['message']):this['view']['handleError'](),_0x28c3e1();})['finally'](()=>{this['stopProcessing'](),_0x28c3e1();});});}_parseAndNormalizeContent(_0x55d67c,_0x3be582=!0x1){const _0x464dee=As['exec'](_0x55d67c);_0x55d67c=_0x464dee?_0x55d67c['substring'](_0x464dee[0x1]['length']):_0x55d67c['length']<0x64&&!_0x3be582?'':this['_stripMarkdownSyntax'](_0x55d67c);const _0x33e3da=this['_domParser']['parseFromString'](Qt(_0x55d67c),'text/html');if(_0x464dee){const _0x42e57d=Array['from'](_0x33e3da['body']['childNodes']);_0x42e57d['reverse']();for(const _0x1a2fb3 of _0x42e57d){if(_0x1a2fb3['nodeType']==Node['ELEMENT_NODE'])break;_0x1a2fb3['remove']();}}const _0x2cea9b=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x33e3da['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x2cea9b);const _0x26dcba=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x144072=this['editor']['data']['toModel'](_0x2cea9b);return _0x26dcba||_0x144072['markers']['clear'](),this['editor']['data']['stringify'](_0x144072);}['_normalizeResponseHeadings'](_0x305e59){const _0x1d69c9=new _0x1617d1(this['editor']['editing']['view']['document']),_0x286fb5=new _0x3c66f4({'name':/^h[1-5]$/}),_0x4b864b=[];let _0x28ec16=!0x1;for(const _0x29ebea of _0x305e59)_0x29ebea['is']('element')&&_0x286fb5['match'](_0x29ebea)&&(_0x4b864b['push'](_0x29ebea),'h1'==_0x29ebea['name']&&(_0x28ec16=!0x0));if(_0x28ec16){for(const _0x12e54f of _0x4b864b)_0x1d69c9['rename']('h'+(parseInt(_0x12e54f['name'][0x1])+0x1),_0x12e54f);}}_isH1TagSupportEnabled(){const {data:_0x2a4976,editing:_0x1cbf52}=this['editor'],_0x5ec119=_0x2a4976['htmlProcessor']['toView']('<h1></h1>'),_0xc213db=_0x2a4976['toView'](_0x2a4976['toModel'](_0x5ec119));return!!_0x1cbf52['view']['domConverter']['viewToDom'](_0xc213db)['querySelector']('h1');}_sanitizeHTML(_0x3d2a9c){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3d2a9c),this['_sanitizationContainer']['innerHTML'];}_stripMarkdownSyntax(_0x307d48){const _0x2a619b=_0x307d48['trim']();return _0x2a619b['startsWith']('```html')?_0x2a619b['endsWith']('```')?_0x2a619b['substring'](0x7,_0x2a619b['length']-0x3):_0x2a619b['substring'](0x7):_0x307d48;}};const ms={'REPLACE':'replace','INSERT':'insert'};var Ts=class extends _0x20288e{constructor(_0x2ad8a9){super(_0x2ad8a9),this['set']('isVisible',!0x1),this['set']('mainAction',ms['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x36fa94=>_s(_0x2ad8a9,'AI_'+_0x36fa94['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](_s(_0x2ad8a9,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](_s(_0x2ad8a9,'Try\x20again')),this['stopButton']=this['_createButton'](_s(_0x2ad8a9,'Stop'));const _0x93b9d4=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x93b9d4['if']('isVisible','ck-hidden',_0x568a32=>!_0x568a32)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}_createButton(_0x1a7962,_0xc81814){const _0x4f28dc=new _0x1a9216(this['locale']);return _0x4f28dc['set']({'label':_0x1a7962,'class':_0xc81814||'','isVisible':!0x0,'withText':!0x0}),_0x4f28dc;}},ws=class extends _0x2df458{contentFieldView;copyButtonView;constructor(_0x301a9c,_0x13f09f=''){super(_0x301a9c),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x460cfd=this['bindTemplate'];this['contentFieldView']=new Cs(_0x301a9c,_0x13f09f),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x460cfd['if']('isVisible','ck-hidden',_0x1e79d5=>!_0x1e79d5)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x460cfd['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 _0x36b07c=!0x1;this['on']('change:value',(_0x32c0ba,_0x5dd602,_0x2c497e)=>{const _0x497906=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2c497e),this['isProcessing']&&_0x497906&&!_0x36b07c&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3f4a62,_0x2c76d8,_0x19c659)=>{_0x36b07c=!0x1,_0x19c659?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x36b07c=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x36b07c=!0x0;});}['focus'](){this['element']['focus']();}_createCopyButton(){const _0x24ff26=this['locale'],_0x244d43=new _0x1a9216(this['locale']),_0x17ffdc='ck-ai-form__copy-button';return _0x244d43['set']({'label':_s(_0x24ff26,'Copy'),'icon':_0x21a060,'class':_0x17ffdc,'tooltip':!0x0}),_0x244d43['bind']('isVisible')['to'](this,'value',_0x24734f=>!!_0x24734f),_0x244d43['bind']('isEnabled')['to'](this,'isProcessing',_0x15044a=>!_0x15044a),_0x244d43['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x244d43['icon']=_0x42448e,_0x244d43['class']=_0x17ffdc+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x244d43['icon']=_0x21a060,_0x244d43['class']=_0x17ffdc;},0x3e8);}),_0x244d43;}['_copyHTMLToClipboard'](_0x2622ba){const {window:_0x31a2ee,document:_0xcf1b1a}=Vt;if(_0x31a2ee['ClipboardItem']){const {Blob:_0x1b2238,ClipboardItem:_0xb3827f}=_0x31a2ee,_0x290c10=[new _0xb3827f({'text/html':new _0x1b2238([_0x2622ba['innerHTML']],{'type':'text/html'}),'text/plain':new _0x1b2238([_0x2622ba['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x290c10);}else{const _0xe83ad1=_0xcf1b1a['createElement']('div');_0xe83ad1['style']['position']='absolute',_0xe83ad1['style']['left']='-9999px',_0xe83ad1['innerHTML']=Qt('<span>[</span>'+_0x2622ba['innerHTML']+'<span>]</span>'),_0xcf1b1a['body']['appendChild'](_0xe83ad1);const _0x5ab63c=_0xcf1b1a['createRange']();_0x5ab63c['setStartAfter'](_0xe83ad1['firstElementChild']),_0x5ab63c['setEndBefore'](_0xe83ad1['lastElementChild']);const _0x7b0bb3=_0x31a2ee['getSelection']();_0x7b0bb3['removeAllRanges'](),_0x7b0bb3['addRange'](_0x5ab63c),_0xcf1b1a['execCommand']('copy'),_0xe83ad1['remove']();}}},Cs=class extends _0x2df458{constructor(_0x2f7756,_0x18e9ed=''){super(_0x2f7756),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x18e9ed,'ck-reset_all-excluded','ck-ai-form__content-field']}});}setContent(_0x25f511){this['element']['innerHTML']=Qt(_0x25f511||'');}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}_createLoader(){const _0x457c91=new _0x2df458(),_0x31c782=this['locale'],_0x531ebf=new _0x407319();return _0x531ebf['isVisible']=!0x0,_0x457c91['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x531ebf,{'text':_s(_0x31c782,'AI\x20is\x20writing...')}]}),_0x457c91['render'](),_0x457c91;}},fs=class extends _0x2df458{constructor(_0xa20cbc,_0x548efb=''){super(_0xa20cbc);const _0x3cce3d=new _0x5e3c18(),_0x4216eb=this['bindTemplate'];this['set']('text',_0x548efb),_0x3cce3d['content']=_0x1797f9,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x3cce3d,{'text':_0x4216eb['to']('text')}]});}},Rs=class extends jt{submitButtonView;showHistoryButtonView;constructor(_0x164617,_0x47d0e3){super(_0x164617,_0x47d0e3),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',(_0x174b7e,_0x3b8aa9)=>{_0x174b7e['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3b8aa9());});}_createSubmitButton(){const _0x308771=new _0x1a9216(this['locale']),_0x282cae=this['locale'];return _0x308771['set']({'icon':at,'label':_s(_0x282cae,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x308771['on']('execute',()=>{this['submit']();}),_0x308771['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4b6fc9,_0x237a1d)=>!_0x4b6fc9&&_0x237a1d),_0x308771;}_createShowHistoryButton(){const _0x594d03=new _0x1a9216(this['locale']),_0x826579=this['resultsView'],_0x24c390=this['locale'];_0x594d03['set']({'label':_s(_0x24c390,'History'),'withText':!0x1,'icon':_0x23e734,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x594d03['bind']('isOn')['to'](_0x826579,'isVisible'),_0x594d03['bind']('isEnabled')['to'](this,'isEnabled'),_0x594d03['on']('execute',()=>{_0x826579['isVisible']=!_0x826579['isVisible'],_0x826579['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x230978=()=>{Vt['window']['requestAnimationFrame'](()=>{if(Bt(this['element'])){const _0xe77469=new Tt(this['queryView']['fieldView']['element']),_0x15ee8f=_0xe77469['width'],_0x856771='rtl'===_0x24c390['uiLanguageDirection']?'left':'right';_0xe77469['excludeScrollbarsAndBorders'](),_0x594d03['element']['style'][_0x856771]=_0x15ee8f-_0xe77469['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x230978),this['on']('render',_0x230978),_0x594d03;}submit(){const _0x137c86=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x137c86);}['focus'](_0x440b45){-0x1===_0x440b45?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}},bs=class extends _0x4e6fd6{historyGroupView;clearHistoryButton;constructor(_0xcf27bf){super(_0xcf27bf),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x340eed(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=_s(_0xcf27bf,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}filter(){let _0x489252=0x0;for(const _0x3f4eb3 of this['items'])_0x489252+=_0x3f4eb3['items']['length'];return{'resultsCount':_0x489252,'totalItemsCount':_0x489252};}_createClearHistoryButton(){const _0x28d2b7=this['locale'],_0x248d9f=new _0x1a9216(this['locale']);return _0x248d9f['set']({'label':'('+_s(_0x28d2b7,'Clear')+')','withText':!0x0}),_0x248d9f['on']('execute',()=>this['fire']('clearHistory')),_0x248d9f;}},Ss=class extends _0xf665cb{constructor(_0x3e3e52){super();const _0x465419=new te(),_0xcd4ea6=new _0x1a9216(this['locale'],_0x465419);this['children']['add'](_0xcd4ea6),_0xcd4ea6['set']({'label':_0x3e3e52['prompt'],'withText':!0x0}),_0xcd4ea6['on']('execute',()=>{this['fire']('execute',{'value':_0x2e6a78(_0x3e3e52['prompt'])});});}};const Os='CKEditor/AIFormView/PromptHistory';var vs=class extends _t{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x533cfa,_0x21bcbb)=>{const _0x23a26c=ys(_0x21bcbb['prompt']);for(const _0x346f3a of this)if(_0x346f3a!=_0x21bcbb&&ys(_0x346f3a['prompt'])===_0x23a26c){this['remove'](_0x346f3a);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}_loadFromSessionStorage(){const _0x17e897=sessionStorage['getItem'](Os)||'[]';this['addMany'](JSON['parse'](_0x17e897));}_saveToSessionStorage(){sessionStorage['setItem'](Os,JSON['stringify'](this['map'](_0x2fe141=>_0x2fe141)));}};function ys(_0x2fa1b6){return _0x2fa1b6['toLowerCase']()['trim']();}var Ns=class extends _0x2df458{['focusTracker'];keystrokes;contentArea;toolbar;promptView;['errorView'];['_focusables'];['focusCycler'];_promptHistory;constructor(_0x2573a2,_0x407a08,_0x3a8aca=''){super(_0x2573a2),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',ms['REPLACE']),this['_promptHistory']=new vs(),this['errorView']=new fs(_0x2573a2),this['contentArea']=new ws(_0x2573a2,_0x3a8aca),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new Et(),this['keystrokes']=new pt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x17323b({'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 _0x33a448=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x407a08],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x33a448['if']('isError','ck-hidden',_0x4343ef=>!_0x4343ef)]},'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'](_0x258b47=0x1){-0x1===_0x258b47?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 _0xfa027b=this['locale'],_0x52cac6=new Rs(_0xfa027b,{'queryView':{'label':_s(_0xfa027b,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x3e1b5a,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_s(_0xfa027b,'Empty\x20history'),'secondary':_s(_0xfa027b,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x52cac6['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x35caf6,_0xbf0d05)=>_0x35caf6&&!_0xbf0d05),this['listenTo'](_0x52cac6,'submit',(_0x1446f8,_0x20ac40)=>{this['prompt']=_0x20ac40;const _0x379785=_0x369484(_0x20ac40);this['fire']('submitPrompt',_0x379785),_0x20ac40['trim']()&&this['_promptHistory']['add']({'prompt':_0x379785},0x0);},{'priority':'high'}),_0x52cac6;}_createHistoryView(){const _0x3d82f6=new bs(this['locale']);return _0x3d82f6['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ss),_0x3d82f6['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3d82f6;}_createToolbar(){const _0x1532df=new Ts(this['locale']);return _0x1532df['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x19340e,_0x232db2,_0x10dd30)=>_0x19340e&&!_0x232db2&&!!_0x10dd30),_0x1532df['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1532df['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2abaa6,_0xb001ea,_0x66c06)=>_0x2abaa6&&!_0xb001ea&&!!_0x66c06),_0x1532df['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1532df['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x56c457,_0x30eaff)=>_0x56c457&&!_0x30eaff),_0x1532df['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1532df['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1532df['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1532df;}startProcessing(){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x1922cc=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=_s(_0x1922cc,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x45e5ae){const _0x1b50ba=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x45e5ae||_s(_0x1b50ba,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}};const ks=globalThis['DataTransfer'];var xs=class extends _0x158c3f{['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[_0x5aeead,ls,us,_0x3fa2e4];}constructor(_0x494daf){super(_0x494daf),_0x494daf['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x494daf['config']['define']('ai.assistant.contentAreaCssClass',''),this['_uiCssClasses']='ck-ai-assistant-ui\x20ck-ai-assistant-ui_theme';}init(){const {editor:_0x409b4e}=this;this['_aiAdapter']=_0x409b4e['plugins']['get'](us),this['_dialog']=_0x409b4e['plugins']['get'](_0x3fa2e4),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x2d6bd0=new gs(_0x409b4e,Array['from'](this['_commandDefinitions']['values']()));_0x409b4e['commands']['add']('showAIAssistant',_0x2d6bd0),_0x409b4e['ui']['componentFactory']['add']('aiCommands',_0x2a0b83=>{const _0x12754d=_0x4c754a(_0x2a0b83);return _0x12754d['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x12754d['buttonView']['set']({'label':_s(_0x2a0b83,'AI\x20Commands'),'icon':_0x3e186b,'tooltip':!0x0}),_0x12754d['on']('execute',_0x157b7a=>this['_onExecute'](_0x157b7a['source']['id'])),_0x318cd1(_0x12754d,_0x409b4e['ui']['view']['body'],function(_0x289020){const _0x5e17e3=Ds(_0x289020,as(_0x289020['config']['get']('ai.assistant.commands'),_0x289020['locale']))['filter'](_0x170d7d=>_0x170d7d['commands']['length']);return 0x1===_0x5e17e3['length']?Ds(_0x289020,_0x5e17e3[0x0]['commands'])['map'](_0x481a03=>({'id':_0x481a03['id'],'label':_0x481a03['label']})):_0x5e17e3['map'](_0x4c93fe=>{const {groupId:_0x3e539f,groupLabel:_0x2f6ace,commands:_0x18ae59}=_0x4c93fe,_0xa471e7=Ds(_0x289020,_0x18ae59)['map'](_0x16f482=>({'id':_0x16f482['id'],'label':_0x16f482['label']}));return{'id':_0x3e539f,'menu':_0x2f6ace||_0x3e539f,'children':_0xa471e7};});}(_0x409b4e),{'ariaLabel':_s(_0x2a0b83,'AI\x20Commands')}),_0x12754d['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x2d6bd0['on']('change:enabledCommandsIds',_0x6c4675),_0x12754d['menuView']['once']('render',_0x6c4675),_0x12754d;function _0x6c4675(){_0x12754d['isEnabled']=_0x2d6bd0['enabledCommandsIds']['length']>0x0;for(const _0xd0445d of _0x12754d['menuView']['buttons'])_0xd0445d['isEnabled']=_0x2d6bd0['enabledCommandsIds']['includes'](_0xd0445d['id']);}}),_0x409b4e['ui']['componentFactory']['add']('menuBar:aiCommands',_0xc66edf=>{const _0x484c5d=new _0x5e7fd5(_0xc66edf);_0x484c5d['buttonView']['set']({'label':_s(_0xc66edf,'AI\x20Commands'),'icon':_0x3e186b}),_0x484c5d['bind']('isEnabled')['to'](_0x2d6bd0,'enabledCommandsIds',_0x506d08=>_0x506d08['length']>0x0);const _0x79f01=as(_0x409b4e['config']['get']('ai.assistant.commands'),_0xc66edf);return this['_populateMenuBarMenu'](_0x2d6bd0,_0x484c5d,_0x79f01,_0x4573d0=>this['_onExecute'](_0x4573d0)),_0x484c5d;}),_0x409b4e['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x232324=this['_createAIAssistantUIButton'](_0x1a9216);return _0x232324['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x232324;}),_0x409b4e['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x2b8554=this['_createAIAssistantUIButton'](_0x410c15);return _0x2b8554['set']({'role':'menuitemcheckbox'}),_0x2b8554;}),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x1a6dda=[this['editor']];for(const _0x18b9ed of _0x1a6dda){let _0x29a330;for(const _0x27b391 in _0x18b9ed){const _0x1c8a22=_0x27b391,_0x5aafde=_0x18b9ed[_0x1c8a22];if('aiLicenseKeyValid'==_0x5aafde||'aiLicenseKeyInvalid'==_0x5aafde||'aiLicenseKeyExpired'==_0x5aafde||'aiLicenseKeyDomainLimit'==_0x5aafde||'aiLicenseKeyNotAllowed'==_0x5aafde||'aiLicenseKeyEvaluationLimit'==_0x5aafde||'aiLicenseKeyUsageLimit'==_0x5aafde){delete _0x18b9ed[_0x1c8a22],_0x29a330=_0x5aafde,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x29a330&&_0x18b9ed['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x29a330&&_0x18b9ed['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x29a330&&_0x18b9ed['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x29a330&&_0x18b9ed['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x29a330&&_0x18b9ed['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x29a330&&_0x18b9ed['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x558879='',_0x54be9='',_0x2abef8='custom'){const _0xb2cbdf=this['editor'],_0xf81755=_0xb2cbdf['editing']['view'],_0xda9e70=_0xb2cbdf['plugins']['get'](ls),_0x598b6b=_0xb2cbdf['plugins']['get'](_0x5aeead);_0xda9e70['showFakeVisualSelection']();const _0x4ec770=new ks(),_0x5295bf=new ClipboardEvent('copy',{'clipboardData':_0x4ec770}),_0x382362=new _0x416400(_0x4ec770),_0x4016ca=new _0x594118(_0xf81755,_0x5295bf,{'dataTransfer':_0x382362});_0x598b6b['_forceMarkersCopy']('comment',()=>{_0xf81755['document']['fire']('copy',_0x4016ca);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new ps(_0xb2cbdf,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x45c7e8=_0x382362['getData']('text/html');const _0x3d7cef=_0xb2cbdf['model']['document']['selection'],_0x2db778=Array['from'](_0x3d7cef['getRanges']());0x1===_0x2db778['length']&&_0x2db778[0x0]['isFlat']&&!_0x3d7cef['getSelectedElement']()&&''!==_0x45c7e8['replace'](/&nbsp;/g,'')['trim']()&&(_0x45c7e8='<p>'+_0x45c7e8+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2abef8,'query':_0x558879,'htmlContent':_0x45c7e8,'label':_0x54be9,'mainActionLabel':ms[_0xb2cbdf['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','title':_s(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x4abac9['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0xda9e70['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}_getResolvedCommandsDefinitions(){const _0x57d34d=new Map(),_0x5a0af6=as(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x28ea0f of _0x5a0af6)for(const _0x22baa0 of _0x28ea0f['commands'])_0x57d34d['set'](_0x22baa0['id'],{..._0x22baa0,'groupId':_0x28ea0f['groupId'],'groupLabel':_0x28ea0f['groupLabel']||_0x28ea0f['groupId']});return _0x57d34d;}_createAIAssistantUIButton(_0x4feb16){const _0x2a5580=this['editor'],_0x1da424=_0x2a5580['commands']['get']('showAIAssistant'),_0x4f0b3e=new _0x4feb16(_0x2a5580['locale']);return _0x4f0b3e['set']({'label':_s(_0x2a5580['locale'],'AI\x20Assistant'),'icon':et,'isToggleable':!0x0}),_0x4f0b3e['bind']('isEnabled')['to'](_0x1da424),_0x4f0b3e['bind']('isOn')['to'](this['_dialog'],'id',_0x39cff4=>'aiAssistant'===_0x39cff4),this['listenTo'](_0x4f0b3e,'execute',()=>{_0x4f0b3e['isOn']?this['hideUI']():_0x1da424['execute']();}),_0x4f0b3e;}_initView(){const _0x7c4658=this['editor']['plugins']['get'](ls);this['_formView']=new Ns(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',()=>{_0x7c4658['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x7c4658['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}_initAriaAiStatusChangeAnnouncements(){const {locale:_0x1d1b70,ui:{ariaLiveAnnouncer:_0x1a2684}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0xb90f27,_0x4dd1da,_0x3ad404)=>{const _0x42acf5=this['_aiAssistantController']['currentContext'];_0x3ad404?_0x1a2684['announce'](_s(_0x1d1b70,'AI\x20is\x20writing')):_0x42acf5&&_0x1a2684['announce'](_s(_0x1d1b70,'Generated\x20content:\x20%0',_0x42acf5),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x44a3ce,_0x3ed813,_0x301a40)=>{if(_0x301a40){const _0x3b73bd=this['_formView']['errorView']['text'];_0x1a2684['announce'](_s(_0x1d1b70,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3b73bd));}});}_onExecute(_0x561543){const _0x275fd8=this['_commandDefinitions']['get'](_0x561543),_0x40bc70=this['editor'],_0x28417c=_0x40bc70['model']['document']['selection'],_0x59f834=_0x40bc70['commands']['get']('showAIAssistant'),_0x1ebb24=_0x40bc70['plugins']['get'](ls),_0x3bcd4d=''+('_ungrouppedCommands'!==_0x275fd8['groupId']?_0x275fd8['groupLabel']+':\x20':'')+_0x275fd8['label'];if(!0x1!==_0x275fd8['requiresContent']&&_0x28417c['isCollapsed']){const _0x35e157=Ot(_0x28417c['getSelectedBlocks']())||_0x40bc70['model']['schema']['getLimitElement'](_0x28417c);_0x40bc70['model']['change'](_0x3dfb9b=>{_0x3dfb9b['setSelection'](_0x35e157,'in');});}_0x1ebb24['showFakeVisualSelection'](),_0x59f834['execute'](_0x275fd8['prompt'],_0x3bcd4d,'command:'+_0x561543);}_populateMenuBarMenu(_0x423acb,_0x21db37,_0x5aedb7,_0x8bffe5){const _0x5b53fe=this['editor'],_0x3c2a99=_0x5b53fe['locale'],_0xdf31a4=new _0x1969ff(_0x3c2a99),_0x15982c=Ds(_0x5b53fe,_0x5aedb7)['filter'](_0x5eecf9=>_0x5eecf9['commands']['length']);0x1===_0x15982c['length']?this['_getMenuBarGroupButtons']({'command':_0x423acb,'commands':_0x15982c[0x0]['commands'],'parentMenuView':_0x21db37,'onExecute':_0x8bffe5})['forEach'](_0x300c65=>_0xdf31a4['items']['add'](_0x300c65)):_0x15982c['forEach'](({groupId:_0x15307c,groupLabel:_0xebaa65,commands:_0x2014f1})=>{const _0x5be023=new _0x5d5b51(_0x3c2a99,_0x21db37),_0x508c90=new _0x5e7fd5(_0x3c2a99),_0x24f993=new _0x1969ff(_0x3c2a99),_0x3a51af=this['_getMenuBarGroupButtons']({'command':_0x423acb,'commands':_0x2014f1,'parentMenuView':_0x508c90,'onExecute':_0x8bffe5});_0x508c90['buttonView']['set']({'label':_0xebaa65||_0x15307c}),_0x508c90['delegate']('execute')['to'](_0x21db37),_0x24f993['items']['addMany'](_0x3a51af),_0x508c90['panelView']['children']['add'](_0x24f993),_0x5be023['children']['add'](_0x508c90),_0xdf31a4['items']['add'](_0x5be023);}),_0x21db37['panelView']['children']['add'](_0xdf31a4);}_getMenuBarGroupButtons({command:_0x3f10ac,commands:_0x366918,parentMenuView:_0x30fc66,onExecute:_0x4e603f}){const _0x39e4b8=this['editor'],_0x134c82=_0x39e4b8['locale'];return Ds(_0x39e4b8,_0x366918)['map'](_0x4857e2=>{const _0x3141eb=new _0x5d5b51(_0x134c82,_0x30fc66),_0x5a8991=new _0x410c15(_0x134c82);return _0x5a8991['set']({'label':_0x4857e2['label']}),_0x5a8991['delegate']('execute')['to'](_0x30fc66),_0x5a8991['on']('execute',()=>_0x4e603f(_0x4857e2['id'])),_0x5a8991['bind']('isEnabled')['to'](_0x3f10ac,'enabledCommandsIds',_0x91670e=>_0x91670e['includes'](_0x4857e2['id'])),_0x3141eb['children']['add'](_0x5a8991),_0x3141eb;});}};function Ls(_0x511d5e,_0x1fac0c){return void 0x0!==_0x511d5e['order']&&void 0x0===_0x1fac0c['order']?0x1:void 0x0===_0x511d5e['order']&&void 0x0!==_0x1fac0c['order']?-0x1:void 0x0!==_0x511d5e['order']&&void 0x0!==_0x1fac0c['order']?_0x511d5e['order']-_0x1fac0c['order']:0x0;}function Ds(_0x5885e4,_0x44eb79){_0x44eb79['sort'](Ls);const _0x3b2b47={},_0x419bcc=[];for(const _0x2910ea of _0x44eb79)if(void 0x0!==_0x2910ea['order']){if(_0x2910ea['order']in _0x3b2b47)throw new dt('ai-commands-config-order-collision',_0x5885e4,{'conflictingDefinitions':[_0x2910ea,_0x3b2b47[_0x2910ea['order']]]});_0x3b2b47[_0x2910ea['order']]=_0x2910ea,_0x419bcc['splice'](_0x2910ea['order'],0x0,_0x2910ea);}else _0x419bcc['push'](_0x2910ea);return _0x419bcc;}var Ps=class extends _0x158c3f{static get requires(){return[xs,ls];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x36005e){super(_0x36005e);const _0x59ab92=_0x36005e['config'],_0x235657=_0x36005e['locale'];_0x59ab92['define']('ai.assistant.preserveComments',!0x0),_0x59ab92['define']('ai.assistant.commands',Ms(_0x235657)),_0x59ab92['define']('ai.assistant.extraCommandGroups',[]),_0x59ab92['define']('ai.assistant.removeCommands',[]);let _0x691891=as(_0x59ab92['get']('ai.assistant.commands'),_0x235657);const _0x244ce7=_0x59ab92['get']('ai.assistant.extraCommandGroups'),_0x22d6cb=_0x59ab92['get']('ai.assistant.removeCommands');_0x244ce7['forEach'](_0x2f626b=>{const _0x532a90=_0x691891['find'](_0x151653=>_0x151653['groupId']===_0x2f626b['groupId']);_0x532a90?_0x532a90['commands']=_0x532a90['commands']['concat'](_0x2f626b['commands']):_0x691891['push'](_0x2f626b);}),_0x691891=_0x691891['filter'](_0x5b7784=>!_0x22d6cb['includes'](_0x5b7784['groupId'])),_0x691891['forEach'](_0x2bda4e=>{_0x2bda4e['commands']=_0x2bda4e['commands']['filter'](_0x39d3ee=>!_0x22d6cb['includes'](_0x39d3ee['id']));}),_0x59ab92['set']('ai.assistant.commands',_0x691891);}};function Ms(_0x456e90){return[{'groupId':'editOrReview','groupLabel':_s(_0x456e90,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':_s(_0x456e90,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':_s(_0x456e90,'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':_s(_0x456e90,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':_s(_0x456e90,'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':_s(_0x456e90,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':_s(_0x456e90,'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':_s(_0x456e90,'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':_s(_0x456e90,'Change\x20tone'),'commands':[{'id':'professional','label':_s(_0x456e90,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':_s(_0x456e90,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':_s(_0x456e90,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':_s(_0x456e90,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':_s(_0x456e90,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':_s(_0x456e90,'Change\x20style'),'commands':[{'id':'business','label':_s(_0x456e90,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':_s(_0x456e90,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':_s(_0x456e90,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':_s(_0x456e90,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':_s(_0x456e90,'Translate'),'commands':[{'id':'translateEnglish','label':_s(_0x456e90,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':_s(_0x456e90,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':_s(_0x456e90,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':_s(_0x456e90,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':_s(_0x456e90,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':_s(_0x456e90,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':_s(_0x456e90,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':_s(_0x456e90,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}var Vs=class extends _0x158c3f{abortController;static get requires(){return[us];}constructor(_0x5db1c2){super(_0x5db1c2),this['abortController']=new AbortController();}init(){this['editor']['plugins']['get'](us)['textAdapter']=this;}abort(){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async makeRequest(_0x582c34){return this['sendRequest'](_0x582c34)['catch'](_0x5dfef9=>{if(_0x5dfef9 instanceof ds)return Promise['reject'](_0x5dfef9);if('AbortError'==_0x5dfef9['name'])return Promise['resolve']();throw console['error'](_0x5dfef9),new dt('aitextadapter-send-request-failed',null);});}async _prepareRequestHeaders(_0xa97514,_0x3727eb){const _0x348ae7=this['editor']['locale'],_0x485cd5={'Content-Type':'application/json'};if('object'==typeof _0xa97514)Object['assign'](_0x485cd5,_0xa97514);else{if(_0xa97514)try{const _0x1a6881=await _0xa97514(_0x3727eb);Object['assign'](_0x485cd5,_0x1a6881);}catch{return Promise['reject'](new ds(_s(_0x348ae7,'AI_ERROR_GET_HEADERS')));}}return _0x485cd5;}async _prepareRequestParameters(_0x348965,_0x1ea1b1){const _0x753317=this['editor']['locale'];if('object'==typeof _0x348965)return _0x348965;try{return await _0x348965(_0x1ea1b1);}catch{return Promise['reject'](new ds(_s(_0x753317,'AI_ERROR_GET_PARAMETERS')));}}},Hs=class extends Vs{['_apiUrl'];_requestHeaders;_requestParameters;static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x6f205d){super(_0x6f205d),_0x6f205d['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x6f205d['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x6f205d['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x6f205d['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x6f205d['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x6f205d['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async sendRequest({query:_0x469aba,context:_0x59b0bf,onData:_0x139946,actionId:_0x521bf9}){const _0x10c48d=this['editor']['locale'],_0x181a43=await this['prepareMessages'](_0x469aba,_0x59b0bf,_0x521bf9),_0x2fdc41=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x521bf9),_0x449321=await this['_prepareRequestParameters'](this['_requestParameters'],_0x521bf9),_0x5d92b6={'messages':_0x181a43,..._0x449321},_0x1d2167={'method':'POST','headers':_0x2fdc41,'body':JSON['stringify'](_0x5d92b6),'signal':this['abortController']['signal']},_0x35b541=await fetch(this['_apiUrl'],_0x1d2167);if(_0x35b541['ok'])return _0x449321['stream']?await this['_readStreamableResponse'](_0x35b541,_0x139946):await this['_readStaticResponse'](_0x35b541,_0x139946),Promise['resolve']();{const _0x88952b=await _0x35b541['text']();return _0x88952b['includes']('context_length_exceeded')?Promise['reject'](new ds(_s(_0x10c48d,'AI_ERROR_CONTEXT_LENGTH'))):_0x88952b['includes']('Moderation')?Promise['reject'](new ds(_s(_0x10c48d,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x88952b));}}async['prepareMessages'](_0x1dbd5d,_0x1996bd,_0x350595){let _0x51d34d,_0x3926b0;return _0x1996bd?(_0x51d34d='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.',_0x3926b0='Instruction:\x0a'+_0x1dbd5d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1996bd):(_0x51d34d='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.',_0x3926b0=_0x1dbd5d),[{'role':'system','content':_0x51d34d},{'role':'user','content':_0x3926b0}];}async _readStreamableResponse(_0x262dd2,_0x145c00){const _0x56ef34=_0x262dd2['body']['getReader'](),_0xf096e=new TextDecoder();let _0x50dc9d='',_0x461722='',_0x5c79bc='',_0x41d914=!0x1;for(;!_0x41d914;){const {done:_0x2d48b8,value:_0x5f2dde}=await _0x56ef34['read'](),_0x509986=_0x50dc9d+_0xf096e['decode'](_0x5f2dde);let _0x3d4f5b;_0x41d914=_0x2d48b8;try{_0x3d4f5b=this['_cleanUpData'](_0x509986),_0x50dc9d='';}catch{_0x50dc9d=_0x509986;continue;}_0x461722+=_0x3d4f5b,!_0x41d914&&this['_isBufferIncomplete'](_0x461722)||_0x461722&&(_0x5c79bc+=_0x461722,_0x461722='',_0x145c00(_0x5c79bc));}return Promise['resolve']();}async _readStaticResponse(_0x4f0fa1,_0x32d62a){return _0x32d62a((await _0x4f0fa1['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}_isBufferIncomplete(_0x11d28c){const _0x16200d=_0x11d28c['split']('<')['length']!==_0x11d28c['split']('>')['length'],_0x14c86e=_0x11d28c['length']<0x1e;return _0x16200d&&_0x14c86e;}_cleanUpData(_0x10ca54){return _0x10ca54['split'](/\n(?![^{]*\})/g)['map'](_0x22407d=>_0x22407d['replace']('data:\x20',''))['filter'](_0x2db431=>_0x2db431&&_0x2db431['length']>0x0&&'[DONE]'!==_0x2db431)['map'](_0x47a1f3=>{const {choices:_0x40cfde}=JSON['parse'](_0x47a1f3);if(_0x40cfde[0x0]?.['delta']?.['content'])return _0x40cfde[0x0]['delta']['content'];})['filter'](_0x1fb05d=>_0x1fb05d)['join']('');}},Us=class extends Vs{static get['pluginName'](){return'AWSTextAdapter';}init(){super['init'](),Ft('ai-aws-adapter-not-supported');}async sendRequest(_0x9dbe9d){throw Wt('ai-aws-adapter-not-supported'),new ds(_s(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}},Bs=class extends _0x2df458{buttonViews=this['createCollection']();['panelViews']=this['createCollection']();_tabs=new Map();constructor(_0x41ce68,_0xaca26={}){super(_0x41ce68),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0xaca26['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0xaca26['collapsible']||!0x1),this['set']('isCollapsed',!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'isCollapsed',(_0x5d22fd,_0x2c9688)=>_0x5d22fd&&!_0x2c9688);const _0x36e982=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...qt(_0xaca26['class']||[]),_0x36e982['to']('side',_0x35be04=>'ck-tabs_'+_0x35be04),_0x36e982['to']('class'),_0x36e982['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x36e982['if']('isCollapsed','ck-ai-tabs_collapsed')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x36e982['to']('side',_0x1d1b6f=>'ck-tabs__buttons-container_'+_0x1d1b6f)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x36e982['to']('side',_0xe7cd52=>'ck-tabs__panels-container_'+_0xe7cd52)]},'children':this['panelViews']},...qt(_0xaca26['children']||[])]});}getTabIds(){return[...this['_tabs']['keys']()];}getTab(_0x37f2d9){const _0x3a2ed5=this['_tabs']['get'](_0x37f2d9);return _0x3a2ed5||null;}['addTab'](_0x405c53){const _0x24d100=this['_setupButton']({'id':_0x405c53['id'],'label':_0x405c53['buttonLabel'],'icon':_0x405c53['buttonIcon'],'order':_0x405c53['order']}),_0x539479=new _0x224963(this['locale']);return _0x539479['render'](),_0x405c53['content']&&_0x539479['children']['add'](_0x405c53['content']),this['panelViews']['add'](_0x539479),this['_tabs']['set'](_0x405c53['id'],{'button':_0x24d100,'panel':_0x539479,'order':void 0x0!==_0x405c53['order']?_0x405c53['order']:null}),this['fire']('addTab:'+_0x405c53['id'],{'id':_0x405c53['id'],'button':_0x24d100,'panel':_0x539479}),null===this['activeTab']?this['_activateTab'](_0x405c53['id']):this['_hidePanel'](_0x405c53['id']),{'button':_0x24d100,'panel':_0x539479};}activateTab(_0x132006){this['_activateTab'](_0x132006);}_activateTab(_0x34ace2){if(null!==_0x34ace2&&!this['getTab'](_0x34ace2))throw new dt('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x34ace2});if(this['isCollapsed']=!0x1,this['activeTab']===_0x34ace2)return;const _0x229e1f=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x34ace2,_0x34ace2&&this['_showPanel'](_0x34ace2),this['fire']('activateTab:'+_0x34ace2,{'newTab':_0x34ace2,'oldTab':_0x229e1f});}toggleTabPanel(_0x4ebd34){this['activeTab']===_0x4ebd34?this['collapsible']&&(this['isCollapsed']=!this['isCollapsed']):this['activateTab'](_0x4ebd34);}['showTab'](_0xacd990){if(!this['getTab'](_0xacd990))throw new dt('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xacd990});this['_showPanel'](_0xacd990),this['_showButton'](_0xacd990),this['fire']('show:'+_0xacd990,_0xacd990);}['hideTab'](_0xa31b2e){if(!this['getTab'](_0xa31b2e))throw new dt('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xa31b2e});const _0x7f5177=this['activeTab'];this['_hidePanel'](_0xa31b2e),this['_hideButton'](_0xa31b2e);const _0x35c097=this['getTabIds']();_0x7f5177===_0xa31b2e&&_0x35c097['length']>0x1&&this['_activateTab'](_0x35c097['find'](_0xb9863d=>_0xb9863d!==_0xa31b2e)),this['fire']('hide:'+_0xa31b2e,_0xa31b2e);}_getPanel(_0x5d257c){const _0x210cf6=this['_tabs']['get'](_0x5d257c);return _0x210cf6?_0x210cf6['panel']:null;}['_showPanel'](_0x1f9074){null!==this['activeTab']&&this['activeTab']!==_0x1f9074||this['_getPanel'](_0x1f9074)['show']();}['_hidePanel'](_0x351ef0){const _0x170740=this['_getPanel'](_0x351ef0);_0x170740['isVisible']&&(this['activeTab']===_0x351ef0&&(this['activeTab']=null),_0x170740['hide']());}_getButton(_0x14180a){const _0x125a61=this['_tabs']['get'](_0x14180a);return _0x125a61?_0x125a61['button']:null;}_showButton(_0x3bc286){this['_getButton'](_0x3bc286)['show']();}_hideButton(_0xf9b6b8){this['_getButton'](_0xf9b6b8)['hide']();}_setupButton(_0x5d93cb){const _0xa2d1cf=new _0x5207ba(this['locale'],{'side':this['side']}),_0x5e63be=this['buttonViews'];if(_0xa2d1cf['set']({'label':_0x5d93cb['label'],'icon':_0x5d93cb['icon'],'tooltip':!0x0,'withText':!0x0}),_0xa2d1cf['bind']('isOn')['to'](this,'activeTab',this,'isCollapsed',(_0x4d8164,_0x4daaad)=>_0x4d8164===_0x5d93cb['id']&&!_0x4daaad),_0xa2d1cf['bind']('side')['to'](this,'side'),_0x5d93cb['order']){const _0x5528bf=[...this['_tabs']]['reduce']((_0x16a243,_0x5663fb)=>{const _0x17ebbc=_0x5663fb[0x0],{order:_0xfe0374}=_0x5663fb[0x1];return!_0xfe0374||_0xfe0374>_0x5d93cb['order']?_0x16a243:_0xfe0374>=_0x16a243['order']?{'id':_0x17ebbc,'order':_0xfe0374}:_0x16a243;},{'id':'','order':0x0}),_0x27d25e=_0x5e63be['getIndex'](this['_getButton'](_0x5528bf['id']));_0x5e63be['add'](_0xa2d1cf,_0x27d25e+0x1);}else _0x5e63be['add'](_0xa2d1cf);return _0xa2d1cf['on']('execute',()=>{this['toggleTabPanel'](_0x5d93cb['id']);}),_0xa2d1cf;}};const Gs=['overlay','sidebar','custom'],Ws=['left','right'];var Fs=class extends Bs{constructor(_0x5051a3,_0x49f85e={}){super(_0x5051a3,_0x49f85e),this['set']('type',_0x49f85e['type']||'sidebar'),this['set']('side',_0x49f85e['side']||'right'),this['set']('isVisible',_0x49f85e['visibleByDefault']??!0x0);const _0xb99908=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0xb99908['if']('type','ck-ai-tabs__overlay',_0x55eb6e=>'overlay'===_0x55eb6e),_0xb99908['if']('type','ck-ai-tabs__sidebar',_0x4dd47c=>'sidebar'===_0x4dd47c),_0xb99908['if']('isVisible','ck-hidden',_0x390855=>!_0x390855)]}}),this['buttonViews']['on']('add',(_0x16db7f,_0x510b3d)=>{_0x510b3d['set']('withText',!0x1);});}activateTab(_0x331109){const {eventInfo:_0x37984f}=this['_fireBeforeActivateTab'](_0x331109);return!_0x37984f['stop']['called']&&(this['_finalizeActivateTab'](_0x331109),!0x0);}async activateTabAwaitingConfirmation(_0xf3d954){const {eventInfo:_0x5b7a55,activationConfirmed:_0x319f7e}=this['_fireBeforeActivateTab'](_0xf3d954,!0x0);return!(_0x5b7a55['stop']['called']&&!await _0x319f7e)&&(this['_finalizeActivateTab'](_0xf3d954),!0x0);}forceActivateTab(_0x5e7802){this['_finalizeActivateTab'](_0x5e7802);}_finalizeActivateTab(_0x24f671){super['activateTab'](_0x24f671);}_fireBeforeActivateTab(_0x3abc4a,_0xe91477=!0x1){if(null!==_0x3abc4a&&!this['getTab'](_0x3abc4a))throw new dt('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3abc4a});const _0x4c1b5f=this['activeTab'],_0x432eb4=new At(this,'beforeActivateTab');let _0x3dcdd2=()=>{};const _0x2295f2=new Promise(_0x15960a=>{_0x3dcdd2=_0x15960a;}),_0x2b6431={'newTab':_0x3abc4a,'oldTab':_0x4c1b5f};return _0xe91477&&(_0x2b6431['resolveActivation']=_0x3dcdd2),this['fire'](_0x432eb4,_0x2b6431),{'eventInfo':_0x432eb4,'activationConfirmed':_0x2295f2};}},Ks=class extends _0x4cd5fc{['view'];get bodyCollection(){return this['_overlayHost']['bodyCollection'];}_sidebarElement=null;_overlayHost;showResizeButton=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x502df5){if(super(_0x502df5),!this['context']['config']['get']('ai.container'))throw new dt('ai-tabs-configuration-not-found');this['context']['config']['define']('ai.container.visibleByDefault',!0x0),this['context']['config']['define']('ai.container.collapsible',!0x1);const _0x42a480=this['context']['config']['get']('ai.container');if(this['set']('side','right'),this['set']('container',null),void 0x0!==_0x42a480['showResizeButton']&&(this['showResizeButton']=_0x42a480['showResizeButton']),'sidebar'!==_0x42a480['type']&&'overlay'!==_0x42a480['type']||_0x42a480['side']&&(this['side']=_0x42a480['side']),'sidebar'===_0x42a480['type']){if(this['set']('type','sidebar'),this['_sidebarElement']=_0x42a480['element'],!_0x42a480['element'])throw new dt('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x42a480['type']?this['set']('type','overlay'):this['set']('type','custom');this['view']=new Fs(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':_0x42a480['visibleByDefault'],'collapsible':_0x42a480['collapsible']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['_overlayHost']=new _0x5c12c0(this['context']['locale'],{'resolveMountTarget':()=>this['_resolveOverlayMountTarget'](),'resolveInlineContainer':()=>this['container']}),this['bodyCollection']['bodyCollectionContainer']['classList']['add']('ck-ai-body'),this['_refreshContainer'](),this['_mountView'](),this['on']('change:container',()=>this['_mountView']()),this['on']('change:type',()=>this['_refreshContainer']()),this['on']('change:side',()=>this['_overlayHost']['sync']()),this['context']['editors']?this['listenTo'](this['context']['editors'],'add',(_0x1fbbc6,_0x2d0c79)=>this['_refreshContainerWhenReady'](_0x2d0c79)):this['context']instanceof _0x553634&&this['_refreshContainerWhenReady'](this['context']),this['context']instanceof _0x553634&&this['context']['ui']['focusTracker']['add'](this['view']['element']),this['listenTo'](this,'resizeTabs',()=>{this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);});}_refreshContainer(){if('sidebar'===this['type'])this['_sidebarElement']&&(this['container']=this['_sidebarElement']);else{if('overlay'===this['type']){const _0x1f1323=this['_configuredOverlayContainer'];if(_0x1f1323)return void(this['container']=_0x1f1323);for(const _0x91068c of this['_editors'])if('ready'===_0x91068c['state']){for(const _0x26513b of _0x91068c['editing']['view']['domRoots']['values']())if(_0x26513b['isConnected'])return void(this['container']=xt(_0x26513b));}this['container']=document['body'];}}}_refreshContainerWhenReady(_0x3919cb){this['listenTo'](_0x3919cb,'ready',()=>{'overlay'!==this['type']||this['container']&&this['container']!==document['body']||this['_refreshContainer'](),this['_overlayHost']['sync']();});}_mountView(){const _0x4b228a=this['view']['element'];'custom'!==this['type']&&this['container']&&Dt(_0x4b228a)!==this['container']&&this['container']['appendChild'](_0x4b228a),this['_overlayHost']['sync']();}_resolveOverlayMountTarget(){return this['_configuredOverlayContainer']?this['_configuredOverlayContainer']:this['container']?xt(this['container']):document['body'];}get _configuredOverlayContainer(){return this['_getConfiguredContainer']('ai.overlayContainer')||this['_getConfiguredContainer']('ui.overlayContainer');}_getConfiguredContainer(_0x347121){const _0x1ff5d9=this['context']['config']['get'](_0x347121);if(_0x1ff5d9)return _0x1ff5d9;for(const _0x54f7a7 of this['_editors']){const _0x1e998c=_0x54f7a7['config']['get'](_0x347121);if(_0x1e998c)return _0x1e998c;}return null;}get _editors(){return this['context']['editors']||(this['context']instanceof _0x553634?[this['context']]:[]);}switchType(_0xab090){if(_0xab090&&this['type']!==_0xab090){if(!Gs['includes'](_0xab090))throw new dt('ai-tabs-unsupported-ui-type');this['type']=_0xab090;}}switchSide(_0x1ff345){if(_0x1ff345&&this['side']!==_0x1ff345){if(!Ws['includes'](_0x1ff345))throw new dt('ai-tabs-unsupported-ui-side');this['side']=_0x1ff345;}}destroy(){super['destroy'](),this['_overlayHost']['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}},$s=class extends _0x4cd5fc{['_apiUrl'];get['_apiUrlV11'](){return this['_apiUrl']['replace'](/\/v1$/,'/v1.1');}_token;['_decoder'];static get requires(){return[_0x1e4e62];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1c276c){if(super(_0x1c276c),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl')['replace'](/\/+$/,''),!this['_apiUrl']['endsWith']('/v1'))throw new dt('ai-service-url-invalid-version',this,{'serviceUrl':this['_apiUrl']});this['_token']=null,this['_decoder']=new TextDecoder();}init(){const _0x57f5b9=this['context']['plugins']['get'](_0x1e4e62);if(!_0x57f5b9['token'])throw new dt('ai-missing-token',this);this['_token']=_0x57f5b9['token'];}_getExtraHttpHeaders(){const _0x4fac73=this['context']['config']['get']('ai.extraHttpHeaders'),_0x1805be='function'==typeof _0x4fac73?_0x4fac73():_0x4fac73;if(Array['isArray'](_0x1805be)&&_0x1805be['length'])return Object['fromEntries'](_0x1805be['map'](({domain:_0x285c15,headers:_0x2d2aa2})=>[_0x285c15,_0x2d2aa2]));}startConversation(_0x37c04e,_0x218798){const _0x17107f=this['_sendApiRequest']('/conversations','POST',{'id':_0x37c04e,'group':_0x218798});return{'getConversation':async()=>(await _0x17107f['request'])['json'](),'abortController':_0x17107f['abortController']};}queryAssistant({message:_0x432b58,conversationId:_0x396ad6,parts:_0x479336,capabilities:_0x114ad8,model:_0x1fa243,attributes:_0x42ce20}){const _0x2f7946=this['_getExtraHttpHeaders'](),_0xb0ea2d={..._0x432b58&&{'prompt':_0x432b58},'content':_0x479336,'model':_0x1fa243,..._0x114ad8&&{'capabilities':_0x114ad8},..._0x42ce20&&{'attributes':_0x42ce20},..._0x2f7946&&{'extraHttpHeaders':_0x2f7946}},_0x1d46fa=this['_sendApiRequest']('/conversations/'+_0x396ad6+'/messages','POST',_0xb0ea2d,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x26d000=(await _0x1d46fa['request'])['body'];return this['_getStreamReader'](_0x26d000);},'abortController':_0x1d46fa['abortController']};}executeCustomAction({content:_0x534ccf,message:_0x268f59,model:_0x23a90c,outputFormat:_0x2c170f,contexts:_0x37c88a}){const _0x3378e0={'content':[{'type':'text','content':_0x534ccf}],..._0x268f59&&{'prompt':_0x268f59},'model':_0x23a90c,'outputFormat':_0x2c170f,...Ys(_0x37c88a)},_0x17ccbe=this['_sendApiRequest']('/actions/custom/calls','POST',_0x3378e0);return{'getStream':async()=>{const _0x45d184=(await _0x17ccbe['request'])['body'];return this['_getStreamReader'](_0x45d184);},'abortController':_0x17ccbe['abortController']};}executeAction({actionName:_0x156586,content:_0x593a3f,args:_0x731209,contexts:_0xed543b}){const _0x5f01c6={'content':[{'type':'text','content':_0x593a3f}],'args':_0x731209,...Ys(_0xed543b)},_0x3586ba=this['_sendApiRequest']('/actions/system/'+_0x156586+'/calls','POST',_0x5f01c6);return{'getStream':async()=>{const _0xa0575a=(await _0x3586ba['request'])['body'];return this['_getStreamReader'](_0xa0575a);},'abortController':_0x3586ba['abortController']};}['uploadFile'](_0x468690,_0x277db6,_0xa0ea5){const _0x4f7daf=new FormData();_0x4f7daf['append']('file',_0x277db6,_0x277db6['name']),_0xa0ea5&&_0x4f7daf['append']('attributes',JSON['stringify'](_0xa0ea5));const _0xb315db=this['_sendApiRequest']('/conversations/'+_0x468690+'/files','POST',_0x4f7daf);return{'getId':async()=>(await _0xb315db['request'])['json'](),'abortController':_0xb315db['abortController']};}uploadDocuments(_0x4cf4d7,_0x261458){const _0x79c517={'documents':_0x261458['map'](_0x2c4348=>({'content':_0x2c4348['content'],'attributes':{'version':_0x2c4348['version'],'sessionId':_0x2c4348['sessionId'],'channelId':_0x2c4348['channelId'],'rootName':_0x2c4348['rootName'],'selections':_0x2c4348['selections']},...void 0x0!==_0x2c4348['name']?{'name':_0x2c4348['name']}:{},...void 0x0!==_0x2c4348['description']?{'description':_0x2c4348['description']}:{}}))},_0x1123b0=this['_sendApiRequest']('/conversations/'+_0x4cf4d7+'/documents/batch','POST',_0x79c517);return{'getIds':async()=>(await _0x1123b0['request'])['json'](),'abortController':_0x1123b0['abortController']};}fetchDocuments(_0x1ea157,_0x34751d){const _0x3c1ed9=new URLSearchParams();_0x3c1ed9['append']('documentIds',_0x34751d['join'](','));const _0x187f40=this['_sendApiRequest']('/conversations/'+_0x1ea157+'/documents/batch?'+_0x3c1ed9['toString'](),'GET');return{'getDocuments':async()=>(await _0x187f40['request'])['json'](),'abortController':_0x187f40['abortController']};}fetchConversations(_0x4fd8ed,_0x5698e9={}){const _0x2d952a=new URLSearchParams();_0x2d952a['append']('group',_0x4fd8ed),_0x2d952a['append']('excludeEmpty',!0x1!==_0x5698e9['excludeEmpty']?'true':'false'),_0x2d952a['append']('limit',_0x5698e9['limit']?_0x5698e9['limit']['toString']():0x64['toString']()),_0x2d952a['append']('sortBy',_0x5698e9['sortBy']?_0x5698e9['sortBy']:'createdAt'),_0x2d952a['append']('order',_0x5698e9['order']?_0x5698e9['order']:'desc');const _0x4b0faa=this['_sendApiRequest']('/conversations?'+_0x2d952a['toString'](),'GET');return{'getConversations':async()=>(await(await _0x4b0faa['request'])['json']())['items'],'abortController':_0x4b0faa['abortController']};}deleteConversation(_0x422380){const _0xc79d20=this['_sendApiRequest']('/conversations/'+_0x422380,'DELETE');return{'execute':async()=>{await _0xc79d20['request'];},'abortController':_0xc79d20['abortController']};}updateConversation(_0x23bd7a,_0x83a3e3){const _0xbbf2aa=this['_sendApiRequest']('/conversations/'+_0x23bd7a,'PATCH',_0x83a3e3);return{'getResult':async()=>(await _0xbbf2aa['request'],_0x83a3e3),'abortController':_0xbbf2aa['abortController']};}fetchConversation(_0x522b85){const _0x35207c=this['_sendApiRequest']('/conversations/'+_0x522b85,'GET');return{'getConversation':async()=>(await _0x35207c['request'])['json'](),'abortController':_0x35207c['abortController']};}fetchConversationMessages(_0x3741cb){const _0x339d64=this['_sendApiRequest']('/conversations/'+_0x3741cb+'/messages','GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getMessages':async()=>(await(await _0x339d64['request'])['json']())['items'],'abortController':_0x339d64['abortController']};}['uploadUrl'](_0x2bd95d,_0x245ea4,_0x18bca5){const _0x41d270=this['_sendApiRequest']('/conversations/'+_0x2bd95d+'/web-resources','POST',{'url':_0x245ea4,'attributes':_0x18bca5});return{'getId':async()=>(await _0x41d270['request'])['json'](),'abortController':_0x41d270['abortController']};}getModels(_0x4ffa08='en'){const _0x3d59f5=new URLSearchParams();_0x3d59f5['append']('language',_0x4ffa08);const _0xa68a0a='/models/1?'+_0x3d59f5['toString'](),_0x1bb655=this['_sendApiRequest'](_0xa68a0a,'GET');return{'list':async()=>await(await _0x1bb655['request'])['json'](),'abortController':_0x1bb655['abortController']};}listContexts(_0x1bc4d6={}){const _0x60a8f6=new URLSearchParams();_0x60a8f6['append']('limit',_0x1bc4d6['limit']?_0x1bc4d6['limit']['toString']():0x64['toString']()),_0x1bc4d6['cursor']&&_0x60a8f6['append']('cursor',_0x1bc4d6['cursor']),_0x1bc4d6['order']&&_0x60a8f6['append']('order',_0x1bc4d6['order']);const _0x4fc6a3=this['_sendApiRequest']('/contexts?'+_0x60a8f6['toString'](),'GET');return{'getContexts':async()=>(await(await _0x4fc6a3['request'])['json']())['items'],'abortController':_0x4fc6a3['abortController']};}deleteFile(_0x5d6651,_0x32a320){const _0x22c84e=this['_sendApiRequest']('/conversations/'+_0x5d6651+'/files/'+_0x32a320,'DELETE');return{'execute':async()=>{await _0x22c84e['request'];},'abortController':_0x22c84e['abortController']};}deleteDocument(_0xcb3e47,_0x4fe554){const _0x20f53f=this['_sendApiRequest']('/conversations/'+_0xcb3e47+'/documents/'+_0x4fe554,'DELETE');return{'execute':async()=>{await _0x20f53f['request'];},'abortController':_0x20f53f['abortController']};}deleteWebResource(_0x3f193c,_0x32d4f3){const _0x245639=this['_sendApiRequest']('/conversations/'+_0x3f193c+'/web-resources/'+_0x32d4f3,'DELETE');return{'execute':async()=>{await _0x245639['request'];},'abortController':_0x245639['abortController']};}cancelStream(_0x20fe5c,_0x3cbc8c){const _0x1462ee=this['_sendApiRequest']('/conversations/'+_0x20fe5c+'/messages/'+_0x3cbc8c+'/stream','DELETE',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'execute':async()=>{await _0x1462ee['request'];},'abortController':_0x1462ee['abortController']};}resumeStream(_0x39dd13,_0x106f73,_0x532b9b='0-0'){const _0x18467d=new URLSearchParams({'lastEventId':_0x532b9b}),_0x36b274=this['_sendApiRequest']('/conversations/'+_0x39dd13+'/messages/'+_0x106f73+'/stream?'+_0x18467d['toString'](),'GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x401b52=await _0x36b274['request'];return this['_getStreamReader'](_0x401b52['body']);},'abortController':_0x36b274['abortController']};}callSystemReview({reviewName:_0x26399e,content:_0x935cbc,args:_0x31c7ea,contexts:_0x150d16}){const _0x4de882=this['_sendApiRequest']('/reviews/system/'+_0x26399e+'/calls','POST',{'content':[{'type':'text','content':_0x935cbc}],'args':_0x31c7ea,...Ys(_0x150d16)});return{'getStream':async()=>{const _0x9eee7c=(await _0x4de882['request'])['body'];return this['_getStreamReader'](_0x9eee7c);},'abortController':_0x4de882['abortController']};}processDocument({content:_0x44676d,prompt:_0x54d732,model:_0x5f29d1,capabilities:_0x3881ac,contexts:_0x27981d}){const _0x2b6205=this['_getExtraHttpHeaders'](),_0x2b8182=this['_sendApiRequest']('/documents/process','POST',{'content':_0x44676d,'prompt':_0x54d732,'model':_0x5f29d1,..._0x3881ac&&{'capabilities':_0x3881ac},...Ys(_0x27981d),..._0x2b6205&&{'extraHttpHeaders':_0x2b6205}});return{'getResult':async()=>(await _0x2b8182['request'])['json'](),'abortController':_0x2b8182['abortController']};}callCustomReview({content:_0x494e7c,prompt:_0x5b54a6,model:_0x54392f,contexts:_0x4f2ba9}){const _0x382709=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x494e7c}],..._0x5b54a6&&{'prompt':_0x5b54a6},'model':_0x54392f,...Ys(_0x4f2ba9)});return{'getStream':async()=>{const _0x40c6d2=(await _0x382709['request'])['body'];return this['_getStreamReader'](_0x40c6d2);},'abortController':_0x382709['abortController']};}upsertAIChatRating(_0x13f11d,_0x8a36bc,_0x34a237){const _0x58369c=this['_sendApiRequest']('/conversations/'+_0x13f11d+'/messages/'+_0x8a36bc+'/ratings','PUT',{'positiveCount':_0x34a237['positiveCount'],'totalCount':_0x34a237['totalCount'],'modificationId':_0x34a237['modificationId']});return{'execute':async()=>{await _0x58369c['request'];},'abortController':_0x58369c['abortController']};}upsertAIActionRating(_0xff4f50,_0x12f7b9,_0x5232c1){const _0x1c09d1=this['_sendApiRequest']('/actions/system/'+_0xff4f50+'/calls/'+_0x12f7b9+'/ratings','PUT',{'positiveCount':_0x5232c1['positiveCount'],'totalCount':_0x5232c1['totalCount']});return{'execute':async()=>{await _0x1c09d1['request'];},'abortController':_0x1c09d1['abortController']};}upsertCustomAIActionRating(_0x2e225e,_0x279eeb){const _0x2d8eba=this['_sendApiRequest']('/actions/custom/calls/'+_0x2e225e+'/ratings','PUT',{'positiveCount':_0x279eeb['positiveCount'],'totalCount':_0x279eeb['totalCount']});return{'execute':async()=>{await _0x2d8eba['request'];},'abortController':_0x2d8eba['abortController']};}upsertAIReviewRating(_0x41db74,_0x5ec85f,_0x3b21f7,_0x40ab4a){const _0x195f04=this['_sendApiRequest']('/reviews/system/'+_0x41db74+'/calls/'+_0x5ec85f+'/ratings','PUT',{'positiveCount':_0x3b21f7['positiveCount'],'totalCount':_0x3b21f7['totalCount'],'dataId':_0x40ab4a});return{'execute':async()=>{await _0x195f04['request'];},'abortController':_0x195f04['abortController']};}upsertCustomAIReviewRating(_0x17ce47,_0x4a78ae,_0x1e3894){const _0x1e4af2=this['_sendApiRequest']('/reviews/custom/calls/'+_0x17ce47+'/ratings','PUT',{'positiveCount':_0x4a78ae['positiveCount'],'totalCount':_0x4a78ae['totalCount'],'dataId':_0x1e3894});return{'execute':async()=>{await _0x1e4af2['request'];},'abortController':_0x1e4af2['abortController']};}_sendApiRequest(_0x2f1e9a,_0x201ba4,_0x1832ef,_0x589dee={}){const {apiUrl:_0x4fecbe=this['_apiUrl']}=_0x589dee,_0x35fada=new AbortController(),_0x127cff=_0x1832ef instanceof FormData,_0x64a124={'Authorization':'Bearer\x20'+this['_token']?.['value'],'X-Editor-Version':zt};_0x1832ef&&!_0x127cff&&(_0x64a124['Content-Type']='application/json');const _0x588e2a={'method':_0x201ba4,'headers':_0x64a124,'signal':_0x35fada['signal']};return _0x1832ef&&(_0x588e2a['body']=_0x127cff?_0x1832ef:JSON['stringify'](_0x1832ef)),{'request':fetch(''+_0x4fecbe+_0x2f1e9a,_0x588e2a)['catch'](_0x4f4605=>{this['_handleError'](_0x4f4605);})['then'](_0x342adb=>_0x342adb['ok']?_0x342adb:_0x342adb['json']()['then'](_0x287bb3=>{throw{'url':_0x4fecbe,'path':_0x2f1e9a,'method':_0x201ba4,'body':_0x1832ef,'status':(_0x342adb||{})['status'],'statusText':(_0x342adb||{})['statusText'],'code':_0x287bb3['code'],'message':_0x287bb3['message'],'traceId':_0x287bb3['traceId'],'data':_0x287bb3['data']};})),'abortController':_0x35fada};}async *_getStreamReader(_0x50e1a8){const _0x3eb948=[],_0xfc5327=_0x50e1a8['getReader'](),_0x1aa70e=_0x252d62({'onError':_0x5eb535=>{this['_handleError'](_0x5eb535);},'onEvent':_0x3b7da1=>{_0x3b7da1['data']=JSON['parse'](_0x3b7da1['data']),_0x3eb948['push'](_0x3b7da1);}});try{let _0x542cbf=!0x1;for(;!_0x542cbf;){const {done:_0x34a4d5,value:_0x920fea}=await _0xfc5327['read']();_0x34a4d5&&(_0x542cbf=!0x0),_0x1aa70e['feed'](this['_decoder']['decode'](_0x920fea,{'stream':!0x0})),yield*_0x3eb948,_0x3eb948['length']=0x0;}}catch(_0x14ee51){this['_handleError'](_0x14ee51);}finally{_0xfc5327['releaseLock'](),_0x1aa70e['reset']();}}['_handleError'](_0x2b3084){if(_0x2b3084 instanceof dt)throw _0x2b3084;if(_0x2b3084 instanceof Error&&'AbortError'===_0x2b3084['name'])throw new dt('ai-request-aborted',this,{'originalError':_0x2b3084});throw new dt('ai-request-failed',this,{'originalError':_0x2b3084});}};function Ys(_0x112866){return _0x112866?.['length']?{'contexts':_0x112866}:{};}function qs(_0x570297,_0x3ecb7d,_0x235b88){const t=_0x570297['t'];switch(_0x3ecb7d){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'},_0x235b88);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_SUGGESTION_CONTENT_PART_STATE_OUTDATED_TOOLTIP':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_TOOLTIP','string':'Created\x20for\x20a\x20previous\x20version\x20of\x20the\x20document\x20and\x20can\x20no\x20longer\x20be\x20applied.'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_CONTENT_REMOVED_TOOLTIP':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_CONTENT_REMOVED_TOOLTIP','string':'Created\x20for\x20content\x20that\x20no\x20longer\x20exists.'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_EDITOR_REMOVED_TOOLTIP':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_EDITOR_REMOVED_TOOLTIP','string':'Created\x20for\x20content\x20that\x20no\x20longer\x20exists.'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_SESSION_CHANGED_TOOLTIP':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_SESSION_CHANGED_TOOLTIP','string':'Created\x20for\x20a\x20previous\x20version\x20of\x20the\x20document\x20and\x20can\x20no\x20longer\x20be\x20applied.'});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':'Response\x20stopped.'});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.'},_0x235b88);case'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED':return t({'id':'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED','string':'Folders\x20cannot\x20be\x20added\x20to\x20the\x20chat.\x20Try\x20adding\x20individual\x20files\x20instead.'});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.'},_0x235b88);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_PASTED_TEXT_NAME':return t({'id':'AI_CHAT_CONTEXT_PASTED_TEXT_NAME','string':'Pasted\x20Text'});case'AI_CHAT_DROP_ZONE_HINT':return t({'id':'AI_CHAT_DROP_ZONE_HINT','string':'Drop\x20files\x20here\x20to\x20add\x20to\x20the\x20chat'});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_LIBRARY_LABEL':return t({'id':'AI_CHAT_CONTEXT_LIBRARY_LABEL','string':'Context\x20library'});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_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.'},_0x235b88);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_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'},_0x235b88);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x235b88);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'},_0x235b88);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_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.'},_0x235b88);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.'},_0x235b88);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.'},_0x235b88);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.'},_0x235b88);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_CHAT_BALLOON_HEADER_TITLE':return t({'id':'AI_CHAT_BALLOON_HEADER_TITLE','string':'Change\x20%0\x20of\x20%1'},_0x235b88);case'AI_BALLOON_REJECT_BUTTON':return t({'id':'AI_BALLOON_REJECT_BUTTON','string':'Reject'});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.'},_0x235b88);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_REJECT_ALL':return t({'id':'AI_REVIEW_MODE_REJECT_ALL','string':'Reject\x20all'});case'AI_REVIEW_MODE_ACCEPT_REMAINING':return t({'id':'AI_REVIEW_MODE_ACCEPT_REMAINING','string':'Accept\x20remaining'});case'AI_REVIEW_MODE_REJECT_REMAINING':return t({'id':'AI_REVIEW_MODE_REJECT_REMAINING','string':'Reject\x20remaining'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_LEAVE_CONFIRMATION_TITLE':return t({'id':'AI_REVIEW_MODE_LEAVE_CONFIRMATION_TITLE','string':'Exit\x20Review\x20Mode'});case'AI_REVIEW_MODE_LEAVE_CONFIRMATION_CONTENT':return t({'id':'AI_REVIEW_MODE_LEAVE_CONFIRMATION_CONTENT','string':'You\x20can\x27t\x20continue\x20this\x20review\x20after\x20exiting.'});case'AI_REVIEW_MODE_LEAVE_CONFIRMATION_STAY_BUTTON':return t({'id':'AI_REVIEW_MODE_LEAVE_CONFIRMATION_STAY_BUTTON','string':'Stay\x20in\x20Review\x20Mode'});case'AI_REVIEW_MODE_LEAVE_CONFIRMATION_EXIT_BUTTON':return t({'id':'AI_REVIEW_MODE_LEAVE_CONFIRMATION_EXIT_BUTTON','string':'Exit\x20Review\x20Mode'});case'AI_REVIEW_MODE_PROGRESS':return t({'id':'AI_REVIEW_MODE_PROGRESS','string':'%0\x20of\x20%1\x20reviewed'},_0x235b88);case'AI_REVIEW_MODE_CONTENT_PART_TITLE':return t({'id':'AI_REVIEW_MODE_CONTENT_PART_TITLE','string':'Review\x20%0'},_0x235b88);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_SUGGEST_CHANGE':return t({'id':'AI_REVIEW_MODE_SUGGEST_CHANGE','string':'Suggest'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_NAVIGATION_READ_ONLY_NOTICE':return t({'id':'AI_REVIEW_MODE_NAVIGATION_READ_ONLY_NOTICE','string':'Review\x20Mode\x20-\x20editor\x20is\x20read-only'});case'AI_REVIEW_MODE_NAVIGATION_COUNTER':return t({'id':'AI_REVIEW_MODE_NAVIGATION_COUNTER','string':'Review\x20%0\x20of\x20%1'},_0x235b88);case'AI_REVIEW_MODE_NAVIGATION_PREVIOUS_CHANGE':return t({'id':'AI_REVIEW_MODE_NAVIGATION_PREVIOUS_CHANGE','string':'Previous\x20change'});case'AI_REVIEW_MODE_NAVIGATION_NEXT_CHANGE':return t({'id':'AI_REVIEW_MODE_NAVIGATION_NEXT_CHANGE','string':'Next\x20change'});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_MODE_RUN_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_RUN_REVIEW_BUTTON_LABEL','string':'Review'});case'AI_REVIEW_MODE_CUSTOM_PROMPT_PLACEHOLDER':return t({'id':'AI_REVIEW_MODE_CUSTOM_PROMPT_PLACEHOLDER','string':'Describe\x20how\x20you\x20want\x20to\x20review\x20the\x20content'});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':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Check\x20correctness'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Verify\x20grammar,\x20spelling,\x20and\x20style'});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':'Remove\x20redundant\x20phrases,\x20simplify\x20wording,\x20and\x20suggest\x20active\x20voice.'});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':'Simplify\x20complex\x20sentences\x20and\x20highlight\x20formatting\x20that\x20makes\x20text\x20harder\x20to\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':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs'});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':'Make\x20your\x20writing\x20more\x20consistent\x20and\x20adapt\x20its\x20tone\x20to\x20match\x20the\x20intended\x20audience.'});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_REVIEW_MODE_REVIEW_CATEGORY_TITLE_NON_PARAMETERIZED':return t({'id':'AI_REVIEW_MODE_REVIEW_CATEGORY_TITLE_NON_PARAMETERIZED','string':'Select\x20and\x20run\x20review'});case'AI_REVIEW_MODE_REVIEW_CATEGORY_TITLE_PARAMETERIZED':return t({'id':'AI_REVIEW_MODE_REVIEW_CATEGORY_TITLE_PARAMETERIZED','string':'Customize\x20and\x20run\x20review'});case'AI_REVIEW_MODE_COMPLETE_REVIEW':return t({'id':'AI_REVIEW_MODE_COMPLETE_REVIEW','string':'Complete'});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_TRANSLATE_LEAVE_CONFIRMATION_TITLE':return t({'id':'AI_TRANSLATE_LEAVE_CONFIRMATION_TITLE','string':'Exit\x20Translation\x20Mode'});case'AI_TRANSLATE_LEAVE_CONFIRMATION_CONTENT':return t({'id':'AI_TRANSLATE_LEAVE_CONFIRMATION_CONTENT','string':'You\x20can\x27t\x20continue\x20this\x20translation\x20after\x20exiting.'});case'AI_TRANSLATE_LEAVE_CONFIRMATION_STAY_BUTTON':return t({'id':'AI_TRANSLATE_LEAVE_CONFIRMATION_STAY_BUTTON','string':'Stay\x20in\x20Translation\x20Mode'});case'AI_TRANSLATE_LEAVE_CONFIRMATION_EXIT_BUTTON':return t({'id':'AI_TRANSLATE_LEAVE_CONFIRMATION_EXIT_BUTTON','string':'Exit\x20Translation\x20Mode'});default:return _0x3ecb7d;}}const Qs=/* #__PURE__ -- @preserve */
25
+ It();var Xs=class extends Qs{_connector;['_config'];['_locale'];_modelList=[];_modelsRequest=null;constructor({connector:_0x506d7a,config:_0x36c88b,locale:_0x4bdac9}){super(),this['_connector']=_0x506d7a,this['_config']=_0x36c88b,this['_locale']=_0x4bdac9;}get['_availableModels'](){const _0x2dbef5=qt(this['_config']?.['displayedModels']??[])['filter'](_0x1f7ca8=>_0x1f7ca8['trim']());return _0x2dbef5['length']?_0x2dbef5:void 0x0;}get _defaultModelId(){return this['_config']?.['defaultModelId'];}async getAllModels(){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()['catch'](_0x4715ce=>{throw this['_modelsRequest']=null,_0x4715ce;})),this['_modelsRequest'];}async getAvailableModels(){const _0x1a726d=await this['getAllModels']();let _0x4619da;return _0x4619da=this['_availableModels']?this['_filterModels'](_0x1a726d,this['_availableModels']):_0x1a726d['filter'](_0x245502=>_0x245502['recommended']),_0x4619da;}async['resolveModel'](_0x431a2d){const _0x4956c0=await this['getAllModels']();if(!_0x4956c0['length'])return null;if(_0x431a2d){const _0x11959a=this['_getModelById'](_0x4956c0,_0x431a2d);if(_0x11959a)return _0x11959a;Ft('ai-chat-model-id-unrecognized',{'modelId':_0x431a2d,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async getDefault(){const _0x40827d=await this['getAvailableModels']();if(!_0x40827d['length'])return null;if(this['_defaultModelId']){const _0x276109=this['_getModelById'](_0x40827d,this['_defaultModelId']);if(_0x276109)return _0x276109;Ft('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x40827d[0x0]['id']});}return _0x40827d[0x0];}async['isAvailable'](_0x3f0db3){return(await this['getAvailableModels']())['some'](_0x1d96c4=>_0x1d96c4['name']===_0x3f0db3['name']&&_0x1d96c4['provider']===_0x3f0db3['provider']);}async getModel(_0x211c8c){const _0x35e8fc=await this['getAllModels']();return this['_getModelById'](_0x35e8fc,_0x211c8c)||null;}async _retrieveModels(){if(!this['_modelList']['length']){const _0x257767=this['_locale']['uiLanguage']||'en',_0x46b525=await this['_connector']['getModels'](_0x257767)['list']();this['_modelList']=_0x46b525['items']['map'](_0x2b55da=>zs(_0x2b55da)?{..._0x2b55da,'name':qs(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x2b55da);}return[...this['_modelList']];}_filterModels(_0x458592,_0xc5713c){let _0x5979ce;if(_0xc5713c){_0x5979ce=[];const _0x417a77=new Set(),_0x14d9e3='string'==typeof _0xc5713c?[_0xc5713c['toLocaleLowerCase']()]:_0xc5713c['map'](_0xb145dd=>_0xb145dd['toLocaleLowerCase']());for(const _0x40df85 of _0x14d9e3)for(const _0x319d39 of _0x458592)!_0x417a77['has'](_0x319d39['id'])&&this['_isMatchingFilter'](_0x319d39,_0x40df85)&&(_0x5979ce['push'](_0x319d39),_0x417a77['add'](_0x319d39['id']));}else _0x5979ce=_0x458592;return _0x5979ce;}_isMatchingFilter(_0x322845,_0x19eaf8){const _0x3f7242=_0x322845['id']['toLocaleLowerCase'](),_0x4aa1a6=_0x322845['name']['toLocaleLowerCase'](),_0xe4aff8=_0x322845['provider']['toLocaleLowerCase']();return _0x3f7242===_0x19eaf8||_0x4aa1a6===_0x19eaf8||zs(_0x322845)&&'auto'===_0x19eaf8||_0xe4aff8===_0x19eaf8||_0x3f7242['startsWith'](_0x19eaf8);}_getModelById(_0x181518,_0x11be44){return _0x181518['find'](_0x107e87=>zs(_0x107e87)&&'auto'===_0x11be44?_0x107e87:_0x107e87['id']===_0x11be44)||null;}};function zs(_0x48aeab){return _0x48aeab['id']['startsWith']('agent');}var js=class{_connector;_defaultContext;_contextsRequest=null;constructor({connector:_0x5e9f60,defaultContext:_0x568742}){this['_connector']=_0x5e9f60,this['_defaultContext']=_0x568742;}async getAllContexts(){return this['_contextsRequest']||(this['_contextsRequest']=this['_connector']['listContexts']()['getContexts']()['catch'](_0x364962=>{throw this['_contextsRequest']=null,_0x364962;})),[...await this['_contextsRequest']];}async getAvailableContexts(){const _0x34e21b=await this['getAllContexts'](),_0x218f3d=new Set((this['_defaultContext']??[])['map'](_0x10690f=>_0x10690f['id']));return _0x34e21b['filter'](_0x22fd9b=>!_0x218f3d['has'](_0x22fd9b['id']));}resolveContext({feature:_0x3d982c,ids:_0x1434ff=[],extraContexts:_0x37655c=[],idScopedOnly:_0x2e733a=!0x1,context:_0x373c52}){const _0x4cdd65=this['_resolveDefaultContext'](_0x3d982c,_0x1434ff,_0x2e733a);return _0x373c52['addDefaultContext']([..._0x4cdd65,..._0x37655c]),_0x373c52;}_resolveDefaultContext(_0x223eba,_0x501abf,_0x116748=!0x1){if(!this['_defaultContext'])return[];const _0x2d15aa=[];for(const _0xaa4602 of this['_defaultContext'])this['_entryAppliesToFeature'](_0xaa4602['features'],_0x223eba,_0x501abf)&&(_0x116748&&this['_entryAppliesToFeature'](_0xaa4602['features'],_0x223eba,[])||_0x2d15aa['push'](this['_toContextRef'](_0xaa4602)));return _0x2d15aa;}_toContextRef(_0x2a878c){return'promptId'in _0x2a878c?{'id':_0x2a878c['id'],'promptId':_0x2a878c['promptId']}:'fileId'in _0x2a878c?{'id':_0x2a878c['id'],'fileId':_0x2a878c['fileId']}:{'id':_0x2a878c['id']};}_entryAppliesToFeature(_0x214bbe,_0x580586,_0x2d6251){if(!_0x214bbe)return!0x0;const _0x38a0fc=_0x214bbe[_0x580586];return!!_0x38a0fc&&(!0x0===_0x38a0fc||_0x2d6251['some'](_0xd366c=>_0x38a0fc['test'](_0xd366c)));}},Js=class extends _0x4cd5fc{['models'];contextLibrary;static get['pluginName'](){return'AICore';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$s];}init(){const _0x47ca6d=this['context']['plugins']['get']($s);this['models']=new Xs({'connector':_0x47ca6d,'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']}),this['contextLibrary']=new js({'connector':_0x47ca6d,'defaultContext':this['context']['config']['get']('ai.defaultContext')});}};function Zs(_0x4725ec){return _0x4725ec?_0x4725ec instanceof _0x553634?[_0x4725ec]:_0x4725ec['editors']&&0x0!==_0x4725ec['editors']['length']?Array['from'](_0x4725ec['editors']):[]:[];}function tn(_0x116ba3){const _0x1f6835=Zs(_0x116ba3);if(!_0x1f6835['length'])throw new dt('ai-get-editor-from-context-no-editor');if(0x1===_0x1f6835['length'])return _0x1f6835[0x0];const _0x25ac1e=_0x1f6835['find'](_0x205a19=>_0x205a19['ui']?.['focusTracker']?.['isFocused']);if(_0x25ac1e)return _0x25ac1e;const _0x12397d=function(_0x13df9c){if(_0x13df9c instanceof _0x553634)return;const _0x22d636=_0x13df9c;if(!_0x22d636['plugins']||!_0x22d636['plugins']['has']('AIEditing'))return;return _0x22d636['plugins']['get']('AIEditing')['getLastContentFocusedEditor']?.();}(_0x116ba3);return _0x12397d&&_0x1f6835['includes'](_0x12397d)?_0x12397d:_0x1f6835[0x0];}function en(_0x18166f,_0xb27a14){return _0x15b430(_0x18166f,_0xb27a14);}function sn(_0x49171f,_0x232fa1){return _0x24a162(_0x49171f,_0x232fa1);}function nn(_0x491907,_0x52227e,_0x30b65f){const _0x22efa4=null!==_0x52227e?_0xa29066=>_0xa29066['attribs'][_0x491907]===_0x52227e:_0xb3d5dd=>Boolean(_0xb3d5dd['attribs'][_0x491907]);return _0x1b0303(_0x84f263=>_0x58049c(_0x84f263)&&_0x22efa4(_0x84f263),_0x30b65f);}function rn(_0x37f1ff,_0x52d5f8,_0x319c60){const _0x46a754=null!==_0x52d5f8?_0x237992=>_0x237992['attribs'][_0x37f1ff]===_0x52d5f8:_0x1e0787=>Boolean(_0x1e0787['attribs'][_0x37f1ff]);return _0x457f76(_0x17285f=>_0x58049c(_0x17285f)&&_0x46a754(_0x17285f),_0x319c60);}function on(_0x3aa4cf){return _0x457f76(_0xf47214=>_0x58049c(_0xf47214)&&function(_0xfefb02){const _0x12096d=_0xfefb02['toLowerCase']();return'script'===_0x12096d||'style'===_0x12096d||_0x12096d['includes']('-');}(_0xf47214['name']),_0x3aa4cf);}const an=['comment-start','comment-end','suggestion-start','suggestion-end'];function hn(_0x2c3291){return _0x58049c(_0x2c3291)&&an['includes'](_0x2c3291['name']['toLowerCase']());}function cn(_0x5b43ff){return _0x55659d(_0x5c3f62=>_0x1800e7(_0x5c3f62),_0x5b43ff,!0x0,0x1/0x0);}function ln(_0x1e6338,_0x34f2a7){return _0x1e6338&&_0x58049c(_0x1e6338)?_0x1e6338['attribs'][_0x34f2a7]:null;}function un(_0x4be30b,_0x15ffcd,_0x5982f7){_0x58049c(_0x4be30b)&&(null===_0x5982f7?delete _0x4be30b['attribs'][_0x15ffcd]:_0x4be30b['attribs'][_0x15ffcd]=_0x5982f7);}function dn(_0x40476e,_0xac9c8b,_0xef324f){const _0x4a6659=_0xac9c8b['cloneNode'](!0x0);'beforebegin'===_0xef324f?_0x1e83fe(_0x40476e,_0x4a6659):'afterbegin'===_0xef324f?_0x18efcf(_0x40476e,_0x4a6659):'beforeend'===_0xef324f?_0x4e05c7(_0x40476e,_0x4a6659):'afterend'===_0xef324f&&_0x4fa086(_0x40476e,_0x4a6659);}function _n(_0x20bf45){const _0x42d02c=[];let _0x123dff=_0x20bf45;for(;_0x123dff;)_0x123dff=_0x294335(_0x123dff),_0x123dff&&_0x42d02c['push'](_0x123dff);return _0x42d02c;}function gn(_0x32c18f){return _0x32c18f['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function In(_0x54dac2){let _0x29f982=0x0;for(;_0x54dac2['parentNode'];)_0x54dac2=_0x54dac2['parentNode'],_0x29f982++;return _0x29f982;}function An(_0x3df40e){const _0xfc447b=[];let _0x52ce3e=_0x3df40e['nextSibling'];for(;_0x52ce3e;)_0xfc447b['push'](_0x52ce3e),_0x52ce3e=_0x52ce3e['nextSibling'];_0xfc447b['forEach'](_0x4abaf9=>{_0x15340f(_0x4abaf9);});}function En(_0x5d3dd2,_0x2623c8){return!!_0x5d3dd2['model']['document']['getRoot'](_0x2623c8)&&!_0x598751(_0x5d3dd2,_0x2623c8);}function pn(_0x3b119e,_0x87d1ad){return'<p\x20data-id=\x22'+_0x87d1ad+'\x22>'+_0x3b119e+'</p>';}function mn(_0xc71faf){return'p'===_0xc71faf['name']['toLowerCase']()&&Boolean(_0xc71faf['attribs']['data-id']);}function Tn(_0x5abaa5){const _0x48e9df=en(_0x5abaa5)['children']['filter'](_0x58049c);return 0x1===_0x48e9df['length']&&mn(_0x48e9df[0x0])?_0x48e9df[0x0]['children']['map'](_0x35248e=>sn(_0x35248e))['join'](''):_0x5abaa5;}function wn(_0x74c616,_0x3e3922){const _0x355dc1=function(_0x5cc73a){const _0x229f5d=_0x5cc73a['children']['filter'](_0x58049c);return 0x1===_0x229f5d['length']&&mn(_0x229f5d[0x0])?_0x229f5d[0x0]['children']:_0x5cc73a['children'];}(_0x3e3922),{blockElements:_0x4c43e4}=_0x74c616['editing']['view']['domConverter'],_0x53f3d3=_0x23e273=>_0x23e273['some'](_0x181100=>_0x58049c(_0x181100)&&('p'!==_0x181100['name']['toLowerCase']()&&_0x4c43e4['includes'](_0x181100['name']['toLowerCase']())||_0x53f3d3(_0x181100['children'])));if(_0x53f3d3(_0x355dc1))return!0x1;const _0x27c51d=_0x355dc1['map'](_0x5449d5=>sn(_0x5449d5))['join'](''),_0x452ceb=_0x74c616['data']['parse'](_0x27c51d,'$root'),{schema:_0x3a69c4}=_0x74c616['model'];let _0x260281=0x0;for(const {item:_0x399196}of _0x74c616['model']['createRangeIn'](_0x452ceb))if(_0x399196['is']('element')&&_0x3a69c4['isBlock'](_0x399196)&&(++_0x260281>0x1||'paragraph'!==_0x399196['name']))return!0x1;return!0x0;}function Cn(_0x39453f,_0x2d21b6){const _0x42dce9=_0x2d21b6['filter'](_0x5b1dc1=>'new'!=_0x5b1dc1['type'])['map'](_0x46b811=>nn('data-id',_0x46b811['id'],_0x39453f))['filter'](_0x1e52b4=>null!==_0x1e52b4),_0x58bd5d=_0x2d21b6['filter'](_0x2df4dd=>'removed'!=_0x2df4dd['type'])['map'](_0x4ba684=>_0x4ba684['node']['cloneNode'](!0x0));let _0x2d2c1b=null;if(_0x42dce9['length']){_0x2d2c1b=_0x42dce9[0x0]['previousSibling'];for(let _0x458e10=0x0;_0x458e10<_0x42dce9['length'];_0x458e10++)_0x15340f(_0x42dce9[_0x458e10]);}if(_0x58bd5d['length']){_0x2d2c1b||(_0x2d21b6[0x0]['anchorId']?_0x2d2c1b=nn('data-id',_0x2d21b6[0x0]['anchorId'],_0x39453f):(_0x2d2c1b=_0x58bd5d['shift'](),_0x18efcf(_0x39453f,_0x2d2c1b)));for(let _0x4f5c64=0x0;_0x4f5c64<_0x58bd5d['length'];_0x4f5c64++)_0x4fa086(_0x2d2c1b,_0x58bd5d[_0x4f5c64]),_0x2d2c1b=_0x58bd5d[_0x4f5c64];}}function fn(_0x3ee2cb,_0x16b63a){const _0x5f44a0=new Set();for(const _0x24722f of _0x3ee2cb){if(!_0x24722f['editor']||'destroyed'===_0x24722f['editor']['state']||!En(_0x24722f['editor'],_0x24722f['rootName']))continue;const _0x55c606=_0x16b63a['get'](_0x24722f['documentId']);let _0x55b963;_0x55c606?(_0x55b963=_0x55c606['cloneNode'](!0x0),Cn(_0x55b963,_0x24722f['changes'])):_0x55b963=new _0x47233a(_0x24722f['changes']['filter'](_0xafbd0f=>'removed'!=_0xafbd0f['type'])['map'](_0x104eeb=>_0x104eeb['node']['cloneNode'](!0x0))),wn(_0x24722f['editor'],_0x55b963)||_0x5f44a0['add'](_0x24722f['index']);}return _0x5f44a0;}function Rn(_0x4b1deb,_0x1d209e,_0x285439,_0x4cf99a){return En(_0x4b1deb,_0x1d209e)?wn(_0x4b1deb,en(_0x4cf99a))?{'before':Tn(_0x285439),'after':Tn(_0x4cf99a)}:null:{'before':_0x285439,'after':_0x4cf99a};}function bn(_0x99effb,_0xa91e2f){return{'isInline':En(_0x99effb,_0xa91e2f),'hostElement':Sn(_0x99effb,_0xa91e2f)};}function Sn(_0x5ada15,_0x48a505){const _0x539a26=On(_0x5ada15['config']['get']('roots')?.[_0x48a505]?.['element']);if(_0x539a26)return _0x539a26;const _0x232558=_0x5ada15['model']['document']['getRoot'](_0x48a505)?.['getAttribute']('$rootEditableOptions');return On(_0x232558?.['element'])||'div';}function On(_0x29ab2c){if(_0x29ab2c)return'string'==typeof _0x29ab2c?_0x29ab2c['toLowerCase']():_0x106ca2(_0x29ab2c)?_0x29ab2c['tagName']['toLowerCase']():_0x29ab2c['name']?.['toLowerCase']();}function vn(_0x38d98a,_0x48ad17){return _0x35ebf4(_0x38d98a,_0x48ad17);}function yn(_0x29b44c,_0x2a5dae){return _0x29b44c['map'](_0x31cbe8=>null!==_0x31cbe8&&'object'==typeof _0x31cbe8?vn(_0x31cbe8,_0x2a5dae):_0x31cbe8);}function Nn(_0x13a254){return _0x13a254 instanceof RegExp?String(_0x13a254):Array['isArray'](_0x13a254)?_0x13a254['map'](_0x1fa4e2=>Nn(_0x1fa4e2)):null!==_0x13a254&&'object'==typeof _0x13a254?Object['fromEntries'](Object['entries'](_0x13a254)['map'](([_0x4c052b,_0x46c3ff])=>[_0x4c052b,Nn(_0x46c3ff)])):_0x13a254;}const kn=[['BlockQuoteEditing','blockQuote'],['BoldEditing','bold'],['BookmarkEditing','bookmark'],['CodeEditing','code'],['HorizontalLineEditing','horizontalLine'],['HtmlEmbedEditing','htmlEmbed'],['ItalicEditing','italic'],['MathType','math'],['PageBreakEditing','pageBreak'],['Paragraph','paragraph'],['StandardEditingModeEditing','restrictedEditing'],['StrikethroughEditing','strikethrough'],['SubscriptEditing','subscript'],['SuperscriptEditing','superscript'],['TableOfContentsEditing','tableOfContents'],['Title','title'],['TodoListEditing','todoList'],['UnderlineEditing','underline']];function xn(_0x16219f,_0xda1634='main'){const _0x464a38={'editorVersion':zt,'rootType':bn(_0x16219f,_0xda1634)};if(_0x16219f['plugins']['has']('AlignmentEditing')&&(_0x464a38['alignment']=_0x16219f['config']['get']('alignment')),_0x16219f['plugins']['has']('CodeBlockEditing')&&(_0x464a38['codeBlock']=_0x16219f['config']['get']('codeBlock')),_0x16219f['plugins']['has']('FontBackgroundColorEditing')&&(_0x464a38['fontBackgroundColor']=vn(_0x16219f['config']['get']('fontBackgroundColor'),['documentColors','columns','colorPicker'])),_0x16219f['plugins']['has']('FontColorEditing')&&(_0x464a38['fontColor']=vn(_0x16219f['config']['get']('fontColor'),['documentColors','columns','colorPicker'])),_0x16219f['plugins']['has']('FontFamilyEditing')&&(_0x464a38['fontFamily']=_0x16219f['config']['get']('fontFamily'),_0x464a38['fontFamily']&&_0x464a38['fontFamily']['options']&&(_0x464a38['fontFamily']['options']=yn(_0x464a38['fontFamily']['options'],['model','upcastAlso']))),_0x16219f['plugins']['has']('FontSizeEditing')&&(_0x464a38['fontSize']=_0x16219f['config']['get']('fontSize'),_0x464a38['fontSize']&&_0x464a38['fontSize']['options']&&(_0x464a38['fontSize']['options']=yn(_0x464a38['fontSize']['options'],['upcastAlso']))),_0x16219f['plugins']['has']('FootnotesEditing')){const _0x19eaf2=_0x16219f['config']['get']('footnotes')??{};_0x19eaf2['footnotesProperties']&&'object'==typeof _0x19eaf2['footnotesProperties']&&(_0x19eaf2['footnotesProperties']=vn(_0x19eaf2['footnotesProperties'],['toolbar','listStyles'])),_0x464a38['footnotes']=_0x19eaf2;}if(_0x16219f['plugins']['has']('GeneralHtmlSupport')){const _0x50805f=_0x16219f['config']['get']('htmlSupport');_0x50805f&&(_0x464a38['htmlSupport']=Nn(vn(_0x50805f,['preserveEmptyBlocksInEditingView','htmlIframeSandbox','fullPage'])));}if(_0x16219f['plugins']['has']('HeadingEditing')&&(_0x464a38['heading']=_0x16219f['config']['get']('heading'),_0x464a38['heading']&&_0x464a38['heading']['options']&&(_0x464a38['heading']['options']=yn(_0x464a38['heading']['options'],['model','icon','class','converterPriority','upcastAlso']))),_0x16219f['plugins']['has']('HighlightEditing')&&(_0x464a38['highlight']=_0x16219f['config']['get']('highlight'),_0x464a38['highlight']&&_0x464a38['highlight']['options']&&(_0x464a38['highlight']['options']=yn(_0x464a38['highlight']['options'],['model','color']))),_0x16219f['plugins']['has']('ImageBlockEditing')||_0x16219f['plugins']['has']('ImageInlineEditing')){const _0x3adfa7=vn(_0x16219f['config']['get']('image'),['toolbar','upload','insert','resizeOptions']);_0x16219f['plugins']['has']('ImageResizeEditing')||delete _0x3adfa7['resizeUnit'],_0x16219f['plugins']['has']('ImageStyleEditing')?_0x3adfa7['styles']?.['options']&&(_0x3adfa7['styles']['options']=yn(_0x3adfa7['styles']['options'],['icon'])):delete _0x3adfa7['styles'],_0x464a38['image']=_0x3adfa7;}if(_0x16219f['plugins']['has']('IndentBlock')&&(_0x464a38['indentBlock']=_0x16219f['config']['get']('indentBlock')),_0x16219f['plugins']['has']('LineHeightEditing')&&(_0x464a38['lineHeight']=_0x16219f['config']['get']('lineHeight'),_0x464a38['lineHeight']&&(delete _0x464a38['lineHeight']['supportAllValues'],_0x464a38['lineHeight']['options']&&(_0x464a38['lineHeight']['options']=yn(_0x464a38['lineHeight']['options'],['model'])))),_0x16219f['plugins']['has']('LinkEditing')&&(_0x464a38['link']=vn(_0x16219f['config']['get']('link'),['toolbar'])),_0x16219f['plugins']['has']('ListEditing')){const _0x49897f=_0x16219f['config']['get']('list')??{};delete _0x49897f['enableListItemMarkerFormatting'],_0x16219f['plugins']['has']('ListPropertiesEditing')?_0x49897f['properties']&&_0x49897f['properties']['styles']&&'object'==typeof _0x49897f['properties']['styles']&&(_0x49897f['properties']['styles']=vn(_0x49897f['properties']['styles'],['listStyleTypes'])):delete _0x49897f['properties'],_0x464a38['list']=_0x49897f;}if(_0x16219f['plugins']['has']('MediaEmbedEditing')&&(_0x464a38['mediaEmbed']=_0x16219f['config']['get']('mediaEmbed'),_0x464a38['mediaEmbed']&&(delete _0x464a38['mediaEmbed']['toolbar'],_0x16219f['plugins']['has']('MediaEmbedResizeEditing')?_0x464a38['mediaEmbed']['resizeOptions']&&(_0x464a38['mediaEmbed']['resizeOptions']=_0x464a38['mediaEmbed']['resizeOptions']['map'](_0x594398=>vn(_0x594398,['icon','label']))):delete _0x464a38['mediaEmbed']['resizeOptions'],_0x16219f['plugins']['has']('MediaEmbedStyleEditing')?_0x464a38['mediaEmbed']['styles']&&_0x464a38['mediaEmbed']['styles']['options']&&(_0x464a38['mediaEmbed']['styles']['options']=yn(_0x464a38['mediaEmbed']['styles']['options'],['icon','title'])):delete _0x464a38['mediaEmbed']['styles'])),_0x16219f['plugins']['has']('MultiLevelListEditing')&&(_0x464a38['listMultiLevel']=_0x16219f['config']['get']('listMultiLevel')??{}),_0x16219f['plugins']['has']('MentionEditing')){const _0x23054d=vn(_0x16219f['config']['get']('mention'),['commitKeys','dropdownLimit']);_0x23054d['feeds']&&(_0x23054d['feeds']=_0x23054d['feeds']['map'](_0x1b4516=>vn(_0x1b4516,['minimumCharacters','itemRenderer','dropdownLimit']))),_0x464a38['mention']=_0x23054d;}if(_0x16219f['plugins']['has']('MergeFieldsEditing')){const _0x58eaea=vn(_0x16219f['config']['get']('mergeFields'),['previewModes','initialPreviewMode','previewHtmlValues','sanitizeHtml']);Array['isArray'](_0x58eaea['definitions'])&&(_0x58eaea['definitions']=_0x58eaea['definitions']['map'](_0x1ce705=>'groupId'in _0x1ce705?(Array['isArray'](_0x1ce705['definitions'])&&(_0x1ce705['definitions']=_0x1ce705['definitions']['map'](_0x8f3ec3=>vn(_0x8f3ec3,['defaultValue']))),_0x1ce705):vn(_0x1ce705,['defaultValue']))),_0x464a38['mergeFields']=_0x58eaea;}if(_0x16219f['plugins']['has']('ShiftEnter')&&(_0x464a38['shiftEnter']={}),_0x16219f['plugins']['has']('StyleEditing')&&(_0x464a38['style']=_0x16219f['config']['get']('style')),_0x16219f['plugins']['has']('TableEditing')){const _0x1781b6=vn(_0x16219f['config']['get']('table'),['contentToolbar','tableToolbar','showHiddenBorders']);_0x16219f['plugins']['has']('TablePropertiesEditing')?_0x1781b6['tableProperties']&&'object'==typeof _0x1781b6['tableProperties']&&(_0x1781b6['tableProperties']=vn(_0x1781b6['tableProperties'],['colorPicker','borderColors','backgroundColors'])):delete _0x1781b6['tableProperties'],_0x16219f['plugins']['has']('TableCellPropertiesEditing')?_0x1781b6['tableCellProperties']&&'object'==typeof _0x1781b6['tableCellProperties']&&(_0x1781b6['tableCellProperties']=vn(_0x1781b6['tableCellProperties'],['colorPicker','borderColors','backgroundColors'])):delete _0x1781b6['tableCellProperties'],_0x16219f['plugins']['has']('TableLayoutEditing')?_0x1781b6['tableLayout']||(_0x1781b6['tableLayout']={}):delete _0x1781b6['tableLayout'],_0x16219f['plugins']['has']('TableCaptionEditing')?_0x1781b6['tableCaption']||(_0x1781b6['tableCaption']={}):delete _0x1781b6['tableCaption'],_0x464a38['table']=_0x1781b6;}_0x16219f['plugins']['has']('TextPartLanguageEditing')&&(_0x464a38['textPartLanguage']=_0x16219f['config']['get']('language.textPartLanguage'));for(const [_0x2a3ad6,_0x281b30]of kn)_0x16219f['plugins']['has'](_0x2a3ad6)&&(_0x464a38[_0x281b30]={});return _0x464a38;}const Ln='ai-selection',Dn=['br'];var Pn=class extends _0x4cd5fc{constructor(_0x1d29bb){super(_0x1d29bb),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}_outputDataProcessor;_fakeSelections=[];_sessionIdByEditor=new WeakMap();_lastContentFocusedEditor;static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}getLastContentFocusedEditor(){return this['_lastContentFocusedEditor'];}getSessionId(_0x1c5a3f){let _0x1e6f03=this['_sessionIdByEditor']['get'](_0x1c5a3f);return _0x1e6f03||(_0x1e6f03=_0x1c5a3f['plugins']['has']('RealTimeCollaborationClient')&&_0x1c5a3f['plugins']['get']('RealTimeCollaborationClient')['sessionId']||Xt(),this['_sessionIdByEditor']['set'](_0x1c5a3f,_0x1e6f03)),_0x1e6f03;}async getDocumentData(_0x2c57bf){const _0x18a97b=Zs(this['context']),_0x17a5f9=[],_0x54909b=new Set();for(const _0xef5a06 of _0x18a97b){if(_0x2c57bf&&!_0x2c57bf['has'](_0xef5a06['config']['get']('collaboration.channelId')))continue;const _0x17f19b=_0xef5a06['config']['get']('roots')||{},_0x1a6ddc=this['_getEditorSelectionSignature'](_0xef5a06),_0x2e5cbd=_0xef5a06['config']['get']('collaboration.channelId'),_0x51d163=this['getSessionId'](_0xef5a06);for(const _0x1efc34 of _0xef5a06['model']['document']['getRoots']()){if('$graveyard'===_0x1efc34['rootName'])continue;const _0x50ca0b=await this['_getDocumentDataForEditorRoot'](_0xef5a06,_0x1efc34,_0x54909b),_0xe3b2f3=_0x17f19b[_0x1efc34['rootName']],_0x1c5585=_0x1efc34['getAttribute']('$description')??_0xe3b2f3?.['description'];let _0x741692=_0x1efc34['getAttribute']('$title')??_0xe3b2f3?.['title'];_0x741692||(_0x741692=_0x1efc34['getAttribute']('$rootEditableOptions')?.['label']??_0xe3b2f3?.['label']),_0x741692||(Ft('ai-document-root-missing-title',{'editor':_0xef5a06,'rootName':_0x1efc34['rootName']}),_0x741692=_0x1efc34['rootName']),_0x17a5f9['push']({'editor':_0xef5a06,'rootName':_0x1efc34['rootName'],'content':_0x50ca0b['content'],'version':_0x50ca0b['version'],'sessionId':_0x51d163,'channelId':_0x2e5cbd,'selections':_0x50ca0b['selections'],'selectionSignature':_0x1a6ddc,'editorConfig':xn(_0xef5a06,_0x1efc34['rootName']),'name':_0x741692,'description':_0x1c5585});}}return _0x17a5f9;}getEditorsVersions(){const _0x4b2d56=Zs(this['context']),_0x5b6c01=new Map();for(const _0x3f5fe2 of _0x4b2d56){const _0x1e4b89=_0x3f5fe2['config']['get']('collaboration.channelId');_0x5b6c01['set'](_0x1e4b89,_0x3f5fe2['model']['document']['version']);}return _0x5b6c01;}getEditorsSelections(){const _0x28db3c=Zs(this['context']),_0x3a8625=new Map();for(const _0xd05256 of _0x28db3c){const _0x593020=_0xd05256['config']['get']('collaboration.channelId'),_0x49f3c4=this['_getEditorSelectionSignature'](_0xd05256);_0x3a8625['set'](_0x593020,_0x49f3c4);}return _0x3a8625;}_getEditorSelectionSignature(_0x31d035){return this['_getMarkersInDocumentOrder'](_0x31d035)['map'](_0x712b23=>{const _0x48c6ca=_0x712b23['getRange']();return _0x48c6ca['root']['rootName']+':'+_0x48c6ca['start']['path']['join']('.')+'-'+_0x48c6ca['end']['path']['join']('.');})['join']('|');}async _getDocumentDataForEditorRoot(_0x162b81,_0x37fd8b,_0x1a729a){const _0x3b84c2=_0x162b81['data']['toView'](_0x37fd8b,{'convertAiChatSelectionMarker':!0x0}),_0xb1d062=new _0x1cc48b(_0x162b81['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x3b84c2,_0xb1d062,_0x1a729a);let _0x21b7a6=await this['_getDocumentDataStringFromView'](_0x3b84c2,_0x162b81);En(_0x162b81,_0x37fd8b['rootName'])&&(_0x21b7a6=pn(_0x21b7a6,this['_nextDataId'](_0x1a729a)));const _0x54ae84=this['_getMarkersInDocumentOrder'](_0x162b81,_0x37fd8b),_0x581e41=[];for(const _0x543591 of _0x54ae84){const _0x30e008='<'+_0x543591['name']+':start></'+_0x543591['name']+':start>',_0x180dc5=_0x21b7a6['indexOf'](_0x30e008);_0x21b7a6=_0x21b7a6['substring'](0x0,_0x180dc5)+_0x21b7a6['substring'](_0x180dc5+_0x30e008['length']);const _0x14931a='<'+_0x543591['name']+':end></'+_0x543591['name']+':end>',_0x4421bb=_0x21b7a6['indexOf'](_0x14931a);_0x21b7a6=_0x21b7a6['substring'](0x0,_0x4421bb)+_0x21b7a6['substring'](_0x4421bb+_0x14931a['length']),_0x581e41['push']({'markerName':_0x543591['name'],'start':_0x180dc5,'end':_0x4421bb,'htmlFragment':_0x21b7a6['substring'](_0x180dc5,_0x4421bb)});}return{'content':_0x21b7a6,'version':_0x162b81['model']['document']['version'],'selections':_0x581e41};}afterInit(){this['context']instanceof _0x553634?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x5b8e28,_0xc56bfb)=>{_0xc56bfb['on']('ready',()=>{this['_integrateEditor'](_0xc56bfb);});});}_setOutputDataProcessor(_0x3962e9){this['_outputDataProcessor']=_0x3962e9;}async _getDocumentDataStringFromView(_0x47f177,_0x2b7ed5){let _0x493783;if(this['_outputDataProcessor']){const _0xf74448=_0x2b7ed5['data']['processor']['domConverter']['viewToDom'](_0x47f177),_0x58c3a3=await this['_outputDataProcessor'](_0xf74448);_0x493783=_0x2b7ed5['data']['processor']['htmlWriter']['getHtml'](_0x58c3a3);}else _0x493783=_0x2b7ed5['data']['processor']['toData'](_0x47f177);return _0x493783;}_integrateEditor(_0x103cd7){if(!_0x103cd7['config']['get']('collaboration.channelId'))throw new dt('ai-missing-channel-id',_0x103cd7);_0x103cd7['ui']['focusTracker']['on']('change:isFocused',(_0x2861b2,_0x41264b,_0x3783e5)=>{_0x3783e5&&(this['_lastContentFocusedEditor']=_0x103cd7);}),_0x103cd7['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x103cd7&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x103cd7['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ln,'view':({markerName:_0x2cefa3})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x2cefa3['split'](':')[0x1]],'priority':0xc})}),_0x103cd7['conversion']['for']('dataDowncast')['markerToElement']({'model':Ln+':context','view':(_0x297d1c,{writer:_0x97ed83,options:_0x58fe14})=>_0x58fe14['convertAiChatSelectionMarker']?_0x97ed83['createUIElement'](_0x297d1c['markerName']+':'+(_0x297d1c['isOpening']?'start':'end')):null});}showFakeVisualSelection(_0xa649bd){const _0x5c2d8b=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0xa649bd);const _0x135a87=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x5c2d8b,_0x135a87);}hideFakeVisualSelection(_0x1770c4){const _0x49b1e8=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x1770c4);const _0x53c9f5=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x49b1e8,_0x53c9f5);}async modelToDataWithIds(_0x102e0a,_0x3e270c,_0x1c42ea){const _0xd8df18=_0x3e270c['data']['toView'](_0x102e0a),_0x3fa09f=new _0x1cc48b(_0x3e270c['editing']['view']['document']),_0x9e1668=new Set();this['_setDataIdsOnChildren'](_0xd8df18,_0x3fa09f,_0x9e1668);const _0xd7959d=await this['_getDocumentDataStringFromView'](_0xd8df18,_0x3e270c);return _0x1c42ea&&En(_0x3e270c,_0x1c42ea)?pn(_0xd7959d,this['_nextDataId'](_0x9e1668)):_0xd7959d;}_setDataIdsOnChildren(_0x46f89f,_0x47edfe,_0x1b81aa=new Set()){let _0x8a3add=!0x1;for(const _0x560236 of _0x46f89f['getChildren']()){if(!_0x560236['is']('view:element')||Dn['includes'](_0x560236['name']))continue;const _0x52f2a3=_0x560236['is']('view:containerElement'),_0x40ea11=_0x560236['is']('view:emptyElement'),_0x522b98=_0x560236['is']('view:rawElement'),_0x2d5a5c=this['_setDataIdsOnChildren'](_0x560236,_0x47edfe,_0x1b81aa);_0x560236['hasAttribute']('data-id')?(_0x8a3add=!0x0,_0x1b81aa['add'](_0x560236['getAttribute']('data-id'))):(_0x52f2a3||_0x40ea11||_0x522b98||_0x2d5a5c)&&(_0x47edfe['setAttribute']('data-id',this['_nextDataId'](_0x1b81aa),_0x560236),_0x8a3add=!0x0);}return _0x8a3add;}_nextDataId(_0x575163){let _0x460c0d;do{_0x460c0d='';for(let _0x753e3b=0x0;_0x753e3b<0x4;_0x753e3b++)_0x460c0d+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x575163['has'](_0x460c0d));return _0x575163['add'](_0x460c0d),_0x460c0d;}getSelectionText(_0x4e2e6a){const _0x5ae4f6=(_0x4e2e6a?_0x4e2e6a['model']:tn(this['context'])['model'])['document']['selection'],_0x37ac2e=[],_0x294207=Array['from'](_0x5ae4f6['getRanges']());_0x294207['sort']((_0x37e87e,_0x59a94d)=>_0x37e87e['start']['isBefore'](_0x59a94d['start'])?-0x1:0x1);for(const _0x28a4fe of _0x294207)for(const _0x4e886f of _0x28a4fe['getItems']())_0x4e886f['is']('$textProxy')?_0x37ac2e['push'](_0x4e886f['data']):_0x4e886f['is']('element')&&_0x37ac2e['length']>0x0&&'\x20'!==_0x37ac2e[_0x37ac2e['length']-0x1]&&_0x37ac2e['push']('\x20');return _0x37ac2e['length']?'\x22'+_0x37ac2e['join']('')['trim']()+'\x22':qs(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}_removeFakeSelectionById(_0x2c1f13){for(let _0x1fbecb=0x0;_0x1fbecb<this['_fakeSelections']['length'];_0x1fbecb++)if(this['_fakeSelections'][_0x1fbecb]['id']==_0x2c1f13)return void this['_fakeSelections']['splice'](_0x1fbecb,0x1);}_addFakeSelection(_0x26f773){this['_removeFakeSelectionById'](_0x26f773['id']),Ht(this['_fakeSelections'],_0x26f773);}_refreshFakeSelection(_0x153164,_0x5a760a){if(_0x153164==_0x5a760a)return;const _0x2fde9b=_0x153164?_0x153164['editor']:null,_0x14ddd8=_0x5a760a?_0x5a760a['editor']:null,_0xa50d43=(_0x3da611,_0x50e5b3)=>{const _0x2d0dc8=_0x50e5b3['model']['markers']['getMarkersGroup'](Ln);for(const _0x4b6ccb of _0x2d0dc8)_0x3da611['removeMarker'](_0x4b6ccb);},_0x3b94c8=(_0x269e9b,_0x3cdad0,_0x5e78b4)=>{const _0xf1bedf=_0x3cdad0['model'];for(let _0x4af06c=0x0;_0x4af06c<_0x5e78b4['ranges']['length'];_0x4af06c++){let _0x2c111d=_0x5e78b4['ranges'][_0x4af06c];const _0x4ffc3a=Ln+':'+_0x5e78b4['id']+':'+_0x4af06c;if(_0x2c111d['start']['isAtEnd']){const _0x3b5c62=_0x2c111d['start']['getLastMatchingPosition'](({item:_0x12c6aa})=>!_0xf1bedf['schema']['isContent'](_0x12c6aa),{'boundaries':_0x2c111d});_0x2c111d=_0x269e9b['createRange'](_0x3b5c62,_0x2c111d['end']);}_0x269e9b['addMarker'](_0x4ffc3a,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2c111d});}};_0x2fde9b&&_0x14ddd8&&_0x2fde9b===_0x14ddd8&&_0x5a760a?_0x2fde9b['model']['change'](_0x5bb86e=>{_0xa50d43(_0x5bb86e,_0x2fde9b),_0x3b94c8(_0x5bb86e,_0x14ddd8,_0x5a760a);}):(_0x2fde9b&&_0x2fde9b['model']['change'](_0x57c004=>_0xa50d43(_0x57c004,_0x2fde9b)),_0x14ddd8&&_0x5a760a&&_0x14ddd8['model']['change'](_0x413ec3=>_0x3b94c8(_0x413ec3,_0x14ddd8,_0x5a760a)));}_getMarkersInDocumentOrder(_0x1f15bf,_0x3c306c){const _0x14ae2d=Array['from'](_0x1f15bf['model']['markers']['getMarkersGroup'](Ln+':context'));return(_0x3c306c?_0x14ae2d['filter'](_0x4626ef=>{const _0x4a1ad9=_0x4626ef['getRange']();return _0x4a1ad9&&_0x4a1ad9['root']['rootName']===_0x3c306c['rootName'];}):_0x14ae2d)['sort']((_0x62ec9,_0x60940c)=>_0x62ec9['getStart']()['isBefore'](_0x60940c['getStart']())?-0x1:_0x62ec9['getStart']()['isAfter'](_0x60940c['getStart']())?0x1:0x0);}},Mn=class extends _0x4cd5fc{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'DocumentChangesUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['licenseKey']=this['context']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x41d249=this['context'],_0x183cf6=_0x41d249['editors']||[_0x41d249],_0x5eec46=!_0x41d249['editors'];for(const _0x1e3a0a of _0x183cf6){let _0x129978;for(const _0x53861d in _0x1e3a0a){const _0x33023f=_0x53861d,_0x30f243=_0x1e3a0a[_0x33023f];if('documentChangesLicenseKeyValid'==_0x30f243||'documentChangesLicenseKeyInvalid'==_0x30f243||'documentChangesLicenseKeyExpired'==_0x30f243||'documentChangesLicenseKeyDomainLimit'==_0x30f243||'documentChangesLicenseKeyNotAllowed'==_0x30f243||'documentChangesLicenseKeyEvaluationLimit'==_0x30f243||'documentChangesLicenseKeyUsageLimit'==_0x30f243){delete _0x1e3a0a[_0x33023f],_0x129978=_0x30f243,_0x5eec46&&(clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0);break;}}'documentChangesLicenseKeyInvalid'==_0x129978&&_0x1e3a0a['_showLicenseError']('invalid'),'documentChangesLicenseKeyExpired'==_0x129978&&_0x1e3a0a['_showLicenseError']('expired'),'documentChangesLicenseKeyDomainLimit'==_0x129978&&_0x1e3a0a['_showLicenseError']('domainLimit'),'documentChangesLicenseKeyNotAllowed'==_0x129978&&_0x1e3a0a['_showLicenseError']('featureNotAllowed','DocumentChanges'),'documentChangesLicenseKeyEvaluationLimit'==_0x129978&&_0x1e3a0a['_showLicenseError']('evaluationLimit'),'documentChangesLicenseKeyUsageLimit'==_0x129978&&_0x1e3a0a['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}};const Vn='$elementId',Hn='data-id';var Un=class extends _0x4cd5fc{static get['pluginName'](){return'DocumentChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Mn];}async init(){!async function(_0x1100d1){const _0x589196='EMDS3dsLoJY0nbe9cmlCrXyaZ8zpPqN6jxThf7gwBi2KFOVUWRAG14HQIkut5v',_0xc10c0d=0x79710,_0x277882={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x9c90d2(_0x556136){const _0x5f129e=window['Promise']['resolve'](_0x556136),_0x25e5ab=window['Date']['now'](),_0x4dfb14=_0x556136['config']['get']('licenseKey');async function _0x3f4d1a(){let _0xe833a9,_0x181ccd=null,_0x42b208=null;try{return'GPL'==_0x4dfb14?'NotAllowed':(_0xe833a9=_0x529658(),_0xe833a9?(_0xe833a9['usageEndpoint']&&(_0x42b208=_0x4cdd61(_0xe833a9['usageEndpoint'],_0xe833a9['jti'])),await _0x2fe7f3()?_0x27e409()?_0xddc7c4()?'Expired':_0x3463be()?('evaluation'==_0xe833a9['licenseType']&&(_0x181ccd=_0x327913('EvaluationLimit')),await _0x3e74f8()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0xddc7c4(){const _0x474d05=['evaluation','trial']['includes'](_0xe833a9['licenseType'])?_0x25e5ab/0x3e8:0xe10*_0xc10c0d;return _0xe833a9['exp']<_0x474d05;}function _0x27e409(){const _0x51165c=_0xe833a9['features'];return!!_0x51165c&&(!!_0x51165c['includes']('*')||(!!_0x51165c['includes']('DIFF')||(!!_0x51165c['includes']('ET')||!!_0x51165c['includes']('CKAI'))));}function _0x3463be(){const _0xf3c878=_0xe833a9['licensedHosts'];if(!_0xf3c878||0x0==_0xf3c878['length'])return!0x0;const {hostname:_0x2e891a}=new URL(window['location']['href']);if(_0xf3c878['includes'](_0x2e891a))return!0x0;const _0x585e=_0x2e891a['split']('.');return _0xf3c878['filter'](_0x379676=>_0x379676['includes']('*'))['map'](_0x134dfe=>_0x134dfe['split']('.'))['filter'](_0x3ab565=>_0x3ab565['length']<=_0x585e['length'])['map'](_0x3c3d27=>Array(_0x585e['length']-_0x3c3d27['length'])['fill']('*'===_0x3c3d27[0x0]?'*':'')['concat'](_0x3c3d27))['some'](_0x5a465b=>_0x585e['every']((_0x48d489,_0x1cab8f)=>_0x5a465b[_0x1cab8f]===_0x48d489||'*'===_0x5a465b[_0x1cab8f]));}function _0x3e74f8(){return _0x181ccd&&_0x42b208?new window['Promise']((_0x3091db,_0x510d6a)=>{_0x181ccd['then'](_0x3091db,_0x510d6a),_0x42b208['then'](_0x4d5ed0=>{'Valid'!=_0x4d5ed0&&_0x3091db(_0x4d5ed0);},_0x510d6a);}):_0x181ccd||_0x42b208||'Valid';}}function _0x4cdd61(_0x474a1d,_0x1fcf98){return new window['Promise'](_0x17c7b7=>{if(_0x128a0a())return _0x17c7b7('Valid');_0x108e8f(),_0x556136['decorate']('_sendUsageRequest');let _0x436d6c=!0x1;const _0x12c36a=Xt();function _0x212461(_0x10d272){return!!_0x10d272&&('object'==typeof _0x10d272||'function'==typeof _0x10d272)&&'function'==typeof _0x10d272['then']&&'function'==typeof _0x10d272['catch'];}function _0x125cda(_0x1f897c){_0x15ef28(_0x1f897c)['then'](_0x3cc0b1=>_0x3cc0b1&&'ok'==_0x3cc0b1['status']?_0x213950(_0x51d7a5(_0x12c36a+_0x1fcf98))!=_0x3cc0b1['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x280041=>(_0x58941b(),_0x280041),()=>{const _0x5bac14=_0x305bd0();return null==_0x5bac14?(_0x58941b(),'Valid'):_0x25e5ab-_0x5bac14>0x240c8400?'UsageLimit':'Valid';})['then'](_0x17c7b7)['catch'](()=>{_0x17c7b7('UsageLimit');});const _0x1c399d=0x36ee80;function _0x58941b(){const _0x4bb446='llct-'+_0x213950(_0x51d7a5(_0x474a1d)),_0x55fc6a=_0x39999e(_0x213950(window['Math']['ceil'](_0x25e5ab/_0x1c399d)));window['localStorage']['setItem'](_0x4bb446,_0x55fc6a);}function _0x305bd0(){const _0xe345c6='llct-'+_0x213950(_0x51d7a5(_0x474a1d)),_0x1e1c1c=window['localStorage']['getItem'](_0xe345c6);return _0x1e1c1c?window['parseInt'](_0x39999e(_0x1e1c1c),0x10)*_0x1c399d:null;}function _0x15ef28(_0x109107){return new window['Promise']((_0x442c50,_0x5a143a)=>{_0x109107['then'](_0x442c50,_0x5a143a),window['setTimeout'](_0x5a143a,0x1d4c0);});}}_0x556136['on']('_sendUsageRequest',(_0x26e7c4,_0x20d244)=>{if(_0x20d244[0x0]!=_0x474a1d)return _0x17c7b7('UsageLimit');_0x20d244[0x1]={..._0x20d244[0x1],'requestId':_0x12c36a};},{'priority':'high'}),_0x556136['on']('_sendUsageRequest',_0xa2a94f=>{_0x212461(_0xa2a94f['return'])&&(_0x436d6c=!0x0,_0x125cda(_0xa2a94f['return']));},{'priority':'low'}),_0x5f129e['then'](()=>{_0x436d6c||_0x17c7b7('UsageLimit');});});function _0x128a0a(){return'auto'==_0x556136['editing']['view']['_overlayModeHint'];}function _0x108e8f(){_0x556136['editing']['view']['_overlayModeHint']='auto';}}function _0x327913(_0x209aee){const _0x4b2d17=[new window['Promise'](_0x556a10=>setTimeout(_0x556a10,0x93ecc)),_0x5f129e['then'](()=>new window['Promise'](_0x44798e=>{let _0x511e21=0x0;_0x556136['model']['on']('applyOperation',(_0x239f5c,_0x222423)=>{_0x222423[0x0]['isDocumentOperation']&&_0x511e21++,0x5e8==_0x511e21&&(_0x44798e(),_0x239f5c['off']());});}))];return window['Promise']['race'](_0x4b2d17)['then'](()=>_0x209aee);}async function _0x6e0a1e(){await _0x5f129e,_0x1100d1['getDiff']=_0x19178e,_0x1100d1['_createDiff']=_0x19178e,_0x556136['model']['change']=_0x19178e,_0x556136['model']['enqueueChange']=_0x19178e,_0x556136['enableReadOnlyMode']('model');}function _0x101ef2(_0x548e4b){const _0xd94492=_0x3ac9e3();_0x556136[_0xd94492]='documentChangesLicenseKey'+_0x548e4b,'Valid'!=_0x548e4b&&_0x6e0a1e();}function _0x3ac9e3(){const _0x37ef98=window['String'](window['performance']['now']())['replace']('.','');let _0x5527dc='E';for(let _0x18981c=0x0;_0x18981c<_0x37ef98['length'];_0x18981c+=0x2){let _0x16f58a=window['parseInt'](_0x37ef98['substring'](_0x18981c,_0x18981c+0x2));_0x16f58a>=0x3e&&(_0x16f58a-=0x3e),_0x5527dc+=_0x589196[_0x16f58a];}return _0x5527dc;}function _0x529658(){const _0x5c1f53=_0x4dfb14['split']('.');if(0x3!=_0x5c1f53['length'])return null;return _0x2d578(_0x5c1f53[0x1]);function _0x2d578(_0x11a4f8){const _0x2025e6=_0x4fd8bd(_0x11a4f8);return _0x2025e6&&_0x59b1b9()?_0x2025e6:null;function _0x59b1b9(){const _0x109b3a=_0x2025e6['jti'],_0x5a429c=window['parseInt'](_0x109b3a['substring'](_0x109b3a['length']-0x8),0x10),_0x64a184={..._0x2025e6,'jti':_0x109b3a['substring'](0x0,_0x109b3a['length']-0x8)};return delete _0x64a184['vc'],_0x51d7a5(_0x64a184)==_0x5a429c;}}}async function _0x2fe7f3(){let _0x5adb23=!0x0;try{const [_0x44b5b7,_0x2c7229,_0x3fe86d]=_0x4dfb14['split']('.');return _0x1045ee(_0x44b5b7),await _0x324f4c(_0x44b5b7,_0x2c7229,_0x3fe86d),_0x5adb23;}catch{return!0x1;}function _0x1045ee(_0x46f019){const _0x36db49=_0x4fd8bd(_0x46f019);_0x36db49&&'ES256'==_0x36db49['alg']||(_0x5adb23=!0x1);}async function _0x324f4c(_0x91c330,_0x47b6c1,_0x1b67dd){const _0x4b506d=window['Uint8Array']['from'](_0x3d9265(_0x1b67dd),_0x2eb6dd=>_0x2eb6dd['charCodeAt'](0x0)),_0x23220e=new window['TextEncoder']()['encode'](_0x91c330+'.'+_0x47b6c1),_0x9076f7=window['crypto']['subtle'];if(!_0x9076f7)return;const _0x4356e6=await _0x9076f7['importKey']('jwk',_0x277882,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x9076f7['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x4356e6,_0x4b506d,_0x23220e)||(_0x5adb23=!0x1);}}function _0x4fd8bd(_0x2c6f01){return _0x2c6f01['startsWith']('ey')?JSON['parse'](_0x3d9265(_0x2c6f01)):null;}function _0x3d9265(_0x3a881e){return window['atob'](_0x3a881e['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x51d7a5(_0x5fd8f3){let _0x52619d=0x1505;function _0x16689d(_0x1717da){for(let _0x30c303=0x0;_0x30c303<_0x1717da['length'];_0x30c303++){const _0x4d041f=_0x1717da['charCodeAt'](_0x30c303);_0x52619d=(_0x52619d<<0x5)+_0x52619d+_0x4d041f,_0x52619d&=_0x52619d;}}function _0x571e1c(_0x4aa8b4){Array['isArray'](_0x4aa8b4)?_0x4aa8b4['forEach'](_0x571e1c):_0x4aa8b4&&'object'==typeof _0x4aa8b4?Object['entries'](_0x4aa8b4)['sort']()['forEach'](([_0x15e122,_0x1a1da1])=>{_0x16689d(_0x15e122),_0x571e1c(_0x1a1da1);}):_0x16689d(window['String'](_0x4aa8b4));}return _0x571e1c(_0x5fd8f3),_0x52619d>>>0x0;}function _0x213950(_0x4480fc){return _0x4480fc['toString'](0x10)['padStart'](0x8,'0');}function _0x39999e(_0x57b8b0){return _0x57b8b0['split']('')['reverse']()['join']('');}function _0x19178e(){}_0x101ef2(await _0x3f4d1a());}const _0xdb1ea1=_0x1100d1['context'],_0x12c48e=_0xdb1ea1['editors'];_0x12c48e?(_0x12c48e['forEach'](_0x4c4e5a),_0x1100d1['listenTo'](_0x12c48e,'add',(_0x37e592,_0x2b18c0)=>_0x4c4e5a(_0x2b18c0),{'priority':'highest'})):_0x4c4e5a(_0xdb1ea1);function _0x4c4e5a(_0x14fd56){_0x14fd56['once']('ready',()=>_0x9c90d2(_0x14fd56),{'priority':'highest'});}}(this),this['context']instanceof _0x553634?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x23da75,_0x306bb9)=>{_0x306bb9['on']('ready',()=>{this['_integrateEditor'](_0x306bb9);});});}get editor(){if(this['context']instanceof _0x553634)return this['context'];{const _0x5f5b67=this['context']['editors']['first'];if(!_0x5f5b67)throw new dt('documentchanges-no-editor',this);return _0x5f5b67;}}getDiff(_0x36c346,_0x230ea7,_0x146668={'anchor':'main','markDeletions':!0x1}){return this['_createDiff'](_0x36c346,_0x230ea7,_0x146668)['getOperations']();}_getDiffWithOperationsData(_0x401d17,_0x4d8f52,_0x3af1f0={'anchor':'main','markDeletions':!0x1}){const _0x4312da=this['_createDiff'](_0x401d17,_0x4d8f52,_0x3af1f0);return{'operationsData':_0x4312da['getOperationsData'](),'operations':_0x4312da['getOperations']()};}_createDiff(_0x32d877,_0x2a4f4d,_0x1a26ce){const _0x2d934e=_0x1a26ce['targetEditor']||this['editor'],_0xf91de7=_0x1a26ce['anchor']??'main';let _0x2d7add,_0x352cbe;if('string'==typeof _0xf91de7){const _0x331028=_0x2d934e['model']['document']['getRoot'](_0xf91de7);if(!_0x331028)throw new dt('documentchanges-compare-no-root',this,{'anchor':_0xf91de7});_0x2d7add=_0x331028,_0x352cbe=_0x2d934e['model']['createPositionAt'](_0x331028,0x0);}else _0x2d7add=_0xf91de7['clone'](),_0x352cbe=_0xf91de7['clone']();const _0x47844f=_0x2d934e['data']['parse'](_0x32d877,_0x2d7add),_0x2f715a=_0x2d934e['data']['parse'](_0x2a4f4d,_0x2d7add);return new Bn({'editor':_0x2d934e,'before':_0x47844f,'after':_0x2f715a,'options':{'anchor':_0x352cbe,'markDeletions':_0x1a26ce['markDeletions']}});}isMarkedRemoveOperation(_0x4dacdd){return'marker'==_0x4dacdd['type']&&_0x4dacdd['name']['startsWith']('$markedRemove');}applyOperations(_0x35f8d9,_0xf397f8){const _0x18727f=_0x35f8d9['model'];for(const _0xfdfece of _0xf397f8)_0x3463ba(_0xfdfece)||(_0xfdfece instanceof _0x155687?_0x35f8d9['_addOperationForAffectedMarkers']('move',_0x3aaa22['_createFromPositionAndShift'](_0xfdfece['sourcePosition'],_0xfdfece['howMany'])):_0xfdfece instanceof _0xfcd33f?_0x35f8d9['_addOperationForAffectedMarkers']('merge',_0xfdfece['deletionPosition']):_0xfdfece instanceof _0x2070bd&&this['_fixMarkerOperationOldRange'](_0x18727f,_0xfdfece),_0xfdfece['baseVersion']=_0x18727f['document']['version'],_0x35f8d9['batch']['addOperation'](_0xfdfece),_0x18727f['applyOperation'](_0xfdfece));}_fixMarkerOperationOldRange(_0x1e1889,_0x2ce126){const _0x2c6e68=_0x1e1889['markers']['get'](_0x2ce126['name']);_0x2c6e68&&(_0x2ce126['oldRange']=_0x2c6e68['getRange']());}_integrateEditor(_0xf60f31){_0xf60f31['conversion']['for']('upcast')['add'](_0x4b7103=>{_0x4b7103['on']('element',(_0x326dcd,_0x264cb9,_0x1d7127)=>{if(_0x264cb9['modelRange']&&_0x1d7127['consumable']['consume'](_0x264cb9['viewItem'],{'attributes':'data-id'}))for(const _0x182779 of _0x264cb9['modelRange']['getItems']({'shallow':!0x0})){if(_0x182779['is']('$textProxy'))continue;const _0x57bc36=_0x264cb9['viewItem']['getAttribute'](Hn);_0x57bc36&&_0x1d7127['writer']['setAttribute'](Vn,_0x57bc36,_0x182779);}},{'priority':Kt['low']+0x1});}),_0xf60f31['model']['schema']['addAttributeCheck'](()=>!0x0,Vn);}},Bn=class{_editor;_diffItems=[];_markDeletions;['_anchor'];_operationsData=[];_path=[0x0];_parents=[];_splitPostponedData=new Map();constructor({editor:_0x2c2ba8,before:_0x5882ad,after:_0xe81f0c,options:_0x4e968c}){this['_editor']=_0x2c2ba8,this['_markDeletions']=!!_0x4e968c['markDeletions'],this['_anchor']=_0x4e968c['anchor'];const _0x3c8037=this['_tokenizeModel'](_0x5882ad),_0x5642e6=this['_tokenizeModel'](_0xe81f0c);this['_diffItems']=this['_diffModelTokens'](_0x3c8037,_0x5642e6),this['_calculateOperationsData'](),this['_markDeletions']||this['_calculateMarkersOperationsData'](_0x5882ad['markers'],_0xe81f0c['markers']);}getOperationsData(){return this['_operationsData'];}getOperations(){const _0x48f7be=this['_editor']['model']['document'],_0x4c1638=[];let _0x15e093=_0x48f7be['version'];for(const _0xc46730 of this['getOperationsData']())switch(_0xc46730['type']){case'attribute':{const _0x44536b=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['path']),_0x4152a4=_0x44536b['getShiftedBy'](_0xc46730['howMany']),_0x365cbb=new _0x3aaa22(_0x44536b,_0x4152a4),_0x1e5802=JSON['parse'](_0xc46730['oldValue']),_0x3ee886=JSON['parse'](_0xc46730['newValue']);_0x4c1638['push'](new _0x3d87a4(_0x365cbb,_0xc46730['key'],_0x1e5802,_0x3ee886,_0x15e093++));break;}case'insert':{const _0x5819cf=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['path']),_0x15a881=this['_makeModelFromTokens'](_0xc46730['tokens']);_0x4c1638['push'](new _0x38210e(_0x5819cf,_0x15a881,_0x15e093++));break;}case'remove':{const _0x1af0fc=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['path']),_0xf02227=new _0x265910(_0x48f7be['graveyard'],[0x0]);_0x4c1638['push'](new _0x155687(_0x1af0fc,_0xc46730['howMany'],_0xf02227,_0x15e093++));break;}case'rename':{const _0x40d45c=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['path']);_0x4c1638['push'](new _0x127e1f(_0x40d45c,_0xc46730['oldName'],_0xc46730['newName'],_0x15e093++));break;}case'split':{const _0x5d896f=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['path']),_0x1e6b48=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['path']['slice'](0x0,-0x1));_0x1e6b48['offset']++,_0x4c1638['push'](new _0xe7e0e0(_0x5d896f,Number['NEGATIVE_INFINITY'],_0x1e6b48,null,_0x15e093++));break;}case'merge':{const _0x18ebd2=_0xc46730['path']['slice'](),_0x22af14=_0x18ebd2['slice'](0x0,-0x1);_0x22af14[_0x22af14['length']-0x1]++,_0x22af14['push'](0x0);const _0x20e74b=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x22af14),_0x494be3=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x18ebd2),_0x37cc1c=new _0x265910(_0x48f7be['graveyard'],[0x0]);_0x4c1638['push'](new _0xfcd33f(_0x20e74b,Number['NEGATIVE_INFINITY'],_0x494be3,_0x37cc1c,_0x15e093++));break;}case'marker':case'markedRemove':{let _0x480eec=null;if(_0xc46730['range']){const _0x568333=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['range']['start']),_0x414728=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['range']['end']);_0x480eec=new _0x3aaa22(_0x568333,_0x414728);}const _0xf3a9fb='marker'==_0xc46730['type']?_0xc46730['name']:'$markedRemove:'+Xt();_0x4c1638['push'](new _0x2070bd(_0xf3a9fb,null,_0x480eec,_0x48f7be['model']['markers'],!0x0,_0x15e093++));break;}case'unwrap':{const _0x313d17=_0xc46730['path']['slice']();_0x313d17['push'](0x0);const _0x4b02e1=_0xc46730['path']['slice'](),_0x6ae20e=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x313d17),_0x1d4118=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x4b02e1),_0xac4df6=new _0x265910(_0x48f7be['graveyard'],[0x0]);_0x4c1638['push'](new _0x155687(_0x6ae20e,_0xc46730['howMany'],_0x1d4118,_0x15e093++)),_0x4c1638['push'](new _0x155687(_0x1d4118['getShiftedBy'](_0xc46730['howMany']),0x1,_0xac4df6,_0x15e093++));break;}case'wrap':{const _0x401ad3=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['range']['start']),_0x4df10c=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['range']['end']),_0x936b94=_0xc46730['token']['element']['_clone'](!0x1);_0x936b94['_removeAttribute'](Vn);const _0x324db7=_0xc46730['range']['end']['slice']();_0x324db7['push'](0x0);const _0x55372a=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x324db7);_0x4c1638['push'](new _0x38210e(_0x4df10c,_0x936b94,_0x15e093++)),_0x4c1638['push'](new _0x155687(_0x401ad3,_0x4df10c['offset']-_0x401ad3['offset'],_0x55372a,_0x15e093++));break;}}return _0x4c1638;}_tokenizeModel(_0xfb4d4e){const _0x6b8925=[],_0x7897=_0x3aaa22['_createIn'](_0xfb4d4e),_0xabc606=new _0x3d1b58({'boundaries':_0x7897});let _0x23b2b0='',_0x12f99a=null;const _0x330f82=[''],_0x24beb8=new Map();for(const _0x1f6356 of _0xabc606)if('elementStart'==_0x1f6356['type']||'elementEnd'==_0x1f6356['type']){let _0x2d4f99=_0x330f82[0x0];''!==_0x23b2b0&&(_0x6b8925['push'](...this['_makeTokensFromTextByWords'](_0x23b2b0,_0x12f99a,_0x2d4f99)),_0x23b2b0='');const _0xb4c082=_0x1f6356['item'];let _0x4247c6;_0xb4c082['getAttribute']('$elementId')?_0x4247c6=_0xb4c082['getAttribute'](Vn):'elementStart'==_0x1f6356['type']?(_0x4247c6=Wn(_0xb4c082),_0x24beb8['set'](_0xb4c082,_0x4247c6)):_0x4247c6=_0x24beb8['get'](_0xb4c082);const _0x49b5b6=this['_getElementCategory'](_0xb4c082);'solid'==_0x49b5b6&&('elementStart'==_0x1f6356['type']?(_0x2d4f99=_0x4247c6,_0x330f82['unshift'](_0x2d4f99)):_0x330f82['shift']());const _0x4d9808={'type':'element','element':_0xb4c082,'elementId':_0x4247c6,'category':_0x49b5b6,'isStart':'elementStart'==_0x1f6356['type'],'limitId':_0x2d4f99};_0x6b8925['push'](_0x4d9808);}else''==_0x23b2b0&&(_0x12f99a=_0x1f6356['previousPosition']['clone']()),_0x23b2b0+=_0x1f6356['item']['data'];return''!==_0x23b2b0&&_0x6b8925['push'](...this['_makeTokensFromTextByWords'](_0x23b2b0,_0x12f99a,_0x330f82[0x0])),_0x6b8925;}_makeTokensFromTextByWords(_0x28a1c8,_0x529130,_0x144ef1){const _0x26efdb=_0x28a1c8['matchAll'](/(\s)/g),_0x2efbff=Array['from'](_0x26efdb)['map'](_0x3b7265=>_0x3b7265['index']);_0x2efbff['push'](_0x28a1c8['length']),0x0==_0x2efbff[0x0]&&_0x2efbff['shift']();const _0x30ca99=[],_0x107fd2=_0x529130['parent'];let _0x1fd824=0x0,_0x212005=_0x529130['offset'];for(let _0x753dc3=0x0;_0x753dc3<_0x2efbff['length'];_0x753dc3++)_0x30ca99['push']({'type':'text','data':_0x28a1c8['slice'](_0x1fd824,_0x2efbff[_0x753dc3]),'parent':_0x107fd2,'offset':_0x212005,'limitId':_0x144ef1}),_0x1fd824=_0x2efbff[_0x753dc3],_0x212005=_0x529130['offset']+_0x2efbff[_0x753dc3];return _0x30ca99;}_getElementCategory(_0x89889b){const _0x274134=this['_editor']['model']['schema'];return _0x274134['isLimit'](_0x89889b)||_0x274134['isContent'](_0x89889b)||_0x274134['isInline'](_0x89889b)?'solid':_0x274134['isBlock'](_0x89889b)?'block':function(_0x5b4522,_0x240c82){const _0x134121=_0x5b4522['parent'];if(!_0x134121||_0x134121['is']('documentFragment'))return!0x1;if(_0x240c82['checkChild'](_0x134121,'$text'))return!0x1;for(const _0x5a73c7 of _0x5b4522['getChildren']())if(_0x5a73c7['is']('$text'))return!0x0;return!0x1;}(_0x89889b,_0x274134)?'solid':'container';}['_diffModelTokens'](_0x38e0b4,_0x3962c9){const _0x116715=_0x3874b5(_0x38e0b4,_0x3962c9,{'comparator':Gn});this['_handleUnclosedBlockOpeningTags'](_0x116715);const _0x1c6863=_0x116715['flatMap'](_0x343f8f=>{const _0x463f5d=_0x343f8f['added']?'added':_0x343f8f['removed']?'removed':'unchanged';return _0x343f8f['value']['map'](_0x26b341=>({'token':_0x26b341,'change':_0x463f5d}));});let _0x2f9643=0x0;for(const _0x2ec466 of _0x1c6863)'added'!=_0x2ec466['change']&&('unchanged'==_0x2ec466['change']&&(_0x2ec466['before']=_0x38e0b4[_0x2f9643]),_0x2f9643++);return _0x1c6863;}['_handleUnclosedBlockOpeningTags'](_0x3070ec){for(let _0x10f7ef=0x0;_0x10f7ef<_0x3070ec['length']-0x1;_0x10f7ef++)if(_0x3070ec[_0x10f7ef]['removed']&&_0x3070ec[_0x10f7ef+0x1]['added']){const _0x466a24=this['_findUnclosedBlockOpeningToken'](_0x3070ec[_0x10f7ef]['value']);if(null!==_0x466a24){const _0x9a3432=this['_findUnclosedBlockOpeningToken'](_0x3070ec[_0x10f7ef+0x1]['value']),_0x2c1a2a=_0x3070ec[_0x10f7ef]['value']['splice'](_0x466a24),_0x184edc=_0x3070ec[_0x10f7ef+0x1]['value']['splice'](_0x9a3432),_0x3eab49=[_0x184edc['shift']()];_0x2c1a2a['shift']();const _0x483b3e={'value':_0x2c1a2a,'removed':!0x0},_0x398566={'value':_0x184edc,'added':!0x0},_0x5d1008={'value':_0x3eab49};_0x3070ec['splice'](_0x10f7ef+0x2,0x0,_0x5d1008,_0x483b3e,_0x398566);}}}['_findUnclosedBlockOpeningToken'](_0x22a17f){let _0x335bae=0x0,_0x54bdab=-0x1;for(let _0x16f9dc=0x0;_0x16f9dc<_0x22a17f['length'];_0x16f9dc++){const _0x566987=_0x22a17f[_0x16f9dc];'element'==_0x566987['type']&&'block'==_0x566987['category']&&(_0x335bae+=_0x566987['isStart']?0x1:-0x1,_0x566987['isStart']&&(_0x54bdab=_0x16f9dc));}return 0x0===_0x335bae?null:_0x54bdab;}_calculateOperationsData(){this['_handleUnwraps'](),this['_path']=[0x0],this['_parents']=[];for(let _0x25daa7=0x0;_0x25daa7<this['_diffItems']['length'];_0x25daa7++){const _0x19300a=this['_diffItems'][_0x25daa7]['change'],_0x31e51c=[];_0x31e51c['push'](this['_diffItems'][_0x25daa7]);let _0x40c262=_0x25daa7+0x1;for(;this['_diffItems'][_0x40c262]&&this['_diffItems'][_0x40c262]['change']==_0x19300a;)_0x31e51c['push'](this['_diffItems'][_0x40c262]),_0x40c262++,_0x25daa7++;const _0x2fdd41=_0x31e51c['map'](_0x529fab=>_0x529fab['token']);if('unchanged'==_0x19300a)_0x31e51c['map'](_0x401007=>_0x401007['before'])['forEach'](_0x48ecc9=>this['_traverseOverItem'](_0x48ecc9));else{if('removed'==_0x19300a){if(this['_markDeletions']){const _0x3afcea=this['_path']['slice']();_0x2fdd41['forEach'](_0x475a77=>this['_traverseOverItem'](_0x475a77));const _0x39fafc=this['_path']['slice']();this['_operationsData']['push']({'type':'markedRemove','range':{'start':_0x3afcea,'end':_0x39fafc}});}else this['_handleChanged'](_0x2fdd41,!0x0,this['_path']['slice']());}else{const _0x1e38ac=_0x2fdd41['filter'](_0x1f42cf=>'element'!=_0x1f42cf['type']||'container'!=_0x1f42cf['category']);this['_handleChanged'](_0x1e38ac,!0x1,this['_path']);}}}this['_handleWraps'](),this['_path']=[0x0],this['_parents']=[];for(let _0x1447d0=0x0;_0x1447d0<this['_diffItems']['length'];_0x1447d0++){const _0x4fe418=this['_diffItems'][_0x1447d0]['change'],_0xccec5c=[];_0xccec5c['push'](this['_diffItems'][_0x1447d0]);let _0x2335f0=_0x1447d0+0x1;for(;this['_diffItems'][_0x2335f0]&&this['_diffItems'][_0x2335f0]['change']==_0x4fe418;)_0xccec5c['push'](this['_diffItems'][_0x2335f0]),_0x2335f0++,_0x1447d0++;const _0xfa4670=_0xccec5c['map'](_0x4f283f=>_0x4f283f['token']);if('unchanged'==_0x4fe418){const _0x2d4373=_0xccec5c['map'](_0x3ba46a=>_0x3ba46a['before']);this['_handleUnchanged'](_0x2d4373,_0xfa4670);}else('added'==_0x4fe418||this['_markDeletions'])&&_0xfa4670['forEach'](_0x48d3bb=>{'element'==_0x48d3bb['type']&&_0x48d3bb['isStart']&&this['_splitPostponedData']['has'](_0x48d3bb['element'])&&this['_handleSplitPostponedData'](_0x48d3bb['element'],this['_path']),this['_traverseOverItem'](_0x48d3bb);});}}_handleSplitPostponedData(_0x5f26aa,_0x3a215e){const _0x26c583=this['_splitPostponedData']['get'](_0x5f26aa);for(const _0x30bec1 of _0x26c583)'rename'==_0x30bec1['type']?this['_operationsData']['push']({'type':'rename','path':_0x3a215e['slice'](),'oldName':_0x30bec1['oldValue'],'newName':_0x5f26aa['name']}):this['_operationsData']['push']({'type':'attribute','path':_0x3a215e['slice'](),'howMany':0x1,'key':_0x30bec1['key'],'oldValue':_0x30bec1['oldValue'],'newValue':JSON['stringify'](_0x5f26aa['getAttribute'](_0x30bec1['key'])??null)});}_calculateMarkersOperationsData(_0x265720,_0x1ca7ff){const _0x46961e={};for(const [_0x55da93]of _0x265720)_0x46961e[_0x55da93]=null;for(const [_0x1b1e17,_0x1dd997]of _0x1ca7ff)_0x46961e[_0x1b1e17]=_0x1dd997;const _0x4b7fd1=Object['entries'](_0x46961e)['map'](([_0x5f08ee,_0x574b4d])=>({'type':'marker','name':_0x5f08ee,'range':_0x574b4d?{'start':_0x574b4d['start']['path']['slice'](),'end':_0x574b4d['end']['path']['slice']()}:null}));this['_operationsData']['push'](..._0x4b7fd1);}['_handleUnwraps'](){const _0x185243=new Map(),_0x5215bd=[],_0x2073f3=[0x0];let _0x165ce2=this['_diffItems']['length']+0x1;for(let _0x58621f=this['_diffItems']['length']-0x1;_0x58621f>=0x0;_0x58621f--){const {token:_0x4502bd,before:_0x564351,change:_0x4b7e72}=this['_diffItems'][_0x58621f];if('removed'!=_0x4b7e72&&(_0x165ce2=_0x58621f),'element'!=_0x4502bd['type']||'container'!=_0x4502bd['category']||'added'==_0x4b7e72)continue;const _0xff4949=_0x564351?_0x564351['element']:_0x4502bd['element'];if(_0x4502bd['isStart']){const _0x6d9c09=_0x185243['get'](_0xff4949),_0xf4f1b7=this['_diffItems'][_0x6d9c09];('removed'==_0x4b7e72||'removed'==_0xf4f1b7['change'])&&_0x165ce2<_0x6d9c09&&(this['_operationsData']['push']({'type':'unwrap','path':_0xff4949['getPath'](),'howMany':_0xff4949['maxOffset']+_0x2073f3[0x0]}),_0x2073f3['shift'](),_0x2073f3[0x0]+=_0xff4949['maxOffset']-0x1,_0x5215bd['push'](_0x58621f),_0x5215bd['push'](_0x6d9c09));}else _0x185243['set'](_0xff4949,_0x58621f),_0x2073f3['unshift'](0x0);}_0x5215bd['sort']((_0x591758,_0x46cec5)=>_0x46cec5-_0x591758),_0x5215bd['forEach'](_0x3ecfaf=>{const _0x288e01=this['_diffItems'][_0x3ecfaf];'removed'==_0x288e01['change']?this['_diffItems']['splice'](_0x3ecfaf,0x1):(_0x288e01['change']='added',delete _0x288e01['before']);});}['_handleWraps'](){this['_path']=[0x0],this['_parents']=[];const _0xfe0eb4=[];for(let _0x4ac691=0x0;_0x4ac691<this['_diffItems']['length'];_0x4ac691++){const {change:_0x43b44c,token:_0x41449a}=this['_diffItems'][_0x4ac691];if('added'==_0x43b44c&&'element'==_0x41449a['type']&&'container'==_0x41449a['category']){if(_0x41449a['isStart'])_0xfe0eb4['push'](this['_path']['slice']());else{if(!_0x41449a['isStart']){const _0x2de2db=_0xfe0eb4['pop']();this['_operationsData']['push']({'type':'wrap','range':{'start':_0x2de2db,'end':this['_path']['slice']()},'token':_0x41449a}),this['_path'][this['_path']['length']-0x1]=_0x2de2db[this['_path']['length']-0x1]+0x1;}}}else('removed'!=_0x43b44c||this['_markDeletions'])&&this['_traverseOverItem'](_0x41449a);}}['_handleUnchanged'](_0x3adea4,_0x4a872f){for(let _0x4ea866=0x0;_0x4ea866<_0x3adea4['length'];_0x4ea866++){const _0x257ea3=_0x3adea4[_0x4ea866];if('element'==_0x257ea3['type']&&_0x257ea3['isStart']){const _0x4a73c4=_0x4a872f[_0x4ea866];'block'==_0x257ea3['category']&&this['_handleElementRename'](_0x257ea3['element'],_0x4a73c4['element'],this['_path']),this['_handleElementAttributeChanges'](_0x257ea3['element'],_0x4a73c4['element'],this['_path']),this['_path']['push'](0x0),this['_parents']['push'](_0x4a73c4);}else{if('element'!=_0x257ea3['type']||_0x257ea3['isStart']){if('text'==_0x257ea3['type']){const _0x135adf=this['_path']['slice'](),_0x4243a4=[],_0x14f5b0=[];for(;_0x3adea4[_0x4ea866]&&'text'==_0x3adea4[_0x4ea866]['type'];)_0x4243a4['push'](_0x3adea4[_0x4ea866]),_0x14f5b0['push'](_0x4a872f[_0x4ea866]),this['_path'][this['_path']['length']-0x1]+=_0x3adea4[_0x4ea866]['data']['length'],_0x4ea866++;_0x4ea866--,this['_handleTextAttributeChanges'](_0x4243a4,_0x14f5b0,_0x135adf);}}else this['_path']['pop'](),this['_path'][this['_path']['length']-0x1]++,this['_parents']['pop']();}}}['_handleChanged'](_0x3f2f3e,_0x361a66,_0x3de69f){const _0x49f26a=[],_0x203079=[],_0x56466d=_0x3de69f['slice']();let _0x3f36ad=this['_parents']['length']-0x1;for(let _0x49dd87=0x0;_0x49dd87<_0x3f2f3e['length'];_0x49dd87++){const _0x293f0c=_0x3f2f3e[_0x49dd87],_0x5582a9=_0x3de69f['slice']();'element'!=_0x293f0c['type']||_0x293f0c['isStart']?'element'==_0x293f0c['type']&&_0x293f0c['isStart']?(_0x3de69f['push'](0x0),_0x3f36ad++,_0x203079['push']({'before':_0x5582a9,'after':_0x3de69f['slice'](),'index':_0x49dd87})):_0x3de69f[_0x3de69f['length']-0x1]+=_0x293f0c['data']['length']:(_0x3de69f['pop'](),_0x3de69f[_0x3de69f['length']-0x1]++,_0x3f36ad--,_0x203079['length']?_0x203079['pop']():_0x49f26a['push']({'before':_0x5582a9,'after':_0x3de69f['slice'](),'index':_0x49dd87}));}if(_0x203079['length']!==_0x49f26a['length'])throw new dt('model-diff-incorrect-matching-and-closing-tags',null,{'tokens':_0x3f2f3e,'isRemove':_0x361a66});const _0x4933f0=[{'after':_0x56466d['slice'](),'index':-0x1},..._0x49f26a,..._0x203079,{'before':_0x3de69f['slice'](),'index':_0x3f2f3e['length']}];if(_0x361a66){for(let _0x423f94=_0x4933f0['length']-0x1;_0x423f94>=0x1;_0x423f94--){const _0x5e2ef0=_0x4933f0[_0x423f94-0x1]['after'],_0x1a2cdc=_0x4933f0[_0x423f94]['before'],_0x3d96f6=_0x1a2cdc[_0x1a2cdc['length']-0x1]-_0x5e2ef0[_0x5e2ef0['length']-0x1];_0x3d96f6&&(this['_operationsData']['push']({'type':'remove','path':_0x5e2ef0,'howMany':_0x3d96f6}),_0x1a2cdc[_0x1a2cdc['length']-0x1]-=_0x3d96f6);}for(const {before:_0x1c7525}of _0x49f26a)this['_operationsData']['push']({'type':'merge','path':_0x1c7525});}else for(let _0x35bb49=0x0;_0x35bb49<_0x4933f0['length']-0x1;_0x35bb49++){const _0x4bff8e=_0x4933f0[_0x35bb49]['after'],_0x59cec7=_0x4933f0[_0x35bb49+0x1]['before'],_0x7cb3f8=_0x4933f0[_0x35bb49]['index']+0x1,_0x10ba5f=_0x4933f0[_0x35bb49+0x1]['index'];if(_0x7cb3f8!==_0x10ba5f&&this['_operationsData']['push']({'type':'insert','path':_0x4bff8e,'tokens':_0x3f2f3e['slice'](_0x7cb3f8,_0x10ba5f)}),_0x35bb49<_0x49f26a['length']){this['_operationsData']['push']({'type':'split','path':_0x59cec7});const _0x1628bc=_0x3f2f3e[_0x203079[_0x203079['length']-0x1-_0x35bb49]['index']],_0x1c4e59=this['_parents'][_0x3f36ad]['element'];_0x1c4e59['name']!=_0x1628bc['element']['name']&&this['_addSplitPostponedData'](_0x1628bc['element'],{'type':'rename','oldValue':_0x1c4e59['name']});const _0x4a0c29=this['_getAttributeChanges'](_0x1c4e59['getAttributes'](),_0x1628bc['element']['getAttributes']());for(const _0x2e0dfd in _0x4a0c29){const _0x9c4356=_0x4a0c29[_0x2e0dfd]['oldValue'];this['_addSplitPostponedData'](_0x1628bc['element'],{'type':'attribute','key':_0x2e0dfd,'oldValue':_0x9c4356});}}}}_addSplitPostponedData(_0x32be8b,_0x477564){const _0x344d94=this['_splitPostponedData']['get'](_0x32be8b)||[];_0x344d94['push'](_0x477564),this['_splitPostponedData']['set'](_0x32be8b,_0x344d94);}_traverseOverItem(_0x3c531d){'element'==_0x3c531d['type']&&_0x3c531d['isStart']?(this['_path']['push'](0x0),this['_parents']['push'](_0x3c531d)):'element'!=_0x3c531d['type']||_0x3c531d['isStart']?'text'==_0x3c531d['type']&&(this['_path'][this['_path']['length']-0x1]+=_0x3c531d['data']['length']):(this['_path']['pop'](),this['_path'][this['_path']['length']-0x1]++,this['_parents']['pop']());}_handleElementRename(_0x2e3ebc,_0x38b5f9,_0x5bc90b){_0x2e3ebc['name']!=_0x38b5f9['name']&&this['_operationsData']['push']({'type':'rename','path':_0x5bc90b['slice'](),'oldName':_0x2e3ebc['name'],'newName':_0x38b5f9['name']});}_handleElementAttributeChanges(_0x19af09,_0xea59f5,_0x5d6ae0){const _0x3ebf2d=this['_getAttributeChanges'](_0x19af09['getAttributes'](),_0xea59f5['getAttributes']());for(const _0x26b8a9 in _0x3ebf2d){const {oldValue:_0x3a5cda,newValue:_0x3559e6}=_0x3ebf2d[_0x26b8a9];this['_operationsData']['push']({'type':'attribute','path':_0x5d6ae0['slice'](),'howMany':0x1,'key':_0x26b8a9,'oldValue':_0x3a5cda,'newValue':_0x3559e6});}}_handleTextAttributeChanges(_0x19c2eb,_0x1cf0ec,_0xfc6f09){const _0x50fd80=this['_operationsData'],_0x59870f=_0x19c2eb[0x0]['parent'],_0x5a9bec=_0x19c2eb[0x0]['offset'],_0x449619=_0x1cf0ec[0x0]['parent'],_0xa7a778=_0x1cf0ec[0x0]['offset'],_0x3bb6c4=_0x19c2eb['reduce']((_0x331f48,_0xe362b)=>_0x331f48+_0xe362b['data']['length'],0x0),_0x394f44=this['_getAttrsForOffsets'](_0x59870f,_0x5a9bec,_0x3bb6c4),_0x2b7517=this['_getAttrsForOffsets'](_0x449619,_0xa7a778,_0x3bb6c4),_0x35eb0f={};for(let _0x109c3d=0x0;_0x109c3d<_0x3bb6c4;_0x109c3d++){const _0x4df471=_0x394f44[_0x5a9bec+_0x109c3d],_0x54195d=_0x2b7517[_0xa7a778+_0x109c3d],_0x4e4498=this['_getAttributeChanges'](_0x4df471,_0x54195d);for(const _0x26c71d in _0x35eb0f)_0x4e4498[_0x26c71d]||_0x4bb53c(_0x26c71d);for(const _0x3c078a in _0x4e4498){const {oldValue:_0x4b1b89,newValue:_0x162732}=_0x4e4498[_0x3c078a],_0x1336a2=_0x35eb0f[_0x3c078a];_0x1336a2?_0x1336a2['oldValue']==_0x4b1b89&&_0x1336a2['newValue']==_0x162732?_0x1336a2['length']++:(_0x4bb53c(_0x3c078a),_0x35eb0f[_0x3c078a]={'oldValue':_0x4b1b89,'newValue':_0x162732,'start':_0x109c3d,'length':0x1}):_0x35eb0f[_0x3c078a]={'oldValue':_0x4b1b89,'newValue':_0x162732,'start':_0x109c3d,'length':0x1};}}for(const _0x2f84f1 in _0x35eb0f)_0x4bb53c(_0x2f84f1);function _0x4bb53c(_0x490db3){const _0x1768c4=_0x35eb0f[_0x490db3],_0x597fd1=_0xfc6f09['slice']();_0x597fd1[_0x597fd1['length']-0x1]+=_0x1768c4['start'],_0x50fd80['push']({'type':'attribute','path':_0x597fd1,'howMany':_0x1768c4['length'],'key':_0x490db3,'oldValue':_0x1768c4['oldValue'],'newValue':_0x1768c4['newValue']}),delete _0x35eb0f[_0x490db3];}}_getAttributeChanges(_0x2b9606,_0x3e07ab){const _0x235055={};for(const [_0x39c3c2,_0x112b75]of _0x2b9606)_0x235055[_0x39c3c2]={'oldValue':JSON['stringify'](_0x112b75),'newValue':'null'};for(const [_0x455b2f,_0xb264e9]of _0x3e07ab){const _0x12b6e0=JSON['stringify'](_0xb264e9);_0x235055[_0x455b2f]?_0x235055[_0x455b2f]['oldValue']==_0x12b6e0?delete _0x235055[_0x455b2f]:_0x235055[_0x455b2f]['newValue']=_0x12b6e0:_0x235055[_0x455b2f]={'oldValue':'null','newValue':_0x12b6e0};}return delete _0x235055[Vn],_0x235055;}_getAttrsForOffsets(_0x6b13f2,_0x1c5bdd,_0x372541){const _0x6264ef=new Array(_0x1c5bdd+_0x372541);let _0xee81ab=_0x6b13f2['getChildAtOffset'](_0x1c5bdd),_0x13d8ec=_0xee81ab['startOffset'];for(;_0xee81ab&&_0x13d8ec<_0x1c5bdd+_0x372541;){const _0x1cb924=Array['from'](_0xee81ab['getAttributes']());_0x6264ef['fill'](_0x1cb924,_0x13d8ec,_0x13d8ec+_0xee81ab['offsetSize']),_0x13d8ec+=_0xee81ab['offsetSize'],_0xee81ab=_0xee81ab['nextSibling'];}return _0x6264ef;}_getPositionFromAnchorAndPath(_0x5e77c4,_0x33489c){const _0x3449a6=[..._0x5e77c4['path']['slice'](0x0,-0x1),_0x5e77c4['offset']+_0x33489c[0x0],..._0x33489c['slice'](0x1)];return new _0x265910(_0x5e77c4['root'],_0x3449a6);}['_makeModelFromTokens'](_0xce8a48){const _0x3f5d37=[];let _0x551f12=null;for(const _0x2492db of _0xce8a48)if('element'!=_0x2492db['type']||_0x2492db['isStart']||_0x551f12!=_0x2492db['element']){if(!_0x551f12){if('text'==_0x2492db['type']){const _0x37c066=_0x265910['_createAt'](_0x2492db['parent'],_0x2492db['offset']),_0x3c0b1b=_0x3aaa22['_createFromPositionAndShift'](_0x37c066,_0x2492db['data']['length']),_0x35c225=Array['from'](_0x3c0b1b['getItems']())['map'](_0x2d4fed=>new _0x55e0d0(_0x2d4fed['data'],_0x2d4fed['getAttributes']()));_0x3f5d37['push'](..._0x35c225);}else{_0x551f12=_0x2492db['element'];const _0x255f48=_0x2492db['element']['_clone'](!0x0);_0x255f48['_removeAttribute'](Vn);for(const _0x4b929c of this['_editor']['model']['createRangeIn'](_0x255f48)['getItems']())_0x4b929c['is']('element')&&_0x4b929c['_removeAttribute'](Vn);_0x3f5d37['push'](_0x255f48);}}}else _0x551f12=null;return _0x3f5d37;}};function Gn(_0x3f9f04,_0x1a42f5){return _0x3f9f04['type']===_0x1a42f5['type']&&(_0x3f9f04['limitId']===_0x1a42f5['limitId']&&('text'==_0x3f9f04['type']?_0x3f9f04['data']==_0x1a42f5['data']:function(_0x4d56ff,_0x1fec98){if(_0x4d56ff['isStart']!=_0x1fec98['isStart'])return!0x1;if(_0x4d56ff['isStart']&&_0x4d56ff['elementId']!=_0x1fec98['elementId'])return!0x1;if(_0x4d56ff['category']!=_0x1fec98['category'])return!0x1;if('block'==_0x4d56ff['category'])return!0x0;if('container'==_0x4d56ff['category']&&_0x4d56ff['elementId']!=_0x1fec98['elementId'])return!0x1;return _0x4d56ff['element']['name']==_0x1fec98['element']['name'];}(_0x3f9f04,_0x1a42f5)));}function Wn(_0x3ea4eb){return _0xab9059({'name':_0x3ea4eb['name'],...Object['fromEntries'](_0x3ea4eb['getAttributes']())});}const Fn=/* #__PURE__ -- @preserve */
26
+ mt();var Kn=class extends Fn{_generateUid;_uidCounter=0x0;_touchedNodesState={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null,'rescuedNewIds':new Set()};_existingDataIds=new Set();_referencedExistingIds=new Set();constructor(_0x11c429){super(),this['_generateUid']=_0x11c429||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x3b02f6,_0x3593d3,_0x1f47fa){this['_uidCounter']=0x0;const _0x3a6318=_0x3b02f6['cloneNode'](!0x0);qn(_0x3593d3,_0x3a6318);const _0x1795f2=_0x3a6318['childNodes'],_0x557c82=Array['from'](_0x1795f2)['filter'](_0x58a605=>!(0x3===_0x58a605['nodeType']&&''===sn(_0x58a605)['trim']())),_0x17752d=_0x557c82['length'];this['_existingDataIds']=new Set(rn('data-id',null,_0x3593d3)['map'](_0x270d05=>ln(_0x270d05,'data-id'))['filter'](_0x2b0415=>!!_0x2b0415));for(const _0x5eeac9 of _0x557c82)_0x5eeac9&&_0x58049c(_0x5eeac9)&&void 0x0===_0x5eeac9['attribs']['data-id']&&un(_0x5eeac9,'data-id','new-element');if(rn('data-id',null,_0x3a6318)['forEach'](_0x106afa=>{const _0x2b0109=ln(_0x106afa,'data-id');'new-element'===_0x2b0109||this['_existingDataIds']['has'](_0x2b0109)||un(_0x106afa,'data-id','new-element');}),0x0===_0x3593d3['childNodes']['length']){const _0x2e1c2a=[];return rn('data-id','new-element',_0x3a6318)['forEach'](_0x27166a=>{const _0x15afe0=this['_generateUid']();un(_0x27166a,'data-id',_0x15afe0),_0x2e1c2a['push'](_0x15afe0);}),this['_removeSpecialComments'](_0x3a6318),{'parsedContent':_0x3a6318,'newNodeIds':_0x2e1c2a,'modifiedNodeIds':[],'removedNodeIds':[]};}this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_touchedNodesState']['rescuedNewIds']=new Set(),this['_referencedExistingIds']=new Set();let _0x112741=-0x1,_0xab7786=!0x1;for(let _0x43267d=0x0;_0x43267d<_0x17752d;_0x43267d++){const _0x35aec1=_0x557c82[_0x43267d],_0x5b1680=_0x557c82[_0x43267d+0x1];if(this['_isNewNode'](_0x35aec1)){if(-0x1===_0x112741&&(_0x112741=_0x43267d),this['_markWrappedElements'](_0x35aec1),!this['_isNewNode'](_0x5b1680)){const [_0x1cb356,_0x2e1c28]=this['_findReferenceNode'](_0x35aec1,_0xab7786,_0x3593d3);if(_0x1cb356){const _0x193bea=Array['from'](_0x557c82)['slice'](_0x112741,_0x43267d+0x1);this['_insertNodes'](_0x1cb356,_0x193bea,_0x2e1c28),_0x112741=-0x1;}}}else{if(this['_isExistingContentComment'](_0x35aec1))_0xab7786=!0x0;else{if(this['_isExistingNode'](_0x35aec1)){const _0x1ad4eb=ln(_0x35aec1,'data-id');if(_0x1ad4eb&&this['_existingDataIds']['has'](_0x1ad4eb)){this['_referencedExistingIds']['add'](_0x1ad4eb);const _0x13abae=nn('data-id',_0x1ad4eb,_0x3593d3);this['_replaceNode'](_0x13abae,_0x35aec1);}}else{if($n(_0x35aec1)){const _0x1a1dea=Yn(_0x35aec1);nn('data-id',_0x1a1dea,_0x3a6318)||this['_touchedNodesState']['removedIds']['push'](_0x1a1dea);}}}}}for(const _0x2ced6f of this['_touchedNodesState']['removedIds']){const _0x2639af=nn('data-id',_0x2ced6f,_0x3593d3);_0x2639af&&(this['_rescueUnwrappedElements'](_0x2639af),this['_removeNode'](_0x2639af,_0x2ced6f,_0x1f47fa));}if(rn('data-id','new-element',_0x3593d3)['forEach'](_0x47e636=>{const _0x36f961=this['_getUid'](_0x47e636);un(_0x47e636,'data-id',_0x36f961),this['_touchedNodesState']['newIds']['push'](_0x36f961);}),this['_removeSpecialComments'](_0x3593d3),_0x1f47fa&&_0x1f47fa['cutAfterUnstable']){const _0x1308ea=this['_findLastConfirmationPoint'](_0x557c82),_0xb8396c=this['_getLastStableElement'](_0x3593d3,_0x1308ea);this['_markUnstableElements'](_0x3593d3,_0xb8396c);}if(this['_processWrappedElements'](_0x3593d3,_0x1f47fa),_0x1f47fa&&_0x1f47fa['cutAfterUnstable']&&this['_touchedNodesState']['lastTouchedId']){const _0x543ad8=rn('data-id',this['_touchedNodesState']['lastTouchedId'],_0x3593d3);let _0xabc7d9=_0x543ad8[_0x543ad8['length']-0x1];for(;_0xabc7d9;)An(_0xabc7d9),_0xabc7d9=_0xabc7d9['parentNode'];}return{'parsedContent':_0x3593d3,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}_insertNodes(_0x504515,_0x532c7f,_0x484e6c){for(const _0x38152e of _0x532c7f){const _0x1adfda=this['_getUid'](_0x38152e);un(_0x38152e,'data-id',_0x1adfda),this['_touchedNodesState']['newIds']['push'](_0x1adfda),this['_touchedNodesState']['lastTouchedId']=_0x1adfda;}const _0x3a4b46='afterbegin'===_0x484e6c||'afterend'===_0x484e6c?_0x532c7f['reverse']():_0x532c7f;for(const _0x37b798 of _0x3a4b46)dn(_0x504515,_0x37b798,_0x484e6c);}['_replaceNode'](_0x43c374,_0x586867){if(!_0x43c374)return;if(_0x1fb64d=_0x586867,gn(sn(_0x43c374))===gn(sn(_0x1fb64d)))return;var _0x1fb64d;const _0x4589a5=ln(_0x43c374,'data-id');this['_touchedNodesState']['modifiedIds']['push'](_0x4589a5),this['_touchedNodesState']['lastTouchedId']=_0x4589a5,_0x418ed2(_0x43c374,_0x586867['cloneNode'](!0x0));}['_removeNode'](_0x1be261,_0x87da17,_0x1be224){if(_0x1be224&&_0x1be224['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x87da17;const _0x4fc393=_0x1be224['replaceRemovedWith']['cloneNode'](!0x0);un(_0x4fc393,'data-id',_0x87da17),un(_0x4fc393,'data-removed','true'),_0x418ed2(_0x1be261,_0x4fc393);}else _0x15340f(_0x1be261);}['_findReferenceNode'](_0x4869b9,_0xa85397,_0xb9fd5f){const _0x42f96e=this['_findPrevElementWithDataId'](_0x4869b9,!0x1);if(_0x42f96e){const _0x48d52b=Yn(_0x42f96e),_0x42ee62=nn('data-id',_0x48d52b,_0xb9fd5f);if(_0x42ee62)return[_0x42ee62,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x48d52b);}const _0x42b9cb=this['_findNextElementWithDataId'](_0x4869b9,!0x1);if(_0x42b9cb){const _0x185b19=Yn(_0x42b9cb),_0x71e3a3=nn('data-id',_0x185b19,_0xb9fd5f);if(_0x71e3a3)return[_0x71e3a3,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x185b19);}return _0xa85397?_0x4869b9['nextSibling']?this['_findFallbackReferenceNode'](_0x4869b9,_0xb9fd5f):[_0xb9fd5f['childNodes'][_0xb9fd5f['childNodes']['length']-0x1],'afterend']:[_0xb9fd5f['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x3c0d32,_0x2e1059){const _0x3652b1=[],_0x1bb190=this['_findPrevElementWithDataId'](_0x3c0d32,!0x0);if(_0x1bb190){const _0x21ba25=nn('data-id',Yn(_0x1bb190),_0x2e1059);_0x21ba25&&_0x3652b1['push']([_0x21ba25,'afterend']);}const _0x58453d=this['_findNextElementWithDataId'](_0x3c0d32,!0x0);if(_0x58453d){const _0x1038e6=nn('data-id',Yn(_0x58453d),_0x2e1059);_0x1038e6&&_0x3652b1['push']([_0x1038e6,'beforebegin']);}return _0x3652b1['length']>0x1?In(_0x3652b1[0x0][0x0])<=In(_0x3652b1[0x1][0x0])?_0x3652b1[0x0]:_0x3652b1[0x1]:0x1===_0x3652b1['length']?_0x3652b1[0x0]:[_0x2e1059['lastChild'],'afterend'];}_findNextElementWithDataId(_0x2de6cd,_0x32c84e){let _0x45edc2=_0x2de6cd['nextSibling'],_0x5cacdd=null,_0x52c30f=!0x1;for(;_0x45edc2;){if(_0x1800e7(_0x45edc2)){if($n(_0x45edc2)&&(_0x5cacdd=_0x45edc2),this['_isExistingContentComment'](_0x45edc2)&&_0x32c84e&&!_0x52c30f){_0x52c30f=!0x0,_0x45edc2=_0x45edc2['nextSibling'];continue;}break;}const _0x14d353=ln(_0x45edc2,'data-id');if(_0x14d353&&'new-element'!==_0x14d353&&this['_existingDataIds']['has'](_0x14d353)){_0x5cacdd=_0x45edc2;break;}_0x45edc2=_0x45edc2['nextSibling'];}return _0x5cacdd;}_findPrevElementWithDataId(_0x5da110,_0x42b098){let _0x42ad00=_0x5da110['previousSibling'],_0x5347f4=null,_0x536a93=!0x1;for(;_0x42ad00;){if(_0x1800e7(_0x42ad00)){if($n(_0x42ad00)&&(_0x5347f4=_0x42ad00),this['_isExistingContentComment'](_0x42ad00)&&_0x42b098&&!_0x536a93){_0x536a93=!0x0,_0x42ad00=_0x42ad00['previousSibling'];continue;}break;}const _0x50a7fc=ln(_0x42ad00,'data-id');if(_0x50a7fc&&'new-element'!==_0x50a7fc&&this['_existingDataIds']['has'](_0x50a7fc)){_0x5347f4=_0x42ad00;break;}_0x42ad00=_0x42ad00['previousSibling'];}return _0x5347f4;}_markWrappedElements(_0x3c7d7a){_0x58049c(_0x3c7d7a)&&rn('data-id',null,_0x3c7d7a)['forEach'](_0x599315=>{this['_isExistingNode'](_0x599315)&&(un(_0x599315,'data-wrapped-id',ln(_0x599315,'data-id')),un(_0x599315,'data-id',null));});}_processWrappedElements(_0x1e4442,_0x4cb388){rn('data-wrapped-id',null,_0x1e4442)['forEach'](_0x5123e6=>{const _0x3fbc91=ln(_0x5123e6,'data-wrapped-id');if(this['_hasUnstableParent'](_0x5123e6))return;const _0x2b0d10=nn('data-id',_0x3fbc91,_0x1e4442);un(_0x5123e6,'data-id',_0x3fbc91),_0x2b0d10&&(this['_removeNode'](_0x2b0d10,_0x3fbc91,_0x4cb388),this['_touchedNodesState']['removedIds']['push'](_0x3fbc91),this['_touchedNodesState']['lastTouchedId']=_0x3fbc91);});}_hasUnstableParent(_0x1e143a){let _0x244de2=_0x1e143a['parentNode'];for(;_0x244de2;){if(ln(_0x244de2,'data-unstable'))return!0x0;_0x244de2=_0x244de2['parentNode'];}return!0x1;}_rescueUnwrappedElements(_0x465094){const _0x1b6fde=new Set(this['_touchedNodesState']['removedIds']),_0x59b091=new Set(this['_touchedNodesState']['newIds']);rn('data-id',null,_0x465094)['forEach'](_0x546371=>{const _0x40d85b=ln(_0x546371,'data-id'),_0x2f5917=!!_0x40d85b&&this['_referencedExistingIds']['has'](_0x40d85b),_0x1afdd2=!!_0x40d85b&&_0x59b091['has'](_0x40d85b);if(!_0x40d85b||!_0x2f5917&&!_0x1afdd2)return;if(_0x1b6fde['has'](_0x40d85b))return;let _0x23e374=_0x546371['parentNode'],_0x43e42a=!0x1;for(;_0x23e374;){if(_0x23e374===_0x465094){_0x43e42a=!0x0;break;}const _0x359c46=ln(_0x23e374,'data-id');if(_0x359c46&&(this['_referencedExistingIds']['has'](_0x359c46)||_0x59b091['has'](_0x359c46)))return;_0x23e374=_0x23e374['parentNode'];}if(_0x43e42a){if(_0x1e83fe(_0x465094,_0x546371),_0x2f5917){const _0x2d0e97=this['_generateUid'](),_0x361c0b=this['_touchedNodesState']['modifiedIds']['indexOf'](_0x40d85b);-0x1!==_0x361c0b&&this['_touchedNodesState']['modifiedIds']['splice'](_0x361c0b,0x1),un(_0x546371,'data-unwrapped-id',_0x40d85b),un(_0x546371,'data-id',_0x2d0e97),this['_touchedNodesState']['newIds']['push'](_0x2d0e97),this['_touchedNodesState']['rescuedNewIds']['add'](_0x2d0e97),this['_touchedNodesState']['lastTouchedId']=_0x2d0e97;}else this['_touchedNodesState']['rescuedNewIds']['add'](_0x40d85b),this['_touchedNodesState']['lastTouchedId']=_0x40d85b;}});}_getUid(_0x1b22c0){return this['_isExistingNode'](_0x1b22c0)?ln(_0x1b22c0,'data-id'):this['_generateUid']();}_removeSpecialComments(_0x15609c){cn(_0x15609c)['filter'](_0x42134e=>$n(_0x42134e)||this['_isExistingContentComment'](_0x42134e))['forEach'](_0x5dc819=>{_0x15340f(_0x5dc819);});}_findLastConfirmationPoint(_0x3cf68d){let _0x6d74d8=null,_0x13cf43=null,_0x4068c9=null,_0x3c00b3=null;const _0x59bb76=_0x573d91=>{_0x573d91&&(_0x6d74d8=_0x573d91),_0x4068c9=null,_0x3c00b3=null;};for(let _0x4f49df=0x0;_0x4f49df<_0x3cf68d['length'];_0x4f49df++){const _0x205cf9=_0x3cf68d[_0x4f49df];if(this['_isExistingContentComment'](_0x205cf9)){_0x59bb76(_0x13cf43);continue;}if(_0x58049c(_0x205cf9)){const _0x44cd0b=ln(_0x205cf9,'data-id'),_0x204c8a=_0x4f49df===_0x3cf68d['length']-0x1;if(_0x44cd0b&&'new-element'!==_0x44cd0b&&this['_touchedNodesState']['modifiedIds']['includes'](_0x44cd0b)&&!_0x204c8a){_0x59bb76(_0x44cd0b),_0x13cf43=_0x44cd0b;continue;}}let _0x86ca94;const _0x4e363b=Yn(_0x205cf9);if(_0x4e363b&&this['_touchedNodesState']['rescuedNewIds']['has'](_0x4e363b))_0x13cf43=_0x4e363b;else{if(_0x4e363b&&this['_touchedNodesState']['newIds']['includes'](_0x4e363b))_0x86ca94='N';else{if(!$n(_0x205cf9))continue;_0x86ca94='R';}_0x86ca94===_0x3c00b3||null===_0x3c00b3?_0x3c00b3=_0x86ca94:null!==_0x4068c9?(_0x59bb76(_0x13cf43),_0x3c00b3=_0x86ca94):(_0x4068c9=_0x3c00b3,_0x3c00b3=_0x86ca94),_0x13cf43=_0x4e363b;}}const _0x147d9f=_0x3cf68d[_0x3cf68d['length']-0x1];return _0x147d9f&&!_0x58049c(_0x147d9f)&&!$n(_0x147d9f)&&_0x13cf43&&_0x59bb76(_0x13cf43),_0x6d74d8;}_getLastStableElement(_0x14fdba,_0x25f5fb){if(!_0x25f5fb)return null;const _0x394c25=nn('data-id',_0x25f5fb,_0x14fdba);if(!_0x394c25)return null;const _0xb912a8=[_0x394c25,..._n(_0x394c25)]['at'](-0x2);if(_0xb912a8===_0x394c25)return _0x394c25;let _0x217737=_0xb912a8['previousSibling'];for(;_0x217737&&!_0x58049c(_0x217737);)_0x217737=_0x217737['previousSibling'];return _0x217737;}_markUnstableElements(_0x49c71a,_0x10aec7){const _0x1b0eb4=new Set([...this['_touchedNodesState']['newIds'],...this['_touchedNodesState']['modifiedIds'],...this['_touchedNodesState']['removedIds']]);let _0xa130ec=_0x10aec7?_0x10aec7['nextSibling']:_0x49c71a['firstChild'];for(;_0xa130ec;)_0x58049c(_0xa130ec)&&(_0x1b0eb4['has'](ln(_0xa130ec,'data-id'))||rn('data-id',null,_0xa130ec)['some'](_0x261f13=>_0x1b0eb4['has'](ln(_0x261f13,'data-id'))))&&un(_0xa130ec,'data-unstable','true'),_0xa130ec=_0xa130ec['nextSibling'];}['_isNewNode'](_0x4978b2){return Boolean('new-element'===ln(_0x4978b2,'data-id'));}_isExistingNode(_0x19b79f){return Boolean((ln(_0x19b79f,'data-id')||'')['length']>0x0&&'new-element'!==ln(_0x19b79f,'data-id'));}_isExistingContentComment(_0x581ea1){return Boolean(_0x1800e7(_0x581ea1)&&sn(_0x581ea1)['match'](/\s*existing[\s*-](content|document)\s*/g));}};function $n(_0x14836e){return!!_0x14836e&&Boolean(_0x1800e7(_0x14836e)&&sn(_0x14836e)['match'](/removed[\s*-]data-id="[^"]+"/));}function Yn(_0x4aeb64){if(!_0x4aeb64)return null;if(_0x58049c(_0x4aeb64))return ln(_0x4aeb64,'data-id')??null;if(_0x1800e7(_0x4aeb64)){const _0x2be61f=sn(_0x4aeb64)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x2be61f&&_0x2be61f[0x1])return _0x2be61f[0x1];}return null;}function qn(_0xd21c93,_0x52aef4){const _0x46bfac=new Map();for(const _0x13d1f7 of on(_0xd21c93))hn(_0x13d1f7)||_0x46bfac['set'](ln(_0x13d1f7,'data-id'),_0x13d1f7);const _0x5d4abd=new Set();for(const _0x1fd9f of on(_0x52aef4)){if(hn(_0x1fd9f))continue;const _0x329cdd=ln(_0x1fd9f,'data-id'),_0x46c55d=_0x329cdd?_0x46bfac['get'](_0x329cdd):void 0x0;_0x46c55d?(_0x418ed2(_0x1fd9f,_0x950ff(_0x46c55d,!0x0)),_0x5d4abd['add'](_0x329cdd)):_0x15340f(_0x1fd9f);}for(const _0x5bfb72 of cn(_0x52aef4))$n(_0x5bfb72)&&_0x46bfac['has'](Yn(_0x5bfb72))&&_0x15340f(_0x5bfb72);const _0x218bfc=new Set(rn('data-id',null,_0x52aef4)['map'](_0x15b3de=>ln(_0x15b3de,'data-id')));for(const [_0x56b061,_0x3b512c]of _0x46bfac){if(_0x5d4abd['has'](_0x56b061))continue;let _0x261f8d=_0x3b512c['parent'],_0x37a9d2=null;for(;_0x261f8d&&_0x58049c(_0x261f8d);){const _0x7af257=ln(_0x261f8d,'data-id');if(_0x7af257&&_0x218bfc['has'](_0x7af257)){_0x37a9d2=_0x7af257;break;}_0x261f8d=_0x261f8d['parent'];}if(!_0x37a9d2)continue;const _0x11fc92=nn('data-id',_0x37a9d2,_0x52aef4);_0x11fc92&&_0x4e05c7(_0x11fc92,_0x950ff(_0x3b512c,!0x0));}}const Qn=/* #__PURE__ -- @preserve */
27
+ mt();var Xn=class extends Qn{_m2html;constructor(){super();const _0x49bccd=Object['entries'](_0x229e08),_0x35c5ac=_0x49bccd['findIndex'](([_0x29e1d0])=>'rehypeDomRaw'===_0x29e1d0);if(-0x1===_0x35c5ac)throw new dt('ai-response-parser-unable-to-set-up-parser');_0x49bccd['splice'](_0x35c5ac+0x1,0x0,['rehypeSanitize',_0x100e8b]),this['_m2html']=new _0x329971({'plugins':Object['fromEntries'](_0x49bccd)});}convertMarkdownToHTML(_0x56895f){const _0x524fb5=this['_m2html']['parse'](_0x56895f);return this['parseAndNormalizeHTML'](_0x524fb5);}['parseAndNormalizeHTML'](_0x181254){return this['_parseHTML'](_0x181254);}['_parseHTML'](_0x3caf64){const _0x3eb3a6=en('<dummy>'+_0x3caf64['replace'](/<[^>]*?$/g,'')+'</dummy>');return zn(_0x3eb3a6),_0x3eb3a6['children']=_0x3eb3a6['children'][0x0]['children'],_0x3eb3a6;}};function zn(_0x1f1075){for(const _0xa688f9 of _0x1f1075['children'])_0x58049c(_0xa688f9)?'pre'!==_0xa688f9['name']&&zn(_0xa688f9):_0x4f3ed2(_0xa688f9)&&(_0xa688f9['data']=_0xa688f9['data']['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/[ \t\r\f\v]+/g,'\x20'));}function jn(_0x2c1726,_0x371244){for(const _0x68e72c of _0x2c1726)'noop'!==_0x68e72c['type']&&(_0x68e72c['_aiSource']=_0x371244);}var Jn=class extends _0x4cd5fc{static get['pluginName'](){return'AIGateway';}static get requires(){return[Un,Js];}get['models'](){return this['context']['plugins']['get'](Js)['models'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['apply'](_0x2131df,_0x17a15){const {applyMethod:_0x161f9a,roots:_0xc02351}=_0x17a15,_0x8093bf='suggest'===_0x161f9a;if(_0x2131df['error']||!_0x2131df['results']['length'])throw new dt('ai-gateway-apply-invalid-status',this,{'status':_0x2131df['status']});if(_0xc02351){if(0x0===_0xc02351['length'])throw new dt('ai-gateway-apply-empty-roots',this);for(const {channelId:_0x9525c1,rootName:_0x4df28c}of _0xc02351)if(!_0x2131df['results']['some'](_0x4429c7=>_0x4429c7['channelId']===_0x9525c1&&_0x4429c7['rootName']===_0x4df28c))throw new dt('ai-gateway-apply-root-not-found',this,{'channelId':_0x9525c1,'rootName':_0x4df28c});}const _0x35a1fd=_0x2131df['results']['reduce']((_0x2e5ac7,_0x5dc5be)=>{if(_0xc02351&&!_0xc02351['some'](_0x2aa25c=>_0x2aa25c['channelId']===_0x5dc5be['channelId']&&_0x2aa25c['rootName']===_0x5dc5be['rootName']))return _0x2e5ac7;if('completed'!==_0x5dc5be['status'])throw new dt('ai-gateway-apply-invalid-status',this,{'status':_0x5dc5be['status'],'channelId':_0x5dc5be['channelId'],'rootName':_0x5dc5be['rootName']});if(_0x8093bf&&!_0x5dc5be['editor']['plugins']['has']('TrackChanges'))throw new dt('ai-no-track-changes',this,{'channelId':_0x5dc5be['channelId'],'rootName':_0x5dc5be['rootName']});let _0x4afdf5=_0x2e5ac7['get'](_0x5dc5be['editor']);return _0x4afdf5||(_0x4afdf5=[],_0x2e5ac7['set'](_0x5dc5be['editor'],_0x4afdf5)),_0x4afdf5['push'](_0x5dc5be),_0x2e5ac7;},new Map()),_0x1b9794=this['context']['plugins']['get'](Un);for(const [_0x43167d,_0x373fd6]of _0x35a1fd){const _0x16ee84=_0x373fd6['map'](_0x42dd3d=>{const _0x293a2f=_0x43167d['model']['createPositionAt'](_0x43167d['model']['document']['getRoot'](_0x42dd3d['rootName']),0x0),_0x1bd9d6=Rn(_0x43167d,_0x42dd3d['rootName'],_0x42dd3d['contentRawOld'],_0x42dd3d['contentRawNew']);if(!_0x1bd9d6)return _0x42dd3d['droppedUnsupportedInlineChange']=!0x0,null;const _0x192198=_0x1b9794['getDiff'](_0x1bd9d6['before'],_0x1bd9d6['after'],{'anchor':_0x293a2f,'markDeletions':_0x8093bf,'targetEditor':_0x43167d}),_0x3fe00b=_0x43167d['model']['document']['history']['getOperations'](_0x42dd3d['documentVersion']),_0xe8a2e2={'document':_0x43167d['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x5660ca=_0x3e782f(_0x192198,_0x3fe00b,_0xe8a2e2)['operationsA'];return jn(_0x5660ca,_0x17a15['aiSource']??'api'),_0x5660ca;});_0x43167d['model']['change'](_0x3bb4e1=>{for(const _0x57f5be of _0x16ee84)_0x57f5be&&(_0x8093bf?_0x43167d['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x57f5be):_0x1b9794['applyOperations'](_0x3bb4e1,_0x57f5be));});}}mergeChangesIntoContent(_0x5610a5,_0x1bbdbf){const _0x48a9b2=new Xn(),_0x2937d7=new Kn();let _0x529711=_0x48a9b2['parseAndNormalizeHTML'](_0x1bbdbf);for(const _0x497189 of _0x5610a5)try{const _0x18177b=_0x48a9b2['parseAndNormalizeHTML'](_0x497189['content']);_0x529711=_0x2937d7['merge'](_0x18177b,_0x529711,{'cutAfterUnstable':!0x1,'replaceRemovedWith':void 0x0})['parsedContent'];}catch(_0x5c3823){throw new dt('ai-gateway-merge-failed',this,{..._0x497189},_0x5c3823);}return _0x529711;}};const Zn=/* #__PURE__ -- @preserve */
28
+ It(),tr=['capabilitiesUpdated'];var er=class extends Zn{['_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(_0x945945){const _0x4afa54={};if(!_0x945945)return _0x4afa54;('isWebSearchEnabled'in _0x945945?_0x945945['isWebSearchEnabled']:_0x945945['webSearch'])&&(_0x4afa54['webSearch']={});const _0x407f53='isReasoningEnabled'in _0x945945?_0x945945['isReasoningEnabled']:_0x945945['reasoning'];return _0x407f53&&(_0x4afa54['reasoning']='string'==typeof _0x407f53?{'level':_0x407f53}:{}),_0x4afa54;}toggleWebSearch(){this['setWebSearch'](!this['_isWebSearchEnabled']);}toggleReasoning(){this['setReasoning'](!this['_isReasoningEnabled']);}setWebSearch(_0x3a4601){_0x3a4601!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x3a4601,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}setReasoning(_0x547aa){_0x547aa!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x547aa,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}};const ir='defaultContextIds',sr=/* #__PURE__ -- @preserve */
29
+ mt();var nr=class AIContext extends sr{['_refs'];constructor(_0x78bf82=[]){super(),this['_refs']=[..._0x78bf82];}get['refs'](){return[...this['_refs']];}get isEmpty(){return 0x0===this['_refs']['length'];}cloneWith(..._0x11f268){return new AIContext([...this['_refs'],..._0x11f268]);}addDefaultContext(_0x50aadb){this['_refs']=[...this['_refs'],..._0x50aadb];}toRequestParts(_0x15f29f=[]){return[...this['toRequestContexts'](),..._0x15f29f];}toRequestContexts(){return this['_refs']['map'](_0x55ae7d=>({..._0x55ae7d,'type':'context'}));}toMessageAttributes(_0x21b1f5){return this['isEmpty']?_0x21b1f5:{..._0x21b1f5,[ir]:[...new Set(this['_refs']['map'](_0x291174=>_0x291174['id']))]};}static getDefaultContextIds(_0x3d102b){const _0x96180c=_0x3d102b&&_0x3d102b[ir];return new Set(Array['isArray'](_0x96180c)?_0x96180c:[]);}};function rr(_0x5ee8cc,_0x573af2,_0x1cdb04,_0x19a281){if(_0x5ee8cc instanceof dt)return _0x5ee8cc;const _0x5975db=_0x5ee8cc?.['data'],_0x10d93a=void 0x0!==_0x5975db?{..._0x19a281,'backendData':_0x5975db}:_0x19a281;return new dt(_0x573af2,_0x1cdb04,_0x10d93a,_0x5ee8cc);}var or=class{_editor;_rootName;['_channelId'];['_sessionId'];_documentVersion;_contentRawOld;_contentRawNew;['_error'];_isAborted=!0x1;_droppedUnsupportedInlineChange=!0x1;constructor(_0x459d63){this['_editor']=_0x459d63['editor'],this['_rootName']=_0x459d63['rootName'],this['_channelId']=_0x459d63['channelId'],this['_sessionId']=_0x459d63['sessionId'];}get status(){return this['_error']?'error':this['_isAborted']?'aborted':void 0x0!==this['_contentRawNew']?'completed':'initialized';}get editor(){return this['_editor'];}get rootName(){return this['_rootName'];}get['channelId'](){return this['_channelId'];}get['sessionId'](){return this['_sessionId'];}get documentVersion(){return this['_documentVersion'];}set documentVersion(_0x4ba82d){this['_documentVersion']=_0x4ba82d;}get contentRawOld(){return this['_contentRawOld'];}set contentRawOld(_0x12b8c3){this['_contentRawOld']=_0x12b8c3;}get contentRawNew(){return this['_contentRawNew'];}set contentRawNew(_0x5968c3){this['_contentRawNew']=_0x5968c3;}get contentOld(){return this['_dropDataIds'](this['_contentRawOld']||'');}get contentNew(){return this['_dropDataIds'](this['_contentRawNew']||'');}get['error'](){return this['_error'];}set['error'](_0x4758dd){this['_error']=_0x4758dd;}get droppedUnsupportedInlineChange(){return this['_droppedUnsupportedInlineChange'];}set droppedUnsupportedInlineChange(_0x437e5c){this['_droppedUnsupportedInlineChange']=_0x437e5c;}abort(){this['_isAborted']=!0x0;}_dropDataIds(_0x76b682){return _0x76b682['replace'](/ data-id="[a-z0-9]+"/g,'');}},ar=class extends or{['_summary']='';get['summary'](){return this['_summary'];}set['summary'](_0x4f4bbc){this['_summary']=_0x4f4bbc;}},hr=class{_results;constructor(_0x28f15e=[]){this['_results']=_0x28f15e;}_status='initialized';['_error'];abort(){'error'!==this['_status']&&(this['_status']='aborted');}get status(){return this['_status'];}set status(_0x4bde10){this['_status']=_0x4bde10;}get['error'](){return this['_error'];}set['error'](_0x40bcbc){this['_status']='error',this['_error']=_0x40bcbc;}get results(){return this['_results'];}addResult(..._0x3f64e5){this['_results']['push'](..._0x3f64e5);}},cr=class extends _0x4cd5fc{static get['pluginName'](){return'AIDocumentProcessingGateway';}static get requires(){return[$s,Pn,Jn,Js];}get['models'](){return this['context']['plugins']['get'](Js)['models'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async processDocument(_0x4787bb,_0x505ad6){if(!_0x4787bb)throw new dt('ai-documentprocessinggateway-missing-prompt',this);const _0x4fc6d5=await this['context']['plugins']['get'](Pn)['getDocumentData'](),_0x5546a7=_0x505ad6['roots'];if(0x0===(_0x5546a7??_0x4fc6d5)['length'])throw new dt('ai-documentprocessinggateway-empty-roots',this);if(_0x5546a7){for(const _0xaf1191 of _0x5546a7)if(!_0x4fc6d5['some'](_0x3be5c3=>_0x3be5c3['rootName']===_0xaf1191['rootName']&&_0x3be5c3['channelId']===_0xaf1191['channelId']))throw new dt('ai-documentprocessinggateway-root-not-found',this,{'channelId':_0xaf1191['channelId'],'rootName':_0xaf1191['rootName']});}const _0x2720b3=_0x5546a7?_0x4fc6d5['filter'](_0x1a239e=>_0x5546a7['some'](_0x41566a=>_0x41566a['rootName']===_0x1a239e['rootName']&&_0x41566a['channelId']===_0x1a239e['channelId'])):_0x4fc6d5,_0x4547b4=[],_0x2ed2ae=[];for(const _0x143352 of _0x2720b3){const _0xdc05ee={'editor':_0x143352['editor'],'rootName':_0x143352['rootName'],'sessionId':_0x143352['sessionId'],'channelId':_0x143352['channelId'],'contentRawOld':_0x143352['content'],'documentVersion':_0x143352['version']};_0x4547b4['push'](_0xdc05ee),_0x2ed2ae['push']({'type':'document','content':_0xdc05ee['contentRawOld']});}const _0x433bc1=this['context']['plugins']['get']('AIConnector')['processDocument']({'content':_0x2ed2ae,'prompt':_0x4787bb,'model':_0x505ad6['model'],'capabilities':er['getCapabilitiesRequestData'](_0x505ad6['capabilities']),'contexts':new nr(_0x505ad6['contexts'])['toRequestContexts']()});let _0xa225f0;if(_0x505ad6?.['signal']){_0x505ad6['signal']['aborted']&&_0x433bc1['abortController']['abort']();const _0x35ef7f=_0x505ad6['signal'],_0x3d193e=()=>_0x433bc1['abortController']['abort']();_0x35ef7f['addEventListener']('abort',_0x3d193e),_0xa225f0=()=>_0x35ef7f['removeEventListener']('abort',_0x3d193e);}const _0xaed141=new hr();let _0x5da672=[];try{if(_0x5da672=(await _0x433bc1['getResult']())['documents'],!(_0x5da672&&_0x5da672['length']>0x0))throw new dt('ai-documentprocessinggateway-empty-reply',this);if(_0x5da672['length']!==_0x2ed2ae['length'])throw new dt('ai-documentprocessinggateway-reply-count-mismatch',this,{'expected':_0x2ed2ae['length'],'received':_0x5da672['length']});const _0x57b5fd=_0x5da672['findIndex'](({document:_0x59406d})=>!_0x59406d['length']);if(-0x1!==_0x57b5fd){const _0x2208cf=_0x4547b4[_0x57b5fd];throw new dt('ai-documentprocessinggateway-empty-root-content',this,{'channelId':_0x2208cf['channelId'],'rootName':_0x2208cf['rootName']});}_0xaed141['status']='completed';}catch(_0x6f3e87){_0x6f3e87 instanceof Error&&_0x6f3e87['message']['includes']('ai-request-aborted')?_0xaed141['abort']():_0xaed141['error']=rr(_0x6f3e87,'ai-documentprocessinggateway-run-failed',this);}finally{_0xa225f0&&_0xa225f0();}if('completed'===_0xaed141['status'])for(const [_0x370421,_0x3e5131]of _0x4547b4['entries']()){const {channelId:_0x1d73af,contentRawOld:_0x53b351,documentVersion:_0x1d800a,editor:_0x5e0aba,rootName:_0x2ec147,sessionId:_0x57c5da}=_0x3e5131,_0x3034fb=new ar({'channelId':_0x1d73af,'editor':_0x5e0aba,'rootName':_0x2ec147,'sessionId':_0x57c5da});_0x3034fb['contentRawOld']=_0x53b351,_0x3034fb['documentVersion']=_0x1d800a,_0x3034fb['contentRawNew']=_0x5da672[_0x370421]['document'],_0x3034fb['summary']=_0x5da672[_0x370421]['summary'],_0xaed141['addResult'](_0x3034fb);}return _0xaed141;}applyResult(_0x5e2a19,_0x1f22d1){this['context']['plugins']['get']('AIGateway')['apply'](_0x5e2a19,_0x1f22d1);}};function lr(_0x1ea9a1){return _0x1ea9a1 instanceof Error&&('AbortError'===_0x1ea9a1['name']||('AICoreError'===_0x1ea9a1['name']?!0x0===_0x1ea9a1['isAbort']:_0x1ea9a1['message']['startsWith']('ai-request-aborted')));}var ur=class extends Error{['code'];severity;type;context;isAbort;constructor(_0x3e0c1a){super(_0x3e0c1a['code'],_0x3e0c1a['cause']instanceof Error?{'cause':_0x3e0c1a['cause']}:void 0x0),this['name']='AICoreError',this['code']=_0x3e0c1a['code'],this['severity']=_0x3e0c1a['severity']??'error',this['type']=_0x3e0c1a['type']??'system',this['context']=_0x3e0c1a['context'],this['isAbort']=_0x3e0c1a['isAbort']??lr(_0x3e0c1a['cause']);}},dr=class extends _0x4cd5fc{static get['pluginName'](){return'AIErrorSink';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}createReporter(_0x3aa071){return new _r(this,_0x3aa071);}},_r=class{['_sink'];_component;constructor(_0x8099f,_0x103ec4){this['_sink']=_0x8099f,this['_component']=_0x103ec4;}['logError'](_0x562386,_0x3f94e5={}){this['_emit'](_0x562386,_0x3f94e5),this['_defaultLog'](_0x562386);}reportError(_0x54d27b,_0x481071={}){this['_emit'](_0x54d27b,_0x481071);}_emit(_0x14efd4,_0x3ba6fc){if(lr(_0x14efd4))return;const _0x4ec140=_0x14efd4 instanceof ur?_0x14efd4:void 0x0,_0x18961c=_0x4ec140?.['context']||_0x3ba6fc['context']?{..._0x4ec140?.['context'],..._0x3ba6fc['context']}:void 0x0;this['_sink']['fire']('error',{'error':_0x14efd4,'component':this['_component'],'code':_0x4ec140?.['code'],'type':_0x4ec140?.['type'],'severity':_0x4ec140?.['severity'],'context':_0x18961c});}_defaultLog(_0x3d23a0){if(!lr(_0x3d23a0)){if(_0x3d23a0 instanceof ur){if('user'===_0x3d23a0['type']||'network'===_0x3d23a0['type'])return;if('warning'===_0x3d23a0['severity'])return void console['warn'](this['_component'],_0x3d23a0);}console['error'](this['_component'],_0x3d23a0);}}};const gr='ck-ai-button-primary\x20ck-button-action',Ir='ck-ai-button-secondary\x20ck-button_outline',Ar='ck-ai-button-tertiary',Er='ck-ai-button-surface\x20ck-button_surface',pr='ck-button_small',mr='ck-button_standard';function Tr(_0x431c29,_0x408f2b){const _0x24a314=new _0x1a9216(_0x431c29),_0x5e41ee=qs(_0x431c29,'AI_TABS_LABEL_MINIMIZE'),_0x4d581a=qs(_0x431c29,'AI_TABS_LABEL_MAXIMIZE');return _0x24a314['set']({'withText':!0x1,'icon':_0x1ab7e1,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-button_small\x20'+Ar}),_0x24a314['bind']('label')['to'](_0x408f2b,'isMaximized',_0x43a630=>_0x43a630?_0x5e41ee:_0x4d581a),_0x24a314['bind']('icon')['to'](_0x408f2b,'isMaximized',_0x2c9bf9=>_0x2c9bf9?_0x2a01f5:_0x1ab7e1),_0x24a314['bind']('isOn')['to'](_0x408f2b,'isMaximized'),_0x24a314['on']('execute',()=>{_0x408f2b['fire']('resizeTabs');}),_0x24a314;}function wr({changeGroups:_0xa8d11a,documentContextContent:_0x2abb71,showDiff:_0x235649,trimUnchanged:_0x1e341d=!0x0}){const _0x97f25a=fn(_0xa8d11a,_0x2abb71);return _0xa8d11a['map'](_0x2990cf=>{if(!_0x2990cf['editor']||'destroyed'===_0x2990cf['editor']['state'])return null;const _0x5a2487=En(_0x2990cf['editor'],_0x2990cf['rootName']),_0x4038b7=new _0x47233a([]),_0x564e46=new _0x47233a([]),_0xa98cf9=new Set();for(const _0x20100f of _0x2990cf['changes'])'new'==_0x20100f['type']&&rn('data-id',null,_0x20100f['node'])['forEach'](_0x3bb26e=>{_0xa98cf9['add'](ln(_0x3bb26e,'data-id'));});for(const _0x19aa43 of _0x2990cf['changes'])if('removed'!=_0x19aa43['type']?_0x564e46['children']['push'](_0x19aa43['node']['cloneNode'](!0x0)):_0x235649||_0xa98cf9['has'](_0x19aa43['id'])||_0x564e46['children']['push'](_0x19aa43['node']['cloneNode'](!0x0)),'new'!=_0x19aa43['type']&&(_0x235649||'removed'!=_0x19aa43['type'])){const _0x1f2596=_0x1b0303(_0x155487=>ln(_0x155487,'data-id')==_0x19aa43['id'],_0x2abb71['get'](_0x2990cf['documentId']),!0x0);_0x1f2596&&_0x4038b7['children']['push'](_0x1f2596['cloneNode'](!0x0));}if(_0x5a2487&&_0x97f25a['has'](_0x2990cf['index']))return{'type':_0x2990cf['changes'][0x0]['type'],'index':_0x2990cf['index'],'state':_0x2990cf['state'],'outdatedReason':_0x2990cf['outdatedReason'],'content':new _0x47233a([]),'hasChanges':!0x1};let _0x3ec419,_0x1017bc,_0x27bcc6;try{({content:_0x3ec419,hasChanges:_0x1017bc}=function(_0x2ba8a0,_0x12c8e9,_0xbb4276,_0x5761fe,_0x1a05a8=!0x0){const _0x4e45cc=_0x2ba8a0['plugins']['get']('DocumentChanges'),_0x5e5725=sn(_0x12c8e9),_0x18a1b4=sn(_0xbb4276),_0x190525=_0x2ba8a0['data']['parse'](_0x5e5725,'$root'),_0x3feb2e=_0x2ba8a0['model']['createPositionAt'](_0x190525,0x0),_0x771e03=_0x4e45cc['getDiff'](_0x5e5725,_0x18a1b4,{'anchor':_0x3feb2e,'markDeletions':_0x5761fe,'targetEditor':_0x2ba8a0});if(0x0==_0x771e03['length'])return{'content':_0x12c8e9['cloneNode'](!0x0),'hasChanges':!0x1};_0x5761fe?function(_0x4146e2,_0xd3be79,_0x72e184){if(0x0==_0x4146e2['length'])return;const _0x565aed=_0x72e184['plugins']['get']('DocumentChanges'),_0x650b5=_0x72e184['plugins']['get']('SuggestionsConversion');_0x72e184['model']['change'](_0x3afc04=>{const _0x39ec27=new Set();for(let _0x3e33c5=0x0;_0x3e33c5<_0x4146e2['length'];_0x3e33c5++){const _0x4150f6=_0x4146e2[_0x3e33c5];if(_0x4150f6['baseVersion']=null,_0x4150f6['isDocumentOperation']=!0x1,!_0x3463ba(_0x4150f6)){if(_0x565aed['isMarkedRemoveOperation'](_0x4150f6)){const _0x5151e0=_0x236d37(_0x4150f6['newRange'],_0x72e184['model']),_0x45624a='suggestion:deletion:'+Xt()+':$aiSuggestion';_0xd3be79['markers']['set'](_0x45624a,_0x5151e0);}else switch(_0x4150f6['type']){case'rename':{if(_0x4150f6['oldName']==_0x4150f6['newName'])break;_0x3afc04['batch']['addOperation'](_0x4150f6),_0x72e184['model']['applyOperation'](_0x4150f6);const _0x193d4d='$elementName',_0x4860b7=_0x4150f6['position'],_0x264958=_0x72e184['model']['createRange'](_0x4860b7,_0x72e184['model']['createPositionAt'](_0x4860b7['nodeAfter'],'end')),_0xe79d12='suggestion:attribute:'+_0x193d4d+':'+Xt()+':$aiSuggestion';_0xd3be79['markers']['set'](_0xe79d12,_0x264958);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x4150f6['oldValue']==_0x4150f6['newValue'])break;_0x3afc04['batch']['addOperation'](_0x4150f6),_0x72e184['model']['applyOperation'](_0x4150f6);const _0x484460=_0x4150f6['key'];if(!_0x650b5['isRegisteredAttribute'](_0x484460))break;const _0x1b1c13=_0x236d37(_0x4150f6['range'],_0x72e184['model']),_0x1e56ea='suggestion:attribute:'+_0x484460+':'+Xt()+':$aiSuggestion';_0xd3be79['markers']['set'](_0x1e56ea,_0x1b1c13);break;}case'insert':{if(_0x3afc04['batch']['addOperation'](_0x4150f6),_0x72e184['model']['applyOperation'](_0x4150f6),Cr(_0xd3be79,_0x4150f6),_0x4146e2[_0x3e33c5+0x1]&&'move'==_0x4146e2[_0x3e33c5+0x1]['type'])break;const _0x361b11=_0x4150f6['position'],_0x2e575b=_0x4150f6['howMany'],_0x1919de=_0x236d37(_0x72e184['model']['createRange'](_0x361b11,_0x361b11['getShiftedBy'](_0x2e575b)),_0x72e184['model']),_0x1e509b='suggestion:insertion:'+Xt()+':$aiSuggestion';_0xd3be79['markers']['set'](_0x1e509b,_0x1919de);break;}case'split':{_0x3afc04['batch']['addOperation'](_0x4150f6),_0x72e184['model']['applyOperation'](_0x4150f6),Cr(_0xd3be79,_0x4150f6);const _0x309250=_0x4150f6['splitPosition'],_0x6ead04=_0x4150f6['moveTargetPosition'],_0xfa4b47=_0x72e184['model']['createRange'](_0x309250,_0x6ead04),_0x423921='suggestion:insertion:'+Xt()+':$aiSuggestion';_0xd3be79['markers']['set'](_0x423921,_0xfa4b47);break;}case'move':{_0x3afc04['batch']['addOperation'](_0x4150f6),_0x72e184['model']['applyOperation'](_0x4150f6),Cr(_0xd3be79,_0x4150f6);const _0x2a49dd=_0x4150f6['getMovedRangeStart'](),_0x8a4ca0=_0x4150f6['howMany'];for(let _0x28a63f=0x0;_0x28a63f<_0x8a4ca0;_0x28a63f++){const _0x308374=_0x2a49dd['getShiftedBy'](_0x28a63f)['nodeAfter'];_0x39ec27['add'](_0x308374);}break;}case'remove':{const _0x2927f2=_0x4150f6['sourcePosition'],_0x38161b=_0x4150f6['howMany'],_0x52aaab=new _0x500e5d(_0x2927f2,_0x38161b);_0x3afc04['batch']['addOperation'](_0x52aaab),_0x72e184['model']['applyOperation'](_0x52aaab),Cr(_0xd3be79,_0x4150f6);break;}}}}for(const _0x23d7ff of _0x39ec27){const _0x3edf23=_0x72e184['model']['createRangeOn'](_0x23d7ff),_0x572e34='suggestion:formatBlock:$fakeWrap:'+Xt()+':$aiSuggestion';_0xd3be79['markers']['set'](_0x572e34,_0x236d37(_0x3edf23,_0x72e184['model']));}});}(_0x771e03,_0x190525,_0x2ba8a0):_0x2ba8a0['model']['change'](_0xbae5fe=>{for(const _0x28a8f6 of _0x771e03)if(!_0x3463ba(_0x28a8f6)){if('remove'==_0x28a8f6['type']){const _0x5f1190=_0x28a8f6['sourcePosition'],_0x53549d=_0x28a8f6['howMany'],_0x556806=new _0x500e5d(_0x5f1190,_0x53549d);_0xbae5fe['batch']['addOperation'](_0x556806),_0x2ba8a0['model']['applyOperation'](_0x556806),Cr(_0x190525,_0x28a8f6);}else{if('marker'==_0x28a8f6['type']){const _0x18eea4=_0x28a8f6['name'],_0x4901a4=_0x28a8f6['newRange'];null!==_0x4901a4?_0x190525['markers']['set'](_0x18eea4,_0x4901a4):_0x190525['markers']['delete'](_0x18eea4);}else _0x28a8f6['baseVersion']=null,_0x28a8f6['isDocumentOperation']=!0x1,_0xbae5fe['batch']['addOperation'](_0x28a8f6),_0x2ba8a0['model']['applyOperation'](_0x28a8f6),Cr(_0x190525,_0x28a8f6);}}});if(_0x1a05a8){const _0x3cdd1d=fr(_0x2ba8a0,_0x771e03,_0x190525);br(_0x2ba8a0['model'],_0x3cdd1d),function(_0x116255,_0x56e1fa){const _0x374fa8=_0x56e1fa['getFirstRange']()['start'];let _0x4e15e2=_0x56e1fa['getFirstRange']()['end'];const _0x59c894=_0x374fa8['root'];(_0x4e15e2['textNode']||_0x4e15e2['nodeAfter']&&_0x4e15e2['nodeAfter']['is']('$text'))&&(_0x53f0c6(_0x4e15e2,'...'),vr(_0x59c894,_0x4e15e2,0x3),_0x4e15e2=_0x4e15e2['getShiftedBy'](0x3)),(_0x374fa8['textNode']||_0x374fa8['nodeBefore']&&_0x374fa8['nodeBefore']['is']('$text'))&&(_0x53f0c6(_0x374fa8,'...'),vr(_0x59c894,_0x374fa8,0x3),_0x374fa8['parent']==_0x4e15e2['parent']&&(_0x4e15e2=_0x4e15e2['getShiftedBy'](0x3)));const _0x1cc394=_0x116255['createRange'](_0x116255['createPositionAt'](_0x59c894,0x0),_0x374fa8),_0x36739e=_0x116255['createRange'](_0x4e15e2,_0x116255['createPositionAt'](_0x59c894,'end')),_0x41fc50=[..._0x1cc394['getMinimalFlatRanges'](),..._0x36739e['getMinimalFlatRanges']()];_0x41fc50['reverse']();for(const _0x4f4b02 of _0x41fc50)_0x3922ec(_0x4f4b02),Or(_0x59c894,_0x4f4b02);}(_0x2ba8a0['model'],_0x3cdd1d);}return{'content':en(_0x2ba8a0['data']['stringify'](_0x190525,{'showSuggestionHighlights':!0x0})),'hasChanges':!0x0};}(_0x2990cf['editor'],_0x4038b7,_0x564e46,_0x235649,_0x1e341d));}catch{return{'type':_0x2990cf['changes'][0x0]['type'],'index':_0x2990cf['index'],'state':_0x2990cf['state'],'outdatedReason':_0x2990cf['outdatedReason'],'content':new _0x47233a([]),'hasChanges':!0x1};}if(_0x5a2487){_0x27bcc6=_0x2990cf['editor']['ui']['getEditableElement'](_0x2990cf['rootName'])?.['tagName']['toLowerCase']();const _0x483f14=_0x3ec419['children']['filter'](_0x58049c);0x1===_0x483f14['length']&&(_0x3ec419=new _0x47233a(_0x483f14[0x0]['children']));}return{'type':_0x2990cf['changes'][0x0]['type'],'index':_0x2990cf['index'],'state':_0x2990cf['state'],'outdatedReason':_0x2990cf['outdatedReason'],'content':_0x3ec419,'hasChanges':_0x1017bc,'wrapperTag':_0x27bcc6};})['filter'](_0x2a0494=>null!==_0x2a0494);}function Cr(_0x1a8271,_0x309eed){for(const [_0x33b293,_0x16342a]of _0x1a8271['markers']){const _0x120fe9=_0x3aaa22['_createFromRanges'](_0x16342a['getTransformedByOperation'](_0x309eed));_0x120fe9['root']==_0x1a8271?_0x1a8271['markers']['set'](_0x33b293,_0x120fe9):_0x1a8271['markers']['delete'](_0x33b293);}}function fr(_0x38ca29,_0x4e33d2,_0x208ebf){const _0x109373=_0x38ca29['plugins']['get']('DocumentChanges');let _0x2756b3=_0x38ca29['model']['createPositionAt'](_0x208ebf,Number['POSITIVE_INFINITY']),_0x2f816e=_0x38ca29['model']['createPositionAt'](_0x208ebf,0x0);for(const _0x1f4291 of _0x4e33d2){let _0x198865,_0x2f6eab;if(_0x109373['isMarkedRemoveOperation'](_0x1f4291))_0x198865=_0x1f4291['newRange']['start'],_0x2f6eab=_0x1f4291['newRange']['end'];else switch(_0x2756b3=Rr(_0x2756b3,_0x1f4291),_0x2f816e=Rr(_0x2f816e,_0x1f4291),_0x1f4291['type']){case'rename':_0x198865=_0x1f4291['position'],_0x2f6eab=_0x198865['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x198865=_0x1f4291['range']['start'],_0x2f6eab=_0x1f4291['range']['end'];break;case'insert':_0x198865=_0x1f4291['position'],_0x2f6eab=_0x198865['getShiftedBy'](_0x1f4291['howMany']);break;case'split':_0x198865=_0x1f4291['splitPosition'],_0x2f6eab=_0x1f4291['moveTargetPosition'];break;case'merge':{const _0x53bc31=_0x1f4291['targetPosition']['path']['slice'](0x0,-0x1);_0x198865=_0x38ca29['model']['createPositionFromPath'](_0x208ebf,_0x53bc31),_0x2f6eab=_0x198865['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x1d0154=_0x1f4291['howMany'],_0xb3b9b0=_0x1f4291['sourcePosition']['_getTransformedByInsertion'](_0x1f4291['targetPosition'],_0x1d0154),_0xd5ff3c=_0x1f4291['getMovedRangeStart']();'remove'==_0x1f4291['type']?(_0x198865=_0xb3b9b0,_0x2f6eab=_0xb3b9b0):(_0x198865=_0xd5ff3c,_0x2f6eab=_0xd5ff3c['getShiftedBy'](_0x1d0154));break;}}_0x198865&&_0x198865['isBefore'](_0x2756b3)&&(_0x2756b3=_0x198865['clone'](),_0x2756b3['stickiness']='toNone'),_0x2f6eab&&_0x2f6eab['isAfter'](_0x2f816e)&&(_0x2f816e=_0x2f6eab['clone'](),_0x2f816e['stickiness']='toNone');}return _0x38ca29['model']['createSelection'](_0x38ca29['model']['createRange'](_0x2756b3,_0x2f816e));}function Rr(_0x4a1c14,_0x2a79bd){return'move'!=_0x2a79bd['type']&&'remove'!=_0x2a79bd['type']||_0x2a79bd['sourceRange']['containsPosition'](_0x4a1c14)&&((_0x4a1c14=_0x2a79bd['sourcePosition']['clone']())['stickiness']='toNone'),_0x4a1c14['getTransformedByOperation'](_0x2a79bd);}function br(_0x51b7f3,_0x4ac6c6){Sr(_0x51b7f3,_0x4ac6c6,'forward');const _0x5c5ad9=_0x4ac6c6['getFirstRange']();_0x4ac6c6['setTo']([]),_0x4ac6c6['setTo'](_0x5c5ad9,{'backward':!0x0}),Sr(_0x51b7f3,_0x4ac6c6,'backward');}function Sr(_0xa7cc96,_0x3e8b88,_0x2776ce){let _0x8379c7=0x14;for(;_0x8379c7;){_0xa7cc96['modifySelection'](_0x3e8b88,{'unit':'word','direction':_0x2776ce}),_0x8379c7--;const _0x3c1d02=_0x3e8b88['focus']['forward'==_0x2776ce?'nodeBefore':'nodeAfter'];if(_0x3c1d02&&_0x3c1d02['is']('element')&&_0xa7cc96['schema']['isBlock'](_0x3c1d02)&&_0xa7cc96['schema']['isObject'](_0x3c1d02))break;}}function Or(_0x557fd7,_0x3b1de2){for(const [_0x4d31c7,_0x4564f2]of _0x557fd7['markers']){const _0x518eed=_0x4564f2['_getTransformedByDeletion'](_0x3b1de2['start'],_0x3b1de2['end']['offset']-_0x3b1de2['start']['offset']);null!=_0x518eed?_0x557fd7['markers']['set'](_0x4d31c7,_0x518eed):_0x557fd7['markers']['delete'](_0x4d31c7);}}function vr(_0x131d02,_0x1257a6,_0x4beaf7){for(let [_0x382c39,_0x9dea40]of _0x131d02['markers'])_0x9dea40=_0x9dea40['_getTransformedByInsertion'](_0x1257a6,_0x4beaf7,!0x1)[0x0],_0x131d02['markers']['set'](_0x382c39,_0x9dea40);}const yr=/* #__PURE__ -- @preserve */
30
+ mt();var Nr=class extends yr{['id'];interactionId;type;content=new Map();['sources']=[];parsedContent=new Map();parsedMergedContent=new Map();['changeGroups']=[];areActionsDisabled=!0x1;_outdatedReasonByDocumentId;isFromHistory=!0x1;documentContextContent;_documentIdToSource=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];cachedSuggestionContentParts={'withDiff':[],'withoutDiff':[]};constructor({type:_0x4471d3,isDone:_0x1d869d=!0x1,isComplete:_0x6bb5e7,interactionId:_0x488b2a,areActionsDisabled:_0x15e368,outdatedReasonByDocumentId:_0x189c9b,isFromHistory:_0x5ca517=!0x1,documentContextContent:_0x3739fc,locale:_0x415d47,id:_0x79b79,channelsToEditors:_0x2a03a9}){super(),this['id']=_0x79b79||Xt(),this['interactionId']=_0x488b2a,this['type']=_0x4471d3,this['areActionsDisabled']=!!_0x15e368,this['_outdatedReasonByDocumentId']=_0x189c9b,this['isFromHistory']=_0x5ca517,this['locale']=_0x415d47,this['aiResponseParser']=new Xn(),this['aiResponseApplier']=new Kn(),this['documentContextContent']=new Map(_0x3739fc?.['map'](_0x52f343=>[_0x52f343['id'],en(_0x52f343['content'])])||[]),this['_documentIdToSource']=new Map(_0x3739fc?.['map'](_0x17c5fb=>[_0x17c5fb['id'],{'editor':_0x2a03a9['get'](_0x17c5fb['channelId']),'rootName':_0x17c5fb['rootName']}])||[]),this['set']('isDone',_0x1d869d),this['set']('isComplete',_0x6bb5e7??_0x1d869d),'text'===this['type']&&this['content']['set']('text','');}appendContent(_0x29fd20,_0x179a96){const _0x39f769='text'===this['type']?'text':_0x179a96;this['content']['has'](_0x39f769)||this['content']['set'](_0x39f769,''),this['content']['set'](_0x39f769,this['content']['get'](_0x39f769)+_0x29fd20),this['onContentChange'](_0x39f769);}['done'](_0x3a7dea=!0x0){this['isComplete']=_0x3a7dea,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}destroy(){this['stopListening']();}setChangeGroupState(_0x220a3a,_0x3a94c5,_0x3ca92d){this['changeGroups'][_0x220a3a]['state']=_0x3a94c5,this['changeGroups'][_0x220a3a]['outdatedReason']=_0x3ca92d,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x220a3a,'state':_0x3a94c5,'outdatedReason':_0x3ca92d});}getContentParts({showDiff:_0x361a56,groupIndex:_0x3acc51}){const _0x2b7da8=this['_getCachedContentParts'](_0x361a56,_0x3acc51);if(_0x2b7da8)return _0x2b7da8;let _0x4fbe76;if(void 0x0===_0x3acc51)_0x4fbe76=this['changeGroups'];else{const _0x3e310e=this['changeGroups']['find'](({index:_0xb4aef9})=>_0xb4aef9===_0x3acc51);if(!_0x3e310e)throw new dt('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x3acc51});_0x4fbe76=[_0x3e310e];}const _0x21049c=wr({'showDiff':_0x361a56,'changeGroups':_0x4fbe76,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x361a56,_0x21049c),_0x21049c;}_getCachedContentParts(_0x592099,_0x17ac4a){const _0x5d6f59=_0x592099?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x5d6f59]['length'])return null;const _0x373e7b=this['cachedSuggestionContentParts'][_0x5d6f59];if(void 0x0===_0x17ac4a)return _0x373e7b['length']>0x0&&_0x373e7b['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x592099,null),null):_0x30d267(_0x373e7b);{const _0x5711ee=_0x373e7b['find'](({index:_0x425a7b})=>_0x425a7b===_0x17ac4a);if(_0x5711ee)return[_0x30d267(_0x5711ee)];}return null;}_setCachedContentParts(_0x1cd92e,_0x368df9){const _0x1cb0b5=_0x1cd92e?'withDiff':'withoutDiff';_0x368df9?_0x368df9['forEach'](_0x472ae7=>{const _0x4dde26=this['cachedSuggestionContentParts'][_0x1cb0b5],_0x5b7e06=_0x4dde26['find'](({index:_0x5d077a})=>_0x5d077a===_0x472ae7['index']);if(_0x5b7e06){const _0x3888ed=_0x4dde26['indexOf'](_0x5b7e06);_0x4dde26['splice'](_0x3888ed,0x1,_0x472ae7);}else _0x4dde26['push'](_0x472ae7);}):this['cachedSuggestionContentParts'][_0x1cb0b5]['length']=0x0;}onContentChange(_0x33063b){if('modification'===this['type']){if(_0x33063b)this['parsedContent']['set'](_0x33063b,this['aiResponseParser']['parseAndNormalizeHTML'](this['content']['get'](_0x33063b)));else{for(const [_0x2ff1e7,_0x5a2301]of this['content'])this['parsedContent']['set'](_0x2ff1e7,this['aiResponseParser']['parseAndNormalizeHTML'](_0x5a2301));}const _0x311d5a=this['changeGroups'];for(const _0x2c3747 of this['content']['keys']())this['updateChangeGroups'](_0x2c3747);const _0x42f446=this['_getDifferentChangeGroups'](_0x311d5a,this['changeGroups']);(_0x42f446['length']||this['isDone'])&&(this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0,this['fire']('replyContentUpdated',this,_0x42f446));}else this['parsedContent']['set']('text',this['aiResponseParser']['convertMarkdownToHTML'](this['content']['get']('text'))),this['fire']('replyContentUpdated',this);}_getDifferentChangeGroups(_0x1d688b,_0x3bae79){const _0xd922f3=[];for(const _0x30510a of _0x3bae79){const _0x2352e4=_0x1d688b[_0x30510a['index']];_0x2352e4?_0x2352e4['changes']['length']!==_0x30510a['changes']['length']?_0xd922f3['push'](_0x30510a):_0x2352e4['changes']['forEach']((_0x5cd5f5,_0x1a2622)=>{const _0x3366d6=_0x30510a['changes'][_0x1a2622];_0x5cd5f5['id']!==_0x3366d6['id']&&_0xd922f3['push'](_0x30510a);}):_0xd922f3['push'](_0x30510a);}return _0xd922f3;}updateChangeGroups(_0x22c474){const _0x464ce8=this['documentContextContent']['get'](_0x22c474),_0x10caff=this['parsedContent']['get'](_0x22c474);if(!_0x464ce8||!_0x10caff)return;const _0x46c8e5=new _0x3cf04b('p',{},[new _0x3cf04b('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x3978f9(qs(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x59b904=this['aiResponseApplier']['merge'](_0x10caff,_0x464ce8['cloneNode'](!0x0),{'cutAfterUnstable':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x46c8e5});this['parsedMergedContent']['set'](_0x22c474,_0x59b904['parsedContent']);let _0x184c8f=[];if(_0x457f76(_0x246abd=>{const _0x1f5075=ln(_0x246abd,'data-id');if(!_0x1f5075||!_0x19f650(_0x1f5075))return!0x1;const _0x27ac35=[_0x246abd,..._n(_0x246abd)]['at'](-0x2);if(_0x246abd!=_0x27ac35){const _0x1578e3=ln(_0x27ac35,'data-id');_0x19f650(_0x1578e3)||(_0x184c8f['push']({'node':_0x27ac35,'id':_0x1578e3,'type':'modified'}),_0x59b904['modifiedNodeIds']['push'](_0x1578e3));}else _0x59b904['modifiedNodeIds']['includes'](_0x1f5075)?_0x184c8f['push']({'node':_0x246abd,'type':'modified','id':_0x1f5075}):_0x59b904['newNodeIds']['includes'](_0x1f5075)?_0x184c8f['push']({'node':_0x246abd,'type':'new','id':_0x1f5075,'anchorId':ln(_0x246abd['previousSibling'],'data-id')}):_0x184c8f['push']({'node':_0x246abd,'type':'removed','id':_0x1f5075});return!0x0;},this['parsedMergedContent']['get'](_0x22c474)),_0x184c8f=_0x184c8f['filter'](({node:_0x5eb792})=>[..._n(_0x5eb792),_0x5eb792]['every'](_0x5667b3=>!ln(_0x5667b3,'data-unstable'))),this['changeGroups']=this['changeGroups']['filter'](_0x3c5097=>_0x3c5097['documentId']!==_0x22c474),0x0==_0x184c8f['length'])return;const _0x2cfbad=[[_0x184c8f[0x0]]];for(let _0x2679c4=0x1;_0x2679c4<_0x184c8f['length'];_0x2679c4++){const _0x486312=_0x2cfbad[_0x2cfbad['length']-0x1],_0x268e6b=_0x486312[_0x486312['length']-0x1];_0x184c8f[_0x2679c4]['node']['previousSibling']==_0x268e6b['node']&&'modified'!=_0x184c8f[_0x2679c4]['type']&&'modified'!=_0x268e6b['type']?_0x486312['push'](_0x184c8f[_0x2679c4]):_0x2cfbad['push']([_0x184c8f[_0x2679c4]]);}for(const _0x268ef4 of _0x2cfbad){const _0x5a5d44=_0x268ef4[0x0],_0x1907d6=_0x268ef4[_0x268ef4['length']-0x1],_0x443251=_0x2a72a2(_0x5a5d44['node']['previousSibling']);_0x443251&&_0x268ef4['unshift'](_0x443251);const _0x487b85=_0x2a72a2(_0x1907d6['node']['nextSibling']);_0x487b85&&_0x268ef4['push'](_0x487b85);}rn('data-wrapped-id',null,this['parsedMergedContent']['get'](_0x22c474))['forEach'](_0x3bbde8=>{un(_0x3bbde8,'data-wrapped-id',null);});const _0x1ae64b=new Map();rn('data-unwrapped-id',null,this['parsedMergedContent']['get'](_0x22c474))['forEach'](_0xc6c415=>{const _0x508a88=ln(_0xc6c415,'data-unwrapped-id'),_0x1173f0=ln(_0xc6c415,'data-id');_0x1ae64b['set'](_0x1173f0,_0x508a88),un(_0xc6c415,'data-id',_0x508a88),un(_0xc6c415,'data-unwrapped-id',null);});for(const _0x5b0107 of _0x184c8f){const _0x26fd5e=_0x1ae64b['get'](_0x5b0107['id']);_0x26fd5e&&(_0x5b0107['id']=_0x26fd5e);}this['changeGroups']['push'](..._0x2cfbad['map']((_0x2e8343,_0x3d86fe)=>{const _0xe23994=this['_documentIdToSource']['get'](_0x22c474),_0x1820ff=this['_outdatedReasonByDocumentId']?.['get'](_0x22c474),_0xa39959=this['areActionsDisabled']||void 0x0!==_0x1820ff;return{'changes':_0x2e8343,'state':_0xa39959?'outdated':'pending','outdatedReason':_0xa39959?_0x1820ff:void 0x0,'index':_0x3d86fe,'editor':_0xe23994['editor'],'rootName':_0xe23994['rootName'],'documentId':_0x22c474};}));const _0x223198=Array['from'](this['documentContextContent']['keys']());function _0x19f650(_0x1a672e){return _0x59b904['modifiedNodeIds']['includes'](_0x1a672e)||_0x59b904['newNodeIds']['includes'](_0x1a672e)||_0x59b904['removedNodeIds']['includes'](_0x1a672e);}function _0x2a72a2(_0x3d0625){if(_0x3d0625&&ln(_0x3d0625,'data-id')&&!ln(_0x3d0625,'data-unstable')){const _0x4d4839=ln(_0x3d0625,'data-id');if(!_0x19f650(_0x4d4839))return{'node':_0x3d0625,'type':'context','id':_0x4d4839};}return null;}this['changeGroups']['sort']((_0x3a45ba,_0x5baabf)=>_0x223198['indexOf'](_0x3a45ba['documentId'])-_0x223198['indexOf'](_0x5baabf['documentId'])),this['changeGroups']['forEach']((_0x5dc4f9,_0x1e235f)=>{_0x5dc4f9['index']=_0x1e235f;});}};const kr=/* #__PURE__ -- @preserve */
31
+ It(),xr=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];var Lr=class extends kr{['id'];['replies']=[];currentReply;['messageId'];actionCallId;currentRequest;connector;isStopped=!0x1;isDestroyed=!0x1;['locale'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;_channelsToEditors;constructor({connector:_0xf6cc3,locale:_0x418eb5,channelsToEditors:_0x18da5e}){super(),this['id']=Xt(),this['connector']=_0xf6cc3,this['isStopped']=!0x0,this['locale']=_0x418eb5,this['_channelsToEditors']=_0x18da5e||new Map();}async start(){await this['_run']();}async['resume'](_0x418210){await this['_run'](_0x418210);}async['_run'](_0x1f7e99){const _0x527639=[];let _0x2458e7,_0x59f995,_0x585376,_0x260dcf=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=_0x1f7e99||this['sendRequest'](),this['fire']('interactionStarted',this);const _0x454fbe=await this['currentRequest']['getStream']();for await(const _0x347284 of _0x454fbe){if(this['isStopped'])return;if('error'==_0x347284['event'])return void this['fire']('error',{'error':new dt('ai-chat-interaction-error',this)});switch(_0x347284['event']){case'message-metadata':this['messageId']=_0x347284['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x347284['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x347284['data']['conversationTitle'],!0x0);break;case'source':_0x527639['push'](_0x347284['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'](),_0x2458e7='modification-delta'==_0x347284['event']?'modification':'text',_0x59f995='modification-delta'==_0x347284['event']?_0x347284['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x2458e7&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x2458e7,'interactionId':this['id'],'id':_0x59f995,'channelsToEditors':this['_channelsToEditors'],...'modification-delta'==_0x347284['event']&&{'documentId':_0x347284['data']['documentId']}}),'modification'==_0x2458e7&&(this['currentReply']['sources']=_0x527639['splice'](0x0))),this['currentReply']['appendContent'](_0x347284['data']['textDelta'],_0x347284['data']['documentId']);break;case'mcp-tool-result':_0x585376=JSON['parse'](_0x347284['data']['result']),this['_handleToolResultData']({'toolName':_0x347284['data']['toolName'],'data':_0x585376['data'],'attributes':_0x585376['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x347284['data']['toolName'],'data':_0x347284['data']['data']});}}_0x260dcf=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x527639['length']>0x0&&(this['currentReply']['sources']=_0x527639['splice'](0x0)),this['_finalizeInteraction'](_0x260dcf),this['fire']('interactionFinished',this));}}stop(){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}getReply(_0x1a2bc8){return this['replies']['find'](_0x950d1e=>_0x950d1e['id']===_0x1a2bc8);}destroy(){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x19343f=>_0x19343f['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}createReply(_0x2a7aec){const _0x39defa=this['getDocumentContext'](),_0x3e09d0=new Nr({'locale':this['locale'],'documentContextContent':_0x39defa?.['documents'],..._0x2a7aec});return this['replies']['push'](_0x3e09d0),_0x3e09d0['delegate'](...xr)['to'](this),this['fire']('replyCreated',_0x3e09d0),_0x3e09d0;}setConversationTitle(_0x1eaba1,_0x14350e=!0x1){this['fire']('setConversationTitle',_0x1eaba1,_0x14350e);}resetWebSearchState(){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}resetReasoningState(){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}_handleToolResultData(_0xf5fafe){this['fire']('toolDataReceived',{'type':'result','toolName':_0xf5fafe['toolName'],'data':structuredClone(_0xf5fafe['data']||{}),'attributes':structuredClone(_0xf5fafe['attributes']||{})},this);}_handleToolNotificationData(_0x486a25){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x486a25['toolName'],'data':structuredClone(_0x486a25['data'])},this);}_finalizeInteraction(_0x5803f3=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x5803f3),this['currentRequest']=this['currentReply']=void 0x0;}};const Dr=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']]),Pr=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];var Mr=class AIChatContext extends nr{_connector;['_config'];['_ownerId'];constructor({connector:_0x2e7359,config:_0x2b24ab,ownerId:_0x1daecd}){super(),this['_connector']=_0x2e7359,this['_config']=_0x2b24ab,this['_ownerId']=_0x1daecd;}init(){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_shownLibraryContextRefIds']=new Set(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}getPendingContextItems(){return new Map(this['_pendingContextItems']);}async populateFromMessage(_0x5dc15b,_0x5d88be,_0x37981=new Set()){const _0x49b71f=new Map(),{contextItem:_0x4289d7,unmatchedDocumentIds:_0x3771a9}=await this['_populateDocumentContextItem'](_0x5dc15b,_0x5d88be);_0x4289d7&&_0x49b71f['set'](_0x4289d7['id'],_0x4289d7);for(const _0x372b65 of _0x5dc15b){if('document'===_0x372b65['type'])continue;const _0x27dca8=await this['_createContextItemFromContent'](_0x372b65,_0x37981);Vr(_0x27dca8)?this['_hideRepeatedContextReference'](_0x27dca8,_0x37981):this['_addToConversationContextItem'](_0x27dca8),_0x49b71f['set'](_0x27dca8['id'],_0x27dca8);}return this['_restoreContextReferencesAttachment'](_0x49b71f,_0x37981),{'contextItems':_0x49b71f,'hasUnmatched':_0x3771a9['size']>0x0,'unmatchedDocumentIds':_0x3771a9};}async _populateDocumentContextItem(_0x1bbd43,_0x2123b2){const _0x51dae5=_0x1bbd43['filter'](_0x46b4d7=>'document'===_0x46b4d7['type']);if(0x0===_0x51dae5['length'])return{'unmatchedDocumentIds':new Set()};const _0x871b7a=_0x51dae5['map'](_0xfd97c9=>_0xfd97c9['id']),_0x1ae923=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x871b7a)['getDocuments'](),_0x3cbd1f=new Map(_0x1ae923['map'](_0x14e999=>[_0x14e999['id'],_0x14e999])),_0x105261=[],_0x19de8e=new Set();for(const _0x508829 of _0x51dae5){const _0x124540=_0x3cbd1f['get'](_0x508829['id']);_0x124540&&(this['_matchDocumentToRoot'](_0x124540,_0x2123b2)||_0x19de8e['add'](_0x124540['id']),_0x105261['push']({'id':_0x124540['id'],'content':_0x124540['content'],'version':_0x124540['attributes']?.['version']??0x0,'sessionId':_0x124540['attributes']?.['sessionId']??null,'selection':[],'selectionSignature':'','channelId':_0x124540['attributes']?.['channelId']??_0x2123b2[0x0]?.['config']['get']('collaboration.channelId')??'','rootName':_0x124540['attributes']?.['rootName']??_0x2123b2[0x0]?.['model']['document']['getRoots']()[0x0]['rootName']??'','editorConfig':_0x508829['editorConfig']}));}const _0xa3cc4b={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x105261};return this['_addToConversationContextItem'](_0xa3cc4b),this['toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0xa3cc4b,'unmatchedDocumentIds':_0x19de8e};}_matchDocumentToRoot(_0x4c2fdc,_0x3d3fc2){const _0x4660a5=_0x4c2fdc['attributes']?.['channelId'],_0x327416=_0x4c2fdc['attributes']?.['rootName'];if(_0x4660a5&&_0x327416){for(const _0x3202c5 of _0x3d3fc2)if(_0x3202c5['config']['get']('collaboration.channelId')===_0x4660a5){for(const _0x1d4b2a of _0x3202c5['model']['document']['getRoots']())if('$graveyard'!==_0x1d4b2a['rootName']&&_0x1d4b2a['rootName']===_0x327416)return{'editor':_0x3202c5,'rootName':_0x1d4b2a['rootName']};}}}async _createContextItemFromContent(_0x27dcdd,_0x41999d=new Set()){if('mcp-tool-context'===_0x27dcdd['type'])return{'id':_0x27dcdd['id'],'uiId':_0x27dcdd['id'],'label':_0x27dcdd['data']?.['label']||_0x27dcdd['id'],'type':'mcp-tool-context','mcpServerName':_0x27dcdd['mcpServerName'],'toolName':_0x27dcdd['toolName'],'data':_0x27dcdd['data']||{}};const _0x687185=_0x27dcdd['attributes']?.['resourceId']||(Vr(_0x27dcdd)?_0x27dcdd['id']:void 0x0);return{'id':_0x27dcdd['id'],'uiId':_0x27dcdd['id'],'label':_0x27dcdd['attributes']?.['label']||_0x27dcdd['name']||_0x27dcdd['url']||_0x27dcdd['id'],'type':_0x27dcdd['type'],..._0x687185?{'resourceId':_0x687185}:{},...Vr(_0x27dcdd)&&_0x41999d['has'](_0x27dcdd['id'])?{'hidden':!0x0}:{}};}_restoreContextReferencesAttachment(_0x5810d3,_0x3ba00d){const _0x2b0417=new Set(),_0x383bc7=new Set();for(const _0x4ec5d8 of _0x5810d3['values']())Vr(_0x4ec5d8)&&!_0x3ba00d['has'](_0x4ec5d8['id'])&&_0x2b0417['add'](_0x4ec5d8['id']);for(const _0x4b2ec9 of Array['from'](this['_pendingContextItems']['values']()))Vr(_0x4b2ec9)&&(_0x2b0417['has'](_0x4b2ec9['id'])?_0x383bc7['add'](_0x4b2ec9['id']):this['_removeContextItem'](_0x4b2ec9['uiId']));for(const _0x3bedbc of _0x5810d3['values']())_0x2b0417['has'](_0x3bedbc['id'])&&!_0x383bc7['has'](_0x3bedbc['id'])&&this['_keepContextItemAttached'](_0x3bedbc);}getSentContextItems(){return new Map(this['_conversationContextItems']);}removeFromContext(_0x3d2eb7){this['_pendingContextItems']['get'](_0x3d2eb7)?.['isReadOnly']||this['_removeContextItem'](_0x3d2eb7);}clearPendingContextItems(){if(0x0===this['_pendingContextItems']['size'])return;const _0x139d33=Array['from'](this['_pendingContextItems']['values']());for(const _0x2df007 of _0x139d33)Vr(_0x2df007)&&_0x2df007['hidden']||(this['_removeContextItem'](_0x2df007['uiId']),Vr(_0x2df007)&&this['_keepContextItemAttached'](_0x2df007));const _0x5218bb=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x5218bb&&this['_keepContextItemAttached'](_0x5218bb);}addToConversationContext(_0x320c3a){for(const _0x438ca1 of _0x320c3a['values']())Vr(_0x438ca1)||this['_addToConversationContextItem'](_0x438ca1);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(_0x5a27d4){return Array['from'](_0x5a27d4['values']())['flatMap'](_0x4b634b=>this['_mapContextItemToRequestData'](_0x4b634b));}async addFilesToContext(_0x1ec901,_0x598c8f,_0x436e81='file'){const _0x424bf7='files-'+Xt();this['_startUploadOperation'](_0x424bf7);try{await Promise['all'](_0x1ec901['map'](async _0x10f7e2=>{const _0x759f51='file-'+Xt(),_0x32af0d=_0x369484(_0x10f7e2['name']),_0x2168fd='file'===_0x436e81&&_0x10f7e2['type']['startsWith']('image/')?'image':_0x436e81;try{this['_addContextItem']({'type':_0x2168fd,'label':_0x598c8f?.['label']||_0x32af0d,'uiId':_0x759f51,'resourceId':_0x598c8f?.['resourceId']},!0x0);const _0x2a2060=this['_connector']['uploadFile'](this['_ownerId'],_0x10f7e2,_0x598c8f);this['_ongoingUploads']['set'](_0x759f51,_0x2a2060['abortController']);const {id:_0x48b583}=await _0x2a2060['getId']();this['_ongoingUploads']['delete'](_0x759f51),this['_finishContextItemLoading']({'type':_0x2168fd,'id':_0x48b583,'label':_0x598c8f?.['label']||_0x32af0d,'uiId':_0x759f51,'resourceId':_0x598c8f?.['resourceId']},!0x1);}catch(_0x1422b4){if(this['_ongoingUploads']['delete'](_0x759f51),!lr(_0x1422b4)){const _0xcc2470=Dr['get'](_0x1422b4['code'])||'ai-chat-file-upload-failed',_0x1eedb1=new ur({'code':_0xcc2470,'cause':_0x1422b4,'context':{'fileName':_0x32af0d}});this['fire']('error',{'error':_0x1eedb1});}this['_removeContextItem'](_0x759f51);}}));}finally{this['_finishUploadOperation'](_0x424bf7);}}addCurrentDocumentToContext(_0x229216){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x4f9d42={'type':'document','uiId':'current-document','label':_0x229216,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x4f9d42);}getCurrentDocumentContext(){return this['_pendingContextItems']['get']('current-document');}async updateCurrentDocuments(_0x153b9a,_0x4cc0a9){const _0x4a0c97=this['getCurrentDocumentContext']();if(!_0x4a0c97)return;_0x153b9a['length']>0x1&&_0x153b9a['some'](_0x3d1fbd=>!_0x3d1fbd['description'])&&Ft('ai-chat-documents-missing-description');try{const _0x18e403=(_0x4a0c97['documents']||[])['filter'](_0x10ab01=>_0x4cc0a9['has'](_0x10ab01['channelId']));if(!_0x153b9a['length'])return void(_0x4a0c97['documents']=_0x18e403);const _0x1bd100=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x153b9a)['getIds']();if(_0x1bd100['length']!==_0x153b9a['length']||_0x1bd100['some'](_0x148208=>!_0x148208?.['id'])){const _0x1b2927=new dt('ai-chat-document-upload-reply-mismatch',null);return void this['fire']('error',{'error':_0x1b2927});}const _0x241adc=_0x153b9a['map']((_0x271a11,_0x57e1a6)=>{return{'id':_0x1bd100[_0x57e1a6]['id'],'content':_0x271a11['content'],'version':_0x271a11['version'],'sessionId':_0x271a11['sessionId'],'selection':(_0x3d3af4=_0x271a11['selections'],_0x3d3af4?_0x3d3af4['map'](_0xdd005=>({'start':_0xdd005['start'],'end':_0xdd005['end']})):[]),'selectionSignature':_0x271a11['selectionSignature'],'channelId':_0x271a11['channelId'],'rootName':_0x271a11['rootName'],'editorConfig':_0x271a11['editorConfig']};var _0x3d3af4;});_0x4a0c97['documents']=[..._0x18e403,..._0x241adc];}catch(_0x493fd8){throw new ur({'code':'ai-chat-document-upload-failed','type':'network','cause':_0x493fd8});}}addSelectionToContext(_0x181e28){this['_addContextItem']({'type':'selection','label':_0x181e28,'uiId':'selection','content':_0x181e28});}removeSelectionFromContext(){this['_removeContextItem']('selection');}addLibraryContextToContext(_0x579d92,_0x1e555d){this['_isResourceInContext'](_0x579d92)||this['_addContextItem']({'type':'context','id':_0x579d92,'label':_0x1e555d||_0x579d92,'uiId':'context-'+Xt(),'resourceId':_0x579d92});}async addUrlToContext(_0x5b382b,_0x47586d){const _0x311b51='url-'+Xt();this['_startUploadOperation'](_0x311b51);const _0x29e374='url-'+Xt();try{this['_addContextItem']({'type':'web-resource','label':_0x47586d?.['label']||_0x5b382b,'uiId':_0x29e374,'resourceId':_0x47586d?.['resourceId']},!0x0);const _0xd62030=this['_connector']['uploadUrl'](this['_ownerId'],_0x5b382b,_0x47586d);this['_ongoingUploads']['set'](_0x29e374,_0xd62030['abortController']);const {id:_0x120dd2}=await _0xd62030['getId']();this['_ongoingUploads']['delete'](_0x29e374),this['_finishContextItemLoading']({'type':'web-resource','id':_0x120dd2,'label':_0x47586d?.['label']||_0x5b382b,'uiId':_0x29e374,'resourceId':_0x47586d?.['resourceId']},!0x1);}catch(_0x295275){this['_ongoingUploads']['delete'](_0x29e374),lr(_0x295275)||this['fire']('error',{'error':new dt('ai-chat-url-upload-failed',this,{'url':_0x5b382b,'originalError':_0x295275}),'url':_0x5b382b}),this['_removeContextItem'](_0x29e374);}finally{this['_finishUploadOperation'](_0x311b51);}}addToolItemToContext(_0x15efa8){_0x15efa8['id']=_0x15efa8['id']??Xt()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x15efa8['uiId'],_0x15efa8),this['fire']('contextItemAdded',{'contextItem':_0x15efa8,'isLoading':!0x1});}async['loadSourceResources'](_0x4c88d2,_0x1f2d58,_0x12a91f){const _0x2f8448=this['_addContextOptionsState']['sources']['find'](_0x2199f9=>_0x2199f9['id']===_0x4c88d2);if(!_0x2f8448)return this['fire']('error',{'error':new dt('ai-chat-source-not-found',this,{'sourceId':_0x4c88d2}),'sourceId':_0x4c88d2}),[];try{const _0x109e0d=(await _0x2f8448['getResources'](_0x1f2d58))['map'](_0x4f899b=>{const _0x563da9=this['_isResourceInContext'](_0x4f899b['id']);return{..._0x4f899b,'isInContext':_0x563da9};});return _0x2f8448['resources']=_0x109e0d,this['fire']('sourceResourcesLoaded',{'sourceId':_0x4c88d2,'source':_0x2f8448,'resources':_0x109e0d,'uid':_0x12a91f}),_0x109e0d;}catch(_0xc39401){return this['fire']('error',{'error':new dt('ai-chat-source-resources-load-failed',this,{'sourceId':_0x4c88d2,'originalError':_0xc39401}),'sourceId':_0x4c88d2,'sourceLabel':_0x2f8448['label']}),[];}}async addResourceToContext(_0x267f3e,_0x212f01){if(this['_isResourceInContext'](_0x212f01['id']))return;if(Vr(_0x212f01))return void this['addLibraryContextToContext'](_0x212f01['id'],_0x212f01['label']);let _0x2d825d=_0x212f01['data'];if(!_0x2d825d&&_0x267f3e['getData'])try{_0x2d825d=await _0x267f3e['getData'](_0x212f01['id']);}catch(_0x21acd8){return void this['fire']('error',{'error':new dt('ai-chat-resource-load-failed',this,{'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id'],'originalError':_0x21acd8}),'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id']});}if(_0x2d825d)switch(_0x212f01['type']){case'web-resource':if('string'!=typeof _0x2d825d)return void this['fire']('error',{'error':new dt('ai-chat-context-invalid-data',this,{'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id'],'expectedType':'string','actualType':typeof _0x2d825d}),'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id']});await this['addUrlToContext'](_0x2d825d,{'label':_0x212f01['label'],'resourceId':_0x212f01['id']});break;case'file':if(!(_0x2d825d instanceof File))return void this['fire']('error',{'error':new dt('ai-chat-context-invalid-data',this,{'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id'],'expectedType':'File','actualType':typeof _0x2d825d}),'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id']});await this['addFilesToContext']([_0x2d825d],{'label':_0x212f01['label'],'resourceId':_0x212f01['id']});break;case'text':if('object'!=typeof _0x2d825d||!('content'in _0x2d825d)||!('type'in _0x2d825d))return void this['fire']('error',{'error':new dt('ai-chat-context-invalid-data',this,{'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x2d825d}),'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id']});_0x2d825d=AIChatContext['_convertTextResourceToFile'](_0x2d825d,_0x212f01['label']),await this['addFilesToContext']([_0x2d825d],{'label':_0x212f01['label'],'resourceId':_0x212f01['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new dt('ai-chat-context-unsupported-type',this,{'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id'],'resourceType':_0x212f01['type']}),'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id']});}else this['fire']('error',{'error':new dt('ai-chat-resource-no-data',this,{'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id']}),'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id']});}addContextSource(_0x1de2a4){this['_addContextOptionsState']['sources']['some'](_0x2ebe05=>_0x2ebe05['id']===_0x1de2a4['id'])||(this['_addContextOptionsState']['sources']['push']({..._0x1de2a4,'resources':[]}),this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']}));}toggleAddCurrentDocumentOptionVisibility(_0x1970eb){if(void 0x0!==_0x1970eb)this['_addContextOptionsState']['document']['isHidden']=!_0x1970eb;else{const _0x683115=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x683115;}this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}static _convertTextResourceToFile(_0x1c3862,_0x33d801){switch(_0x1c3862['type']){case'markdown':return new File([_0x1c3862['content']],_0x33d801,{'type':'text/markdown'});case'html':return new File([_0x1c3862['content']],_0x33d801,{'type':'text/html'});default:return new File([_0x1c3862['content']],_0x33d801,{'type':'text/plain'});}}static _mapContextItemToRequestData(_0x118081){switch(_0x118081['type']){case'file':case'image':case'text':return[{'type':'file','id':_0x118081['id']}];case'web-resource':return[{'type':'web-resource','id':_0x118081['id']}];case'context':return[{'type':'context','id':_0x118081['id']}];case'document':return _0x118081['documents']?.['length']?_0x118081['documents']['map'](({id:_0x5b8772,editorConfig:_0x289791,selection:_0x4754fc})=>({'type':'document','id':_0x5b8772,..._0x289791&&{'editorConfig':_0x289791},..._0x4754fc?.['length']&&{'selection':_0x4754fc}})):[];case'mcp-tool-context':{const _0x163552=_0x118081;return[{'type':'mcp-tool-context','mcpServerName':_0x163552['mcpServerName'],'toolName':_0x163552['toolName'],'data':{..._0x163552['data'],'label':_0x163552['label']||_0x163552['data']?.['label']||_0x163552['id']},'id':_0x163552['id']}];}default:return[];}}_addContextItem(_0xfe473d,_0x4a174e=!0x1){if(this['_pendingContextItems']['set'](_0xfe473d['uiId'],_0xfe473d),_0xfe473d['hidden']||this['fire']('contextItemAdded',{'contextItem':_0xfe473d,'isLoading':_0x4a174e}),'current-document'===_0xfe473d['uiId']&&this['toggleAddCurrentDocumentOptionVisibility'](),_0xfe473d['resourceId']){const _0x54ed7f=this['_findSourceIdsByResourceId'](_0xfe473d['resourceId']);_0x54ed7f&&_0x54ed7f['forEach'](_0x12c278=>{this['_updateResourceInContextState'](_0x12c278,_0xfe473d['resourceId'],!0x0);});}}_keepContextItemAttached(_0x4cd110){this['_addContextItem']({..._0x4cd110,'isReadOnly':!0x0,'hidden':!0x0});}_removeContextItem(_0x448a4a){const _0x35e116=this['_pendingContextItems']['get'](_0x448a4a),_0x5ff6c2=this['_ongoingUploads']['get'](_0x448a4a);if(_0x5ff6c2&&(_0x5ff6c2['abort'](),this['_ongoingUploads']['delete'](_0x448a4a)),_0x35e116?.['resourceId']){const _0x3209e2=this['_findSourceIdsByResourceId'](_0x35e116['resourceId']);_0x3209e2&&_0x3209e2['forEach'](_0x4a65a2=>{this['_updateResourceInContextState'](_0x4a65a2,_0x35e116['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x448a4a),this['fire']('contextItemRemoved',{'uiId':_0x448a4a,'type':_0x35e116?.['type']}),'current-document'===_0x448a4a&&this['toggleAddCurrentDocumentOptionVisibility']();}_finishContextItemLoading(_0x987156,_0x2e43d8){if(this['_pendingContextItems']['has'](_0x987156['uiId'])&&(this['_pendingContextItems']['set'](_0x987156['uiId'],_0x987156),this['fire']('contextItemLoadingEnded',{'contextItem':_0x987156,'isLoading':_0x2e43d8}),_0x987156['resourceId'])){const _0x4b3e08=this['_findSourceIdsByResourceId'](_0x987156['resourceId']);_0x4b3e08&&_0x4b3e08['forEach'](_0x25e714=>{this['_updateResourceInContextState'](_0x25e714,_0x987156['resourceId'],!0x0);});}}_addToConversationContextItem(_0x356e23){this['_conversationContextItems']['set'](_0x356e23['uiId'],_0x356e23);}_hideRepeatedContextReference(_0x4ca57b,_0x187a28){_0x187a28['has'](_0x4ca57b['id'])||(this['_shownLibraryContextRefIds']['has'](_0x4ca57b['id'])?_0x4ca57b['hidden']=!0x0:this['_shownLibraryContextRefIds']['add'](_0x4ca57b['id']));}_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'](_0x5a8dce=>({..._0x5a8dce,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}_getCustomSourcesInitialState(){return this['_config']?.['sources']?.['map'](_0x24bf49=>({..._0x24bf49,'resources':[]}))??[];}_isResourceInContext(_0x52646e){for(const _0xb9daf7 of this['_pendingContextItems']['values']())if(_0xb9daf7['resourceId']===_0x52646e)return!0x0;for(const _0x343c44 of this['_conversationContextItems']['values']())if(_0x343c44['resourceId']===_0x52646e)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x10ec02){const _0x1643e4=[];for(const _0x10ff10 of this['_addContextOptionsState']['sources'])_0x10ff10['resources']['find'](_0x1139f1=>_0x1139f1['id']===_0x10ec02)&&_0x1643e4['push'](_0x10ff10['id']);return 0x0===_0x1643e4['length']?null:_0x1643e4;}_updateResourceInContextState(_0x10d228,_0x4b9f71,_0x43c3cb){const _0x54dec7=this['_addContextOptionsState']['sources']['find'](_0x20028e=>_0x20028e['id']===_0x10d228);if(!_0x54dec7)return;const _0x500800=_0x54dec7['resources']['find'](_0x12b61c=>_0x12b61c['id']===_0x4b9f71);_0x500800&&(_0x500800['isInContext']=_0x43c3cb,this['fire']('resourceStateChanged',{'sourceId':_0x10d228,'resourceId':_0x4b9f71,'isInContext':_0x43c3cb}));}_startUploadOperation(_0x4a059f){this['_ongoingUploadOperations']['set'](_0x4a059f,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}_finishUploadOperation(_0x54b713){this['_ongoingUploadOperations']['delete'](_0x54b713),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}};function Vr(_0x406e11){return'context'===_0x406e11['type'];}var Hr=class extends Lr{['userMessage'];conversationId;contextItems=new Map();capabilities;['model'];attributes;context;constructor(_0xc19827){super(_0xc19827),this['conversationId']=_0xc19827['conversationId'],this['contextItems']=_0xc19827['contextItems'],this['capabilities']=_0xc19827['capabilities'],this['userMessage']=_0xc19827['userMessage'],this['model']=_0xc19827['model'],this['attributes']=_0xc19827['attributes'],this['context']=_0xc19827['context']??new nr();}sendRequest(){const _0x2caa36=Mr['mapContextItemsToRequestData'](this['contextItems']),_0x42e243=this['context']['toRequestParts'](_0x2caa36);return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':_0x42e243,'capabilities':er['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['context']['toMessageAttributes'](this['attributes'])});}getDocumentContext(){return this['contextItems']['get']('current-document');}};const Ur=/* #__PURE__ -- @preserve */
32
+ It();var Br=class extends Ur{['id'];isStarted=!0x1;isFromHistory;interactions=[];currentInteraction;selectedModel;connector;options;_abortReject;_channelsToEditors;_getSessionId;constructor(_0x2382e9){super(),this['options']=_0x2382e9,this['connector']=_0x2382e9['connector'],this['chatModels']=_0x2382e9['chatModels'],this['id']=_0x2382e9['conversationId'],this['isFromHistory']=_0x2382e9['isFromHistory'],this['_channelsToEditors']=_0x2382e9['channelsToEditors'],this['_getSessionId']=_0x2382e9['getSessionId'];}async init(_0x45de27){try{this['chatContext']=new Mr({'connector':this['connector'],'config':_0x45de27,'ownerId':this['id']}),this['chatContext']['delegate'](...Pr)['to'](this),this['chatContext']['init'](),this['options']['contextLibrary']?.['resolveContext']({'feature':'chat','extraContexts':this['options']['extraContexts'],'context':this['chatContext']}),this['chatCapabilities']=new er(),this['chatCapabilities']['delegate'](...tr)['to'](this),this['chatCapabilities']['init']();const _0x588210=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x588210});const _0x44ef16=await this['chatModels']['resolveModel'](this['options']['selectedModelId']);_0x44ef16&&await this['setModel'](_0x44ef16);}catch(_0x1ef823){const _0x5653b0=new ur({'code':'ai-chat-conversation-init-failed','cause':_0x1ef823,'type':'network'});this['fire']('error',{'error':_0x5653b0});}}async start(){if(this['isStarted'])throw new dt('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new dt('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x586818}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x586818,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x515827){const _0x49043e=new ur({'code':'ai-chat-conversation-start-failed','cause':_0x515827,'type':'network','context':{'conversationId':this['id']}});throw this['fire']('error',{'error':_0x49043e}),_0x49043e;}}async['load'](_0x256078){try{const _0x2fe58b=await this['connector']['fetchConversation'](_0x256078)['getConversation'](),_0xc864f7=await this['connector']['fetchConversationMessages'](_0x256078)['getMessages'](),_0x31e35e=_0xc864f7[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x2fe58b['id'],'title'in _0x2fe58b?this['fire']('setConversationTitle',_0x2fe58b['title'],!this['isFromHistory']):this['fire']('setConversationTitle','',!this['isFromHistory']),this['selectedModel']=await this['chatModels']['getModel'](_0x31e35e)??void 0x0,this['fire']('modelSelected',{'selectedModel':this['selectedModel'],'isDisabled':!0x0});const {streamingMessageId:_0x25ce3e}=await this['_processMessagesToInteractions'](_0xc864f7,_0x31e35e);return _0x25ce3e&&this['currentInteraction']?this['_resumeStream'](_0x25ce3e):this['currentInteraction']=void 0x0,this;}catch(_0x2b1376){const _0x288c54=new ur({'code':'ai-chat-conversation-init-from-id-failed','cause':_0x2b1376,'type':'network','context':{'conversationId':_0x256078}});throw this['fire']('error',{'error':_0x288c54}),_0x288c54;}}async _processMessagesToInteractions(_0x1000c4,_0x2b787c){let _0xb21c03,_0x555049,_0x47ac07=new Set();for(const _0x1a584c of _0x1000c4)if('user'===_0x1a584c['role']){const {contextItems:_0x1ac8ff,unmatchedDocumentIds:_0x3d4be9}=await this['_extractContextItems'](_0x1a584c);_0x47ac07=_0x3d4be9;const _0x54d110={'isReasoningEnabled':Object['hasOwn'](_0x1a584c['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x1a584c['capabilities'],'webSearch')};_0xb21c03=this['createInteraction']({'userMessage':_0x1a584c['prompt'],'contextItems':_0x1ac8ff,'capabilities':_0x54d110,'modelId':_0x2b787c,'attributes':_0x1a584c['attributes'],'channelsToEditors':this['_channelsToEditors']}),this['currentInteraction']=_0xb21c03,_0x555049=void 0x0,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x1a584c['role']&&_0xb21c03){if('streaming'===_0x1a584c['status']){_0x555049=_0x1a584c['id'];continue;}if('error'===_0x1a584c['status'])continue;const _0x1347ae=[];for(const _0x133c3c of _0x1a584c['content'])switch(_0x133c3c['type']){case'text':case'modification':{const _0x34645e=_0xb21c03['getDocumentContext'](),_0x5f4001=this['_getOutdatedReasonsByDocumentId'](_0x34645e,_0x47ac07),_0x3d5584=_0x34645e?.['documents']??[],_0x1af027=_0x3d5584['length']>0x0&&_0x3d5584['every'](_0x21b9e1=>_0x5f4001['has'](_0x21b9e1['id']));_0xb21c03['currentReply']?.['type']!==_0x133c3c['type']&&(_0xb21c03['currentReply']=_0xb21c03['createReply']({'type':_0x133c3c['type'],'isDone':!0x0,'interactionId':_0xb21c03['id'],'areActionsDisabled':_0x1af027,'outdatedReasonByDocumentId':_0x5f4001,'isFromHistory':!0x0,'channelsToEditors':this['_channelsToEditors']}),_0x1347ae['length']>0x0&&(_0xb21c03['currentReply']['sources']=_0x1347ae['splice'](0x0))),_0xb21c03['currentReply']['appendContent'](_0x133c3c['content'],_0x133c3c['documentId']);break;}case'url':_0x1347ae['push'](_0x133c3c);break;case'mcp-tool-result':{const {data:_0x4c65ed,attributes:_0x59d8bd}=JSON['parse'](_0x133c3c['content']);_0xb21c03['_handleToolResultData']({'toolName':_0x133c3c['toolName'],'data':_0x4c65ed,'attributes':_0x59d8bd});break;}}'cancelled'===_0x1a584c['status']&&this['fire']('error',{'interactionId':_0xb21c03['id'],'error':new dt('ai-request-aborted',this)});}}return{'streamingMessageId':_0x555049};}async _resumeStream(_0x26d147){if(this['currentInteraction'])try{const _0x43e39e=this['connector']['resumeStream'](this['id'],_0x26d147);await this['currentInteraction']['resume'](_0x43e39e);}catch(_0x2b4e73){_0x2b4e73 instanceof dt&&this['fire']('error',{'interactionId':this['currentInteraction']?.['id'],'error':_0x2b4e73});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}async _extractContextItems(_0x2cad83){return _0x2cad83['content']?this['chatContext']['populateFromMessage'](_0x2cad83['content'],Array['from'](this['_channelsToEditors']['values']()),nr['getDefaultContextIds'](_0x2cad83['attributes'])):{'contextItems':new Map(),'unmatchedDocumentIds':new Set()};}async handleUserInteraction({userMessage:_0x9d1db8,attributes:_0x397ae3}){if(!this['isStarted'])throw new dt('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new dt('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x68c685=new Map(this['getPendingContextItems']()),_0x5b29f0=this['chatCapabilities']['getCapabilitiesConfig'](),_0x10117f=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x9d1db8,'contextItems':_0x68c685,'capabilities':_0x5b29f0,'modelId':_0x10117f,'attributes':_0x397ae3,'channelsToEditors':this['_channelsToEditors']}),await this['updateCurrentDocumentsInContext'](),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x2efaea){if(_0x2efaea instanceof dt)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x2efaea});else{const _0x32edd3=Dr['get'](_0x2efaea['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new dt(_0x32edd3,null,{'error':_0x2efaea})});}}finally{this['stopProcessing']();}}stopProcessing(){this['_abortReject']&&(this['_abortReject'](),this['_abortReject']=void 0x0),this['currentInteraction']&&(this['currentInteraction']['stop'](),this['currentInteraction']=void 0x0);}createInteraction({userMessage:_0x4285fd,contextItems:_0x81036d,capabilities:_0x2a8132,modelId:_0x1ccfe3,attributes:_0x203aed,channelsToEditors:_0x14b958}){const _0x3ea617=new Hr({'userMessage':_0x4285fd,'contextItems':_0x81036d,'capabilities':_0x2a8132,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x1ccfe3,'attributes':_0x203aed,'channelsToEditors':_0x14b958,'context':this['chatContext']['isEmpty']?void 0x0:new nr(this['chatContext']['refs'])});return _0x3ea617['delegate'](...xr)['to'](this),this['interactions']['push'](_0x3ea617),this['fire']('interactionCreated',_0x3ea617),_0x3ea617;}getInteraction(_0x12c539){return this['interactions']['find'](_0x18a93a=>_0x18a93a['id']===_0x12c539);}removeInteraction(_0x2b2d74){const _0x57f41c=this['getInteraction'](_0x2b2d74);_0x57f41c&&(_0x57f41c['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x57f41c),0x1));}get lastInteraction(){return this['interactions'][this['interactions']['length']-0x1];}cancelLastInteractionStream(){const _0x2d5c21=this['lastInteraction'];_0x2d5c21?.['conversationId']&&_0x2d5c21['messageId']&&this['connector']['cancelStream'](_0x2d5c21['conversationId'],_0x2d5c21['messageId'])['execute']()['catch'](()=>{});}addCurrentDocumentToContext(_0xde4791){this['chatContext']['addCurrentDocumentToContext'](_0xde4791);}async updateCurrentDocumentsInContext(){if(!this['isCurrentDocumentInContext']())return;const {changedIds:_0x153c67,unchangedIds:_0x9bf626}=this['_compareEditorStateWithDocumentContext'](),_0x5e4697=new Promise((_0x63efcc,_0x1d72e9)=>{this['_abortReject']=()=>_0x1d72e9(new dt('ai-request-aborted',this));}),_0x46a616=await Promise['race']([this['options']['aiEditing']['getDocumentData'](_0x153c67),_0x5e4697]);await Promise['race']([this['chatContext']['updateCurrentDocuments'](_0x46a616,_0x9bf626),_0x5e4697]);}_compareEditorStateWithDocumentContext(){const _0x32b6ea=new Set(),_0x459994=new Set(),_0x515926=this['options']['aiEditing']['getEditorsVersions'](),_0x33ab40=this['options']['aiEditing']['getEditorsSelections'](),_0x2281a2=this['chatContext']['getCurrentDocumentContext']()['documents']||[],_0x156602=new Map(_0x2281a2['map'](({channelId:_0x2c4dfb,version:_0x33a66a})=>[_0x2c4dfb,_0x33a66a])),_0xb08920=new Map(_0x2281a2['map'](({channelId:_0x31d3d0,selectionSignature:_0x5c6818})=>[_0x31d3d0,_0x5c6818]));for(const [_0x50e338,_0x4ce9ac]of _0x515926){const _0x3dd8ad=_0x33ab40['get'](_0x50e338);_0x156602['get'](_0x50e338)!=_0x4ce9ac||_0xb08920['get'](_0x50e338)!=_0x3dd8ad?_0x32b6ea['add'](_0x50e338):_0x156602['has'](_0x50e338)&&_0x459994['add'](_0x50e338);}return{'changedIds':_0x32b6ea,'unchangedIds':_0x459994};}toggleAddCurrentDocumentOptionVisibility(_0x43d48c){this['chatContext']['toggleAddCurrentDocumentOptionVisibility'](_0x43d48c);}_getOutdatedReasonsByDocumentId(_0x36e6b5,_0x48c622){const _0x352121=new Map();if(!_0x36e6b5||!_0x36e6b5['documents'])return _0x352121;for(const _0x4cc471 of _0x36e6b5['documents']){const _0x29330d=this['_channelsToEditors']['get'](_0x4cc471['channelId']);_0x29330d&&'destroyed'!==_0x29330d['state']?_0x4cc471['sessionId']!==this['_getSessionId'](_0x29330d)?_0x352121['set'](_0x4cc471['id'],'session-changed'):_0x48c622['has'](_0x4cc471['id'])&&_0x352121['set'](_0x4cc471['id'],'content-removed'):_0x352121['set'](_0x4cc471['id'],'editor-removed');}return _0x352121;}addSelectionToContext(_0x3e9206){this['chatContext']['addSelectionToContext'](_0x3e9206);}removeSelectionFromContext(){this['chatContext']['removeSelectionFromContext']();}addFilesToContext(_0x2e1196){this['chatContext']['addFilesToContext'](_0x2e1196);}addUrlToContext(_0x2e1dcd){this['chatContext']['addUrlToContext'](_0x2e1dcd);}addToolItemToContext(_0x45a3a7){this['chatContext']['addToolItemToContext'](_0x45a3a7);}addLibraryContextToContext(_0x31dcd4,_0x291d39){this['chatContext']['addLibraryContextToContext'](_0x31dcd4,_0x291d39);}addResourceToContext(_0xdaa774,_0x22626b){this['chatContext']['addResourceToContext'](_0xdaa774,_0x22626b);}['loadSourceResources'](_0x338b3c,_0x5af2c4,_0x2b74b0){return this['chatContext']['loadSourceResources'](_0x338b3c,_0x5af2c4,_0x2b74b0);}removeFromContext(_0x57a089){this['chatContext']['removeFromContext'](_0x57a089);}setWebSearch(_0x396da1){this['chatCapabilities']['setWebSearch'](_0x396da1);}toggleWebSearch(){this['chatCapabilities']['toggleWebSearch']();}setReasoning(_0x22f34c){this['chatCapabilities']['setReasoning'](_0x22f34c);}toggleReasoning(){this['chatCapabilities']['toggleReasoning']();}isCurrentDocumentInContext(){return this['chatContext']['isCurrentDocumentInContext']();}isCurrentDocumentInConversation(){return this['chatContext']['isCurrentDocumentInConversation']();}isSelectionInContext(){return this['chatContext']['isSelectionInContext']();}getPendingContextItems(){return this['chatContext']['getPendingContextItems']();}addDefaultContext(_0x1c0a4a){_0x1c0a4a['length']&&this['chatContext']['addDefaultContext'](_0x1c0a4a);}async setModel(_0x139d7b){_0x139d7b?!0x1===await this['chatModels']['isAvailable'](_0x139d7b)&&(Ft('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x139d7b}),_0x139d7b=(await this['chatModels']['getAvailableModels']())[0x0]):(Ft('ai-chat-conversation-set-model-null',{'conversation':this}),_0x139d7b=(await this['chatModels']['getAvailableModels']())[0x0]),_0x139d7b['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x139d7b,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x139d7b}));}};function Gr({documentSuggestions:_0x4ff5a4,transform:_0xe3639b,documentChanges:_0x54d880,documentChangesOptions:_0x18540e}){const _0x1094be=new Map();for(const [_0x2893a5,{groups:_0x244595,documentContext:_0x2e7774,documentContent:_0x1ea14a,editor:_0x2723f2}]of _0x4ff5a4){const _0x27413d=_0x2e7774['content'],_0x354056=_0x2e7774['version'],_0x8f2a29=_0x1ea14a['cloneNode'](!0x0);for(const {changes:_0x42de97}of _0x244595)Cn(_0x8f2a29,_0x42de97);const _0x44eed4=sn(_0x8f2a29),_0x5f24ab=Rn(_0x2723f2,_0x2e7774['rootName'],_0x27413d,_0x44eed4);if(!_0x5f24ab)continue;const _0x24ea8c=_0x54d880['getDiff'](_0x5f24ab['before'],_0x5f24ab['after'],{'targetEditor':_0x2723f2,'anchor':_0x2e7774['rootName'],..._0x18540e});if(_0xe3639b){const _0x28b314=_0x2723f2['model']['document']['history']['getOperations'](_0x354056),_0x4aa9d8={'document':_0x2723f2['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};_0x1094be['set'](_0x2893a5,_0x3e782f(_0x24ea8c,_0x28b314,_0x4aa9d8)['operationsA']);}else _0x1094be['set'](_0x2893a5,_0x24ea8c);}return _0x1094be;}function Wr({groups:_0x5c108a,documentContextContent:_0x4e46f9,documents:_0x527f6a}){const _0x5c6d9f=new Map();for(const _0x298e1d of _0x5c108a){const {documentId:_0x4287cc}=_0x298e1d,_0x3912d1=_0x5c6d9f['get'](_0x4287cc);if(_0x3912d1)_0x3912d1['groups']['push'](_0x298e1d),_0x3912d1['indexes']['push'](_0x298e1d['index']);else{const _0x4f42ad=_0x527f6a['find'](_0x3f1a18=>_0x3f1a18['id']===_0x4287cc),_0x375750=_0x4e46f9['get'](_0x4287cc);if(!_0x4f42ad||!_0x375750)continue;_0x5c6d9f['set'](_0x4287cc,{'groups':[_0x298e1d],'documentContext':_0x4f42ad,'documentContent':_0x375750,'editor':_0x298e1d['editor'],'indexes':[_0x298e1d['index']]});}}return _0x5c6d9f;}function Fr(_0x30a472,_0xf69273){const _0x41b915=_0x30a472['files']['length']>0x0&&_0x30a472['files']['every'](_0x34db69=>_0x34db69['type']['startsWith']('image/')),_0x5954ef=_0x30a472['plainText']['trim']()['length']>0x0;if(_0x30a472['files']['length']>0x0&&_0xf69273['filesEnabled']&&(!_0x41b915||!_0x5954ef)){const _0xa5ad1e=_0x30a472['files']['filter'](_0x1d187e=>_0x1d187e['name']);return _0xa5ad1e['length']>0x0?{'type':'file','files':_0xa5ad1e}:null;}if(_0xf69273['urlsEnabled']){const _0x4077e8=function(_0x56c80e){const _0x464a02=_0x56c80e['trim']();if(/\s/['test'](_0x464a02))return null;try{const _0x304aa7=new URL(_0x464a02);return'http:'!==_0x304aa7['protocol']&&'https:'!==_0x304aa7['protocol']?null:_0x304aa7['toString']();}catch{return null;}}(_0x30a472['plainText']);if(_0x4077e8)return{'type':'url','url':_0x4077e8};}const _0x1af9e3=_0x30a472['forceTextAttachment']?0x1:_0xf69273['longTextThreshold']??0x1/0x0;if(_0x30a472['plainText']['length']>=Math['max'](_0x1af9e3,0x1)&&_0xf69273['filesEnabled']){const _0x43c183=_0xf69273['pastedTextLabel']+'.txt';return{'type':'text','files':[new File([_0x30a472['plainText']],_0x43c183,{'type':'text/plain'})]};}return null;}var Kr=class extends _0x4cd5fc{activeConversation;_aiEditing;_aiConnector;_aiChatUi;['_aiModels'];_aiContextLibrary;_contextLibrarySource=null;_hasAIChatBalloon=!0x1;_activeBalloon;_reporter;_batchToChanges=new Map();_currentPreviewedChangeGroup=null;_channelsToEditors=new Map();static get requires(){return[$s,dr,Un,Js];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['set']('isConversationReady',!0x1),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_reporter']=this['context']['plugins']['get'](dr)['createReporter']('aichat'),this['_aiModels']=this['context']['plugins']['get'](Js)['models'],this['_aiContextLibrary']=this['context']['plugins']['get'](Js)['contextLibrary'];const _0x2f4ec1=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x497d5d,_0x341d82)=>{this['sendMessage']({'message':_0x341d82});}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',()=>{this['activeConversation']?.['stopProcessing']();}),this['listenTo'](_0x2f4ec1['view'],'change:activeTab',(_0x2e5406,_0x530920,_0x4ad8a6)=>{'chat'!==_0x4ad8a6&&this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x2c6a1d,_0x199f05)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x199f05));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x3586a0,_0x3286b8)=>{this['activeConversation']?.['addUrlToContext'](_0x3286b8);}),this['listenTo'](this['_aiChatUi'],'promptInputPaste',(_0x59cb6c,_0x11bb74)=>{const _0x2a4df9=this['activeConversation'];if(!_0x2a4df9)return;_0x11bb74['hasDirectory']&&(_0x11bb74['preventDefault'](),this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED'),'id':'folder-error-'+Xt()}));const _0x5b483f=Fr(_0x11bb74,{'pastedTextLabel':qs(this['context']['locale'],'AI_CHAT_CONTEXT_PASTED_TEXT_NAME'),'longTextThreshold':this['context']['config']['get']('ai.chat.context.paste.textThreshold'),'filesEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.files.enabled'),'urlsEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.urls.enabled')});_0x5b483f&&(_0x11bb74['preventDefault'](),'url'===_0x5b483f['type']?_0x2a4df9['addUrlToContext'](_0x5b483f['url']):_0x2a4df9['chatContext']['addFilesToContext'](_0x5b483f['files'],void 0x0,_0x5b483f['type']));}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x48830b,_0x350161)=>{_0x350161['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x5f4521,_0x54471a)=>{this['activeConversation']?.['addResourceToContext'](_0x54471a['source'],_0x54471a['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x1ddfe6,_0x27ce6a)=>{this['_removeFromContext'](_0x27ce6a);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x508150,_0x3f6075)=>{this['activeConversation']?.['loadSourceResources'](_0x3f6075['sourceId'],_0x3f6075['query'],_0x3f6075['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x47d1fc,_0x32360f)=>{this['activeConversation']?.['setModel'](_0x32360f);}),this['listenTo'](this['_aiChatUi'],'like',(_0x41ea81,{replyId:_0x3f0401})=>{console['log']('Liked\x20response',_0x3f0401);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x11fbcb,{replyId:_0x11d63f})=>{console['log']('Disliked\x20response',_0x11d63f);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0xcf5af5,_0xb79fcf)=>{this['_insertSuggestion'](_0xb79fcf);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x5d924c,{replyId:_0x5f2cd7,partIndex:_0x29fd14})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x5f2cd7,_0x29fd14);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x8ede09,{replyId:_0x3cac29,partIndex:_0x34a189})=>{const _0x1e9b15=this['_getDocumentRangeForReplyChanges'](_0x3cac29,_0x34a189);if(!_0x1e9b15)return;const {reply:_0x103cc6}=this['getInteractionAndReplyById'](_0x3cac29);'$graveyard'!=_0x1e9b15['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'editor':_0x103cc6['changeGroups'][_0x34a189]['editor'],'ranges':[_0x1e9b15['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x3cd0d0,_0x42b063)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x42b063);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x16b326,{replyId:_0x561153,showDiff:_0x385b5e})=>{const {interaction:_0x53a7c2,reply:_0x28f85d}=this['getInteractionAndReplyById'](_0x561153),_0x5f2cd5=_0x28f85d['getContentParts']({'showDiff':_0x385b5e});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x53a7c2['id']+':'+_0x28f85d['id'],'parts':_0x5f2cd5});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x4892fc,{replyId:_0x2b8735,partIndex:_0x4bcc71})=>{this['_rejectSuggestion']({'replyId':_0x2b8735,'partIndex':_0x4bcc71}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['on']('interactionCreated',(_0x55e368,_0x17452c)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x17452c);}),this['on']('replyCreated',(_0x2fa090,_0x397805)=>{this['_addFeedItemReply'](_0x397805);});}afterInit(){this['context']instanceof _0x553634?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x90de87,_0xaef8de)=>{_0xaef8de['on']('ready',()=>{this['_integrateEditor'](_0xaef8de);});}),this['context']['config']['get']('ai.chat.context')?.['contextLibrary']?.['enabled']&&this['_setUpContextLibrarySource'](),this['_initConversation']();}async _initConversation(){const _0x475e3d=this['context']['config']['get']('ai.chat.initialConversation');let _0x2c2691=_0x475e3d;try{if('lastCreated'==_0x475e3d&&(_0x2c2691=await this['_getLastCreatedConversationId'](),!_0x2c2691))return;'new'==_0x2c2691?await this['_startConversationSafely']():(this['context']['plugins']['get'](Ks)['view']['activateTab']('chat'),await this['loadConversation'](_0x2c2691)),await this['_aiChatUi']['idleUiPromise'];}finally{this['_aiChatUi']['toggleLoadingSkeleton'](!0x1,'init');}}async destroy(){return this['_stopLastInteraction'](),super['destroy']();}async loadConversation(_0x481163){this['_closeActiveBalloon'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0,'conversation'),this['_detachFromActiveConversation'](),this['_stopLastInteraction'](),this['_aiChatUi']['toggleConversationLoading'](!0x0);try{this['_aiChatUi']['emptyConversationTitle'](),await this['_aiConnector']['fetchConversation'](_0x481163)['getConversation'](),await this['_startConversationSafely']({'id':_0x481163}),await this['activeConversation']['load'](_0x481163),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext'](),this['set']('isConversationReady',!0x0),this['activeConversation']?.['currentInteraction']?this['_aiChatUi']['enableControls']():this['_aiChatUi']['toggleConversationLoading'](!0x1);}catch(_0x443ffb){this['_aiChatUi']['resetConversationTitle'](),this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x481163}),this['_reporter']['logError'](new dt('ai-chat-conversation-not-found',this,void 0x0,_0x443ffb),{'context':{'operation':'load-conversation'}}),await this['_stopLastInteraction'](),this['_aiChatUi']['disableControls'](),this['set']('isConversationReady',!0x1),this['_aiChatUi']['resetChatBusyStateToIdle'](),this['activeConversation']?.['cancelLastInteractionStream']();}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1,'conversation');}}registerToolDataCallback(_0x5be84a){let _0x2b41f6=null,_0x3a97b1=null;this['on']('toolDataReceived',(_0xa9735,_0xc7d0ff,_0x275dbf)=>{_0x275dbf['id']!==_0x2b41f6&&(_0x2b41f6=_0x275dbf['id'],_0x3a97b1=this['_getAIChatFeedAPI'](_0x275dbf)),_0x5be84a(_0xc7d0ff,_0x3a97b1);});}addCurrentDocumentToChatContext(){Zs(this['context'])['length']&&this['activeConversation']?.['addCurrentDocumentToContext'](qs(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async addSelectionToChatContext(_0x1c0b84){const _0x3f0ce2=this['_aiEditing']['getSelectionText'](_0x1c0b84);this['activeConversation']?.['addSelectionToContext'](_0x3f0ce2),this['addCurrentDocumentToChatContext']();}removeSelectionFromChatContext(){this['activeConversation']?.['removeSelectionFromContext']();}addLibraryContextToChatContext(_0x2fb926,_0x58a202){this['activeConversation']?.['addLibraryContextToContext'](_0x2fb926,_0x58a202);}focusPromptInput(){this['_aiChatUi']['focusPromptInput']();}async startConversation(_0x776332){await this['_startConversationSafely']({'modelId':_0x776332?.['modelId'],'contexts':_0x776332?.['contexts']});}async['sendMessage']({message:_0x427d62,attributes:_0xf5f946}){if(!this['activeConversation'])throw new dt('ai-chat-controller-no-active-conversation');this['activeConversation']['id']&&this['activeConversation']['isStarted']&&(this['_aiChatUi']['startInteraction'](),await this['activeConversation']['handleUserInteraction']({'userMessage':_0x427d62,'attributes':_0xf5f946}));}getGroupId(){const _0xd6d97d=this['context']['config']['get']('collaboration.channelId');if(!_0xd6d97d)throw new dt('ai-missing-channel-id',this);return _0xd6d97d;}_handleRemovedConversation(_0x1b09d2){this['activeConversation']['id']===_0x1b09d2&&this['_startConversationSafely']();}['_isGroupReadOnly'](_0x90f1ad){return!(!_0x90f1ad['editor']||'destroyed'===_0x90f1ad['editor']['state']||!_0x90f1ad['editor']['isReadOnly']);}_isGroupWriteable(_0x330a27){return!(!_0x330a27['editor']||'destroyed'===_0x330a27['editor']['state']||_0x330a27['editor']['isReadOnly']);}_computeSuggestionGating(_0x52d671){const _0xf8751c=new Map();for(const _0xe44db4 of _0x52d671['changeGroups'])_0xf8751c['set'](_0xe44db4['index'],this['_isGroupReadOnly'](_0xe44db4));const _0x2affdb=new Set(_0x52d671['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']})['filter'](_0xf96a1a=>_0xf96a1a['hasChanges'])['map'](_0xb610f6=>_0xb610f6['index']));return{'readOnlyByIndex':_0xf8751c,'isAcceptAllEnabled':_0x52d671['changeGroups']['some'](_0x2ef10b=>'pending'===_0x2ef10b['state']&&this['_isGroupWriteable'](_0x2ef10b)&&_0x2affdb['has'](_0x2ef10b['index']))};}_refreshSuggestionGating(){if(this['activeConversation']){for(const _0x1d0fb3 of this['activeConversation']['interactions'])for(const _0x227efd of _0x1d0fb3['replies'])'modification'===_0x227efd['type']&&this['_aiChatUi']['hasFeedItem'](_0x227efd['id'])&&this['_aiChatUi']['setSuggestionGating'](_0x227efd['id'],this['_computeSuggestionGating'](_0x227efd));}if(this['_activeBalloon']&&this['_currentPreviewedChangeGroup']){const {reply:_0x4cb0c3}=this['getInteractionAndReplyById'](this['_currentPreviewedChangeGroup']['replyId']),_0x40866b=_0x4cb0c3['changeGroups']['find'](_0x4a87bb=>_0x4a87bb['index']===this['_currentPreviewedChangeGroup']['partIndex']);_0x40866b&&this['_activeBalloon']['setTargetReadOnly'](this['_isGroupReadOnly'](_0x40866b));}}_prepareDocumentSuggestions(_0x4346d0){const {reply:_0x3b7ada,interaction:_0x36b2d7}=this['getInteractionAndReplyById'](_0x4346d0['replyId']),_0x3591e0=void 0x0!==_0x4346d0['partIndex']?[_0x3b7ada['changeGroups'][_0x4346d0['partIndex']]]:_0x3b7ada['changeGroups']['filter'](_0x5f2c5d=>'pending'===_0x5f2c5d['state']&&!this['_isGroupReadOnly'](_0x5f2c5d)),_0x1ea87a=_0x3591e0['map'](_0x14aec9=>_0x3b7ada['changeGroups']['indexOf'](_0x14aec9)),_0x575d7c=fn(_0x3b7ada['changeGroups'],_0x3b7ada['documentContextContent']);return _0x1ea87a['forEach'](_0x4f83bf=>{if(_0x575d7c['has'](_0x4f83bf))return;const _0x36675c=this['_getDocumentRangeForReplyChanges'](_0x4346d0['replyId'],_0x4f83bf);_0x36675c&&'$graveyard'!=_0x36675c['range']['root']['rootName']?(_0x3b7ada['setChangeGroupState'](_0x4f83bf,'accepted'),void 0x0!==_0x4346d0['partIndex']&&this['_scrollToSuggestionRange'](_0x36675c['range'],!0x1,_0x36675c['targetEditor'])):_0x3b7ada['setChangeGroupState'](_0x4f83bf,'outdated',this['_getOutdatedReason'](_0x3b7ada['changeGroups'][_0x4f83bf]));}),Wr({'groups':_0x3591e0['filter'](_0x261ff6=>'accepted'===_0x261ff6['state']),'documentContextContent':_0x3b7ada['documentContextContent'],'documents':_0x36b2d7['getDocumentContext']()?.['documents']??[]});}_insertSuggestion(_0x23cc87){const _0x172e97=this['context']['plugins']['get'](Un),{reply:_0x588c00,interaction:_0x1e9103}=this['getInteractionAndReplyById'](_0x23cc87['replyId']),_0xa6819f=this['_prepareDocumentSuggestions'](_0x23cc87),_0x5bfa92=Gr({'documentSuggestions':_0xa6819f,'transform':!0x0,'documentChanges':_0x172e97,'documentChangesOptions':{'markDeletions':!0x0}});for(const [_0x367ea4,_0x4a1b4b]of _0x5bfa92){const {editor:_0x490d9c,indexes:_0x2f8c30}=_0xa6819f['get'](_0x367ea4);if(!_0x490d9c['plugins']['has']('TrackChanges')){Ft('ai-no-track-changes',{'editor':_0x490d9c});continue;}let _0x24448e;jn(_0x4a1b4b,'chat'),_0x490d9c['model']['change'](_0x353bf6=>{_0x24448e=_0x353bf6['batch'],_0x490d9c['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4a1b4b),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x24448e,{'interactionId':_0x1e9103['id'],'replyId':_0x588c00['id'],'indexes':_0x2f8c30});}this['_updateRatings'](_0x588c00);}_applySuggestion(_0x504b9a){const _0x40b189=this['context']['plugins']['get'](Un),{reply:_0xbb7b20,interaction:_0x9bb854}=this['getInteractionAndReplyById'](_0x504b9a['replyId']),_0x44c986=this['_prepareDocumentSuggestions'](_0x504b9a),_0x5ca22a=Gr({'documentSuggestions':_0x44c986,'transform':!0x0,'documentChanges':_0x40b189,'documentChangesOptions':{'markDeletions':!0x1}});for(const [_0x59d9d0,_0x447fc7]of _0x5ca22a){const {editor:_0x4292d2,indexes:_0x1f76d0}=_0x44c986['get'](_0x59d9d0);let _0x57da6a;jn(_0x447fc7,'chat');try{_0x4292d2['model']['change'](_0x44b175=>{_0x57da6a=_0x44b175['batch'],_0x40b189['applyOperations'](_0x44b175,_0x447fc7);}),this['_batchToChanges']['set'](_0x57da6a,{'interactionId':_0x9bb854['id'],'replyId':_0xbb7b20['id'],'indexes':_0x1f76d0});}catch(_0x33d194){throw this['_reporter']['logError'](new ur({'code':'ai-applying-suggestion-failed','type':'runtime','cause':_0x33d194})),_0x33d194;}}this['_updateRatings'](_0xbb7b20);}_rejectSuggestion(_0x75f651){const {reply:_0x3dd71a}=this['getInteractionAndReplyById'](_0x75f651['replyId']);_0x3dd71a['setChangeGroupState'](_0x75f651['partIndex'],'rejected');}['_openBalloonFor'](_0x5b94d0,_0x1c30cc){if(!this['_hasAIChatBalloon'])return;const {reply:_0x553deb}=this['getInteractionAndReplyById'](_0x5b94d0),_0x104c49=_0x553deb['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(!_0x104c49['length'])return;let _0x332e2f,_0x4c70f0;if(void 0x0!==_0x1c30cc?(_0x4c70f0=_0x104c49['find'](_0x13c52d=>_0x13c52d['index']==_0x1c30cc),_0x332e2f=_0x4c70f0?.['index']):(_0x4c70f0=_0x104c49[0x0],_0x332e2f=_0x4c70f0['index']),!_0x4c70f0)return void _0x553deb['setChangeGroupState'](_0x1c30cc??0x0,'outdated','editor-removed');if(this['_currentPreviewedChangeGroup']?.['replyId']==_0x5b94d0&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x332e2f)return;const _0x555ffd=this['_getUserPresentableContentPartDocumentRange'](_0x5b94d0,_0x553deb,_0x4c70f0),_0x8b77aa=_0x553deb['changeGroups']['find'](_0x1e9754=>_0x1e9754['index']==_0x332e2f),_0x7a75c3=_0x8b77aa['editor'],_0x17d820=_0x7a75c3['plugins']['get']('AIChatBalloon');if(this['_activeBalloon']&&this['_activeBalloon']!==_0x17d820&&this['_activeBalloon']['close'](),!_0x555ffd)return _0x17d820['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x17d820,this['_currentPreviewedChangeGroup']={'replyId':_0x5b94d0,'partIndex':_0x332e2f},this['_scrollToSuggestionRange'](_0x555ffd,!0x0,_0x7a75c3);const _0xd7bf2e=this['_getPresentableSiblingContentPartIndex'](_0x5b94d0,_0x332e2f,'next');_0x17d820['clearContent'](),_0x17d820['updateContent']({'part':_0x4c70f0,'renderingStrategy':'static'});const _0x12c691=_0x104c49['filter'](_0x417f89=>_0x417f89['hasChanges']),_0x60899a=this['_aiChatUi']['getFeedItemAIReplySuggestionPartUIIndex']({'id':_0x5b94d0,'index':_0x332e2f})??_0x12c691['findIndex'](_0xab56e9=>_0xab56e9['index']==_0x332e2f)+0x1;_0x17d820['open']({'index':_0x332e2f,'title':qs(this['context']['locale'],'AI_CHAT_BALLOON_HEADER_TITLE',[_0x60899a['toString'](),_0x12c691['length']['toString']()]),'showRotator':null!==_0xd7bf2e,'ranges':[_0x555ffd],'areActionsDisabled':_0x553deb['areActionsDisabled'],'targetEditor':_0x7a75c3,'isTargetReadOnly':this['_isGroupReadOnly'](_0x8b77aa)}),_0x17d820['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x5b94d0,_0x332e2f),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x5b94d0,'index':_0x332e2f,'isActive':!0x0});}_closeActiveBalloon(){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;}_getPresentableSiblingContentPartIndex(_0x30d274,_0x83436,_0x46ca78){const {reply:_0x825a52}=this['getInteractionAndReplyById'](_0x30d274),_0x5f4028=_0x825a52['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x5f4028['length'])return null;const _0x3d5c75='next'==_0x46ca78?0x1:-0x1;function _0x20fd67(_0x575c65){const _0x19a107=(_0x575c65+_0x3d5c75+_0x5f4028['length'])%_0x5f4028['length'];return{'siblingIndex':_0x19a107,'siblingPart':_0x5f4028[_0x19a107]};}const _0x346109=_0x5f4028['findIndex'](_0x2cfaf5=>_0x2cfaf5['index']==_0x83436);let {siblingIndex:_0x424f4f,siblingPart:_0x28c7e8}=_0x20fd67(_0x346109);for(;!this['_getUserPresentableContentPartDocumentRange'](_0x30d274,_0x825a52,_0x28c7e8);)if({siblingIndex:_0x424f4f,siblingPart:_0x28c7e8}=_0x20fd67(_0x424f4f),_0x424f4f===_0x346109)return null;return _0x28c7e8['index'];}_getOutdatedReason(_0x2aaa7a){return _0x2aaa7a?.['editor']&&'destroyed'!==_0x2aaa7a['editor']['state']?'content-removed':'editor-removed';}_getUserPresentableContentPartDocumentRange(_0xddbd86,_0x486342,_0x572ec6){const _0x1d8f37=_0x486342['changeGroups'];if(!_0x572ec6['hasChanges'])return null;const _0x23843f=_0x1d8f37['find'](_0x23473f=>_0x23473f['index']==_0x572ec6['index']);if('pending'!==_0x23843f?.['state'])return null;if(!_0x23843f?.['editor']||'destroyed'===_0x23843f['editor']['state'])return _0x486342['setChangeGroupState'](_0x572ec6['index'],'outdated',this['_getOutdatedReason'](_0x23843f)),null;const _0x112da2=this['_getDocumentRangeForReplyChanges'](_0xddbd86,_0x572ec6['index']);if(!_0x112da2)return _0x486342['setChangeGroupState'](_0x572ec6['index'],'outdated',this['_getOutdatedReason'](_0x23843f)),null;const {range:_0x38fdda,currentIndex:_0x223b4a}=_0x112da2;return'$graveyard'==_0x38fdda['root']['rootName']?(_0x486342['setChangeGroupState'](_0x223b4a,'outdated',this['_getOutdatedReason'](_0x23843f)),null):_0x112da2['range'];}_getDocumentRangeForReplyChanges(_0x324590,_0x4d3ff3){const {reply:_0x5ce10a,interaction:_0x14523f}=this['getInteractionAndReplyById'](_0x324590),_0x372347=_0x5ce10a['changeGroups']['filter'](_0x877b41=>'pending'==_0x877b41['state']),_0x123fd4=_0x372347['map'](_0x268168=>_0x5ce10a['changeGroups']['indexOf'](_0x268168));void 0x0===_0x4d3ff3&&(_0x4d3ff3=_0x123fd4[0x0]);const _0x51ae76=_0x123fd4['indexOf'](_0x4d3ff3);if(-0x1==_0x51ae76)return null;const _0xe8404d=_0x372347[_0x51ae76],_0x13f0c1=_0xe8404d['editor'];if(!_0x13f0c1||'destroyed'===_0x13f0c1['state'])return null;const _0x5ca98a=En(_0x13f0c1,_0xe8404d['rootName']),_0x52be22=_0x5ce10a['documentContextContent']['get'](_0xe8404d['documentId']),_0x570047=new _0x47233a([]),_0x4a2a0f=new _0x47233a([]);for(const _0x256dc5 of _0xe8404d['changes'])if('removed'!=_0x256dc5['type']&&_0x4a2a0f['children']['push'](_0x256dc5['node']['cloneNode'](!0x0)),'new'!=_0x256dc5['type']){const _0x4991fb=_0x1b0303(_0x3146f8=>ln(_0x3146f8,'data-id')==_0x256dc5['id'],_0x52be22,!0x0);_0x570047['children']['push'](_0x4991fb['cloneNode'](!0x0));}if(0x0==_0x570047['children']['length']){if(_0xe8404d['changes'][0x0]['anchorId']){const _0x36ddb3=nn('data-id',_0xe8404d['changes'][0x0]['anchorId'],_0x52be22);_0x570047['children']['unshift'](_0x36ddb3['cloneNode'](!0x0)),_0x4a2a0f['children']['unshift'](_0x36ddb3['cloneNode'](!0x0)),_0x36ddb3['nextSibling']&&(_0x570047['children']['push'](_0x36ddb3['nextSibling']['cloneNode'](!0x0)),_0x4a2a0f['children']['push'](_0x36ddb3['nextSibling']['cloneNode'](!0x0)));}else{const _0x276e56=_0x52be22['children'][0x0];if(!_0x276e56)return null;_0x570047['children']['push'](_0x276e56['cloneNode'](!0x0)),_0x4a2a0f['children']['push'](_0x276e56['cloneNode'](!0x0));}}if(_0x5ca98a&&fn(_0x5ce10a['changeGroups'],_0x5ce10a['documentContextContent'])['has'](_0xe8404d['index']))return null;const _0x3f217d=_0x14523f['getDocumentContext'](),_0x23c1f4=_0x3f217d['documents']['find'](_0x3bccb5=>_0x3bccb5['id']==_0xe8404d['documentId'])['content'],_0x5edcb0=_0x13f0c1['model']['document']['getRoot'](_0xe8404d['rootName']),_0x1b39bf=_0x13f0c1['data']['parse'](_0x23c1f4,_0x5edcb0),_0x1aa6db=_0x5ca98a?Tn(sn(_0x570047)):sn(_0x570047),_0x195486=_0x13f0c1['data']['parse'](_0x1aa6db,_0x5edcb0),_0x316a43=_0x13f0c1['data']['parse'](_0x1aa6db,_0x5edcb0),_0x4fd8c1=_0x13f0c1['model']['createPositionAt'](_0x195486,0x0),_0x53be40=_0x5ca98a?Tn(sn(_0x4a2a0f)):sn(_0x4a2a0f),_0x675fff={'targetEditor':_0x13f0c1,'anchor':_0x4fd8c1,'markDeletions':!0x1};let _0x30e956;try{_0x30e956=_0x13f0c1['plugins']['get'](Un)['getDiff'](_0x1aa6db,_0x53be40,_0x675fff);}catch(_0xee5d1b){return this['_reporter']['reportError'](new ur({'code':'ai-chat-suggestion-diff-failed','type':'runtime','severity':'warning','cause':_0xee5d1b,'context':{'replyId':_0x324590,'partIndex':_0x4d3ff3}})),null;}if(!_0x30e956['length'])return null;_0x13f0c1['model']['change'](_0x11a08e=>{for(const _0x32fa95 of _0x30e956)if(!_0x3463ba(_0x32fa95)){if('remove'==_0x32fa95['type']){const _0x468ff8=_0x32fa95['sourcePosition'],_0x33eb2a=_0x32fa95['howMany'],_0x4508be=new _0x500e5d(_0x468ff8,_0x33eb2a);_0x11a08e['batch']['addOperation'](_0x4508be),_0x13f0c1['model']['applyOperation'](_0x4508be);}else'marker'!==_0x32fa95['type']&&(_0x32fa95['baseVersion']=null,_0x32fa95['isDocumentOperation']=!0x1,_0x11a08e['batch']['addOperation'](_0x32fa95),_0x13f0c1['model']['applyOperation'](_0x32fa95));}});const _0x8536cd=fr(_0x13f0c1,_0x30e956,_0x195486);br(_0x13f0c1['model'],_0x8536cd);const _0x35d328=_0x8536cd['getFirstRange']()['start']['path']['slice'](),_0x568428=_0x8536cd['getFirstRange']()['end']['path']['slice'](),_0x561748=[];let _0xcc735c=_0x195486,_0x3d8de8=_0x316a43;for(let _0x55f50b=0x0;_0x55f50b<_0x568428['length'];_0x55f50b++){const _0x194621=_0xcc735c['maxOffset']-_0x568428[_0x55f50b];_0x561748[_0x55f50b]=_0x3d8de8['maxOffset']-_0x194621,_0xcc735c=_0xcc735c['getChildAtOffset'](_0x568428[_0x55f50b]),_0x3d8de8=_0x3d8de8['getChildAtOffset'](_0x561748[_0x55f50b]);}const _0x28e997=_0x13f0c1['model']['createRange'](_0x13f0c1['model']['createPositionFromPath'](_0x316a43,_0x35d328),_0x13f0c1['model']['createPositionFromPath'](_0x316a43,_0x561748)),_0x4e74b2=_0x28e997['start']['path']['slice'](),_0x5a0e35=_0x28e997['end']['path']['slice']();if(!_0x5ca98a){const _0x49d096=_0x316a43['getChild'](0x0)['getAttribute'](Vn),_0x31851b=Array['from'](_0x1b39bf['getChildren']())['find'](_0x3b27e3=>_0x3b27e3['getAttribute'](Vn)==_0x49d096)['getPath']();_0x4e74b2[0x0]=_0x31851b[0x0]+_0x4e74b2[0x0],_0x5a0e35[0x0]=_0x31851b[0x0]+_0x5a0e35[0x0];}let _0x151222=_0x13f0c1['model']['createRange'](_0x13f0c1['model']['createPositionFromPath'](_0x13f0c1['model']['document']['getRoot'](_0xe8404d['rootName']),_0x4e74b2),_0x13f0c1['model']['createPositionFromPath'](_0x13f0c1['model']['document']['getRoot'](_0xe8404d['rootName']),_0x5a0e35));const _0x89d12d=_0x3f217d['documents']['find'](_0x6f549b=>_0x6f549b['id']==_0xe8404d['documentId'])['version'],_0x30ba10=_0x13f0c1['model']['document']['history']['getOperations'](_0x89d12d);for(const _0x5970dd of _0x30ba10)_0x151222=_0x3aaa22['_createFromRanges'](_0x151222['getTransformedByOperation'](_0x5970dd));return{'range':_0x151222,'currentIndex':_0x4d3ff3,'targetEditor':_0x13f0c1};}_integrateEditorBalloon(_0x573174){if(!_0x573174['plugins']['has']('AIChatBalloon'))return;const _0x370888=_0x573174['plugins']['get']('AIChatBalloon');this['_hasAIChatBalloon']=!0x0,_0x370888['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x370888,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x3996f7,partIndex:_0x801912}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x5ec2da}=this['getInteractionAndReplyById'](_0x3996f7),_0x34e821=_0x5ec2da['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x801912});_0x370888['updateContent']({'part':_0x34e821[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x370888,'applySuggestion',()=>{const {replyId:_0x50e501,partIndex:_0x195444}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x50e501,'partIndex':_0x195444}),_0x370888['setState']('accepted');}),this['listenTo'](_0x370888,'insertSuggestion',()=>{const {replyId:_0x1de355,partIndex:_0x168a55}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x1de355,'partIndex':_0x168a55}),_0x370888['setState']('accepted');}),this['listenTo'](_0x370888,'rejectSuggestion',()=>{const {replyId:_0x563014,partIndex:_0xde6166}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x563014,'partIndex':_0xde6166}),_0x370888['setState']('rejected');}),this['listenTo'](_0x370888,'showNext',()=>{const {replyId:_0x18a357,partIndex:_0x43c049}=this['_currentPreviewedChangeGroup'],_0x21af33=this['_getPresentableSiblingContentPartIndex'](_0x18a357,_0x43c049,'next');null!==_0x21af33&&this['_openBalloonFor'](_0x18a357,_0x21af33);}),this['listenTo'](_0x370888,'showPrevious',()=>{const {replyId:_0x10f4d4,partIndex:_0x3d3da4}=this['_currentPreviewedChangeGroup'],_0x5ad631=this['_getPresentableSiblingContentPartIndex'](_0x10f4d4,_0x3d3da4,'previous');null!==_0x5ad631&&this['_openBalloonFor'](_0x10f4d4,_0x5ad631);}),this['listenTo'](_0x370888,'dialogClosed',(_0x2c52c4,{id:_0x4f75da})=>{if('aiChatBalloon'!==_0x4f75da)return;const {replyId:_0x1e3e34,partIndex:_0x434914}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x1e3e34,'index':_0x434914,'isActive':!0x1}),this['_activeBalloon']===_0x370888&&(this['_activeBalloon']=void 0x0);});}_integrateEditor(_0x22dac9){if(this['_channelsToEditors']['set'](_0x22dac9['config']['get']('collaboration.channelId'),_0x22dac9),this['_integrateEditorBalloon'](_0x22dac9),this['addCurrentDocumentToChatContext'](),this['listenTo'](_0x22dac9,'change:isReadOnly',()=>this['_refreshSuggestionGating']()),_0x22dac9['once']('destroy',()=>{this['_checkRemoveCurrentDocumentFromChatContext']();}),_0x22dac9['plugins']['has']('Undo')){const _0x4a2600=_0x22dac9['commands']['get']('undo'),_0x581541=_0x22dac9['commands']['get']('redo');this['listenTo'](_0x4a2600,'revert',(_0x561948,_0x544beb,_0x4dff82)=>{const _0x2d738d=this['_batchToChanges']['get'](_0x544beb);if(!_0x2d738d)return;const _0x5a8d6c=this['activeConversation']['getInteraction'](_0x2d738d['interactionId']),_0x56952=_0x5a8d6c?.['getReply'](_0x2d738d['replyId']);this['_batchToChanges']['delete'](_0x544beb),_0x5a8d6c&&_0x56952&&(_0x2d738d['indexes']['forEach'](_0x3ea494=>_0x56952['setChangeGroupState'](_0x3ea494,'pending')),this['_batchToChanges']['set'](_0x4dff82,_0x2d738d));}),this['listenTo'](_0x581541,'revert',(_0x22a926,_0xcbef59,_0x52a675)=>{const _0x542e37=this['_batchToChanges']['get'](_0xcbef59);if(!_0x542e37)return;const _0x1c61c2=this['activeConversation']['getInteraction'](_0x542e37['interactionId']),_0x33f3f0=_0x1c61c2?.['getReply'](_0x542e37['replyId']);this['_batchToChanges']['delete'](_0xcbef59),_0x1c61c2&&_0x33f3f0&&(_0x542e37['indexes']['forEach'](_0x1c47bf=>_0x33f3f0['setChangeGroupState'](_0x1c47bf,'accepted')),this['_batchToChanges']['set'](_0x52a675,_0x542e37));});}const _0x1dbb6d=_0x22dac9['config']['get']('ai.chat.context');_0x1dbb6d['alwaysAddSelection']&&_0x1dbb6d['document']['enabled']&&this['listenTo'](_0x22dac9['model']['document']['selection'],'change:range',(_0x278725,_0x5b7040)=>{_0x5b7040['directChange']&&'chat'===_0x22dac9['plugins']['get']('AITabs')['view']['activeTab']&&(_0x22dac9['model']['hasContent'](_0x22dac9['model']['document']['selection'])?this['addSelectionToChatContext'](_0x22dac9):this['removeSelectionFromChatContext']());});}async _getLastCreatedConversationId(){const _0x596016=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x2ed4af=await _0x596016['getConversations']();return _0x2ed4af['length']?_0x2ed4af[0x0]['id']:'new';}catch(_0x3ae1c1){return this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':Xt()}),this['_reporter']['logError'](new dt('ai-chat-conversation-init-failed',this,{'error':_0x3ae1c1})),this['_aiChatUi']['disableControls'](),null;}}async _startConversationSafely(_0x4e896c={}){this['set']('isConversationReady',!0x1);try{await this['_handleStartConversation'](_0x4e896c),_0x4e896c['id']||this['set']('isConversationReady',!0x0);}catch(_0x58ce24){this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x4e896c['id']||Xt()}),this['_reporter']['logError'](_0x58ce24),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}_detachFromActiveConversation(){this['_aiChatUi']['setIsUploadInProgress'](!0x1),this['activeConversation']&&this['stopListening'](this['activeConversation']);}async _handleStartConversation({id:_0x415ce8,modelId:_0x4fa82c,contexts:_0x4121bd}={}){this['_detachFromActiveConversation'](),this['_closeActiveBalloon']();let _0x15018a=_0x4fa82c;_0x15018a||(_0x415ce8||!this['activeConversation']?_0x15018a=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x15018a=this['activeConversation']['selectedModel']?.['id'])),this['_stopLastInteraction']();const _0x1d0ece=this['getGroupId'](),_0x594d0=_0x415ce8||Xt(),_0x43a5fe=await this['_aiModels']['getAvailableModels']();let _0x532f25;this['activeConversation']=new Br({'connector':this['_aiConnector'],'chatModels':this['_aiModels'],'selectedModelId':_0x15018a,'conversationId':_0x594d0,'group':_0x1d0ece,'locale':this['context']['locale'],'isFromHistory':!!_0x415ce8,'channelsToEditors':this['_channelsToEditors'],'contextLibrary':this['_aiContextLibrary'],'extraContexts':_0x4121bd,'getSessionId':_0xacd35b=>this['_aiEditing']['getSessionId'](_0xacd35b),'aiEditing':this['_aiEditing']}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['listenTo'](this['activeConversation'],'conversationInitialized',()=>{this['_aiChatUi']['createConversation']({'availableModels':_0x43a5fe}),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x415ce8||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['listenTo'](this['activeConversation'],'uploadProgressChanged',(_0x34a450,_0x3762d9)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x3762d9['isUploadInProgress']);}),this['listenTo'](this['activeConversation'],'webSearchStarted',()=>{const _0x3c99e3=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x3c99e3);}),this['listenTo'](this['activeConversation'],'reasoningStarted',()=>{const _0x1167b1=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x1167b1);}),this['listenTo'](this['activeConversation'],'webSearchFinished',(_0x584e36,_0x3d6e13)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3d6e13,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['listenTo'](this['activeConversation'],'reasoningFinished',(_0x471979,_0x1be495)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1be495,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['listenTo'](this['activeConversation'],'interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['listenTo'](this['activeConversation'],'interactionFinished',async()=>{this['_updateReplyContentThrottled']['flush'](),await this['_aiChatUi']['finishInteraction']();}),this['listenTo'](this['activeConversation'],'interactionDestroyed',(_0x51d65b,_0x42048c)=>{this['_aiChatUi']['removeFeedInteraction'](_0x42048c['id']);}),this['listenTo'](this['activeConversation'],'setConversationTitle',(_0x17bbe9,_0x4eb1ec,_0x31a323)=>{this['_updateConversationTitle'](_0x4eb1ec,_0x31a323);}),this['listenTo'](this['activeConversation'],'replyContentUpdated',async(_0x1bfa2d,_0x30d44b)=>{void 0x0!==_0x532f25&&_0x532f25!==_0x30d44b['id']&&this['_updateReplyContentThrottled']['flush'](),_0x532f25=_0x30d44b['id'],_0x30d44b['isFromHistory']?await this['_updateReplyContent']({'reply':_0x30d44b}):await this['_updateReplyContentThrottled']({'reply':_0x30d44b});}),this['listenTo'](this['activeConversation'],'replyChangeGroupStateUpdated',(_0x23a99e,{reply:_0x120dd8,index:_0xd76c5e,state:_0x37778c,outdatedReason:_0x509e40})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x120dd8['id'],'index':_0xd76c5e,'state':_0x37778c,'outdatedReason':_0x509e40}),this['_aiChatUi']['hasFeedItem'](_0x120dd8['id'])&&this['_aiChatUi']['setSuggestionGating'](_0x120dd8['id'],this['_computeSuggestionGating'](_0x120dd8)),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x120dd8['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0xd76c5e&&this['_activeBalloon']?.['setState'](_0x37778c,_0x509e40);}),this['listenTo'](this['activeConversation'],'contextItemAdded',(_0x2a25de,_0x54e87e)=>{if(this['_aiChatUi']['addContextItem'](_0x54e87e['contextItem'],_0x54e87e['isLoading']),'selection'===_0x54e87e['contextItem']['type']){const _0x2f8d5c=tn(this['context']),_0x1d2bb4=[..._0x2f8d5c['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'editor':_0x2f8d5c,'ranges':_0x1d2bb4,'id':'context','priority':0x1});}}),this['listenTo'](this['activeConversation'],'contextItemRemoved',(_0xdb64b0,_0xb9e5fc)=>{this['_aiChatUi']['removeContextItem'](_0xb9e5fc['uiId']),'current-document'==_0xb9e5fc['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0xb9e5fc['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['listenTo'](this['activeConversation'],'contextItemLoadingEnded',(_0x29f837,_0x5ca854)=>{this['_aiChatUi']['setContextItemLoading'](_0x5ca854['contextItem']['uiId'],_0x5ca854['isLoading']);}),this['listenTo'](this['activeConversation'],'contextSent',(_0x3468ba,_0x13d5d3)=>{this['_aiChatUi']['setConversationContext'](_0x13d5d3['contextItems']);}),this['listenTo'](this['activeConversation'],'addContextOptionsChanged',(_0x18862f,_0x1b5f6f)=>{this['_aiChatUi']['setAddContextOptions'](_0x1b5f6f['options']);}),this['listenTo'](this['activeConversation'],'sourceResourcesLoaded',(_0x42dae4,_0x1ef16e)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x1ef16e['sourceId'],_0x1ef16e['source'],_0x1ef16e['resources'],_0x1ef16e['uid']);}),this['listenTo'](this['activeConversation'],'resourceStateChanged',(_0x5e7192,_0x402a96)=>{this['_aiChatUi']['updateResourceState'](_0x402a96['sourceId'],_0x402a96['resourceId'],_0x402a96['isInContext']);}),this['listenTo'](this['activeConversation'],'capabilitiesUpdated',(_0x58c3aa,_0x4324a3)=>{this['_aiChatUi']['updateCapabilities'](_0x4324a3);}),this['listenTo'](this['activeConversation'],'modelSelected',(_0x5639c5,_0x4b9860)=>{this['_aiChatUi']['setSelectedModel'](_0x4b9860['selectedModel']??null,_0x4b9860['isDisabled']);}),this['listenTo'](this['activeConversation'],'error',async(_0x59b6d0,{error:_0x38bffb,interactionId:_0x4fc84c,fileName:_0x14b2d6,url:_0x273de3,sourceId:_0x667119,sourceLabel:_0xd8b57b})=>{let _0x1a2659;const _0x3aea4c=_0x4fc84c?_0x4fc84c+':'+Xt():Xt();this['_reporter']['reportError'](_0x38bffb),this['_aiChatUi']['startAutoScroll'](),_0x38bffb['message']['startsWith']('ai-request-aborted')?(this['_cancelProcessing'](),this['activeConversation']?.['cancelLastInteractionStream'](),_0x1a2659=this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':qs(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x3aea4c})):_0x38bffb['message']['startsWith']('ai-chat-conversation-init-failed')||_0x38bffb['message']['startsWith']('ai-chat-conversation-start-failed')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-file-upload-failed')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x14b2d6),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-url-upload-failed')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x273de3),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-context-invalid-data')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-context-unsupported-type')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x667119&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x667119),_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0xd8b57b||'source'),'id':_0x3aea4c})):_0x38bffb['message']['startsWith']('ai-chat-resource-load-failed')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-invalid-request')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-context-unsupported-file-type')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-context-file-too-large')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-context-file-too-many-pages')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x3aea4c}):(this['_cancelProcessing'](),_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x3aea4c}));try{await Promise['race']([_0x1a2659,this['_aiChatUi']['idleUiPromise']]);}finally{this['_aiChatUi']['isBusy']||this['_aiChatUi']['stopAutoScroll']();}}),await this['activeConversation']['init'](this['_buildConversationContextConfig']()),_0x415ce8||(await this['activeConversation']['start'](),this['_aiChatUi']['enableControls']());}_buildConversationContextConfig(){const _0x57f6d3=this['context']['config']['get']('ai.chat.context');return this['_contextLibrarySource']?{..._0x57f6d3,'sources':[..._0x57f6d3?.['sources']??[],this['_contextLibrarySource']]}:_0x57f6d3;}async _setUpContextLibrarySource(){const _0x2e9b2e=await this['_createContextLibrarySource']();_0x2e9b2e&&(this['_contextLibrarySource']=_0x2e9b2e,this['activeConversation']&&this['activeConversation']['chatContext']['addContextSource'](_0x2e9b2e));}async _createContextLibrarySource(){let _0x250f34;try{_0x250f34=await this['_aiContextLibrary']['getAvailableContexts']();}catch{return null;}if(!_0x250f34['length'])return null;const _0x13e15f=_0x250f34['map'](_0x4e68ab=>({'id':_0x4e68ab['id'],'type':'context','label':_0x4e68ab['name']||_0x4e68ab['id']}));return{'id':'ck-ai-context-library','label':qs(this['context']['locale'],'AI_CHAT_CONTEXT_LIBRARY_LABEL'),'useDefaultFiltering':!0x0,'getResources':()=>Promise['resolve'](_0x13e15f)};}_removeFromContext(_0x4219d2){this['activeConversation']?.['removeFromContext'](_0x4219d2);}_toggleWebSearch(){this['activeConversation']?.['toggleWebSearch']();}_toggleReasoning(){this['activeConversation']?.['toggleReasoning']();}getInteractionAndReplyById(_0x488e4f){const [_0x4961f4,_0x30f51b]=_0x488e4f['split'](':'),_0x111847=this['activeConversation']['getInteraction'](_0x4961f4);return{'interaction':_0x111847,'reply':_0x111847['getReply'](_0x30f51b)};}_scrollToSuggestionRange(_0x52ad65,_0x3e8d7b=!0x1,_0x56e63f){const _0xad5ec4={'target':_0x56e63f['editing']['view']['domConverter']['viewRangeToDom'](_0x56e63f['editing']['mapper']['toViewRange'](_0x52ad65)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x3e8d7b};_0x3e8d7b&&(_0xad5ec4['alignToTop']=!0x0),Yt(_0xad5ec4);}_updateConversationTitle(_0xc80b4d,_0x5e5999=!0x1){this['_aiChatUi']['setConversationTitle'](_0xc80b4d||qs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x5e5999);}_addFeedItemReply(_0x3d1d67){'text'===_0x3d1d67['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x3d1d67):this['_aiChatUi']['addFeedItemAISuggestion'](_0x3d1d67);}async _updateReplyContent({reply:_0x5e1e1c,renderingStrategy:_0x37a0c8}){const {id:_0x32f42f,interactionId:_0x4a16ee,isDone:_0x1ecaa5,type:_0x3da76f,parsedContent:_0x4139dd}=_0x5e1e1c,_0x46ad3e=_0x4a16ee+':'+_0x32f42f;if('modification'===_0x3da76f){const _0x4a7a92=_0x5e1e1c['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x46ad3e,'parts':_0x4a7a92,'isDone':_0x1ecaa5,'skipLoadingEffects':_0x5e1e1c['isFromHistory']}),this['_aiChatUi']['hasFeedItem'](_0x5e1e1c['id'])&&this['_aiChatUi']['setSuggestionGating'](_0x5e1e1c['id'],this['_computeSuggestionGating'](_0x5e1e1c));}else'text'===_0x3da76f&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x46ad3e,'parsedContent':_0x4139dd['get']('text'),'renderingStrategy':_0x37a0c8,'isDone':_0x1ecaa5});_0x1ecaa5&&_0x5e1e1c['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x46ad3e,_0x5e1e1c['sources']);}_updateReplyContentThrottled=_0x467982(this['_updateReplyContent']['bind'](this),0xc8);_stopLastInteraction(){this['activeConversation']?.['stopProcessing'](),this['_aiChatUi']['stopInteraction'](this['activeConversation']?.['lastInteraction']),this['_updateReplyContentThrottled']['cancel']();}async _flushLastInteractionUI(){const _0x25ed1f=this['activeConversation']?.['lastInteraction'];if(_0x25ed1f){for await(const _0x15b7aa of _0x25ed1f['replies'])this['_aiChatUi']['hasFeedItem'](_0x15b7aa['id'])||this['_addFeedItemReply'](_0x15b7aa),await this['_updateReplyContent']({'reply':_0x15b7aa,'renderingStrategy':'static'});}}async['_cancelProcessing'](){this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}_updateRatings(_0x2ec2e3){const _0x4680bf={'positiveCount':_0x2ec2e3['changeGroups']['filter'](_0x5930ea=>'accepted'===_0x5930ea['state'])['length'],'totalCount':_0x2ec2e3['changeGroups']['length'],'modificationId':_0x2ec2e3['id']},_0x387dfb=this['activeConversation']['getInteraction'](_0x2ec2e3['interactionId'])['messageId'];_0x387dfb&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x387dfb,_0x4680bf);}_getAIChatFeedAPI(_0x28c6a5){const _0x256815=this['_aiChatUi'],_0x9fd897=()=>{_0x28c6a5['resetWebSearchState'](),_0x28c6a5['resetReasoningState'](),_0x256815['clearLoadingMessage']();},_0xd6fb79=()=>{_0x28c6a5['currentReply']&&(_0x28c6a5['currentReply']['done'](),_0x28c6a5['currentReply']=void 0x0);};return{'insertTextReply':(_0x16313c,_0x115f67)=>{_0xd6fb79(),_0x9fd897();const _0x14f95a=_0x28c6a5['currentReply']=_0x28c6a5['createReply']({'type':'text','interactionId':_0x28c6a5['id'],'id':_0x115f67||Xt(),'channelsToEditors':this['_channelsToEditors']});return _0x14f95a['appendContent'](_0x16313c),_0xd6fb79(),_0x14f95a;},'insertCustomElement':async(_0x28d027,_0x39771d)=>(_0xd6fb79(),_0x9fd897(),_0x256815['addFeedItemCustomElement'](_0x28d027,_0x39771d||Xt())),'setLoadingMessage':_0x39cc78=>{_0x256815['setLoadingMessage'](_0x39cc78);},'clearLoadingMessage':()=>{_0x256815['clearLoadingMessage']();}};}_checkRemoveCurrentDocumentFromChatContext(){Zs(this['context'])['find'](_0x3e8f3a=>'destroyed'!==_0x3e8f3a['state'])||(this['activeConversation']?.['removeFromContext']('current-document'),this['activeConversation']?.['toggleAddCurrentDocumentOptionVisibility'](!0x1));}};const $r=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Yr=[...$r,'startConversation','sendUserMessage','promptInputPaste','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];function qr(_0x10aa1e){const _0x4cdeb6=new AbortController();return{'promise':new Promise((_0x507593,_0x44c001)=>{const _0x39e402=setTimeout(_0x507593,_0x10aa1e);_0x4cdeb6['signal']['addEventListener']('abort',()=>{clearTimeout(_0x39e402),_0x44c001();});}),'abortController':_0x4cdeb6};}var Qr=class{options;isStreaming=!0x1;document=null;nodesList=[];currentIndex=0x0;timeoutAbortController=null;lastUpdateTime=0x0;constructor(_0x57a653){this['options']={'delay':_0x57a653?.['delay']??0xa,'textNodeStyle':_0x57a653?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async stream({document:_0x53629a,targetElement:_0x5667ef,abortSignal:_0x2570e4}){this['isStreaming']&&this['stop'](),_0x2570e4?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x950ff(_0x53629a,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x3f03b9=0x0;_0x3f03b9<this['currentIndex'];_0x3f03b9++)this['nodesList'][_0x3f03b9]['shouldBeStreamed']=!0x0;do{const _0xa9da70=Date['now'](),_0x266111=this['nodesList'][this['currentIndex']],_0x100b75=_0xa9da70-this['lastUpdateTime'];if(_0x266111){_0x266111['shouldBeStreamed']=!0x0;let _0x4d5863=_0x266111['parent'];for(;_0x4d5863;)_0x4d5863['shouldBeStreamed']=!0x0,_0x4d5863=_0x4d5863['parent'];}if(_0x100b75<this['options']['delay'])try{const {promise:_0x25cf80,abortController:_0x3acbaa}=qr(this['options']['delay']-_0x100b75);this['timeoutAbortController']=_0x3acbaa,await _0x25cf80;}catch(_0x45401f){return;}const _0x103253=_0x5667ef['ownerDocument']['createElement'](_0x5667ef['tagName']);_0x103253['innerHTML']=Qt(this['renderNode'](this['document'])),_0x163546(_0x5667ef,_0x103253,{'childrenOnly':!0x0}),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:_0x4bb86a}){Array['from'](_0x4bb86a['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x110bf8=>{_0x110bf8['replaceWith'](_0x110bf8['childNodes'][0x0]);});}stop(){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x55b535){let _0x500c21='';if(function(_0x2eb7d2){return _0x2388bd(_0x2eb7d2);}(_0x55b535)){for(const _0x31c537 of _0x55b535['children'])_0x500c21+=this['renderNode'](_0x31c537);}else{if(jr(_0x55b535)){if(!_0x55b535['shouldBeStreamed'])return'';const _0x2a1a34=_0x55b535,_0x4a52a5=Object['entries'](_0x2a1a34['attribs'])['map'](([_0x569fda,_0x173c7b])=>_0x569fda+'=\x22'+_0x173c7b+'\x22')['join']('\x20');_0x500c21+='<'+_0x2a1a34['tagName']+(_0x4a52a5?'\x20'+_0x4a52a5:'')+'>';for(const _0x4f905f of _0x4fdaaa(_0x2a1a34))_0x500c21+=this['renderNode'](_0x4f905f);_0x500c21+='</'+_0x2a1a34['tagName']+'>';}else{if(!zr(_0x55b535))return'';if(!_0x55b535['shouldBeStreamed'])return'';!function(_0x4ab457){return!(!_0x4ab457['parent']||!jr(_0x4ab457['parent']))&&(!!Xr['includes'](_0x4ab457['parent']['tagName'])&&!_0x42359b(_0x4ab457)['match'](/^\s*[<>]\s*$/));}(_0x55b535)?_0x500c21+=_0x24a162(_0x55b535):_0x500c21+=_0x24a162(new _0x3cf04b('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x55b535]));}}return _0x500c21;}getParsedDocumentNodeList(){const _0x1fd9da=[];return function(_0x178a57,_0x57e4c9){const _0x4ce72f=_0x5193c8=>{if(_0x57e4c9(_0x5193c8),_0x5193c8 instanceof _0x2ba83d)for(let _0x514d7c=0x0;_0x514d7c<_0x5193c8['children']['length'];_0x514d7c++){const _0x183523=_0x5193c8['children'][_0x514d7c];_0x4ce72f(_0x183523);}};for(let _0x536239=0x0;_0x536239<_0x178a57['children']['length'];_0x536239++)_0x4ce72f(_0x178a57['children'][_0x536239]);}(this['document'],_0xfafc8e=>{if(zr(_0xfafc8e)){const _0x203389=this['splitTextNodeIntoWordNodes'](_0xfafc8e);_0x203389['length']&&_0x1fd9da['push'](..._0x203389);}_0xfafc8e['isWordSplitSource']||_0xfafc8e['isWordSplitResult']||_0x1fd9da['push'](_0xfafc8e);}),_0x1fd9da;}splitTextNodeIntoWordNodes(_0x5cfbde){if(_0x5cfbde['isWordSplitSource']||_0x5cfbde['isWordSplitResult'])return[];const _0xcc3b82=_0x42359b(_0x5cfbde)['match'](/(?:\s*\S+\s*)/g),_0x4d77b7=[];if(_0xcc3b82&&_0xcc3b82['length']>0x1){for(const _0x49849e of _0xcc3b82){const _0x332fde=new _0x3978f9(_0x49849e);_0x332fde['isWordSplitResult']=!0x0,_0x1e83fe(_0x5cfbde,_0x332fde),_0x4d77b7['push'](_0x332fde);}_0x5cfbde['isWordSplitSource']=!0x0,_0x15340f(_0x5cfbde);}return _0x4d77b7;}};const Xr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function zr(_0x2b65c4){return _0x4f3ed2(_0x2b65c4);}function jr(_0x5e9c51){return _0x58049c(_0x5e9c51);}function Jr(_0x1cbf27,_0x48ee93){_0x1cbf27['cleanUpAnimations']({'targetElement':_0x48ee93}),_0x48ee93['querySelectorAll']('[data-id]')['forEach'](_0x86f2b1=>{_0x86f2b1['removeAttribute']('data-id');});}var Zr=class extends _0x2df458{options;content='';htmlStreamer;['children'];constructor(_0x59ecb6){super();const _0x1c75a2=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new Qr(),this['options']=_0x59ecb6,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x1c75a2['if']('isDone','ck-ai-chat__feed__item_done'),_0x1c75a2['if']('isVisible','ck-hidden',_0x29f0e0=>!_0x29f0e0),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){Jr(this['htmlStreamer'],this['element']),this['isDone']=!0x0;}async streamIntoElement(_0x20209e,_0xf25ac6,_0x20ce64){await this['htmlStreamer']['stream']({'document':_0x20209e,'targetElement':_0xf25ac6,'abortSignal':_0x20ce64});}},to=class extends _0x2df458{['showChangesToggleView'];constructor(_0x2f4384,_0x5c9cfe){super(_0x2f4384),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new _0x1a9216(_0x2f4384),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-button_small\x20'+Ir,'label':qs(_0x2f4384,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x5c9cfe['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x59ec9f=>_0x59ec9f?nt:st),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x554ce3=new _0x5e3c18();_0x554ce3['content']=_0x5e85dd,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x5c9cfe['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x554ce3,{'tag':'span','children':[qs(_0x2f4384,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}};const eo={'title':'AI_SUGGESTION_CONTENT_PART_TITLE','apply':'AI_SUGGESTION_CONTENT_PART_APPLY','suggest':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','reject':'AI_SUGGESTION_CONTENT_PART_REJECT','stateAccepted':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','stateRejected':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','stateOutdated':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED'},io={'accepted':_0x42448e,'rejected':_0x29be46,'outdated':tt};var so=class extends _0x2df458{statePillView;constructor(_0xf53388,_0x4735e9=eo){super(_0xf53388);const _0xb2615c=this['bindTemplate'];this['set']('state','accepted'),this['set']('outdatedReason',void 0x0),this['set']('isVisible',!0x0),this['statePillView']=new _0x286f6b(_0xf53388),this['statePillView']['bind']('label')['to'](this,'state',_0x49489a=>function(_0x3010a9,_0x4df6ea,_0x8f3741){const _0x5141f5={'accepted':_0x8f3741['stateAccepted'],'rejected':_0x8f3741['stateRejected'],'outdated':_0x8f3741['stateOutdated']};return qs(_0x3010a9,_0x5141f5[_0x4df6ea]);}(_0xf53388,_0x49489a,_0x4735e9)),this['statePillView']['bind']('icon')['to'](this,'state',_0x5c0f7a=>io[_0x5c0f7a]),this['statePillView']['bind']('class')['to'](this,'state',_0x47bac6=>'ck-pill_'+_0x47bac6),this['statePillView']['bind']('tooltip')['to'](this,'state',this,'outdatedReason',(_0x33b75d,_0x37b728)=>function(_0xe62b6a,_0x395e80,_0x169309){if('outdated'!==_0x395e80)return;return qs(_0xe62b6a,_0x169309?no[_0x169309]:'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_TOOLTIP');}(_0xf53388,_0x33b75d,_0x37b728)),this['statePillView']['size']='small',this['statePillView']['tooltipPosition']='s',this['statePillView']['tooltipClass']='ck-tooltip_multi-line',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0xb2615c['if']('isVisible','ck-hidden',_0x44f9bb=>!_0x44f9bb)]},'children':[this['statePillView']]});}setState(_0x38d3a4,_0x5c0265){this['state']=_0x38d3a4,this['outdatedReason']='outdated'===_0x38d3a4?_0x5c0265:void 0x0;}};const no={'content-removed':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_CONTENT_REMOVED_TOOLTIP','editor-removed':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_EDITOR_REMOVED_TOOLTIP','session-changed':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_SESSION_CHANGED_TOOLTIP'};var ro=class extends _0x20288e{_applyButton;_suggestButton;constructor(_0x55dce0,_0x20ea46,_0x430479,_0xf4c5ae=eo){super(_0x55dce0);const _0x7fff7b=Boolean(_0x430479);this['set']('isEnabled',!_0x7fff7b),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1),this['set']('isApplyVisible',!0x0),this['set']('isSuggestVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0xa8e136=[];if(!_0x7fff7b){_0x20ea46['includes']('applySuggestion')&&(this['_applyButton']=new _0x1a9216(_0x55dce0),this['_applyButton']['set']({'label':qs(_0x55dce0,_0xf4c5ae['apply']),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x4e0bfc,'class':pr}),this['_applyButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isTargetReadOnly',(_0xa9f5d5,_0x11b80d)=>_0xa9f5d5&&!_0x11b80d),this['_applyButton']['bind']('isVisible')['to'](this,'isTrackChangesOn',this,'isApplyVisible',(_0x26000a,_0x402ddc)=>!_0x26000a&&_0x402ddc),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0xa8e136['push'](this['_applyButton'])),_0x20ea46['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x1a9216(_0x55dce0),this['_suggestButton']['set']({'label':qs(_0x55dce0,_0xf4c5ae['suggest']),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x32dbd8,'class':pr}),this['_suggestButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isTargetReadOnly',(_0x37c17e,_0x705e84)=>_0x37c17e&&!_0x705e84),this['_suggestButton']['bind']('isVisible')['to'](this,'isSuggestVisible'),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0xa8e136['push'](this['_suggestButton']));const _0x1c4dda=new _0x1a9216(_0x55dce0);_0x1c4dda['set']({'label':qs(_0x55dce0,_0xf4c5ae['reject']),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x28a335,'class':pr}),_0x1c4dda['bind']('isEnabled')['to'](this),_0x1c4dda['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0xa8e136['push'](_0x1c4dda);}this['items']['addMany'](_0xa8e136);const _0x28a7af=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x28a7af['if']('isVisible','ck-hidden',_0x3194cc=>!_0x3194cc)]}});}setButtonsVisibility({showApplyButton:_0x18b2cc,showSuggestButton:_0x3279c1}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x18b2cc),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x3279c1);}},oo=class extends _0x2df458{toolbarView;stateView;titleLabelView;['children'];constructor(_0x241760,{part:_0x1af24c,uiIndex:_0x55c1c0,availableActions:_0x2afc0d,areActionsDisabled:_0x17e58d,translationKeys:_0xfd98df=eo}){super(_0x241760),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1),this['set']('isApplyVisible',!0x0),this['set']('isSuggestVisible',!0x0),this['toolbarView']=new ro(_0x241760,_0x2afc0d,_0x17e58d,_0xfd98df),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x1af24c['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x1af24c['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x1af24c['index']});}),this['toolbarView']['bind']('isEnabled','isTrackChangesOn','isTargetReadOnly','isApplyVisible','isSuggestVisible')['to'](this),this['stateView']=new so(_0x241760,_0xfd98df),this['titleLabelView']=new ao(_0x241760,_0x55c1c0,_0xfd98df['title']),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',(_0x1dc9be,_0x432341,_0x420a87,_0x2fa159)=>{'pending'===_0x2fa159?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x420a87?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x420a87,this['outdatedReason']),this['children']['add'](this['stateView']));});}},ao=class extends _0x2df458{constructor(_0x34b050,_0x3c4b8e,_0x1a5451){super(_0x34b050),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[qs(_0x34b050,_0x1a5451,_0x3c4b8e['toString']())]});}},ho=class extends _0x2df458{htmlStreamer;constructor(_0x4661d6){super(_0x4661d6),this['htmlStreamer']=new Qr(),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async update({part:_0x2f2c03,renderingStrategy:_0x3bb686,abortSignal:_0x3a68bb}){this['_ensureHostElementTag'](_0x2f2c03['wrapperTag']||'div');const _0x4322ef=_0x950ff(_0x2f2c03['content'],!0x0);for(const _0x4ea388 of on(_0x4322ef))_0x15340f(_0x4ea388);if('streaming'===_0x3bb686)await this['htmlStreamer']['stream']({'document':_0x4322ef,'targetElement':this['element'],'abortSignal':_0x3a68bb});else{const _0x3a0c87=this['element']['ownerDocument']['createElement'](this['element']['tagName']);_0x3a0c87['innerHTML']=Qt(sn(_0x4322ef)),_0x163546(this['element'],_0x3a0c87,{'childrenOnly':!0x0});}}['clear'](){this['htmlStreamer']['reset'](),this['element']&&(this['element']['replaceChildren'](),this['element']['scrollTop']=0x0);}cleanUpStreamingArtifacts(){Jr(this['htmlStreamer'],this['element']);}_ensureHostElementTag(_0x3bcd81){if(!this['element']||this['element']['tagName']['toLowerCase']()===_0x3bcd81)return;const _0x4102f1=new _0x4e263f({'tag':_0x3bcd81,'attributes':{'class':this['element']['className']}})['render']();this['element']['replaceWith'](_0x4102f1),this['element']=_0x4102f1;}},co=class extends _0x2df458{['uiIndex'];['_children'];['_headerView'];_streamableContentView;constructor(_0x1b4575,{part:_0x3925d5,uiIndex:_0x47b086,areActionsDisabled:_0x1cd71b,availableActions:_0x2ff154,translationKeys:_0x3e448b=eo}){super(_0x1b4575);const _0x5689db=this['bindTemplate'];this['uiIndex']=_0x47b086,this['set']('state',_0x3925d5['state']),this['set']('outdatedReason',_0x3925d5['outdatedReason']),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1),this['set']('isApplyVisible',!0x0),this['set']('isSuggestVisible',!0x0);const _0x3690e4=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x1cd71b;};this['on']('change:state',_0x3690e4),this['on']('change:isDone',_0x3690e4),_0x3690e4(),this['_children']=this['createCollection'](),this['_headerView']=new oo(_0x1b4575,{'part':_0x3925d5,'uiIndex':_0x47b086,'availableActions':_0x2ff154,'areActionsDisabled':_0x1cd71b,'translationKeys':_0x3e448b}),this['_headerView']['bind']('isEnabled','outdatedReason','state','isTrackChangesOn','isTargetReadOnly','isApplyVisible','isSuggestVisible')['to'](this),this['_headerView']['delegate'](...$r)['to'](this),this['_streamableContentView']=new ho(_0x1b4575),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x5689db['to']('state',_0x2b3360=>'ck-ai-suggestion__body__content-part_'+_0x2b3360),_0x5689db['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x5689db['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x5689db['if']('isVisible','ck-hidden',_0x5b71b8=>!_0x5b71b8)]},'children':this['_children'],'on':{'mouseenter':_0x5689db['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x3925d5['index']});}),'mouseleave':_0x5689db['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x3925d5['index']});}),'click':_0x5689db['to'](_0x1fc648=>{const _0x15e20a=_0x1fc648['target'];_0x15e20a&&'A'===_0x15e20a['tagName']&&_0x1fc648['preventDefault'](),this['isEnabled']&&!Rt(this['_headerView']['toolbarView']['element'],_0x15e20a)&&this['fire']('showChangeInText',{'index':_0x3925d5['index']});})}});}async updateContent({part:_0x5a6e83,showUnchangedParts:_0xa5385d=!0x1,abortSignal:_0x42da89}){this['partDefinition']=_0x5a6e83,this['isVisible']=this['partDefinition']['hasChanges']||_0xa5385d,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x5a6e83,'renderingStrategy':'static','abortSignal':_0x42da89});}['markAsDone'](){this['isDone']=!0x0;}},lo=class extends _0x2df458{constructor(_0x379fa2,_0x245683){super(_0x379fa2),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x2024e9=>!_0x2024e9)]},'children':this['_createSkeletonItems'](_0x245683)});}_createSkeletonItems(_0x5f5843){const _0x76f5d4=['ck','ck-ai-skeleton__item'];return _0x5f5843['map'](_0x2bfaff=>{if('children'in _0x2bfaff)return{'tag':_0x2bfaff['tag'],'attributes':{'class':['ck','ck-ai-skeleton__row']},'children':this['_createSkeletonItems'](_0x2bfaff['children'])};let _0x2a45dd='';switch(_0x2bfaff['attributes']['align']){case'right':_0x2a45dd='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x2a45dd='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x2a45dd='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x2bfaff['tag'],'attributes':{'class':[..._0x76f5d4,_0x2bfaff['attributes']['class']?_0x2bfaff['attributes']['class']:''],'style':'width:\x20'+_0x2bfaff['attributes']['width']+';\x20height:\x20'+_0x2bfaff['attributes']['height']+';'+_0x2a45dd}};});}};const uo={'aiSuggestionBody':[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'85%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'75%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}}],'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'}}],'aiChatInit':[{'tag':'div','attributes':{'width':'70%','height':'36px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'36px','align':'left'}}],'aiChatControls':[{'tag':'div','attributes':{'width':'100%','height':'30px','align':'left'}},{'tag':'div','attributes':{'width':'150px','height':'20px','align':'left'}}],'aiHistory':_o(0x5,'100%','44px','right'),'aiChatResources':_o(0x8,'100%','24px','right'),'aiReviewChecks':go(0x10,[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'85%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'75%','height':'24px','align':'left'}}]),'aiTranslateChecks':go(0x10,[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'83%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'98%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'72%','height':'24px','align':'left'}}]),'aiActionsBalloon':[{'tag':'div','attributes':{'width':'76%','height':'20px','align':'left'}},{'tag':'div','attributes':{'width':'87%','height':'20px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'20px','align':'left'}},{'tag':'div','attributes':{'width':'87%','height':'20px','align':'left'}}],'aiReviewInitCheck':go(0x6,[{'tag':'div','attributes':{'width':'30%','height':'18px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'18px','align':'left'}}])};function _o(_0xda5edb,_0x380504,_0x5c13ff,_0x20636d){return new Array(_0xda5edb)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x380504,'height':_0x5c13ff,'align':_0x20636d}}));}function go(_0x394720,_0x529beb){return new Array(_0x394720)['fill'](null)['map'](()=>({'tag':'div','children':_0x529beb}));}const Io=/* #__PURE__ -- @preserve */
33
+ It();var Ao=class extends Io{['queue']=[];['isProcessing']=!0x1;_abortController;async['enqueue'](_0x12eb5){const _0x154d57=this['createTask'](_0x12eb5);return this['queue']['push'](_0x154d57),this['_processQueue'](),_0x154d57['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(_0xedd69e=>{this['once']('_queueEmpty',()=>{_0xedd69e();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x229d0e=this['queue']['shift']();try{await _0x229d0e['callback'](this['_abortController']['signal']),_0x229d0e['resolve']();}catch(_0x1637e6){_0x229d0e['reject'](_0x1637e6);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}createTask(_0x44fac2){let _0x7ec861,_0x583681;const _0x12be15=new Promise((_0x3e367b,_0x5e7536)=>{_0x7ec861=_0x3e367b,_0x583681=_0x5e7536;});return{'callback':_0x44fac2,'resolve':_0x7ec861,'reject':_0x583681,'completePromise':_0x12be15};}},Eo=class extends Zr{constructor(_0x5100c5){super(_0x5100c5),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x5100c5['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}setContent(_0x293331){this['element']['innerHTML']=Qt(_0x293331);}};const po=['applySuggestion','insertSuggestion'];var mo=class extends _0x2df458{_applyChangesButton;_insertSuggestionsButton;['children'];constructor(_0x4175b4,_0x577427=[...po],_0x38fd6e){super(_0x4175b4);const _0x20a2ed=this['bindTemplate'],_0x5e21f9=Boolean(_0x38fd6e);this['set']('isEnabled',!_0x5e21f9),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x5e21f9||(this['_applyChangesButton']=new _0x1a9216(_0x4175b4),this['_applyChangesButton']['set']({'label':qs(_0x4175b4,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x577427['includes']('applySuggestion'),'class':gr}),this['_insertSuggestionsButton']=new _0x1a9216(_0x4175b4),this['_insertSuggestionsButton']['set']({'label':qs(_0x4175b4,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x577427['includes']('insertSuggestion'),'class':Ir}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x4c894e=>{_0x4c894e['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',_0x20a2ed['if']('isVisible','ck-hidden',_0x1d96b3=>!_0x1d96b3)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}updateVisibility(_0x541bd6){this['isVisible']=_0x541bd6;}_switchButtonLabelsPlurality(_0x3b3776){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x3b3776?(this['_applyChangesButton']['label']=qs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=qs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=qs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=qs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}},To=class extends _0x2df458{['children'];['balloonPanelView'];bodyCollection;constructor(_0x746ed8,_0x4aa3cc){super(_0x746ed8),this['bodyCollection']=_0x4aa3cc,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',_0x24b966=>!_0x24b966)]},'children':this['children']});const _0x34f71e=new _0x2df458(this['locale']),_0x45e373=new _0x5e3c18();_0x45e373['content']=ut,_0x34f71e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x45e373,{'tag':'span','children':[{'text':qs(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x34f71e),this['_setupBalloonPanel'](_0x746ed8);}['addSource'](_0x5b3806){this['children']['add'](new wo(this['locale'],_0x5b3806,this['balloonPanelView']));}_setupBalloonPanel(_0x1ac2ba){this['balloonPanelView']=new Jt(_0x1ac2ba),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}},wo=class extends _0x1a9216{['balloonPanelView'];['source'];constructor(_0x18f1ea,_0x24eb64,_0x67998e){super(_0x18f1ea),this['source']=_0x24eb64,this['balloonPanelView']=_0x67998e,this['set']({'label':_0x24eb64['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x57ae7b=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x57ae7b['to'](()=>{window['open'](_0x24eb64['url'],'_blank');}),'mouseenter':_0x57ae7b['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x57ae7b['to'](()=>{this['_hideTooltip']();})}}),_0x24eb64['favicon']){const _0x35fef6=new _0x2df458(_0x18f1ea);_0x35fef6['setTemplate']({'tag':'img','attributes':{'src':_0x24eb64['favicon']||ut,'alt':_0x24eb64['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x35fef6);}else this['set']('icon',ut);}_createTooltipContentView(_0x43f03d,_0x564ca3){const _0x45b3b9=new _0x2df458(_0x43f03d),_0x20765e=[];let _0x1bc054;_0x564ca3?.['favicon']?(_0x1bc054=new _0x2df458(_0x43f03d),_0x1bc054['setTemplate']({'tag':'img','attributes':{'src':_0x564ca3['favicon'],'alt':_0x564ca3['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x1bc054=new _0x5e3c18(),_0x1bc054['content']=ut,_0x1bc054['extendTemplate']({'attributes':{'alt':_0x564ca3['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x20765e['push'](_0x1bc054);const _0x38353a=new _0x2df458(_0x43f03d);_0x38353a['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x564ca3['url']},'children':[{'text':new URL(_0x564ca3['url'])?.['hostname']}]}),_0x20765e['push'](_0x38353a);const _0x4a2802=new _0x2df458(_0x43f03d);_0x4a2802['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x20765e});const _0xd3b5c7=new _0x2df458(_0x43f03d);return _0xd3b5c7['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x564ca3['title']['length']>0x190?_0x564ca3['title']['substring'](0x0,0x190)+'...':_0x564ca3['title']}]}),_0x45b3b9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x4a2802,_0xd3b5c7]}),_0x45b3b9;}_showTooltip(){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[Jt['defaultPositions']['northArrowSouth'],Jt['defaultPositions']['northArrowSouthWest'],Jt['defaultPositions']['northArrowSouthEast']],'limiter':()=>ah(this['element'])}),this['balloonPanelView']['show']();}_hideTooltip(){this['balloonPanelView']['hide']();}_updateTooltipContent(){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x31c434=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x31c434);}},Co=class extends _0x2df458{_actionsView;['_readOnlyByIndex']=new Map();['_sourcesView'];['_children'];_skeletonView;_showSkeletonDebounced=_0x2fd977(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);_skeletonShownAt=null;_areActionsDisabled;_showUnchangedParts;_updateContentPartsPromiseQueue;_emptyPartsWarningView;_availableActions;_cachedContentParts=[];constructor(_0x2fd199,_0x4e9f89){super(_0x2fd199);const {areActionsDisabled:_0x325b78,showUnchangedParts:_0x38cc79,availableActions:_0x59d248}=_0x4e9f89;this['_areActionsDisabled']=_0x325b78,this['_showUnchangedParts']=_0x38cc79,this['_availableActions']=_0x59d248,this['set']('isTrackChangesOn',!0x1),this['set']('isAcceptAllEnabled',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new lo(_0x2fd199,uo['aiSuggestionBody']),this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now'](),this['_children']['add'](this['_skeletonView']),this['_updateContentPartsPromiseQueue']=new Ao(),this['_emptyPartsWarningView']=new Eo({'id':'empty-parts-warning','initialContent':qs(_0x2fd199,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new mo(_0x2fd199,_0x4e9f89['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new To(this['locale'],_0x4e9f89['bodyCollection']),_0x4e9f89['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'isAcceptAllEnabled'),this['_actionsView']['delegate'](...$r)['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']]});}destroy(){this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),super['destroy']();}get partsCount(){return this['_contentPartViews']['length'];}get _contentPartViews(){return Array['from'](this['_children'])['filter'](_0x42c81f=>_0x42c81f instanceof co);}async updateContentParts({parts:_0x597d74,abortSignal:_0x5c0977,skipLoadingEffects:_0x1e9b85}){this['_cachedContentParts']['length']?_0x597d74['forEach'](_0x357cce=>{const _0x4c33d7=this['_cachedContentParts']['findIndex'](_0x73ed3b=>_0x73ed3b['index']==_0x357cce['index']);-0x1===_0x4c33d7?this['_cachedContentParts']['push'](_0x357cce):this['_cachedContentParts'][_0x4c33d7]=_0x357cce;}):this['_cachedContentParts']=_0x597d74;const _0x1ed854=this['_showUnchangedParts']?_0x597d74:_0x597d74['filter'](_0x27fa44=>_0x27fa44['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x1ed854['length']>0x1),_0x1e9b85&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x2c6c0e of _0x597d74)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x3e4b78=>{let _0x25e8f3=this['getPartView'](_0x2c6c0e['index']);if(_0x25e8f3||_0x2c6c0e['hasChanges']||this['_showUnchangedParts']){if(!_0x25e8f3){if(_0x25e8f3=new co(this['locale'],{'part':_0x2c6c0e,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x25e8f3['delegate'](...$r)['to'](this),_0x25e8f3['bind']('isTrackChangesOn')['to'](this),!_0x1e9b85&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x3e4b78),_0x3e4b78['aborted']))return;_0x25e8f3['isTargetReadOnly']=this['_readOnlyByIndex']['get'](_0x2c6c0e['index'])??!0x1,this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x25e8f3,this['_children']['length']-0x1),_0x1e9b85||this['_showSkeletonDebounced']();}await _0x25e8f3['updateContent']({'part':_0x2c6c0e,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x3e4b78}),_0x25e8f3['markAsDone']();}});return _0x5c0977?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}updatePartState(_0x308968,_0x12a84a,_0x71ba){const _0x286aba=this['getPartView'](_0x308968);_0x286aba&&(_0x286aba['outdatedReason']=_0x71ba,_0x286aba['state']=_0x12a84a);}setGating({readOnlyByIndex:_0x582f68,isAcceptAllEnabled:_0x3ea4a9}){this['_readOnlyByIndex']=_0x582f68,this['isAcceptAllEnabled']=_0x3ea4a9;for(const _0x23ba37 of this['_contentPartViews'])_0x23ba37['isTargetReadOnly']=_0x582f68['get'](_0x23ba37['partDefinition']['index'])??!0x1;}setPartActive(_0x5e71a3,_0x20242){if(!0x1===_0x5e71a3){for(const _0x5d5c89 of this['_contentPartViews'])_0x5d5c89['isActive']=!0x1;}else{const _0x458eba=this['getPartView'](_0x5e71a3);_0x458eba&&(_0x458eba['isActive']=_0x20242);}}updateSources(_0x1f817){_0x1f817['forEach'](_0x485c18=>this['_sourcesView']['addSource'](_0x485c18)),this['_sourcesView']['isVisible']=!0x0;}getPartView(_0x502312){return this['_contentPartViews']['find'](_0x497cd7=>_0x497cd7['partDefinition']['index']==_0x502312)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x256853=!this['_cachedContentParts']['find'](({hasChanges:_0x1ac0bf})=>_0x1ac0bf),_0x2294f9=!!this['_cachedContentParts']['find'](({hasChanges:_0x34643e})=>!_0x34643e);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x2294f9,_0x256853?this['_emptyPartsWarningView']['setContent'](qs(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](qs(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_contentPartViews']['forEach'](_0x2fb461=>_0x2fb461['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']&&!this['_areActionsDisabled']);}async _awaitMinimumSkeletonDisplayTime(_0x1c1842){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x37f8bb=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x37f8bb>0x0){const {promise:_0x56b781,abortController:_0x4893dd}=qr(_0x37f8bb);_0x1c1842?.['addEventListener']('abort',()=>_0x4893dd['abort']()),await _0x56b781['catch'](()=>{});}}get hasNonEmptyParts(){return this['_contentPartViews']['filter'](_0x1938be=>_0x1938be['partDefinition']['hasChanges'])['length']>0x0;}},fo=class extends _0x2df458{['bodyView'];['children'];['headerView'];constructor(_0x422bb0,_0x1b9911,_0x5eb4f0){super(_0x422bb0);const {showDiff:_0x6f1332,areActionsDisabled:_0x28f559,showUnchangedParts:_0x30eabb,availableActions:_0xa85028}=_0x1b9911;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new to(_0x422bb0,{'showDiff':_0x6f1332}),this['headerView']['on']('toggleShowChanges',(_0x103c53,_0x4bf970)=>{this['areChangesVisible']=_0x4bf970['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x4bf970['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new Co(_0x422bb0,{'areActionsDisabled':_0x28f559,'showUnchangedParts':!!_0x30eabb,'availableActions':_0xa85028,'bodyCollection':_0x5eb4f0}),this['bodyView']['delegate'](...$r)['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(_0x2f2f09){await this['bodyView']['updateContentParts'](_0x2f2f09);}updateSources(_0x6ef13a){this['bodyView']['updateSources'](_0x6ef13a);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}},Ro=class extends Zr{containerView;constructor(_0x23b82d,_0x4b08cd,_0x293ed3){super(_0x4b08cd),this['set']('isTrackChangesOn',!0x1),this['containerView']=new fo(_0x23b82d,{'showDiff':_0x4b08cd['showDiff'],'areActionsDisabled':_0x4b08cd['areActionsDisabled'],'availableActions':_0x4b08cd['availableActions']},_0x293ed3),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x471489,_0x4e54fa)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x4e54fa['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',(_0x1f0463,{index:_0x4facc6})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x4facc6});}),this['containerView']['on']('applySuggestion',(_0x2aa03e,{index:_0x4a3a85}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x4a3a85});}),this['containerView']['on']('insertSuggestion',(_0x594ad2,{index:_0x220838}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x220838});}),this['containerView']['on']('rejectSuggestion',(_0x53c922,{index:_0x21139a})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x21139a});}),this['containerView']['on']('mouseOverSuggestion',(_0x30d514,{index:_0x5e8508})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5e8508});}),this['containerView']['on']('mouseLeaveSuggestion',(_0xe9dcb4,{index:_0x11eab7})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x11eab7});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async updateContent(_0x272076){await this['containerView']['updateContent'](_0x272076);}updatePartState(_0x2f54a0,_0x16d0ac,_0x5c3d85){this['containerView']['bodyView']['updatePartState'](_0x2f54a0,_0x16d0ac,_0x5c3d85);}setPartActive(_0x169fb8,_0xee89a6){!0x1===_0x169fb8?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x169fb8,_0xee89a6);}updateSources(_0x3bc52c){this['containerView']['updateSources'](_0x3bc52c);}getPartView(_0x20ec2f){return this['containerView']['bodyView']['getPartView'](_0x20ec2f);}setGating(_0x3d935c){this['containerView']['bodyView']['setGating'](_0x3d935c);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}},bo=class extends Zr{replyContainer;_bodyCollection;constructor(_0x351487,_0x269881,_0x11e6fb){super(_0x269881),this['_bodyCollection']=_0x11e6fb,this['locale']=_0x351487,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x2df458(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container','ck-ai-chat-content']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':en(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async updateContent({parsedContent:_0xf45b2a,renderingStrategy:_0x192ccc,abortSignal:_0xd1f21f}){'streaming'===_0x192ccc?await this['streamIntoElement'](_0xf45b2a,this['replyContainer']['element'],_0xd1f21f):this['replyContainer']['element']['innerHTML']=Qt(_0x24a162(_0xf45b2a));}updateSources(_0xe15b92){const _0x30f267=new To(this['locale'],this['_bodyCollection']);_0x30f267['children']['addMany'](_0xe15b92['map'](_0x3c5ff0=>new wo(this['locale'],_0x3c5ff0,_0x30f267['balloonPanelView']))),_0x30f267['isVisible']=!0x0,this['children']['add'](_0x30f267);}},So=class extends _0x407319{constructor(_0x4712d5=void 0x0){super();const _0x166d11=_0x4712d5?'ck-ai-spinner_'+_0x4712d5:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x166d11]}});}};const Oo={'file':_0x105dd2,'image':_0x3c70a7,'document':_0x5e85dd,'web-resource':_0x3bcbd8,'text':_0x105dd2,'selection':it,'mcp-tool-context':_0x5e85dd,'context':_0x5e85dd},vo='ck-ai-chat-context-chip',yo='ck-ai-chat-context-chip_wide',No='ck-ai-chat-context-chip_document',ko='ck-ai-chat-context-chip__label',xo='ck-ai-chat-context-chip__type-icon',Lo='ck-ai-chat-context-controls__chip-tooltip',Do='n';var Po=class extends _0x1a9216{constructor(_0x8ab145,_0x241b5c,_0x136526,_0x37cba6,_0x1c5675=!0x1){super(_0x8ab145),this['_isAnimationOnEnterEnabled']=_0x37cba6,this['_initializeProperties'](_0x241b5c,_0x136526,_0x1c5675),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(_0x2d7960,_0x29683d,_0x59f0a7){this['set']('label',_0x2d7960['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x2d7960['type']),this['set']('id',_0x2d7960['uiId']),this['set']('readonly',_0x29683d),this['set']('isLoading',_0x59f0a7);}_setupTemplate(){const _0x408608=this['_createIconView'](),_0x224dda=this['_createRemoveButton'](),_0x524612=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x524612),'children':this['_createTemplateChildren'](_0x408608,_0x224dda,_0x524612)});}_createTemplateAttributes(_0xd1d81){return{'class':[vo,_0xd1d81['if']('itemType',No,_0x156a90=>'document'==_0x156a90),_0xd1d81['if']('itemType',yo,_0x10a766=>'selection'==_0x10a766)],'data-cke-tooltip-text':_0xd1d81['to']('label',Mo),'data-cke-tooltip-position':Do,'data-cke-tooltip-class':Lo};}_createTemplateChildren(_0x299487,_0x57374b,_0x51d2b2){const _0x16680f=this['_createLabelElement'](_0x51d2b2),_0x47f80d=this['_createLoaderIcon']();return this['readonly']?[_0x299487,_0x16680f]:[_0x299487,_0x47f80d,_0x16680f,_0x57374b];}_createLabelElement(_0x35261c){return{'tag':'span','attributes':{'class':ko},'children':[{'text':_0x35261c['to']('label')}]};}_createRemoveButton(){const _0x5be6d2=new _0x1a9216(this['locale']);return _0x5be6d2['set']({'label':qs(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x29be46}),this['_setupRemoveButtonEvent'](_0x5be6d2),_0x5be6d2;}_setupRemoveButtonEvent(_0x5bec12){_0x5bec12['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}_createIconView(){const _0x4ea9db=this['bindTemplate'],_0x391203=new _0x5e3c18();return _0x391203['content']=Oo[this['itemType']],_0x391203['extendTemplate']({'attributes':{'class':[xo,_0x4ea9db['if']('isLoading','ck-hidden',_0x2f6639=>_0x2f6639)]}}),_0x391203;}_handleAnimationEndOnce(_0x5a0122,_0x5c9bcb){if(!_0x5a0122)return;const _0x13fdab=()=>{_0x5c9bcb(),_0x5a0122['removeEventListener']('animationend',_0x13fdab),_0x5a0122['removeEventListener']('webkitAnimationEnd',_0x13fdab);};_0x5a0122['addEventListener']('animationend',_0x13fdab),_0x5a0122['addEventListener']('webkitAnimationEnd',_0x13fdab);}_createLoaderIcon(){const _0x4d124a=new So('small');return _0x4d124a['bind']('isVisible')['to'](this,'isLoading',_0x578b3b=>_0x578b3b),_0x4d124a;}};function Mo(_0x358c82){if(!_0x358c82)return _0x358c82;if(_0x358c82['length']<=0x78)return _0x358c82;const _0x2b2450=_0x358c82['slice'](0x0,0x78),_0x26d982=_0x2b2450['lastIndexOf']('\x20');return(_0x26d982>0x0?_0x2b2450['slice'](0x0,_0x26d982):_0x2b2450)+'…';}const Vo={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+','viewportOffset':{'top':0x64,'bottom':0xa}},Ho='300px';var Uo=class{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];_showMoreButtonView=null;['_showMoreBalloonPanelView']=null;_containerElement=null;_bodyCollection;_parentView;_intersectionObserver=null;_pendingCalculation=!0x1;constructor(_0x1fb78,_0x4d35a6,_0x2f117b,_0x1f4a5a,_0x561a40){this['_locale']=_0x1fb78,this['_visibleChips']=_0x4d35a6,this['_config']={...Vo,..._0x2f117b,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x2f117b['cssClasses']}},this['_overflowChips']=new _t(),this['_bodyCollection']=_0x1f4a5a,this['_parentView']=_0x561a40;}setContainerElement(_0x22471f){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x22471f,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':this['_getLimiterElement']()}));}['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 _0x2f7419=[...this['_visibleChips'],...this['_overflowChips']],_0x44711f=this['_createCalculationContainer'](),_0x244d1a=this['_calculateOverflowInContainer'](_0x44711f,_0x2f7419),_0x11cba5=_0x44711f['_ancestorsToRestore'];_0x11cba5&&this['_restoreAncestorVisibility'](_0x11cba5),_0x44711f['remove'](),this['_applyOverflowResults'](_0x2f7419,_0x244d1a);}_createShowMoreButton(){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x314252({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}_createShowMoreButtonView(){const _0x4cb4e9=new _0x1a9216(this['_locale']);_0x4cb4e9['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x1242a3=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x1242a3['push'](this['_config']['cssClasses']['controlsButton']),_0x4cb4e9['extendTemplate']({'attributes':{'class':_0x1242a3}}),_0x4cb4e9;}_createShowMoreBalloonPanelView(){const _0xd7626=new Jt(this['_locale']);return _0xd7626['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0xd7626),_0xd7626;}_updateBalloonContent(){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x1a1d09=>{_0x1a1d09['disableAnimationOnEnter']();});const _0xcb8a08=new _0x2df458(this['_locale']);_0xcb8a08['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0xcb8a08);}}_handleShowMoreButtonClick(){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}_updateShowMoreButtonVisibility(){const _0x58c504=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x58c504?'':'none');}['_repinBalloonPanel'](){this['_showMoreButtonView']?.['isOn']&&this['_showMoreBalloonPanelView']?.['isVisible']&&this['_showMoreButtonView']['element']&&this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':this['_getLimiterElement']()});}_getLimiterElement(){return this['_config']['getLimiterElement']?.()||null;}_findTargetContainer(_0x28059c){const _0x390bd5=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x3ba169=this['_containerElement']?.['classList'];if(_0x3ba169){const _0x58c190=_0x3ba169[0x0]||'',_0x131583=_0x28059c['querySelector']('.'+_0x58c190),_0x25a217=_0x28059c['querySelector'](_0x390bd5);return _0x131583||_0x25a217||_0x28059c;}return _0x28059c['querySelector'](_0x390bd5)||_0x28059c;}_calculateContainerWidth(){const _0x2f5990=this['_parentView']['element']||this['_containerElement'];if(!_0x2f5990)return Ho;const _0x3bf097=window['getComputedStyle'](_0x2f5990)['width'];if('auto'===_0x3bf097||'0px'===_0x3bf097||!_0x3bf097){const _0x7d3bde=kt(_0x2f5990);if(_0x7d3bde){const _0xac526b=window['getComputedStyle'](_0x7d3bde);return'auto'!==_0xac526b['width']?_0xac526b['width']:Ho;}return Ho;}return _0x3bf097;}_applyCalculationStyles(_0x4e474c,_0x498f72){this['_config']['cssClasses']['calculationContainer']&&_0x4e474c['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x4e474c['style']['width']=_0x498f72,_0x4e474c['style']['position']='absolute',_0x4e474c['style']['top']='-9999px',_0x4e474c['style']['left']='-9999px',_0x4e474c['style']['opacity']='0',_0x4e474c['style']['pointerEvents']='none',_0x4e474c['style']['zIndex']='-1',_0x4e474c['style']['visibility']='visible\x20!important',_0x4e474c['style']['display']='block\x20!important',_0x4e474c['style']['boxSizing']='border-box';}_restoreAncestorVisibility(_0x10e271){_0x10e271['forEach'](({element:_0x50b600,originalDisplay:_0x57efb5,originalVisibility:_0x4ab076})=>{_0x50b600['style']['display']=_0x57efb5,_0x50b600['style']['visibility']=_0x4ab076;});}_makeAncestorsVisible(_0x59cc78){const _0xac8404=[],_0x354894=Mt(_0x59cc78),_0x49b6e2=_0x354894['length']?_0x354894[_0x354894['length']-0x1]['host']:null;let _0x508a77=kt(_0x59cc78);for(;_0x508a77&&_0x508a77!==document['body']&&_0x508a77!==_0x49b6e2;){const _0x1c06f7=window['getComputedStyle'](_0x508a77);_0x508a77 instanceof HTMLElement&&('none'===_0x1c06f7['display']||'hidden'===_0x1c06f7['visibility'])&&(_0xac8404['push']({'element':_0x508a77,'originalDisplay':_0x508a77['style']['display'],'originalVisibility':_0x508a77['style']['visibility']}),_0x508a77['style']['display']='block',_0x508a77['style']['visibility']='visible'),_0x508a77=kt(_0x508a77);}return _0xac8404;}_createContainerElements(){let _0x2349ca,_0x2e7a56;return this['_parentView']['element']?(_0x2349ca=this['_parentView']['element']['cloneNode'](!0x0),_0x2e7a56=this['_findTargetContainer'](_0x2349ca)):(_0x2349ca=document['createElement']('div'),_0x2e7a56=_0x2349ca),{'calculationContainer':_0x2349ca,'targetContainer':_0x2e7a56};}_createCalculationContainer(){const _0x2c3bc2=this['_parentView']['element']||this['_containerElement'],_0x3cada6=Dt(_0x2c3bc2),_0x2006a4=_0x3cada6 instanceof HTMLElement?_0x3cada6:xt(_0x2c3bc2),{calculationContainer:_0x557928,targetContainer:_0x15328a}=this['_createContainerElements'](),_0x41259a=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x557928,_0x41259a),_0x2006a4['appendChild'](_0x557928),_0x557928['_targetContainer']=_0x15328a;const _0x5478d6=this['_makeAncestorsVisible'](_0x2c3bc2);return _0x557928['offsetWidth'],_0x557928['_ancestorsToRestore']=_0x5478d6,_0x557928;}_calculateOverflowInContainer(_0x49e097,_0x182b7c){const _0x3689a6=_0x49e097['_targetContainer']||_0x49e097,_0x49baea=[],{rowCount:_0x126527}=this['_renderChipsAndCountRows'](_0x3689a6,_0x182b7c);if(_0x126527<=this['_config']['maxVisibleRows'])return _0x49baea;const _0x512d2c=_0x182b7c['slice']();for(;_0x512d2c['length']>0x0;){if(this['_testButtonFit'](_0x49e097,_0x3689a6,_0x512d2c)){const _0x234ed3=_0x182b7c['filter'](_0x3d8fa2=>!_0x512d2c['includes'](_0x3d8fa2));_0x49baea['push'](..._0x234ed3);break;}if(!_0x512d2c['pop']())break;}return _0x49baea;}_renderChipsAndCountRows(_0x3cf794,_0x48f07b){_0x3cf794['replaceChildren'](),_0x48f07b['forEach'](_0x3edf3a=>{if(_0x3edf3a['element']){const _0x5b5080=_0x3edf3a['element']['cloneNode'](!0x0);_0x3cf794['appendChild'](_0x5b5080);}}),_0x3cf794['offsetWidth'];const _0x303f38=_0x3cf794['children'],_0x5428d4=[];return Array['from'](_0x303f38)['forEach'](_0x903a28=>{const _0x2f6452=_0x903a28['getBoundingClientRect']()['top'];_0x5428d4['some'](_0x3fa910=>Math['abs'](_0x3fa910-_0x2f6452)<this['_config']['rowDetectionTolerance'])||_0x5428d4['push'](_0x2f6452);}),{'rowCount':_0x5428d4['length']};}_createMockButton(){const _0x4c025a=document['createElement']('button');_0x4c025a['className']='ck\x20ck-button\x20ck-off\x20ck-button_with-text\x20'+this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x4c025a['classList']['add'](this['_config']['cssClasses']['controlsButton']);const _0x86e333=document['createElement']('span');return _0x86e333['className']='ck\x20ck-button__label',_0x86e333['textContent']=this['_config']['showMoreLabelPrefix']+'1',_0x4c025a['appendChild'](_0x86e333),_0x4c025a;}_testButtonFit(_0x5c78c8,_0x29b528,_0x3e80b6){this['_renderChipsAndCountRows'](_0x29b528,_0x3e80b6);const _0x4c3f51=this['_createMockButton']();_0x5c78c8['appendChild'](_0x4c3f51),_0x5c78c8['offsetWidth'];const _0x5724bf=[..._0x29b528['children'],_0x4c3f51],_0x564cc5=[];_0x5724bf['forEach'](_0x36acb9=>{const _0x43b26a=_0x36acb9['getBoundingClientRect']()['top'];_0x564cc5['some'](_0x23dcce=>Math['abs'](_0x23dcce-_0x43b26a)<this['_config']['rowDetectionTolerance'])||_0x564cc5['push'](_0x43b26a);});const _0x4a76ce=_0x564cc5['length'];return _0x4c3f51['remove'](),_0x4a76ce<=this['_config']['maxVisibleRows'];}_distributeChips(_0x18de9f,_0x2ee56c){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x18de9f['forEach'](_0x2d902d=>{_0x2ee56c['includes'](_0x2d902d)?this['_overflowChips']['add'](_0x2d902d):this['_visibleChips']['add'](_0x2d902d);});}_updateOverflowUI(_0x40a25d){if(_0x40a25d>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x40a25d>0x0&&this['_showMoreButtonView']){const _0x5caa9e=''+this['_config']['showMoreLabelPrefix']+Math['min'](_0x40a25d,0x9);this['_showMoreButtonView']['label']=_0x5caa9e;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}_applyOverflowResults(_0x563024,_0x10c932){this['_distributeChips'](_0x563024,_0x10c932),this['_updateOverflowUI'](_0x10c932['length']);}_setupVisibilityObserver(){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x1d2e06=>{_0x1d2e06[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 _0xea9e88=this['_containerElement']['getBoundingClientRect']();if(0x0===_0xea9e88['width']||0x0===_0xea9e88['height'])return!0x1;const _0x107fbe=window['innerHeight']||document['documentElement']['clientHeight'],_0x530515=window['innerWidth']||document['documentElement']['clientWidth'];return _0xea9e88['bottom']>=-0xc8&&_0xea9e88['top']<=_0x107fbe+0xc8&&_0xea9e88['right']>=-0xc8&&_0xea9e88['left']<=_0x530515+0xc8;}};const Bo='ck-ai-chat__feed__context-chips',Go='ck-ai-chat-context-chips-wrapper',Wo='ck-ai-chat-context-chips-wrapper-balloon',Fo='ck-ai-chat-controls-button',Ko='ck-ai-chat-controls_context_show-more-button',$o='ck-ai-chat-context-controls__show-more-balloon-panel';var Yo=class extends _0x2df458{_contextChips=this['createCollection']();['_overflowManager'];_bodyCollection;constructor(_0x574273,_0xf9e517,_0xc3abd2){super(_0x574273),this['_bodyCollection']=_0xc3abd2,this['_createContextChips'](_0xf9e517);const _0x294518={'cssClasses':{'showMoreButton':Ko+'\x20'+Ar,'showMoreBalloon':$o,'overflowContainer':Wo,'controlsButton':Fo},'getLimiterElement':()=>ah(this['element'])};this['_overflowManager']=new Uo(_0x574273,this['_contextChips'],_0x294518,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Bo,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Go},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x30c81a=this['element']['querySelector']('.'+Go);_0x30c81a&&(this['_overflowManager']['setContainerElement'](_0x30c81a),this['_overflowManager']['reorganizeChips']());}destroy(){super['destroy'](),this['_overflowManager']['destroy']();}_createContextChips(_0x1870ca){for(const _0x15e2cd of _0x1870ca){const _0x59cfe1=new Po(this['locale'],_0x15e2cd,!0x0,!0x1);this['_contextChips']['add'](_0x59cfe1);}}},qo=class extends Zr{_contextChipsView=null;['_locale'];_bodyCollection;_messageContentView;constructor(_0x33f5f7,_0x1bb3fb,_0x5ed856){super(_0x1bb3fb),this['_locale']=_0x33f5f7,this['_bodyCollection']=_0x5ed856,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 Yo(this['_locale'],this['options']['contextItems']['filter'](_0x47ca35=>!_0x47ca35['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}_createMessageContentView(){this['_messageContentView']=new _0x2df458(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':['ck-reset_all-excluded','ck-ai-chat__feed__message-content','ck-ai-chat-content']}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=Qt(this['options']['initialContent']),this['markAsDone']();}},Qo=class extends Zr{capabilities;constructor(_0x2d4d3d,_0x2fc68f){super(_0x2fc68f);const {isWebSearchEnabled:_0x39df19,isReasoningEnabled:_0x49c5b6}=_0x2fc68f['capabilities'],_0x508927=[];let _0x58083f='';_0x39df19&&_0x49c5b6?(_0x58083f=qs(_0x2d4d3d,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x508927['push'](Xo(ut)),_0x508927['push'](Xo(_0x44fd08))):_0x39df19?(_0x58083f=qs(_0x2d4d3d,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x508927['push'](Xo(ut))):_0x49c5b6&&(_0x58083f=qs(_0x2d4d3d,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x508927['push'](Xo(_0x44fd08))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x58083f?'':'ck-hidden']}});const _0x51727a=new _0x2df458();_0x51727a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x508927,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x58083f]}]}),this['children']['add'](_0x51727a),this['capabilities']=_0x2fc68f['capabilities'];}};function Xo(_0x365159){const _0x4b453c=new _0x5e3c18();return _0x4b453c['content']=_0x365159,_0x4b453c;}const zo=['wheel','touchstart','pointerdown','keydown'],jo=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];var Jo=class{element;animationFrameId;['isRunning'];abortController;['isUserPaused'];['scrollBehavior'];constructor(_0x403920){this['element']=_0x403920,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x3a7ec4 of zo){const _0xa893d6='keydown'!==_0x3a7ec4;this['element']['addEventListener'](_0x3a7ec4,this['_onUserEvent']['bind'](this),{'passive':_0xa893d6,'signal':this['abortController']['signal']});}}start({smooth:_0x2a4ad5=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x2a4ad5?'smooth':'auto',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(_0x206f41){if(this['isRunning']){if('keydown'===_0x206f41['type']){const _0x5c6d=_0x206f41['key'];if(!jo['includes'](_0x5c6d))return;}_0x206f41 instanceof WheelEvent?_0x206f41['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}_isAtBottom(){const {scrollTop:_0x3336e0,scrollHeight:_0x55c102,clientHeight:_0x27b93f}=this['element'];return _0x55c102-_0x3336e0-_0x27b93f<=0x5;}_rafUpdate(){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':this['scrollBehavior']}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}},Zo=class extends _0x2df458{constructor(_0x4415ff){super(_0x4415ff),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-dots-loader']},'children':new Array(0x3)['fill'](null)['map'](()=>({'tag':'div','attributes':{'class':['ck-ai-dots-loader__dot']}}))});}},ta=class extends Zr{constructor(_0x5ce315){super(_0x5ce315),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=Qt(this['options']['content']):this['element']['appendChild'](this['options']['content']);}},ea=class extends _0x2df458{['children'];['scrollManager'];_bodyCollection;constructor(_0x1d99a4,_0x4c80e6){super(_0x1d99a4),this['_bodyCollection']=_0x4c80e6,this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('loadingSkeletonType','conversation'),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Yr)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Jo(this['element']);}destroy(){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}addItem(_0x419ea0,_0x589902){let _0x2423c6;return'ai-reply'===_0x419ea0?_0x2423c6=new bo(this['locale'],_0x589902,this['_bodyCollection']):'ai-suggestion-reply'===_0x419ea0?(_0x2423c6=new Ro(this['locale'],_0x589902,this['_bodyCollection']),_0x2423c6['bind']('isTrackChangesOn')['to'](this)):_0x2423c6='user-message'===_0x419ea0?new qo(this['locale'],_0x589902,this['_bodyCollection']):'interaction-header'===_0x419ea0?new Qo(this['locale'],_0x589902):'custom-element'===_0x419ea0?new ta(_0x589902):new Eo(_0x589902),this['children']['add'](_0x2423c6),_0x2423c6;}async updateReplyItem({id:_0x25bd24,parsedContent:_0x5b2627,renderingStrategy:_0x384a34,abortSignal:_0x5e7c65}){const _0x1ff67f=this['getItemById'](_0x25bd24);if(!(_0x1ff67f instanceof bo))throw new dt('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x1ff67f,'id':_0x25bd24,'parsedContent':_0x5b2627});await _0x1ff67f['updateContent']({'parsedContent':_0x5b2627,'renderingStrategy':_0x384a34,'abortSignal':_0x5e7c65});}async updateWebSources(_0x2f4e4b,_0x3cbd25){const _0x4482ce=this['getItemById'](_0x2f4e4b);if(_0x4482ce instanceof Ro)_0x4482ce['updateSources'](_0x3cbd25);else{if(!(_0x4482ce instanceof bo))throw new dt('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x4482ce,'id':_0x2f4e4b,'sources':_0x3cbd25});_0x4482ce['updateSources'](_0x3cbd25);}}async updateSuggestionItem({id:_0x3d6fe3,parts:_0x1c5775,abortSignal:_0x1753e9,skipLoadingEffects:_0x26352e}){const _0x4a1aa9=this['getItemById'](_0x3d6fe3);if(!(_0x4a1aa9 instanceof Ro))throw new dt('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x4a1aa9,'id':_0x3d6fe3,'parts':_0x1c5775});await _0x4a1aa9['updateContent']({'parts':_0x1c5775,'abortSignal':_0x1753e9,'skipLoadingEffects':_0x26352e});}updateSuggestionPartState({id:_0x102daa,index:_0x33462d,state:_0x30d907,outdatedReason:_0x105407}){const _0x26ba7d=this['getItemById'](_0x102daa);if(!(_0x26ba7d instanceof Ro))throw new dt('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x102daa});_0x26ba7d['updatePartState'](_0x33462d,_0x30d907,_0x105407);}updateSuggestionGating(_0x1f4b57,_0x321943){const _0x4bda28=this['getItemById'](_0x1f4b57);if(!(_0x4bda28 instanceof Ro))throw new dt('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x1f4b57});_0x4bda28['setGating'](_0x321943);}getSuggestionPartUIIndex({id:_0x3590dd,index:_0x148990}){if(!this['hasItem'](_0x3590dd))return null;const _0x51a174=this['getItemById'](_0x3590dd);return _0x51a174 instanceof Ro?_0x51a174['getPartView'](_0x148990)?.['uiIndex']??null:null;}setSuggestionPartActive({id:_0x27a462,index:_0x48036a,isActive:_0x3b930a}){const _0x3e7755=this['getItemById'](_0x27a462);if(!(_0x3e7755 instanceof Ro))throw new dt('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x27a462});this['children']['filter'](_0x5d01ea=>_0x5d01ea instanceof Ro)['forEach'](_0x4a4d6a=>{_0x4a4d6a['setPartActive'](!0x1);}),_0x3e7755['setPartActive'](_0x48036a,_0x3b930a);}markItemAsDone(_0x48f0fb){this['getItemById'](_0x48f0fb)['markAsDone']();}getItemIds(){return this['children']['map'](_0x107934=>_0x107934['options']['id']);}removeItem(_0x479400){this['children']['remove'](this['getItemById'](_0x479400));}hasItem(_0x31f443){return!!this['children']['find'](_0x43267f=>_0x43267f['options']['id']['includes'](_0x31f443));}scrollToSuggestion(_0x5bbb63,_0x13e613){const _0x3a0627=this['getItemById'](_0x5bbb63);if(!(_0x3a0627 instanceof Ro))return void Ft('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x5bbb63,'partIndex':_0x13e613});const _0x451a54=_0x3a0627['getPartView'](_0x13e613);if(_0x451a54){const _0x20bcba=kt(this['element']);_0x20bcba instanceof HTMLElement&&$t(_0x451a54['element'],0x14,_0x20bcba,!0x0,!0x0);}else Ft('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x5bbb63,'partIndex':_0x13e613});}_setupTemplate(){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}_createTemplateChildren(){const _0x500727=this['_createSkeletonLoader']('init',uo['aiChatInit'],'ck-ai-chat__feed__init-skeleton'),_0x1351cb=this['_createSkeletonLoader']('conversation',uo['aiFeed']);return[this['_createFeedItems'](),_0x500727,_0x1351cb,this['_createFeedLoader']()];}_createSkeletonLoader(_0x2a1ab2,_0x1fa117,_0x453ce2){const _0x318af3=new lo(this['locale'],_0x1fa117);return _0x453ce2&&_0x318af3['extendTemplate']({'attributes':{'class':[_0x453ce2]}}),_0x318af3['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible',this,'loadingSkeletonType',(_0x47cadd,_0x56bd7b)=>_0x47cadd&&_0x56bd7b==_0x2a1ab2),_0x318af3;}_createFeedItems(){const _0x5763e7=new _0x2df458(this['locale']);return _0x5763e7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x5763e7;}_createFeedLoader(){const _0x1d3282=new _0x2df458(this['locale']);return _0x1d3282['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x3b36b4=>!_0x3b36b4)]},'children':this['_createLoaderChildren']()}),_0x1d3282;}_createLoaderChildren(){return[new Zo(this['locale']),{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}getItemById(_0x1f5136){const _0x1988e4=this['children']['find'](_0x2c1285=>_0x2c1285['options']['id']['includes'](_0x1f5136));if(!_0x1988e4)throw new dt('ai-chat-feed-view-item-not-found',this,{'id':_0x1f5136});return _0x1988e4;}setLoadingMessage(_0x1ae06b){this['set']('loadingMessage',_0x1ae06b);}toggleLoadingSkeleton(_0x179cbc,_0x48d8f0='conversation'){(_0x179cbc||this['loadingSkeletonType']==_0x48d8f0)&&(this['set']('loadingSkeletonType',_0x48d8f0),this['set']('isLoadingSkeletonVisible',_0x179cbc));}startAutoScroll(_0x32b207={}){this['scrollManager']['start'](_0x32b207);}stopAutoScroll(){this['scrollManager']['stop']();}},ia=class extends _0x4e6fd6{filter(){let _0x3c9770=0x0;for(const _0x38d1db of this['items'])_0x3c9770+=_0x38d1db['items']['length'];return{'resultsCount':_0x3c9770,'totalItemsCount':_0x3c9770};}};function sa(_0x53aae9){const _0x10fbc3=[];let _0x3613d5=!0x1;for(const _0x4030c7 of Array['from'](_0x53aae9['items'])){if('file'!==_0x4030c7['kind'])continue;if(_0x4030c7['webkitGetAsEntry']()?.['isDirectory']){_0x3613d5=!0x0;continue;}const _0x7e5fbc=_0x4030c7['getAsFile']();_0x7e5fbc&&_0x10fbc3['push'](_0x7e5fbc);}return{'files':_0x10fbc3,'hasDirectory':_0x3613d5};}const na='ck-ai-chat__prompt-input_highlighted';var ra=class AIChatPromptInputView extends jt{actionButtonView;static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;_addContextButtonView;['_queryViewResizeObserver'];constructor(_0x4ad1f7,_0x51d8ab){super(_0x4ad1f7,{'queryView':{'label':'','creator':_0x3e1b5a,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new ia(_0x4ad1f7),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['set']('isBusy',!0x1),this['_addContextButtonView']=_0x51d8ab,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=AIChatPromptInputView['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=AIChatPromptInputView['MAX_ROWS'],this['bind']('isEnabled')['to'](this,'isBusy',_0x341a88=>!_0x341a88),this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['bind']('canSubmit')['to'](this,'isEmpty',this,'isUploadInProgress',this,'isBusy',(_0x13641a,_0x1a8027,_0xeca74)=>!_0x13641a&&!_0x1a8027&&!_0xeca74),this['actionButtonView']=this['_createActionButton'](),this['actionButtonView']['bind']('isEnabled')['to'](this,'canSubmit',this,'isBusy',(_0x1d0dbd,_0x466756)=>_0x1d0dbd||_0x466756),this['focusableChildren']['add'](this['actionButtonView']),this['on']('change:isBusy',(_0x338e5b,_0x183ff4,_0x4f0572)=>{_0x4f0572||vt(this['actionButtonView']['element'])!==this['actionButtonView']['element']||this['focus']();});}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['actionButtonView']),this['keystrokes']['set']('enter',(_0x20536d,_0xa97224)=>{this['canSubmit']&&_0x20536d['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xa97224());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();}),this['queryView']['fieldView']['element']['addEventListener']('paste',_0x200461=>this['_handlePaste'](_0x200461)),this['element']['addEventListener']('drop',_0x4a1846=>this['_handleDrop'](_0x4a1846));}_handlePaste(_0x3fa5de){const _0x7a7173=_0x3fa5de['clipboardData'];if(!_0x7a7173||this['isBusy'])return;const {files:_0x4a9e0e,hasDirectory:_0x4d3ba3}=sa(_0x7a7173),_0x3e6514={'files':_0x4a9e0e,'plainText':_0x7a7173['getData']('text/plain'),'hasDirectory':_0x4d3ba3,'forceTextAttachment':!0x1,'preventDefault':()=>_0x3fa5de['preventDefault']()};this['fire']('promptInputPaste',_0x3e6514);}['_handleDrop'](_0x528581){const _0x48d826=_0x528581['dataTransfer'];if(!_0x48d826||this['isBusy'])return;const _0x4f1d39={'files':[],'plainText':_0x48d826['getData']('text/uri-list')||_0x48d826['getData']('text/plain'),'hasDirectory':!0x1,'forceTextAttachment':!0x1,'preventDefault':()=>_0x528581['preventDefault']()};this['fire']('promptInputPaste',_0x4f1d39);}destroy(){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}submit(){const _0x4570be=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x4570be)return this['queryView']['errorText']=qs(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x229e5c=_0x369484(_0x4570be);this['fire']('sendUserMessage',_0x229e5c),this['queryView']['fieldView']['reset']();}setPlaceholderText(_0x976e4){this['queryView']['fieldView']['set']('placeholder',_0x976e4);}['focus'](_0x2e6059=!0x1){super['focus'](),_0x2e6059&&(this['element']['classList']['contains'](na)||(this['element']['classList']['add'](na),setTimeout(()=>{this['element']['classList']['remove'](na);},0x320)));}_createActionButton(){const _0xe32972=new _0x1a9216(this['locale']);return _0xe32972['set']({'isVisible':!0x0,'tooltip':!0x0,'isEnabled':!0x1}),_0xe32972['bind']('icon')['to'](this,'isBusy',_0x27505c=>_0x27505c?ot:at),_0xe32972['bind']('label')['to'](this,'isBusy',_0x26e26f=>qs(this['locale'],_0x26e26f?'AI_CHAT_STOP_GENERATING':'AI_CHAT_LABEL_SUBMIT')),_0xe32972['bind']('class')['to'](this,'isBusy',_0x29a1c0=>'ck-ai-chat__prompt-submit-button\x20'+(_0x29a1c0?Ir:gr)),_0xe32972['on']('execute',()=>{this['isBusy']?this['fire']('abortPromptStream'):this['submit']();}),_0xe32972;}setIsUploadInProgress(_0x279e56){this['isUploadInProgress']=_0x279e56;}_setUpAddContextButtonPositioning(){const _0x3ffeb4=this['locale'],_0x2324fb=()=>{Vt['window']['requestAnimationFrame'](()=>{if(Bt(this['element'])){const _0x303aba=new Tt(this['queryView']['fieldView']['element']),_0x2f645c=new Tt(this['_addContextButtonView']['element']),_0x5366b7=_0x303aba['width'],_0x32b464='rtl'===_0x3ffeb4['uiLanguageDirection']?'right':'left';_0x303aba['excludeScrollbarsAndBorders']();const _0x262612=_0x5366b7-_0x303aba['width']+0x1;this['_addContextButtonView']['element']['style'][_0x32b464]='calc('+(_0x5366b7-_0x2f645c['width']-_0x262612)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x2324fb),this['on']('render',()=>{_0x2324fb(),this['_queryViewResizeObserver']=new wt(this['queryView']['fieldView']['element'],()=>{_0x2324fb();});});}},oa=class extends _0x2df458{constructor(_0x2de198){super(_0x2de198),this['set']('isEnabled',!0x0);const _0x3cb87b=new _0x5e3c18();_0x3cb87b['content']=_0x105dd2,this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls__drop-overlay']},'children':[_0x3cb87b,{'tag':'span','attributes':{'class':['ck-ai-chat-controls__drop-overlay__label']},'children':[{'text':qs(_0x2de198,'AI_CHAT_DROP_ZONE_HINT')}]}]});}attach(_0x310407){let _0x1fe970=0x0;const _0x2d895c=()=>{_0x310407['classList']['toggle']('ck-ai-chat-controls_drag-over',this['isEnabled']&&_0x1fe970>0x0);};this['on']('change:isEnabled',(_0x32e09a,_0x2aab7a,_0x270ed3)=>{_0x270ed3&&_0x1fe970>0x0&&this['fire']('dragEnter'),_0x2d895c();}),_0x310407['addEventListener']('dragenter',_0x5828c2=>{_0x5828c2['dataTransfer']&&(_0x1fe970++,0x1===_0x1fe970&&this['isEnabled']&&this['fire']('dragEnter'),_0x2d895c());}),_0x310407['addEventListener']('dragover',_0x2248f8=>{_0x2248f8['dataTransfer']&&_0x2248f8['preventDefault']();}),_0x310407['addEventListener']('dragleave',()=>{--_0x1fe970<0x0&&(_0x1fe970=0x0),_0x2d895c();}),_0x310407['addEventListener']('drop',_0x107412=>{_0x107412['preventDefault'](),_0x1fe970=0x0,_0x2d895c(),this['isEnabled']&&this['_handleDrop'](_0x107412);});}['_handleDrop'](_0xed54f8){const _0x16b555=_0xed54f8['dataTransfer'];if(!_0x16b555)return;const {files:_0x14ba63,hasDirectory:_0x383a12}=sa(_0x16b555),_0x1cf7c9={'files':_0x14ba63,'plainText':_0x16b555['getData']('text/uri-list')||_0x16b555['getData']('text/plain'),'hasDirectory':_0x383a12,'forceTextAttachment':!0x0,'preventDefault':()=>{}};this['fire']('promptInputPaste',_0x1cf7c9);}};const aa='ck-ai-model-selector__item-name',ha='ck-ai-model-selector__item-description',ca='ck-ai-model-selector__item-capabilities';var la=class extends _0x2df458{['dropdownView'];['nameView'];_items;['_config'];constructor(_0x21de57,_0x314f0b){super(_0x21de57),this['_config']=_0x314f0b,this['set']('modelDisplayMode','selector'),this['set']('activeModelId',null),this['set']('activeModelName',null),this['set']('isEnabled',!0x0),this['dropdownView']=this['_createDropdown'](),this['_items']=new _t(),_0x34e876(this['dropdownView'],this['_items']),this['nameView']=new ua(_0x21de57,_0x314f0b['nameClass']),this['nameView']['bind']('text')['to'](this,'activeModelName',_0x180d31=>_0x180d31??''),this['nameView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5bba5b=>'name'===_0x5bba5b),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-model-selector']},'children':[this['dropdownView'],this['nameView']]});}setModels(_0x43ebe8,_0x1cb8dc){var _0x4553cc;this['set']('modelDisplayMode',(_0x4553cc=_0x43ebe8['length'],_0x1cb8dc?0x1===_0x4553cc?'name':'selector':'hidden')),this['_items']['clear'](),0x1===_0x43ebe8['length']&&this['set']('activeModelName',_0x43ebe8[0x0]['name']||_0x43ebe8[0x0]['id']);for(const _0x344302 of _0x43ebe8){const _0x527e6e=new _0x13bdb1({'label':_0x344302['name'],'withText':!0x0,'role':'menuitemradio','id':_0x344302['id'],'model':_0x344302});_0x527e6e['bind']('isOn')['to'](this,'activeModelId',_0x55a934=>_0x55a934===_0x344302['id']),this['_items']['add']({'type':'button','model':_0x527e6e,'labelView':new da(this['locale'],_0x344302,{'nameClass':this['_config']['itemClasses']['name'],'descriptionClass':this['_config']['itemClasses']['description'],'capabilitiesClass':this['_config']['itemClasses']['capabilities'],'extraContent':this['_config']['showCapabilities']?_a(this['locale'],_0x344302,this['_config']['tooltipPosition']):void 0x0})});}}setSelectedModel(_0x51d821){this['set']('activeModelId',_0x51d821?_0x51d821['id']:null),this['set']('activeModelName',_0x51d821?_0x51d821['name']||_0x51d821['id']:null);}_createDropdown(){const _0x1328c6=_0x4c754a(this['locale']);return _0x1328c6['set']({'panelPosition':this['_config']['panelPosition'],'class':Array['isArray'](this['_config']['dropdownClass'])?this['_config']['dropdownClass']['join']('\x20'):this['_config']['dropdownClass']}),_0x1328c6['panelPositionLimiter']=()=>{const _0x2a0730=_0x1328c6['buttonView']['element'];return _0x2a0730&&St(_0x2a0730);},_0x1328c6['buttonView']['set']({'withText':!0x0,'tooltipPosition':this['_config']['tooltipPosition'],'class':'ck-button_small\x20'+Ar}),_0x1328c6['buttonView']['bind']('label')['to'](this,'activeModelName',_0x464507=>_0x464507??this['_config']['defaultLabel']??''),_0x1328c6['buttonView']['bind']('tooltip')['to'](this,'activeModelName',this,'isEnabled',(_0x3ccb79,_0x5d9ca8)=>!_0x5d9ca8&&this['_config']['disabledTooltip']?this['_config']['disabledTooltip']:_0x3ccb79??this['_config']['defaultLabel']??''),_0x1328c6['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x520986=>'selector'===_0x520986),_0x1328c6['bind']('isEnabled')['to'](this,'isEnabled'),this['listenTo'](_0x1328c6,'execute',_0x5bb50d=>{this['fire']('selectModel',_0x5bb50d['source']['model']);}),_0x1328c6;}},ua=class extends _0x2df458{constructor(_0x431013,_0xfbafb8){super(_0x431013),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x46e045=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck',_0xfbafb8,_0x46e045['if']('isVisible','ck-hidden',_0x2da84d=>!_0x2da84d)]},'children':[{'text':_0x46e045['to']('text')}]});}},da=class extends te{constructor(_0x18174b,_0x139c1c,_0x2d32cc){super();const _0xa5f421=this['bindTemplate'],_0x2c0de9=[{'tag':'span','children':[{'text':_0xa5f421['to']('text')}]}];_0x2d32cc['extraContent']?.['length']&&_0x2d32cc['capabilitiesClass']&&_0x2c0de9['push']({'tag':'div','attributes':{'class':[ca,_0x2d32cc['capabilitiesClass']]},'children':_0x2d32cc['extraContent']});const _0x2ec1ca=[{'tag':'div','attributes':{'class':[aa,_0x2d32cc['nameClass']]},'children':_0x2c0de9},{'tag':'div','attributes':{'class':[ha,_0x2d32cc['descriptionClass']]},'children':[{'tag':'span','children':[_0x139c1c['description']||'']}]}];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0xa5f421['to']('style'),'id':_0xa5f421['to']('id')},'children':_0x2ec1ca});}};function _a(_0x52c6d0,_0x33839f,_0x27a570){const _0x37044c=[];return _0x33839f['capabilities']['webSearch']?.['enabled']&&_0x37044c['push'](ga(_0x52c6d0,ut,'AI_CHAT_SEARCH_WEB',_0x27a570)),_0x33839f['capabilities']['reasoning']?.['enabled']&&_0x37044c['push'](ga(_0x52c6d0,_0x44fd08,'AI_CHAT_REASONING',_0x27a570)),_0x37044c;}function ga(_0x4bbca8,_0x3ee79b,_0x10409a,_0x24eaa5){const _0x25f548=qs(_0x4bbca8,_0x10409a),_0x474409=new _0x5e3c18();_0x474409['content']=_0x3ee79b;const _0x3c56df=new _0x2df458(_0x4bbca8);return _0x3c56df['setTemplate']({'tag':'span','attributes':{'role':'img','aria-label':_0x25f548,'data-cke-tooltip-text':_0x25f548,'data-cke-tooltip-position':_0x24eaa5},'children':[_0x474409]}),_0x3c56df;}const Ia='ck-ai-chat__prompt-capabilities',Aa='ck-ai-chat-controls-button',Ea='ck-ai-chat-controls__model-selection',pa='ck-ai-chat-controls__model-selection__item-name',ma='ck-ai-chat-controls__model-selection__item-description',Ta='ck-ai-chat-controls__model-selection__item-capabilities',wa='n';var Ca=class extends _0x2df458{_webSearchButton;_reasoningButton;_modelSelector;constructor(_0x2c2650){super(_0x2c2650),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorEnabled',!0x0),this['set']('isBusy',!0x1),this['_modelSelector']=function(_0x5b5d01){return new la(_0x5b5d01,{'panelPosition':'ne','dropdownClass':[Ea],'nameClass':'ck-ai-chat-controls__model-name','itemClasses':{'name':pa,'description':ma,'capabilities':Ta},'defaultLabel':qs(_0x5b5d01,'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'disabledTooltip':qs(_0x5b5d01,'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP'),'tooltipPosition':wa,'showCapabilities':!0x0});}(_0x2c2650),this['_modelSelector']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x2e28d2=>_0x2e28d2),this['_modelSelector']['delegate']('selectModel')['to'](this),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['setTemplate']({'tag':'div','attributes':{'class':[Ia]},'children':[this['_modelSelector'],this['_webSearchButton'],this['_reasoningButton']]});}setWebSearch(_0x1455c4){this['set']('webSearchActive',_0x1455c4);}setReasoning(_0x30f3f5){this['set']('reasoningActive',_0x30f3f5);}setModelList(_0x8c424e,_0x44726d){this['_modelSelector']['setModels'](_0x8c424e,!_0x44726d);}setModel(_0xcbfe95){if(!_0xcbfe95)return;this['_modelSelector']['setSelectedModel'](_0xcbfe95);const _0x280d46=_0xcbfe95['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isVisible',_0x280d46);const _0x5eb042=_0xcbfe95['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isVisible',_0x5eb042);}enableModelSelector(){this['set']('modelSelectorEnabled',!0x0);}disableModelSelector(_0x296fe7){this['set']('modelSelectorEnabled',!0x1),_0x296fe7&&(this['_modelSelector']['modelDisplayMode']='hidden');}_createWebSearchButton(){const _0x49f14f=new _0x1a9216();return _0x49f14f['set']({'label':qs(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':ut,'class':Aa+'\x20'+Ar+'\x20ck-button_small','isToggleable':!0x0,'tooltipPosition':wa}),_0x49f14f['bind']('isEnabled')['to'](this,'isBusy',_0x5733f5=>!_0x5733f5),_0x49f14f['bind']('isOn')['to'](this,'webSearchActive',_0x30f0e0=>_0x30f0e0),_0x49f14f['bind']('tooltip')['to'](this,'webSearchActive',_0x5edeb4=>qs(this['locale'],_0x5edeb4?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),_0x49f14f['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x49f14f;}_createReasoningButton(){const _0x5cd3e0=new _0x1a9216();return _0x5cd3e0['set']({'label':qs(this['locale'],'AI_CHAT_REASONING'),'icon':_0x44fd08,'class':Aa+'\x20'+Ar+'\x20ck-button_small','isToggleable':!0x0,'tooltipPosition':wa}),_0x5cd3e0['bind']('isEnabled')['to'](this,'isBusy',_0x4f552e=>!_0x4f552e),_0x5cd3e0['bind']('isOn')['to'](this,'reasoningActive',_0xfcf731=>_0xfcf731),_0x5cd3e0['bind']('tooltip')['to'](this,'reasoningActive',_0x21dbcd=>qs(this['locale'],_0x21dbcd?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),_0x5cd3e0['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x5cd3e0;}};const fa='ck-ai-chat-context-controls__url-form',Ra='ck-ai-chat-context-controls__url-input-section';var ba=class extends _0x2df458{['focusTracker'];keystrokes;['_focusables'];['focusCycler'];urlInputField;backButton;confirmButton;constructor(_0x469a5f){super(_0x469a5f),this['focusTracker']=new Et(),this['keystrokes']=new pt(),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 _0x17323b({'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'](_0x36a013=>{this['focusTracker']['add'](_0x36a013['element']),this['keystrokes']['listenTo'](_0x36a013['element']);}),_0x32c7ed({'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(_0x247983){this['urlInputField']['errorText']=_0x247983,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}_createBackButton(){const _0x2d670a=new _0x1a9216(this['locale']);return _0x2d670a['set']({'icon':_0x9f5b9e,'tooltip':qs(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x338c5f,_0x14344e,_0x4d95ea)=>{_0x2d670a['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x4d95ea?'':'\x20ck-hidden')]});}),_0x2d670a;}_createUrlInputField(){const _0x1b5cbd=new _0x187ed8(this['locale'],_0x31f20c);return _0x1b5cbd['set']({'label':qs(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x1b5cbd['fieldView']['set']({'placeholder':qs(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x1b5cbd;}_createConfirmButton(){const _0x4b94d1=new _0x1a9216(this['locale']);return _0x4b94d1['set']({'icon':_0x42448e,'tooltip':qs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x4b94d1;}_setupTemplate(){const _0x5e2138=new _0x105865(this['locale'],{'label':qs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL')});_0x5e2138['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':fa,'tabindex':'-1'},'children':[_0x5e2138,{'tag':'div','attributes':{'class':Ra},'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',_0x57154c=>{_0x57154c['stop'](),this['_handleSubmit']();});}_setupKeystrokes(){this['keystrokes']['set']('esc',(_0x2d62f2,_0x272d14)=>{this['clear'](),this['fire']('cancel'),_0x272d14();});}_handleSubmit(){const _0x554957=this['getValue']()['trim']();_0x554957?this['_isValidUrl'](_0x554957)?(this['clearError'](),this['fire']('submitUrl',_0x554957)):this['setError'](qs(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](qs(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}_updateConfirmButtonState(){const _0x1ab4df=this['getValue']()['trim'](),_0x53b614=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x1ab4df['length']>0x0&&!_0x53b614;}['_isValidUrl'](_0x546c49){try{return!!new URL(_0x546c49);}catch{return!0x1;}}};const Sa='ck-ai-chat-resources__item',Oa='ck-ai-chat-resources__item--in-context',va='ck-ai-chat-resources__item-title',ya='ck-ai-chat-resources__item__icon',Na='ck-ai-chat-resources__item__check';var ka=class extends _0xf665cb{['resource'];_titleView;['_iconView'];['_checkIconView'];constructor(_0x3e2348,_0x4f1b72){super(_0x3e2348),this['resource']=_0x4f1b72,this['set']('isInContext',!!_0x4f1b72['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_checkIconView']=this['_createCheckIconView'](),this['_setupTemplate']();}['render'](){super['render']();}getResourceIcon(_0x53184b){switch(_0x53184b['type']){case'document':return _0x5e85dd;case'web-resource':return _0x3bcbd8;case'file':case'text':return _0x105dd2;default:return _0x1052b8;}}highlightText(_0x121734){if(!_0x121734||''===_0x121734['trim']())return void this['_titleView']['highlightText'](null);const _0x2e2da4=new RegExp(_0x3df188(_0x121734),'gi');this['_titleView']['highlightText'](_0x2e2da4);}updateResourceState(_0x3d4bf7){this['resource']['isInContext']=_0x3d4bf7,this['isInContext']=_0x3d4bf7;}_createTitleView(){const _0x6e592d=new _0x2d3d45();return _0x6e592d['text']=this['resource']['label'],_0x6e592d['extendTemplate']({'tag':'span','attributes':{'class':[va]}}),_0x6e592d;}_createIconView(){const _0x3d5c78=new _0x5e3c18();return _0x3d5c78['content']=this['getResourceIcon'](this['resource']),_0x3d5c78;}_createCheckIconView(){const _0x1a33f6=new _0x5e3c18();return _0x1a33f6['content']=_0x42448e,_0x1a33f6['bind']('isVisible')['to'](this,'isInContext'),_0x1a33f6;}_setupTemplate(){const _0x3c8d46=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Sa,_0x3c8d46['if']('isVisible','ck-hidden',_0x373b4a=>!_0x373b4a),_0x3c8d46['if']('isInContext',Oa)]},'children':[{'tag':'div','attributes':{'class':[Na]},'children':[this['_checkIconView']]},{'tag':'div','attributes':{'class':[ya]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x3c8d46['to']('execute')}});}};const xa='ck-ai-chat-resources__list';var La=class extends _0x4e6fd6{['_source'];constructor(_0x318793,_0x4ec60d){super(_0x318793),this['_source']=_0x4ec60d,this['extendTemplate']({'attributes':{'class':[xa]}});}setResources(_0x311864,_0x41eb37){this['items']['clear']();let _0x1325e4=_0x311864;if(this['_source']['useDefaultFiltering']&&_0x41eb37&&''!==_0x41eb37['trim']()){const _0x56a040=new RegExp(_0x41eb37['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x1325e4=_0x311864['filter'](_0x1a093b=>_0x56a040['test'](_0x1a093b['label']));}for(const _0x324843 of _0x1325e4){const _0x37c184=new ka(this['locale'],_0x324843);_0x37c184['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x324843);}),this['items']['add'](_0x37c184);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x41eb37);}highlightText(_0x2cc336){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x50a100=>{_0x50a100['highlightText'](_0x2cc336);});}updateResourceState(_0x45377b,_0x339b18){for(const _0x4c3e4f of this['items']){const _0x1ede1a=_0x4c3e4f;_0x1ede1a['resource']['id']===_0x45377b&&_0x1ede1a['updateResourceState'](_0x339b18);}}_handleResourceSelection(_0x484692,_0x32d0bf){this['fire']('addResourceToContext',{'source':_0x484692,'resource':_0x32d0bf});}},Da=class extends _0x187ed8{['iconView'];resetButtonView;['_viewConfig'];constructor(_0x58a285){const t=_0x58a285['t'],_0x382bfb={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x31f20c,'label':qs(_0x58a285,'AI_CHAT_SEARCH_RESOURCES')};super(_0x58a285,_0x382bfb['creator']),this['label']=_0x382bfb['label'],this['_viewConfig']=_0x382bfb,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x58a285,t),this['_setupEventListeners']();}reset(){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x5804a1){this['fire']('search',_0x5804a1);}getQuery(){return this['fieldView']['element']?.['value']||'';}_setupSearchIcon(){this['iconView']=new _0x5e3c18(),this['iconView']['content']=_0x432e10,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}_setupResetButton(_0x5c8502,t){this['resetButtonView']=new _0x1a9216(_0x5c8502),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x29be46,'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',_0x59b87b=>!_0x59b87b),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);}},Pa=class extends _0x2df458{['_searchView'];_searchSection;_searchInputVisibleFrom;_resourcesListView;_skeletonLoader;['_source'];['children'];_latestLoadResourcesUid=null;constructor(_0x430e6e,_0x530779){super(_0x430e6e),this['_source']=_0x530779['source'],this['_searchInputVisibleFrom']=_0x530779['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 _0x15c4c2([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}_createSearchView(){return new Da(this['locale']);}_createSearchSection(){const _0x5ac341=new _0x2df458(this['locale']);return _0x5ac341['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x46279d,_0x22e723)=>{this['loadResources'](_0x22e723),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x22e723);}),_0x5ac341;}_createResourcesListView(){const _0x38ead1=new La(this['locale'],this['_source']);return _0x38ead1['delegate']('addResourceToContext')['to'](this),_0x38ead1['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x38ead1;}_createSkeletonView(){const _0x29f215=new lo(this['locale'],uo['aiChatResources']);return _0x29f215['bind']('isVisible')['to'](this,'isLoading'),_0x29f215;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x1761c4){const _0x46673d=Xt();this['_latestLoadResourcesUid']=_0x46673d,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x1761c4,'uid':_0x46673d}),this['isLoading']=!0x0;}setResources(_0x10c41a,_0x234481){if(_0x234481&&_0x234481!==this['_latestLoadResourcesUid'])return;const _0x301b90=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x10c41a,_0x301b90),_0x10c41a['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}updateResourceState(_0x48685b,_0x18ccd1){this['_resourcesListView']['updateResourceState'](_0x48685b,_0x18ccd1);}};const Ma='ck-ai-chat-context-controls__source-balloon-panel',Va='ck-button-icon\x20ck-button-back';var Ha=class{['_sourceResourceBalloons']=new Map();_bodyCollection;['_locale'];['_config'];constructor(_0x169ae0,_0x4eea06,_0x2383e2){this['_locale']=_0x169ae0,this['_bodyCollection']=_0x4eea06,this['_config']=_0x2383e2;}['showSourceResourcesBalloon']({source:_0x49b26f,withBackButton:_0x21339d}){let _0x1c5423=this['_sourceResourceBalloons']['get'](_0x49b26f['id']);_0x1c5423||(_0x1c5423=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x49b26f['id'],_0x1c5423),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x1c5423)),this['_addSourceResourceContent']({'balloonPanel':_0x1c5423,'source':_0x49b26f,'withBackButton':_0x21339d}),_0x1c5423['show']();const _0x7ef488=this['_config']['getTargetElement']();_0x7ef488&&_0x1c5423['pin']({'target':_0x7ef488,'limiter':this['_config']['getLimiterElement']()});}populateSourceResourceBalloon(_0x3c218d,_0x2e47ed,_0x4c2bb4){const _0x43f7ec=this['_sourceResourceBalloons']['get'](_0x3c218d);if(!_0x43f7ec)return;const _0x3465b1=this['_getResourcesViewFromBalloon'](_0x43f7ec);_0x3465b1&&(_0x3465b1['setResources'](_0x2e47ed,_0x4c2bb4),_0x3465b1['once']('change:isLoading',()=>{_0x43f7ec['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x3f947b){const _0x4c0229=this['_sourceResourceBalloons']['get'](_0x3f947b);_0x4c0229&&requestAnimationFrame(()=>{_0x4c0229['hide'](),this['_sourceResourceBalloons']['delete'](_0x3f947b),this['_config']['onBalloonClosed']();});}['closeAll'](){for(const _0x272998 of Array['from'](this['_sourceResourceBalloons']['keys']()))this['closeSourceResourceBalloon'](_0x272998);}['isAnyResourceBalloonVisible'](){for(const _0xdd7688 of this['_sourceResourceBalloons']['values']())if(_0xdd7688['isVisible'])return!0x0;return!0x1;}updateResourceState(_0xeb9aa9,_0x190261,_0x5f1c4e){const _0x436fce=this['_sourceResourceBalloons']['get'](_0xeb9aa9);if(!_0x436fce||!_0x436fce['isVisible'])return;const _0x463e15=this['_config']['getTargetElement']();if(!_0x463e15)return;_0x436fce['pin']({'target':_0x463e15,'limiter':this['_config']['getLimiterElement']()});const _0x2ff31d=this['_getResourcesViewFromBalloon'](_0x436fce);_0x2ff31d&&_0x2ff31d['updateResourceState'](_0x190261,_0x5f1c4e);}destroy(){for(const _0x4d16dc of this['_sourceResourceBalloons']['values']())_0x4d16dc['destroy']();this['_sourceResourceBalloons']['clear']();}_createSourceResourceBalloonPanel(){const _0x3a7628=new Jt(this['_locale']);return _0x3a7628['extendTemplate']({'attributes':{'class':Ma}}),this['_bodyCollection']['add'](_0x3a7628),_0x3a7628;}_addSourceResourceContent({balloonPanel:_0x13743b,source:_0x5ee164,withBackButton:_0x5e2f80}){_0x13743b['content']['clear']();const _0x2ada56=this['_createBalloonHeader']({'balloonPanel':_0x13743b,'source':_0x5ee164,'withBackButton':_0x5e2f80});_0x13743b['content']['add'](_0x2ada56);const _0x8861b4=this['_createBalloonResourcesView'](_0x5ee164);_0x13743b['content']['add'](_0x8861b4);}_createBalloonHeader({balloonPanel:_0x147f6d,source:_0x5a0607,withBackButton:_0x57d6b0}){const _0x6147b4=new _0x105865(this['_locale'],{'label':_0x5a0607['label']});return _0x57d6b0&&_0x6147b4['children']['add'](this['_createBackButton'](_0x147f6d),0x0),_0x6147b4;}_createBackButton(_0x54d538){const _0x20d880=new _0x1a9216(this['_locale']);return _0x20d880['set']({'icon':_0x9f5b9e,'tooltip':qs(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Va}),_0x20d880['on']('execute',()=>{_0x54d538['hide'](),this['_config']['onBackToContext']();}),_0x20d880;}_createBalloonResourcesView(_0x1d46e2){const _0x5a1bdf=new Pa(this['_locale'],{'source':_0x1d46e2,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x5a1bdf['on']('loadSourceResources',(_0x5e4b4f,_0x41a420)=>{this['_config']['onLoadSourceResources'](_0x41a420);}),_0x5a1bdf['on']('addResourceToContext',(_0x15aade,_0x10e4cb)=>{this['_config']['onResourceSelected'](_0x10e4cb['source'],_0x10e4cb['resource']),this['closeSourceResourceBalloon'](_0x1d46e2['id']);}),_0x5a1bdf;}_getResourcesViewFromBalloon(_0x1a06d7){const _0x685355=_0x1a06d7['content']['get'](0x1);return _0x685355 instanceof Pa?_0x685355:null;}_setupSingleResourceBalloonClickOutsideHandler(_0x58a12b){_0x314252({'emitter':_0x58a12b,'contextElements':[_0x58a12b['element']],'callback':()=>{_0x58a12b['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x58a12b['isVisible']});}};const Ua=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Ba='ck-ai-chat-context-controls',Ga='ck-ai-chat-context-controls__pending-contexts',Wa='ck-ai-chat-context-controls__add-context-balloon-panel',Fa='ck-ai-chat-context-controls__add-context-button',Ka='ck-ai-chat-context-controls__url-balloon-panel',$a='ck-ai-chat-context-controls__balloon-list',Ya='ck-ai-chat-context-controls__balloon-button',qa='ck-ai-chat-context-controls__balloon-button-source',Qa='ck-ai-chat-controls-button',Xa='ck-ai-chat-context-chips-wrapper-balloon',za='ck-ai-chat-controls_context_show-more-button',ja='ck-ai-chat-context-controls__show-more-balloon-panel',Ja=[Jt['defaultPositions']['northArrowSouthWest'],Jt['defaultPositions']['northArrowSouth'],Jt['defaultPositions']['northArrowSouthEast'],Jt['defaultPositions']['southArrowNorthWest'],Jt['defaultPositions']['southArrowNorth'],Jt['defaultPositions']['southArrowNorthEast']];var Za=class extends _0x2df458{addContextButtonView;_currentContextsChips=this['createCollection']();_conversationContextsChips=this['createCollection']();['_overflowManager'];_addContextBalloonPanelView;_addContextListView;['_urlBalloonPanelView'];_urlInputView;['_resourcesBalloonView'];_addContextBalloonConfig;_hasExactlyOneSource=!0x1;bodyCollection;constructor(_0x9d27d1,_0x3b5bf6){super(_0x9d27d1),this['bodyCollection']=_0x3b5bf6['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['set']('isBusy',!0x1),this['set']('hasContextOptions',!0x1),this['addContextButtonView']=this['_createAddContextButtonView'](_0x9d27d1),this['addContextButtonView']['bind']('isEnabled')['to'](this,'hasContextOptions',this,'isBusy',(_0x2c7a02,_0x485f95)=>_0x2c7a02&&!_0x485f95),this['_addContextListView']=this['_createAddContextListView'](_0x9d27d1),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x9d27d1),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x9d27d1),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x9d27d1,_0x3b5bf6);const _0x560ac8={'cssClasses':{'showMoreButton':za+'\x20'+Ar,'showMoreBalloon':ja,'overflowContainer':Xa,'controlsButton':Qa},'getLimiterElement':()=>ah(this['element'])};this['_overflowManager']=new Uo(_0x9d27d1,this['_currentContextsChips'],_0x560ac8,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(_0x2e5fd9,_0x45f85b){const _0x208e1b=this['_createContextButton'](_0x2e5fd9,'current',!0x0,_0x45f85b);this['_addContextToCollection'](_0x208e1b,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}removeContextItem(_0x3457eb){this['_removeContextFromCollection'](_0x3457eb,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x3457eb,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}setContextItemLoading(_0x445305,_0x56ee1d){let _0x140853=this['_currentContextsChips']['find'](_0x5912cb=>_0x5912cb['id']===_0x445305);_0x140853||(_0x140853=this['_overflowManager']['overflowChips']['find'](_0x54eb41=>_0x54eb41['id']===_0x445305)),_0x140853&&(_0x140853['isLoading']=_0x56ee1d);}setConversationContext(_0x10aac0){this['_conversationContextsChips']['clear']();for(const _0x558fa1 of _0x10aac0){const _0x3e0f86=this['_createContextButton'](_0x558fa1,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x3e0f86,this['_conversationContextsChips']);}}clearCurrentContextItems(){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}clearConversationContextItems(){this['_conversationContextsChips']['clear']();}updateResourceState(_0x5ddd39,_0x4949da,_0x260245){this['_resourcesBalloonView']['updateResourceState'](_0x5ddd39,_0x4949da,_0x260245);}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;}['hideAllBalloons'](){this['hideAddContextBalloonPanel'](),this['hideUrlBalloonPanel'](),this['_resourcesBalloonView']['closeAll']();}['_showSourceResourcesBalloon']({source:_0x17a675,withBackButton:_0x4e088e}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x17a675,'withBackButton':_0x4e088e}),this['addContextButtonView']['isOn']=!0x0;}populateSourceResourceBalloon(_0x36526c,_0x4a4476,_0x14078a,_0x4e6920){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x36526c,_0x14078a,_0x4e6920);}['closeSourceResourceBalloon'](_0x3fcf95){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x3fcf95),this['addContextButtonView']['isOn']=!0x1;}setAddContextOptions(_0x35130b){this['_setBalloonPanelContent'](this['locale'],_0x35130b),this['_setAddContextButtonEnabled'](_0x35130b);}_setAddContextButtonEnabled(_0x40fec7){const _0x4e758d=!_0x40fec7['document']['isHidden']&&_0x40fec7['document']['enabled'],_0x800b5f=_0x40fec7['urls']['enabled'],_0x2d090e=_0x40fec7['files']['enabled'],_0x3d268d=_0x40fec7['sources']['length']>0x0,_0x431f45=!!_0x40fec7['customItems']?.['length'];this['hasContextOptions']=_0x4e758d||_0x800b5f||_0x2d090e||_0x3d268d||_0x431f45;}_setupTemplate(){this['setTemplate']({'tag':'div','attributes':{'class':[Ba,'ck-reset_all-excluded',this['bindTemplate']['if']('isBusy','ck-hidden')]},'children':[{'tag':'div','attributes':{'class':Ga},'children':this['_currentContextsChips']}]});}_bindEventHandlers(){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}_createAddContextButtonView(_0xd95534){const _0x2e8a63=new _0x1a9216(_0xd95534);return _0x2e8a63['set']({'label':qs(_0xd95534,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Qa+'\x20'+Fa+'\x20'+Ar+'\x20ck-button_small','icon':_0x4245d8,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x2e8a63;}_createAddContextListView(_0x4a3e72){const _0x108f3a=new _0x4e6fd6(_0x4a3e72);return _0x108f3a['extendTemplate']({'attributes':{'class':$a}}),_0x108f3a;}_createAddContextBalloonPanelView(_0x559409){const _0xd13fe7=this['_createBaseBalloonPanel'](_0x559409,Wa);return _0xd13fe7['content']['add'](this['_addContextListView']),_0xd13fe7;}_createUrlBalloonPanelView(_0xa5bfdf){const _0x279df8=this['_createBaseBalloonPanel'](_0xa5bfdf,Ka);return this['_addUrlContent'](_0x279df8,_0xa5bfdf),_0x279df8;}_createResourcesBalloonView(_0x4fc8d9,_0x18b5f3){const _0x4fd25c={'searchInputVisibleFrom':_0x18b5f3['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':ah(this['element']),'positions':Ja});},'onResourceSelected':(_0x412477,_0x3c56a6)=>{this['fire']('addResourceToContext',{'source':_0x412477,'resource':_0x3c56a6});},'onLoadSourceResources':_0x39a186=>{this['fire']('loadSourceResources',_0x39a186);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>ah(this['element']),'getTargetElement':()=>this['addContextButtonView']['element']};return new Ha(_0x4fc8d9,_0x18b5f3['bodyCollection'],_0x4fd25c);}_createBaseBalloonPanel(_0x1085c6,_0x3046f2){const _0x3ff81e=new Jt(_0x1085c6);return _0x3ff81e['extendTemplate']({'attributes':{'class':_0x3046f2}}),this['bodyCollection']['add'](_0x3ff81e),_0x3ff81e;}_setBalloonPanelContent(_0x15e769,_0xd241de){if(this['_addContextListView']['items']['clear'](),!_0xd241de['document']['isHidden']&&_0xd241de['document']['enabled']){const _0x57983e=this['_createBalloonButton'](_0x15e769,{'label':qs(_0x15e769,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x5e85dd});_0x57983e['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),this['_addBalloonListItem'](_0x15e769,_0x57983e);}if(_0xd241de['urls']['enabled']){const _0x46ae63=this['_createBalloonButton'](_0x15e769,{'label':qs(_0x15e769,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x3bcbd8});_0x46ae63['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':ah(this['element']),'positions':Ja}),this['_urlInputView']['focus']();}),this['_addBalloonListItem'](_0x15e769,_0x46ae63);}if(_0xd241de['files']['enabled']){const _0x14b363=new _0x193b34(_0x15e769);_0x14b363['set']({'label':qs(_0x15e769,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x43cd6e,'withText':!0x0,'tooltip':!0x0,'class':Ya,'allowMultipleFiles':!0x0}),_0x14b363['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x14b363['on']('done',(_0x177ab6,_0x12c680)=>{this['fire']('addFileToContext',_0x12c680);}),_0x14b363['tooltip']=!0x0,this['_addBalloonListItem'](_0x15e769,_0x14b363);}for(const _0x13eef9 of _0xd241de['sources']){const _0x5892a8=this['_createBalloonButton'](_0x15e769,{'label':_0x13eef9['label'],'icon':_0x13eef9['icon']||_0x1052b8,'type':'source'});this['_addBalloonListItem'](_0x15e769,_0x5892a8),_0x5892a8['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x13eef9,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x3c125d of _0xd241de['customItems']||[]){const _0x866274=this['_createBalloonButton'](_0x15e769,{'label':_0x3c125d['label'],'icon':_0x3c125d['icon']||_0x1052b8,'type':'customItem'});this['_addBalloonListItem'](_0x15e769,_0x866274),_0x866274['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x3c125d);});}this['_hasExactlyOneSource']=0x1===this['_addContextListView']['items']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}_addBalloonListItem(_0x1835f9,_0x34cd28){const _0xa1cd7c=new _0xf665cb(_0x1835f9);_0xa1cd7c['children']['add'](_0x34cd28),this['_addContextListView']['items']['add'](_0xa1cd7c);}_getBalloonListButton(_0x3a0609){return this['_addContextListView']['items']['get'](_0x3a0609)?.['children']['first'];}_addUrlContent(_0x100ba2,_0xc77ae2){this['_urlInputView']=new ba(_0xc77ae2),this['_urlInputView']['on']('submitUrl',(_0x456aef,_0x3422f2)=>{this['_handleUrlSubmit'](_0x3422f2);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':ah(this['element']),'positions':Ja}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':ah(this['element']),'positions':Ja});}),_0x100ba2['content']['add'](this['_urlInputView']);}_createBalloonButton(_0x1c8495,_0x37ca54){const _0x5af5eb='source'===_0x37ca54['type']?new th(_0x1c8495):new _0x4bbb4c(_0x1c8495);return _0x5af5eb['set']({'label':_0x37ca54['label'],'icon':_0x37ca54['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Ya}),_0x5af5eb;}_setupAllBalloonClickOutsideHandlers(){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}_setupUrlBalloonClickOutsideHandler(){_0x314252({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}_toggleAddContextBalloon(_0x96d800){const _0x12cb16=this['_addContextBalloonConfig'];_0x12cb16['buttonView']['isOn']=_0x96d800,_0x96d800?_0x12cb16['balloonView']['show']():_0x12cb16['balloonView']['hide']();}_setupAddContextBalloonClickOutsideHandler(){const {balloonView:_0x169e29,buttonView:_0x311825,hideMethod:_0x29c30c}=this['_addContextBalloonConfig'];_0x314252({'emitter':_0x169e29,'contextElements':[_0x169e29['element'],_0x311825['element']],'callback':()=>{_0x29c30c();},'activator':()=>_0x311825['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}_createContextButton(_0x5cfff1,_0x808e43,_0x466daa=!0x1,_0xbfa3ea=!0x1){const _0x10445f='conversation'===_0x808e43||!0x0===_0x5cfff1['isReadOnly'],_0x3bd468=new Po(this['locale'],_0x5cfff1,_0x10445f,_0x466daa,_0xbfa3ea);return _0x10445f||_0x3bd468['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x3bd468['id']);}),_0x3bd468;}_addContextToCollection(_0x2e35dd,_0xf83944){_0xf83944['add'](_0x2e35dd,0x0);}_removeContextFromCollection(_0x321d55,_0x247427){const _0x3840aa=_0x247427['find'](_0x585f51=>_0x585f51['id']===_0x321d55);_0x3840aa&&_0x247427['remove'](_0x3840aa);}_handleAddContextButtonClick(){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':ah(this['element']),'positions':Ja}),this['_hasExactlyOneSource']&&this['_getBalloonListButton'](0x0)?.['fire']('execute'));}_handleUrlSubmit(_0x5c067b){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x5c067b);}},th=class extends _0x4bbb4c{['arrowView'];constructor(_0x3fc0cc){super(_0x3fc0cc),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[qa]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}_createArrowView(){const _0x564a12=new _0x5e3c18();return _0x564a12['content']=_0x4e5c52,_0x564a12['extendTemplate']({'attributes':{'class':qa+'__arrow'}}),_0x564a12;}},eh=class extends _0x2df458{_contextPanelView;_promptInputView;['_dropZoneView'];_promptCapabilitiesView;['_modelUnavailableMessageView'];['_filesEnabled'];constructor(_0x247c38,_0x1b79b6){super(_0x247c38),this['_filesEnabled']=_0x1b79b6['filesEnabled'],this['_contextPanelView']=this['_createContextPanelView'](_0x247c38,{'bodyCollection':_0x1b79b6['bodyCollection'],'searchInputVisibleFrom':_0x1b79b6['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x247c38),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x247c38),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x247c38),this['_dropZoneView']=new oa(_0x247c38),this['_promptInputView']['delegate']('sendUserMessage','promptInputPaste','abortPromptStream')['to'](this),this['_promptInputView']['bind']('isBusy')['to'](this,'isBusy'),this['_contextPanelView']['bind']('isBusy')['to'](this,'isBusy'),this['_promptCapabilitiesView']['bind']('isBusy')['to'](this,'isBusy'),this['_dropZoneView']['delegate']('promptInputPaste')['to'](this),this['_dropZoneView']['on']('dragEnter',()=>this['_contextPanelView']['hideAllBalloons']()),this['_dropZoneView']['bind']('isEnabled')['to'](this,'isBusy',_0x2f8ee8=>!_0x2f8ee8),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...Ua)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1),this['set']('isLoadingSkeletonVisible',!0x1);const _0x45e1a7=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x45e1a7['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x45e1a7['if']('isModelAvailable','ck-hidden',_0x5f5841=>!_0x5f5841),_0x45e1a7['if']('isLoadingSkeletonVisible','ck-ai-chat-controls__content_covered')]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x45e1a7['if']('isModelAvailable','ck-hidden',_0x1376e4=>_0x1376e4)]},'children':[this['_modelUnavailableMessageView']]},this['_dropZoneView'],this['_createSkeletonView']()]});}['render'](){super['render'](),this['_filesEnabled']&&this['_dropZoneView']['attach'](this['element']);}_createContextPanelView(_0x39aee7,_0x140c9b){return new Za(_0x39aee7,_0x140c9b);}_createPromptInputView(_0x307911){return new ra(_0x307911,this['_contextPanelView']['addContextButtonView']);}_createPromptCapabilitiesView(_0x1d1f18){return new Ca(_0x1d1f18);}_createSkeletonView(){const _0x113db1=new lo(this['locale'],uo['aiChatControls']);return _0x113db1['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x113db1;}_createModelUnavailableMessageView(_0x2821af){const _0xd38e68=new ih(_0x2821af);return _0xd38e68['delegate']('startConversation')['to'](this),_0xd38e68;}addContextItem(_0x318d36,_0x518a59){this['_contextPanelView']['addContextItem'](_0x318d36,_0x518a59);}removeContextItem(_0x910984){this['_contextPanelView']['removeContextItem'](_0x910984);}setContextItemLoading(_0x55698e,_0x382720){this['_contextPanelView']['setContextItemLoading'](_0x55698e,_0x382720);}setIsUploadInProgress(_0x327ceb){this['_promptInputView']['setIsUploadInProgress'](_0x327ceb);}setConversationContext(_0x351e4e){this['_contextPanelView']['setConversationContext'](_0x351e4e);}clearPendingContextUI(){this['_contextPanelView']['clearCurrentContextItems']();}clearConversationContextUI(){this['_contextPanelView']['clearConversationContextItems']();}updateResourceState(_0x20f55a,_0x1e1800,_0x35ae08){this['_contextPanelView']['updateResourceState'](_0x20f55a,_0x1e1800,_0x35ae08);}setWebSearch(_0x4538cf){this['_promptCapabilitiesView']['setWebSearch'](_0x4538cf);}setReasoning(_0x1e316c){this['_promptCapabilitiesView']['setReasoning'](_0x1e316c);}resetMessageInput(){this['_promptInputView']['reset']();}setAddContextOptions(_0xf9d377){this['_contextPanelView']['setAddContextOptions'](_0xf9d377);}setInputPlaceholder(_0x1c0ce5){this['_promptInputView']['setPlaceholderText'](_0x1c0ce5);}setModelList(_0xf3dc0d,_0x335a52){this['_promptCapabilitiesView']['setModelList'](_0xf3dc0d,_0x335a52);}setModel(_0x1905e7){_0x1905e7?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x1905e7)):this['isModelAvailable']=!0x1;}enableModelSelector(){this['_promptCapabilitiesView']['enableModelSelector']();}disableModelSelector(_0x312e4a){this['_promptCapabilitiesView']['disableModelSelector'](_0x312e4a);}populateSourceResourceBalloon(_0x49ff2a,_0x267bd8,_0x1b0094,_0x2880ee){this['_contextPanelView']['populateSourceResourceBalloon'](_0x49ff2a,_0x267bd8,_0x1b0094,_0x2880ee);}['closeSourceResourceBalloon'](_0x458e18){this['_contextPanelView']['closeSourceResourceBalloon'](_0x458e18);}focusPromptInput(_0x29ea1=!0x1){this['_promptInputView']['focus'](_0x29ea1);}setPromptInputValue(_0x3c6083){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x3c6083;}},ih=class extends _0x2df458{constructor(_0x35ad98){super(_0x35ad98);const _0x44472e=new _0x1a9216(_0x35ad98);_0x44472e['set']({'label':qs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x44472e['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':qs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x44472e]}]});}},sh=class extends _0x105865{resizeButton;constructor(_0x3a3d5f,_0x57824b){super(_0x3a3d5f,{'label':_0x57824b['label'],'class':'ck-ai-header\x20'+_0x57824b['class'],'icon':_0x57824b['icon']}),this['set']('isMaximized',!0x1),this['set']('isLoadingSkeletonVisible',!0x1),this['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-ai-header_loading')]}}),_0x57824b['content']&&this['children']['add'](_0x57824b['content']),_0x57824b['showResizeButton']&&(this['resizeButton']=Tr(_0x3a3d5f,this),this['children']['add'](this['resizeButton']));}},nh=class extends _0x2df458{constructor(_0x5d4322){super(_0x5d4322),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':qs(_0x5d4322,'AI_DISCLAIMER_TEXT')}]}]});}};function rh(_0x1d2263,_0xfc53da){const _0x53e08d=new _0x1a9216(_0x1d2263);return _0x53e08d['set']({'label':qs(_0x1d2263,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x293553,'class':'ck-ai-chat__start-conversation\x20ck-button_small\x20'+Ir}),_0x53e08d['on']('execute',()=>{_0xfc53da['fire']('startConversation');}),_0x53e08d;}const oh='ck-ai-chat';function ah(_0x2531b9){return _0x2531b9?.['closest']('.'+oh)||null;}var hh=class extends _0x2df458{chatHeader;chatFeed;chatControls;chatDisclaimer;constructor(_0x108473,_0x28ea67){super(_0x108473);const _0x4c5697=rh(_0x108473,this);this['chatHeader']=new sh(_0x108473,{'label':qs(_0x108473,'AI_CHAT_HEADING'),'icon':_0x2024d5,'class':'ck-ai-header_chat','content':_0x4c5697,'showResizeButton':_0x28ea67['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new ea(_0x108473,_0x28ea67['bodyCollection']),this['chatFeed']['delegate'](...Yr)['to'](this),this['chatControls']=new eh(_0x108473,{'bodyCollection':_0x28ea67['bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x28ea67['contextResourcesSearchInputVisibleFrom'],'filesEnabled':_0x28ea67['filesEnabled']}),this['chatControls']['delegate'](...Yr)['to'](this),this['chatControls']['bind']('isLoadingSkeletonVisible')['to'](this['chatFeed']),this['chatHeader']['bind']('isLoadingSkeletonVisible')['to'](this['chatFeed']),this['chatDisclaimer']=new nh(_0x108473),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all',oh,'ck-rounded-corners'],'dir':_0x108473['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}populateSourceResourceBalloon(_0x4b6a64,_0x53f7ad,_0x70f5c7,_0x154b9b){this['chatControls']['populateSourceResourceBalloon'](_0x4b6a64,_0x53f7ad,_0x70f5c7,_0x154b9b);}['closeSourceResourceBalloon'](_0x4e202d){this['chatControls']['closeSourceResourceBalloon'](_0x4e202d);}},ch=class extends _0x4cd5fc{static get requires(){return[Ks];}['_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;get['idleUiPromise'](){return this['_promiseQueue']['queueEmptyPromise'];}constructor(_0x220a29){super(_0x220a29);const _0x56be23=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['set']('isChatStreaming',!0x1),this['_promiseQueue']=new Ao(),this['_view']=new hh(this['context']['locale'],{'bodyCollection':_0x56be23['bodyCollection'],'showResizeButton':_0x56be23['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom'),'filesEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.files.enabled')}),this['_view']['delegate']('resizeTabs')['to'](_0x56be23),this['_view']['delegate'](...Yr)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x361eea,{showDiff:_0x550440})=>{this['showDiff']=_0x550440;}),this['disableControls'](),this['toggleLoadingSkeleton'](!0x0,'init'),_0x56be23['view']['addTab']({'id':'chat','buttonLabel':qs(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x2024d5,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x56be23['view'],'isMaximized',_0x4da277=>_0x4da277),this['_view']['chatControls']['bind']('isBusy')['to'](this,'isChatStreaming',_0x4fe16c=>_0x4fe16c),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}destroy(){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}createConversation({availableModels:_0x137d68}){const _0x2b46dc=this['context']['config']['get']('ai.chat.welcomeMessage')??qs(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x137d68,!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x2b46dc}),this['fire']('conversationCreated');}async addFeedItemStaticMessage({id:_0x4b6519,staticMessage:_0x4b7bc9}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x4b6519,'initialContent':'<p>'+_0x4b7bc9+'</p>'});});}async addFeedItemUserMessage(_0x27df2c){const _0xba6fda=_0x27df2c['attributes']?.['displayedPrompt']||_0x27df2c['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x27df2c['contextItems']['values']()),'initialContent':'<p>'+_0xba6fda+'</p>','id':_0x27df2c['id']});});}async addFeedItemError({errorMessage:_0x57258e,id:_0x1e7a27}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x57258e+'</p>','id':_0x1e7a27});});}async addFeedItemAIReply(_0x51ab1c){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x51ab1c['interactionId']+':'+_0x51ab1c['id']}),this['clearLoadingMessage']();});}async addFeedItemAISuggestion(_0x5e20a6){const _0x207fd5=Zs(this['context']),_0x15ba52=_0x207fd5['map'](_0x3e8f8e=>_0x3e8f8e['config']['get']('ai.availableReplyActions')||[...po]);let _0x4b3bf0=_0x15ba52['reduce']((_0x118195,_0xd3120d)=>_0x118195['filter'](_0x405195=>_0xd3120d['includes'](_0x405195)),_0x15ba52[0x0]||[...po]);const _0x3308e4=_0x207fd5['every'](_0x20dfbb=>_0x20dfbb['plugins']['has']('TrackChanges')),_0x4ba95a=_0x207fd5['map'](_0x5e93d3=>_0x5e93d3['commands']['get']('trackChanges'));return _0x3308e4?this['_isTrackChangesCommandValueBound']||(this['_isTrackChangesCommandValueBound']=!0x0,this['_view']['chatFeed']['bind']('isTrackChangesOn')['toMany'](_0x4ba95a,'value',(..._0x34146e)=>_0x34146e['some'](_0x45eb91=>_0x45eb91))):_0x4b3bf0=_0x4b3bf0['filter'](_0x4a393e=>'insertSuggestion'!=_0x4a393e),this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x5e20a6['interactionId']+':'+_0x5e20a6['id'],'areActionsDisabled':_0x5e20a6['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x4b3bf0}),this['clearLoadingMessage']();});}async addFeedInteractionHeader(_0x55661c,_0x28c0f5){return this['_promiseQueue']['enqueue'](async()=>{const _0x4bc371=this['_view']['chatFeed']['children']['last'];if(_0x4bc371 instanceof Qo)return this['_view']['chatFeed']['children']['remove'](_0x4bc371),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x55661c['id'],'capabilities':{'isWebSearchEnabled':_0x4bc371['capabilities']['isWebSearchEnabled']||_0x28c0f5['isWebSearchEnabled'],'isReasoningEnabled':_0x4bc371['capabilities']['isReasoningEnabled']||_0x28c0f5['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x55661c['id'],'capabilities':_0x28c0f5});});}async addFeedItemCustomElement(_0x56e46c,_0x578eff){let _0x586971;return await this['_promiseQueue']['enqueue'](async()=>{_0x586971=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x56e46c,'id':_0x578eff});}),_0x586971;}removeFeedItem(_0x2ed51a){this['_view']['chatFeed']['removeItem'](_0x2ed51a);}hasFeedItem(_0xafdf60){return this['_view']['chatFeed']['hasItem'](_0xafdf60);}updateFeedInteractionHeader(_0x1b6a19){const _0x9c9cb9=this['_view']['chatFeed']['children']['find'](_0x3ff435=>_0x3ff435['options']['id']==_0x1b6a19['id']&&_0x3ff435 instanceof Qo);_0x9c9cb9&&_0x9c9cb9['set']('isVisible',_0x1b6a19['isVisible']);}async updateFeedItemAIReplyContent(_0x4024fd){const _0x45b9f2=_0x4024fd['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x4290cf=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x4024fd,'abortSignal':_0x4290cf,'renderingStrategy':_0x45b9f2}),_0x4024fd['isDone']&&this['markFeedItemAsDone'](_0x4024fd['id']);});}updateFeedItemAIReplySources(_0x1dde72,_0x596f36){this['_view']['chatFeed']['updateWebSources'](_0x1dde72,_0x596f36);}async updateFeedItemAIReplySuggestionContent(_0x26e949){return this['_promiseQueue']['enqueue'](async _0x4de266=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x26e949,'abortSignal':_0x4de266}),_0x26e949['isDone']&&this['markFeedItemAsDone'](_0x26e949['id']);});}updateFeedItemAIReplySuggestionPartState(_0x1875b6){this['_view']['chatFeed']['updateSuggestionPartState'](_0x1875b6);}setSuggestionGating(_0x3dcb54,_0x353d82){this['_view']['chatFeed']['updateSuggestionGating'](_0x3dcb54,_0x353d82);}setFeedItemAIReplySuggestionPartActive(_0x1e91ad){this['_view']['chatFeed']['setSuggestionPartActive'](_0x1e91ad);}getFeedItemAIReplySuggestionPartUIIndex(_0x45e4bc){return this['_view']['chatFeed']['getSuggestionPartUIIndex'](_0x45e4bc);}markFeedItemAsDone(_0x4f251c){this['_view']['chatFeed']['markItemAsDone'](_0x4f251c);}removeFeedInteraction(_0x2da4b2){this['_view']['chatFeed']['getItemIds']()['filter'](_0x8ef9d8=>_0x8ef9d8['startsWith'](_0x2da4b2))['forEach'](_0x2d9f0=>this['_view']['chatFeed']['removeItem'](_0x2d9f0));}startInteraction(){const _0x103eec=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x103eec),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['isChatStreaming']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}stopInteraction(_0x2dd897){this['_promiseQueue']['abort'](),_0x2dd897&&this['_view']['chatFeed']['getItemIds']()['filter'](_0x57fb12=>_0x57fb12['startsWith'](_0x2dd897['id']))['forEach'](_0x120842=>this['markFeedItemAsDone'](_0x120842)),this['resetChatBusyStateToIdle']();}resetChatBusyStateToIdle(){this['isBusy']=!0x1,this['isChatStreaming']=!0x1,this['clearLoadingMessage'](),this['_view']['chatFeed']['stopAutoScroll']();}async finishInteraction(){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['resetChatBusyStateToIdle']();});}addContextItem(_0x2e3f9c,_0x23c7a3){this['_view']['chatControls']['addContextItem'](_0x2e3f9c,_0x23c7a3);}removeContextItem(_0x29d9dd){this['_view']['chatControls']['removeContextItem'](_0x29d9dd);}setContextItemLoading(_0xbacd39,_0xde5b9a){this['_view']['chatControls']['setContextItemLoading'](_0xbacd39,_0xde5b9a);}setIsUploadInProgress(_0x4a410a){this['_view']['chatControls']['setIsUploadInProgress'](_0x4a410a);}setConversationContext(_0x320a26){this['_view']['chatControls']['setConversationContext'](_0x320a26);}clearPendingContextUI(){this['_view']['chatControls']['clearPendingContextUI']();}clearConversationContextUI(){this['_view']['chatControls']['clearConversationContextUI']();}updateResourceState(_0x3ce1a1,_0x1a7dd8,_0x104216){this['_view']['chatControls']['updateResourceState'](_0x3ce1a1,_0x1a7dd8,_0x104216);}resetMessageInput(){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}setAddContextOptions(_0x16f053){this['_view']['chatControls']['setAddContextOptions'](_0x16f053);}updateCapabilities(_0x53753d){this['_view']['chatControls']['setWebSearch'](_0x53753d['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x53753d['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x53753d));}setSelectedModel(_0xd011f3,_0x3f5220){this['_view']['chatControls']['setModel'](_0xd011f3),_0x3f5220&&this['_view']['chatControls']['disableModelSelector'](!0x1);}setFeedItemRenderingStrategy(_0x4d5010){this['feedItemRenderingStrategy']=_0x4d5010;}toggleLoadingSkeleton(_0x5b7f4e,_0x25e5e9='conversation'){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x5b7f4e,_0x25e5e9);}resetConversationTitle(){this['setConversationTitle'](qs(this['context']['locale'],'AI_CHAT_HEADING'));}emptyConversationTitle(){this['setConversationTitle']('');}setConversationTitle(_0x1ccd85,_0x1f9215=!0x1){if(clearInterval(this['_titleAnimationInterval']),_0x1f9215&&!ft()&&_0x1ccd85['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x1ccd85);this['_view']['chatHeader']['label']=_0x1ccd85;}setLoadingMessage(_0x533176){this['_view']['chatFeed']['setLoadingMessage'](_0x533176);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}_animateConversationTitle(_0x542e8f){let _0x561e46=0x0;this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x542e8f[_0x561e46],_0x561e46++,_0x561e46===_0x542e8f['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x2c6d08){return _0x2c6d08['isWebSearchEnabled']&&_0x2c6d08['isReasoningEnabled']?qs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x2c6d08['isWebSearchEnabled']?qs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x2c6d08['isReasoningEnabled']?qs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):qs(this['context']['locale'],'AI_CHAT_IS_WRITING');}_getInputPlaceholder(_0x6864d7){return _0x6864d7?_0x6864d7['isWebSearchEnabled']&&_0x6864d7['isReasoningEnabled']?qs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x6864d7['isWebSearchEnabled']?qs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x6864d7['isReasoningEnabled']?qs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):qs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):qs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}populateSourceResourceBalloon(_0x5dee2b,_0x1e326b,_0x5eb107,_0x46bf66){this['_view']['populateSourceResourceBalloon'](_0x5dee2b,_0x1e326b,_0x5eb107,_0x46bf66);}['closeSourceResourceBalloon'](_0x1d4d8b){this['_view']['closeSourceResourceBalloon'](_0x1d4d8b);}setPromptInputValue(_0x2a350c){this['_view']['chatControls']['setPromptInputValue'](_0x2a350c);}focusPromptInput(_0x208c40=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x208c40);}scrollFeedToSuggestion(_0x1e8d21,_0x4290fb){this['_view']['chatFeed']['scrollToSuggestion'](_0x1e8d21,_0x4290fb);}startAutoScroll(_0x5c3016={}){this['_view']['chatFeed']['startAutoScroll'](_0x5c3016);}stopAutoScroll(){this['_view']['chatFeed']['stopAutoScroll']();}disableControls(){this['_view']['chatControls']['isDisabled']=!0x0;}enableControls(){this['_view']['chatControls']['isDisabled']=!0x1;}toggleConversationLoading(_0x30d1c3){_0x30d1c3?(this['isBusy']=_0x30d1c3,this['disableControls']()):(this['enableControls'](),this['resetChatBusyStateToIdle']());}},lh=class extends _0x4e6fd6{sections;constructor(_0x185a22,_0x276289){super(_0x185a22),this['sections']=_0x276289,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}filter(_0x2598f1){let _0x18c4b2=0x0,_0x21aee5=0x0;for(const _0x10eccb of this['sections']){const {resultsCount:_0x21d781,totalItemsCount:_0x9c93ae}=_0x10eccb['filter'](_0x2598f1);_0x18c4b2+=_0x21d781,_0x21aee5+=_0x9c93ae;}return{'resultsCount':_0x18c4b2,'totalItemsCount':_0x21aee5};}},uh=class extends _0xf665cb{title;itemsViews;_itemsListView;constructor(_0x559d5d,{title:_0x39cebf,items:_0x2e479b}){super(_0x559d5d);const _0x2e7c05=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x39cebf,this['itemsViews']=_0x2e479b;const _0x3128d9=new _0x2df458(_0x559d5d);_0x3128d9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x4e6fd6(_0x559d5d),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x2e7c05['if']('isVisible','ck-hidden',_0x515fa3=>!_0x515fa3)]},'children':[_0x3128d9,this['_itemsListView']]});}filter(_0x2bd3e1){const _0x595f66=this['itemsViews']['length'];let _0x16216c=0x0;for(const _0x16ec7a of this['itemsViews'])_0x2bd3e1?(_0x16ec7a['isVisible']=!!_0x16ec7a['isMatching'](_0x2bd3e1),_0x16ec7a['highlightText'](_0x2bd3e1)):(_0x16ec7a['isVisible']=!0x0,_0x16ec7a['highlightText'](null)),_0x16ec7a['isVisible']&&_0x16216c++;return this['isVisible']=_0x16216c>0x0,{'resultsCount':_0x16216c,'totalItemsCount':_0x595f66};}getItem(_0x457c44){return this['itemsViews']['find'](_0x16109b=>_0x16109b['id']===_0x457c44);}removeItem(_0x4384f6){const _0x40ecac=this['itemsViews']['indexOf'](_0x4384f6);-0x1!==_0x40ecac&&(this['itemsViews']['splice'](_0x40ecac,0x1),this['_itemsListView']['items']['remove'](_0x4384f6));}};const dh=/* #__PURE__ -- @preserve */
34
+ _0x15c985(_0xf665cb);var _h=class AIChatHistoryListItemView extends dh{['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(_0x1a887a,_0x38b493){super(_0x1a887a);const _0x3c32e3=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x38b493['pinned']),this['set']('loadingState',null),this['set']('title',_0x38b493['title']),this['id']=_0x38b493['id'];const {createdAt:_0x44bf6a,active:_0x3663a3=!0x1}=_0x38b493;this['_titleView']=new _0x2d3d45(),this['_titleView']['bind']('text')['to'](this,'title'),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x50bd6a=this['_createCheckView'](),_0x416ba4=this['_createPinButtonView'](_0x1a887a),_0x463e9f=this['_createMenuDropdownView'](),_0x1b94f8=this['_createEditInputView'](_0x1a887a),_0x38e907=this['_createAcceptEditButtonView'](_0x1a887a,_0x1b94f8),_0x201179=this['_createCancelEditButtonView'](_0x1a887a);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x416ba4),this['actions']['add'](_0x463e9f),this['on']('change:isEdit',(_0x3b0b23,_0xc3c177,_0x46f5f4)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x46f5f4?(this['actions']['add'](_0x38e907),this['actions']['add'](_0x201179),this['mainContent']['add'](_0x1b94f8),_0x1b94f8['element']['value']=this['title']||'',_0x1b94f8['element']['focus']()):(this['actions']['add'](_0x416ba4),this['actions']['add'](_0x463e9f),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x3663a3?'ck-ai-chat-history__item--active':'',_0x3c32e3['if']('isVisible','ck-hidden',_0x4b21ee=>!_0x4b21ee),_0x3c32e3['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',_0x3c32e3['if']('loadingState','ck-hidden',_0xe1f3d8=>!!_0xe1f3d8)]},'children':_0x3663a3?[_0x50bd6a]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x3c32e3['if']('loadingState','ck-hidden',_0x19a55=>!_0x19a55)]},'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-container',_0x3c32e3['if']('loadingState','ck-hidden',_0x401ad5=>!!_0x401ad5)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x3c32e3['if']('loadingState','ck-hidden',_0x4156fd=>!_0x4156fd)]},'children':[{'text':_0x3c32e3['to']('loadingState',_0x3aa2f7=>_0x3aa2f7?qs(this['locale'],AIChatHistoryListItemView['LOADING_LABELS'][_0x3aa2f7]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x44bf6a]}]},{'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(_0x38cfee){this['set']('title',_0x38cfee);}updateLoadingState(_0x193d55,_0x466eeb){this['set']('loadingState',_0x466eeb?_0x193d55:null);}_createCheckView(){const _0x2ff775=new _0x5e3c18();return _0x2ff775['set']({'content':_0x42448e}),_0x2ff775;}_createPinButtonView(_0x3ab60f){const _0x4e1375=new _0x1a9216(_0x3ab60f);return _0x4e1375['set']({'label':qs(_0x3ab60f,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x5ad74f,'withText':!0x1,'tooltip':!0x0,'class':Er}),_0x4e1375['bind']('isOn')['to'](this,'pinned'),_0x4e1375['on']('execute',()=>{const _0x36abdc=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x36abdc});}),_0x4e1375;}_createMenuDropdownView(){const _0x40c0ae=_0x4c754a(this['locale']),_0x30982e=_0x40c0ae['panelView']['children'];_0x40c0ae['buttonView']['set']({'label':qs(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':ht,'class':Er}),_0x40c0ae['panelPosition']='sw';const _0x31f8c0=new _0x1a9216(this['locale']);_0x31f8c0['label']=qs(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x31f8c0['icon']=_0x4e1016,_0x31f8c0['withText']=!0x0,_0x31f8c0['on']('execute',()=>{this['isEdit']=!0x0;});const _0x400c93=new _0x1a9216(this['locale']);_0x400c93['label']=qs(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x400c93['icon']=_0x173e6f,_0x400c93['withText']=!0x0,_0x400c93['on']('execute',()=>{this['showConfirm'](qs(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x56f710=new _0x4e6fd6(this['locale']),_0x144b80=new _0xf665cb(this['locale']);_0x144b80['children']['add'](_0x31f8c0);const _0x56cba1=new _0xf665cb(this['locale']);return _0x56cba1['children']['add'](_0x400c93),_0x56f710['items']['addMany']([_0x144b80,_0x56cba1]),_0x30982e['add'](_0x56f710),_0x40c0ae;}_createEditInputView(_0x2abce7){const _0x30970d=new _0x3a21ad(_0x2abce7),_0xa4f96b=_0x30970d['bindTemplate'];return _0x30970d['extendTemplate']({'on':{'keydown':_0xa4f96b['to'](_0x149b08=>{'Enter'==_0x149b08['key']&&this['_commitEditInputValue'](_0x30970d);})}}),_0x30970d;}_createAcceptEditButtonView(_0x7893cd,_0x4a92c2){const _0x298e61=new _0x1a9216(_0x7893cd);return _0x298e61['set']({'icon':_0x42448e,'withText':!0x1,'tooltip':qs(_0x7893cd,'AI_CHAT_HISTORY_ACCEPT'),'class':Er}),_0x298e61['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x298e61['on']('execute',()=>{this['_commitEditInputValue'](_0x4a92c2);}),_0x298e61;}_commitEditInputValue(_0x1167fd){const _0x18ef2b=_0x1167fd['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x18ef2b});}_createCancelEditButtonView(_0x206637){const _0x2fe53c=new _0x1a9216(_0x206637);return _0x2fe53c['set']({'icon':_0x29be46,'withText':!0x1,'tooltip':qs(_0x206637,'AI_CHAT_HISTORY_CANCEL'),'class':Er}),_0x2fe53c['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x2fe53c['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x2fe53c;}_createSpinnerView(){const _0x252f3f=new So('small');return _0x252f3f['isVisible']=!0x0,_0x252f3f;}isMatching(_0x592f76){return'string'==typeof this['title']&&this['title']['match'](_0x592f76)?{'title':!0x0}:null;}highlightText(_0x36b4eb){this['_titleView']['highlightText'](_0x36b4eb);}},gh=class extends _0x2df458{['headerView'];['searchView'];['mainErrorView'];skeletonView;emptyView;sectionsView;constructor(_0x21255d,_0xe03038){super(_0x21255d),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x229c98=rh(_0x21255d,this);this['headerView']=new sh(_0x21255d,{'label':qs(_0x21255d,'AI_CHAT_HISTORY_HEADING'),'icon':_0x23e734,'class':'ck-ai-header_history','content':_0x229c98,'showResizeButton':_0xe03038}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new lh(_0x21255d,[]),this['sectionsView']['delegate'](...Ih)['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',_0x5e37ea=>!_0x5e37ea)]}}),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':[this['headerView'],{'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 _0xfee83b=new _0x2750eb(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':qs(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x43c270=>qs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x43c270),'secondary':qs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x22d94e=this['_createErrorView']();return _0x22d94e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x689c80=>!_0x689c80)]}}),_0xfee83b['on']('render',()=>{_0xfee83b['children']['add'](_0x22d94e,0x1);}),_0xfee83b['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x6049e4=>!_0x6049e4)]}}),_0xfee83b;}_createSkeletonView(){const _0x3b807f=new lo(this['locale'],uo['aiHistory']);return _0x3b807f['bind']('isVisible')['to'](this,'isLoading'),_0x3b807f;}_createErrorView(){const _0x49b14c=new _0x2df458(this['locale']),_0x10c9f2=new _0x1a9216(this['locale']);_0x10c9f2['set']({'withText':!0x1,'icon':_0x29be46,'class':'ck-ai-notification_error__dismiss-button'}),_0x10c9f2['bind']('isVisible')['to'](this,'hasItems',_0x587157=>!!_0x587157),_0x10c9f2['on']('execute',()=>{this['errorMessage']='';});const _0x35afcd=this['bindTemplate'];return _0x49b14c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x35afcd['to']('errorMessage')}]},_0x10c9f2]}),_0x49b14c;}_createEmptyStateView(){const _0x4035c5=new _0x2df458(this['locale']);return _0x4035c5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x3601b3=>!_0x3601b3)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[qs(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x4035c5;}_createListItemViews(_0x13d38c,_0x1acabf){const _0x23de8a=[];for(const _0x2f567f of _0x13d38c){const _0x1aa382=new _h(_0x1acabf,_0x2f567f);_0x1aa382['delegate'](...Ih)['to'](this),_0x23de8a['push'](_0x1aa382);}return _0x23de8a;}updateHistoryItemsWithCategories(_0x492f5b){const _0x142d9c=this['locale']||'en',_0x562c49=[];for(const _0x4e0d37 of _0x492f5b){const _0x58e7bf=this['_createListItemViews'](_0x4e0d37['items'],_0x142d9c);_0x562c49['push'](new uh(_0x142d9c,{'title':_0x4e0d37['title'],'items':_0x58e7bf}));}this['sectionsView']['sections']=_0x562c49,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x562c49),this['hasItems']=_0x492f5b['some'](_0x3cb22f=>_0x3cb22f['items']['length']>0x0),this['_refreshSearch']();}removeHistoryItem(_0x492fa4){for(const _0x875f60 of this['sectionsView']['sections']){const _0x555a25=_0x875f60['getItem'](_0x492fa4);if(_0x555a25){if(_0x875f60['removeItem'](_0x555a25),0x0===_0x875f60['itemsViews']['length']){const _0x63172=this['sectionsView']['sections']['indexOf'](_0x875f60);-0x1!==_0x63172&&(this['sectionsView']['sections']['splice'](_0x63172,0x1),this['sectionsView']['items']['remove'](_0x875f60));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}updateItemTitle(_0x21feee,_0x4f5ebb){for(const _0x229bff of this['sectionsView']['sections']){const _0x546731=_0x229bff['getItem'](_0x21feee);if(_0x546731){_0x546731['updateTitle'](_0x4f5ebb);break;}}}updateItemLoadingState(_0x44bf33,_0x503be5,_0x455e98){for(const _0x22467d of this['sectionsView']['sections']){const _0x1acee7=_0x22467d['getItem'](_0x44bf33);if(_0x1acee7){_0x1acee7['updateLoadingState'](_0x503be5,_0x455e98);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x3b7dda=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x3b7dda);}}};const Ih=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];var Ah=class extends _0x4cd5fc{static get requires(){return[Ks];}_historyView;static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5b1b41){super(_0x5b1b41);const _0x53e8bf=this['context']['plugins']['get']('AITabs');this['_historyView']=new gh(this['context']['locale'],_0x53e8bf['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x53e8bf),this['_historyView']['delegate'](...Ih)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x53e8bf['view'],'isMaximized',_0x287458=>_0x287458),_0x53e8bf['view']['addTab']({'id':'history','buttonLabel':qs(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x23e734,'order':0x0,'content':this['_historyView']});}removeHistoryItem(_0x434ada){this['_historyView']['removeHistoryItem'](_0x434ada);}updateItems(_0x57daef){this['_historyView']['updateHistoryItemsWithCategories'](_0x57daef);}updateItemTitle(_0x5859d2,_0x4641ac){this['_historyView']['updateItemTitle'](_0x5859d2,_0x4641ac);}updateItemLoadingState(_0x5e98cf,_0x287739,_0x2bfa3c){this['_historyView']['updateItemLoadingState'](_0x5e98cf,_0x287739,_0x2bfa3c);}setLoadingSkeleton(_0x4108ee){this['_historyView']['isLoading']=_0x4108ee;}['showError'](_0xf24d50){this['_historyView']['errorMessage']=_0xf24d50;}['hideError'](){this['_historyView']['errorMessage']='';}};const Eh=/* #__PURE__ -- @preserve */
35
+ mt();var ph=class extends Eh{['id'];createdAt;constructor({id:_0x29e090,title:_0x196392,createdAt:_0x5d6596,updatedAt:_0xc56c09,pinned:_0x55215c}){super(),this['id']=_0x29e090,this['createdAt']=new Date(_0x5d6596),this['set']('title',_0x196392),this['set']('updatedAt',_0xc56c09?new Date(_0xc56c09):null),this['set']('pinned',_0x55215c||!0x1);}updateTitle(_0x2b7730){this['set']('title',_0x2b7730),this['updatedAt']=new Date();}updatePinned(_0x58e7c5){this['set']('pinned',_0x58e7c5),this['updatedAt']=new Date();}};const mh=/* #__PURE__ -- @preserve */
36
+ It();var Th=class extends mh{items=[];connector;['group'];constructor({connector:_0x1e6471,group:_0xc641ca}){super(),this['connector']=_0x1e6471,this['group']=_0xc641ca;}async init(){try{const _0x2dcda2=await this['connector']['fetchConversations'](this['group'])['getConversations']();this['loadItems'](_0x2dcda2);}catch(_0x211afa){this['fire']('error',{'error':_0x211afa,'operation':'init'});}}addItem(_0x1a5939){this['items']['push'](_0x1a5939);}async removeItem(_0x395826){const _0xd414ff=this['items']['findIndex'](_0x5c3961=>_0x5c3961['id']===_0x395826);if(-0x1===_0xd414ff)return!0x1;try{return await this['connector']['deleteConversation'](_0x395826)['execute'](),this['items']['splice'](_0xd414ff,0x1),this['fire']('itemRemoved',{'itemId':_0x395826}),!0x0;}catch(_0xf8418e){return this['fire']('error',{'error':_0xf8418e,'operation':'removeItem','itemId':_0x395826}),!0x1;}}getItem(_0x544559){return this['items']['find'](_0x56dc67=>_0x56dc67['id']===_0x544559);}async updateItemTitle(_0x3ab6b9,_0x430fdb){const _0x417922=this['getItem'](_0x3ab6b9);if(!_0x417922)return!0x1;try{return await this['connector']['updateConversation'](_0x3ab6b9,{'title':_0x430fdb})['getResult'](),_0x417922['updateTitle'](_0x430fdb),this['fire']('itemUpdated',{'itemId':_0x3ab6b9,'updates':{'title':_0x430fdb}}),!0x0;}catch(_0x1dc9cd){return this['fire']('error',{'error':_0x1dc9cd,'operation':'updateItemTitle','itemId':_0x3ab6b9}),!0x1;}}async updateItemPinned(_0x20402a,_0xe3e49f){const _0x5529bf=this['getItem'](_0x20402a);if(!_0x5529bf)return!0x1;try{return await this['connector']['updateConversation'](_0x20402a,{'pinned':_0xe3e49f})['getResult'](),_0x5529bf['updatePinned'](_0xe3e49f),this['fire']('itemUpdated',{'itemId':_0x20402a,'updates':{'pinned':_0xe3e49f}}),!0x0;}catch(_0x254f39){return this['fire']('error',{'error':_0x254f39,'operation':'updateItemPinned','itemId':_0x20402a}),!0x1;}}loadItems(_0x486662){try{this['items']=[],_0x486662['map'](_0xd4bf95=>{this['addItem'](new ph(_0xd4bf95));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x1496e2){this['fire']('error',{'error':_0x1496e2,'operation':'loadItems'});}}getItems(_0x5a540f={}){const _0x48e05e=void 0x0!==_0x5a540f['pinned']&&_0x5a540f['pinned'],_0x277169=_0x5a540f['from']?new Date(_0x5a540f['from']['getFullYear'](),_0x5a540f['from']['getMonth'](),_0x5a540f['from']['getDate']()):null,_0x2bc372=_0x5a540f['to']?new Date(_0x5a540f['to']['getFullYear'](),_0x5a540f['to']['getMonth'](),_0x5a540f['to']['getDate']()):null;return this['items']['filter'](_0x39f218=>{if(_0x39f218['pinned']!==_0x48e05e)return!0x1;if(_0x2bc372){const _0x4f4ed8=new Date(_0x39f218['createdAt']['getFullYear'](),_0x39f218['createdAt']['getMonth'](),_0x39f218['createdAt']['getDate']());return _0x277169?_0x277169['getTime']()===_0x2bc372['getTime']()?_0x4f4ed8['getTime']()===_0x277169['getTime']():_0x4f4ed8<_0x2bc372&&_0x4f4ed8>=_0x277169:_0x4f4ed8<_0x2bc372;}return!0x0;});}},wh=class extends _0x4cd5fc{_aiConnector;_reporter;_aiChatHistoryUi;_aiChatController;static get requires(){return[$s,dr,Kr,Ah,Ks];}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'](Ah),this['_aiChatController']=this['context']['plugins']['get'](Kr),this['_reporter']=this['context']['plugins']['get'](dr)['createReporter']('aichathistory');const _0x42974a=this['context']['plugins']['get'](Ks);try{const _0x6de4f4=this['_aiChatController']['getGroupId']();this['history']=new Th({'connector':this['_aiConnector'],'group':_0x6de4f4}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x486386,_0x5125cc)=>{this['_setItemLoading'](_0x5125cc['id'],'remove'),this['_handleRemove'](_0x5125cc['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x7358b1,_0x2fdade)=>{this['_setItemLoading'](_0x2fdade['id'],'rename'),this['_handleEditTitle'](_0x2fdade['id'],_0x2fdade['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x12b6f7,_0x186f28)=>{void 0x0!==_0x186f28['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x186f28['itemId'],_0x186f28['updates']['title']),void 0x0!==_0x186f28['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x186f28['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0xcb9d41,_0x3117e1)=>{this['_aiChatController']['_handleRemovedConversation'](_0x3117e1['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x3117e1['itemId']),this['_clearItemLoading'](_0x3117e1['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0xf22add,_0xe0719b)=>{this['_handleHistoryErrorUI'](_0xe0719b['error'],_0xe0719b['operation'],_0xe0719b['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x101371,_0x17a482)=>{this['_handleSelectConversation'](_0x17a482['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x4bd3a5,_0x1d09c7)=>{const _0x948e98=_0x1d09c7['pinned']?'pin':'unpin';this['_setItemLoading'](_0x1d09c7['id'],_0x948e98),this['_handleTogglePin'](_0x1d09c7['id'],_0x1d09c7['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{_0x42974a['view']['activateTab']('chat'),this['_aiChatController']['startConversation']();}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x42974a['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x46e821){this['_handleHistoryErrorUI'](_0x46e821,'init');}}async _handleEditTitle(_0x4b506a,_0x2a0bb9){await this['history']['updateItemTitle'](_0x4b506a,_0x2a0bb9);}async['_handleTogglePin'](_0x536d3d,_0x19cdeb){await this['history']['updateItemPinned'](_0x536d3d,_0x19cdeb);}async['_handleRemove'](_0x258a0c){await this['history']['removeItem'](_0x258a0c);}async _handleSelectConversation(_0x2ef82){this['context']['plugins']['get'](Ks)['view']['activateTab']('chat'),await this['_aiChatController']['loadConversation'](_0x2ef82);}async _showConversationHistory(){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}_updateHistoryItemsUI(){const _0xb4c82a=this['_aiChatController']['activeConversation']?.['id'],_0x4f7099=this['_getCategorizedItems']()['map'](_0x5e53db=>({'title':_0x5e53db['title'],'items':_0x5e53db['items']['map'](_0x54a06a=>({'id':_0x54a06a['id'],'title':_0x54a06a['title']||qs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x54a06a['createdAt'])['toLocaleDateString'](),'active':_0x54a06a['id']===_0xb4c82a,'pinned':_0x54a06a['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x4f7099);}_setItemLoading(_0x186367,_0x2a5006){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x186367,_0x2a5006,!0x0);}_clearItemLoading(_0x199cee){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x199cee,null,!0x1);}_handleHistoryErrorUI(_0x248d18,_0x27f5f0,_0x4f2877){const _0x316497=this['_generateErrorMessage'](_0x27f5f0,_0x4f2877);this['_aiChatHistoryUi']['showError'](_0x316497),this['_reporter']['reportError'](_0x248d18,{'context':{'operation':_0x27f5f0}}),_0x4f2877&&this['_clearItemLoading'](_0x4f2877),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}_generateErrorMessage(_0x14829a,_0x55db31){const _0x40cd5b=_0x55db31?this['history']['getItem'](_0x55db31):null,_0x4faaac=_0x40cd5b?.['title']||qs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x14829a){case'updateItemTitle':return qs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x4faaac);case'updateItemPinned':{const _0x333e35=qs(this['context']['locale'],_0x40cd5b?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return qs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x333e35,_0x4faaac]);}case'removeItem':return qs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x4faaac);case'init':case'loadItems':return qs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return qs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}_getCategorizedItems(){const _0x58e2e3=new Date(),_0x43d6b5=new Date(_0x58e2e3['getFullYear'](),_0x58e2e3['getMonth'](),_0x58e2e3['getDate']()),_0x277106=new Date(_0x43d6b5);_0x277106['setDate'](_0x277106['getDate']()-0x1);const _0x2c951e=new Date(_0x43d6b5);_0x2c951e['setDate'](_0x2c951e['getDate']()-0xe);const _0x5187da=this['history']['getItems']({'pinned':!0x0}),_0x156f96=this['history']['getItems']({'from':_0x43d6b5,'to':_0x43d6b5}),_0x4cddc2=this['history']['getItems']({'from':_0x277106,'to':_0x277106}),_0x1ef322=this['history']['getItems']({'from':_0x2c951e,'to':_0x277106}),_0x43b524=this['history']['getItems']({'to':_0x2c951e}),_0x169a8=[];return _0x5187da['length']>0x0&&_0x169a8['push']({'title':qs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x5187da}),_0x156f96['length']>0x0&&_0x169a8['push']({'title':qs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x156f96}),_0x4cddc2['length']>0x0&&_0x169a8['push']({'title':qs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x4cddc2}),_0x1ef322['length']>0x0&&_0x169a8['push']({'title':qs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x1ef322}),_0x43b524['length']>0x0&&_0x169a8['push']({'title':qs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x43b524}),_0x169a8;}},Ch=class extends _0x4cd5fc{static get requires(){return[wh,Ah];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},fh=class extends _0x4cd5fc{static get requires(){return[Kr,Pn,ch,Ch,cr];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x39c694){super(_0x39c694),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'contextLibrary':{'enabled':!0x1},'sources':[],'alwaysAddSelection':!0x1,'paste':{'textThreshold':0x5dc}}),this['context']['config']['define']('ai.chat.initialConversation','new');}},Rh=class extends _0x1a9216{['id'];constructor(_0x220397,_0x4c3095){super(_0x220397);const {id:_0x304829,type:_0x10d5df,icon:_0x2fbcfe}=_0x4c3095;this['id']=_0x304829,this['set']({'label':_0x4c3095['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x4c3095['id']}}),_0x2fbcfe?this['icon']=_0x2fbcfe:'chat'===_0x10d5df?this['icon']=_0x2024d5:'review'===_0x10d5df?this['icon']=_0x2c00e7:'translate'===_0x10d5df&&(this['icon']=_0x46b415);}},bh=class extends _0x2df458{listView;constructor(_0x3ad90c,_0x5dc02e){super(_0x3ad90c),this['set']('isEnabled',!0x0);const _0x474c3d=_0x5dc02e['map'](_0x228136=>{const _0x568265=new _0xf665cb(this['locale']),_0x267a6a=new Rh(this['locale'],_0x228136);return _0x267a6a['bind']('isEnabled')['to'](this),_0x568265['children']['add'](_0x267a6a),_0x267a6a['delegate']('execute')['to'](this),_0x568265;});this['listView']=new _0x4e6fd6(this['locale']),this['listView']['items']['addMany'](_0x474c3d),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}};const Sh='reviewMode',Oh='translate',vh='chat-shortcuts';var yh=class extends _0x4cd5fc{_shortcuts;_shortcutsView;_aiChatUI;_listenedConversation;static get requires(){return[ch,Js];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_aiChatUI']=this['context']['plugins']['get'](ch),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x22349a=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{const _0xe239e1=_0x22349a['activeConversation'];_0xe239e1['isFromHistory']||this['_injectShortcuts'](_0xe239e1);}),this['listenTo'](_0x22349a,'interactionCreated',()=>{this['_removeShortcuts']();}));}_validateShortcuts(){const _0x2515d9=['chat','review','translate'];this['_shortcuts']['forEach'](_0x33ee2d=>{let _0x31e7e9=!0x0;if(_0x33ee2d['id']&&_0x33ee2d['label']&&_0x2515d9['includes'](_0x33ee2d['type'])?'chat'===_0x33ee2d['type']&&(_0x31e7e9='string'==typeof _0x33ee2d['prompt']):_0x31e7e9=!0x1,!_0x31e7e9)throw new dt('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x33ee2d});});}_injectShortcuts(_0x5f0f60){this['_removeShortcuts'](),this['_shortcutsView']=new bh(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),this['_aiChatUI']['addFeedItemCustomElement'](this['_shortcutsView']['element'],vh),this['_shortcutsView']['on']('execute',_0x58c4a6=>{const _0x5601e9=_0x58c4a6['source']['id'];this['_executeShortcut'](_0x5601e9);}),this['_listenedConversation']=_0x5f0f60,this['listenTo'](_0x5f0f60,'uploadProgressChanged',(_0xa5bd73,_0x124ee7)=>{this['_shortcutsView']['isEnabled']=!_0x124ee7['isUploadInProgress'];});}_removeShortcuts(){const _0x143423=this['context']['plugins']['get'](ch);_0x143423['hasFeedItem'](vh)&&_0x143423['removeFeedItem'](vh),this['_listenedConversation']&&(this['stopListening'](this['_listenedConversation'],'uploadProgressChanged'),this['_listenedConversation']=void 0x0),this['_shortcutsView']?.['destroy']();}_executeShortcut(_0x17e22c){const _0x1aaa76=this['_shortcuts']['find'](_0x2a278c=>_0x2a278c['id']===_0x17e22c),_0x15db9f=_0x1aaa76['type'];'chat'===_0x15db9f?this['_runChatShortcut'](_0x1aaa76):'review'===_0x15db9f?_0x1aaa76['commandId']?this['_runReviewShortcut'](_0x1aaa76):this['_switchTab'](Sh):'translate'===_0x15db9f&&(_0x1aaa76['language']?this['_runTranslateShortcut'](_0x1aaa76):this['_switchTab'](Oh));}_switchTab(_0x5467a5){if(!this['context']['plugins']['has']('AITabs'))throw new dt('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x5467a5});return this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x5467a5);}async _runChatShortcut({id:_0x352262,prompt:_0x208d91,draftMode:_0x40c688,useWebSearch:_0x4b52a8=!0x1,useReasoning:_0x1e2d91=!0x1,model:_0x5576bc}){const _0x2ffdd5=this['context']['plugins']['get']('AIChatController'),_0x1eb783=_0x2ffdd5['activeConversation'],_0x3799f6=this['context']['plugins']['get'](Js),_0x4d8bcf=await _0x3799f6['models']['resolveModel'](_0x5576bc);_0x4d8bcf&&await _0x1eb783['setModel'](_0x4d8bcf),_0x1eb783['setWebSearch'](_0x4b52a8),_0x1eb783['setReasoning'](_0x1e2d91);const _0x49eef7=_0x3799f6['contextLibrary']['resolveContext']({'feature':'chat','ids':[_0x352262],'idScopedOnly':!0x0,'context':new nr()});_0x1eb783['addDefaultContext'](_0x49eef7['refs']),_0x2ffdd5['addCurrentDocumentToChatContext'](),_0x40c688?(this['_aiChatUI']['setPromptInputValue'](_0x208d91),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x2ffdd5['sendMessage']({'message':_0x208d91});}_runReviewShortcut({commandId:_0x2159d4,model:_0x34b39f,prompt:_0x4adf7a,params:_0x3c16df}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new dt('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab'](Sh);const _0x264507={'id':_0x2159d4,'isCustom':'custom'===_0x2159d4};_0x34b39f&&_0x4adf7a&&(_0x264507['args']={'model':_0x34b39f,'prompt':_0x4adf7a}),_0x3c16df&&(_0x264507['params']=_0x3c16df),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x264507);}_runTranslateShortcut({language:_0x524707}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new dt('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x524707,'args':{'language':_0x524707}});}},Nh=class extends _0x3f0a57{constructor(_0x4fb691){super(_0x4fb691);const _0x125aa9=_0x4fb691['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x125aa9,'isVisible'),this['isEnabled']=!0x0;}execute(){const _0x4e5ae7=this['editor']['plugins']['get']('AITabs')['view'];_0x4e5ae7['isVisible']=!_0x4e5ae7['isVisible'];}},kh=class extends _0x158c3f{static get requires(){return[Ks];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x1fe14b=this['editor'];_0x1fe14b['commands']['add']('toggleAi',new Nh(_0x1fe14b)),_0x1fe14b['ui']['componentFactory']['add']('toggleAi',()=>{const _0x1c5596=this['_createAIUIButton'](_0x1a9216);return _0x1c5596['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x1c5596;}),_0x1fe14b['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x3d2177=this['_createAIUIButton'](_0x410c15);return _0x3d2177['set']({'role':'menuitemcheckbox'}),_0x3d2177;});}_createAIUIButton(_0x4683f6){const _0x582ded=this['editor'],_0x2d5435=_0x582ded['commands']['get']('toggleAi'),_0x365737=new _0x4683f6(_0x582ded['locale']);return _0x365737['set']({'label':qs(_0x582ded['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x4745fe,'isToggleable':!0x0}),_0x365737['bind']('isEnabled')['to'](_0x2d5435),_0x365737['bind']('isOn')['to'](_0x2d5435,'value',_0x75d7c5=>!!_0x75d7c5),this['listenTo'](_0x365737,'execute',()=>{_0x2d5435['execute']();}),_0x365737;}},xh=class extends _0x2df458{constructor(_0x57507b){super(_0x57507b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':qs(_0x57507b,'AI_DISCLAIMER_TEXT')}]}]});}};const Lh='ck-ai-mini-toolbar-copy-button\x20'+Ar,Dh=Lh+'\x20ck-ai-mini-toolbar-copy-button_copied';var Ph=class extends _0x20288e{copyButton;likeButton;dislikeButton;showChangesButton;['_config'];constructor(_0x4a6cda,_0x227315={}){super(_0x4a6cda),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x227315};const _0x1961b2=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x1961b2?'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(_0x3646b8){this['showChangesButton']['isEnabled']=_0x3646b8;}_setupRatingButtons(){this['likeButton']=new _0x1a9216(this['locale']),this['likeButton']['set']({'icon':lt,'label':qs(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':Ar,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x1a9216(this['locale']),this['dislikeButton']['set']({'icon':ct,'label':qs(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':Ar,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}_setupCopyButton(){this['copyButton']=new _0x1a9216(this['locale']),this['copyButton']['set']({'icon':_0x21a060,'label':qs(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':Lh,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x15be84=new _0x5e3c18();_0x15be84['set']({'content':_0x42448e}),_0x15be84['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']=Dh,setTimeout(()=>{this['copyButton']['class']=Lh;},0x7d0);}),this['copyButton']['children']['add'](_0x15be84);}_setupShowChangesButton(){this['showChangesButton']=new _0x1a9216(this['locale']),this['showChangesButton']['set']({'icon':st,'label':qs(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':Ar}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x4e445c=>_0x4e445c?nt:st),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}},Mh=class extends _0x20288e{constructor(_0x356c2f,_0x17ab9c=!0x0,_0x31950b=!0x0){super(_0x356c2f),this['set']('isEnabled',!0x1),this['set']('isVisible',!0x0),this['set']('isTargetReadOnly',!0x1),this['rejectButton']=this['_createButton'](qs(_0x356c2f,'AI_BALLOON_REJECT_BUTTON'),Ar),this['rejectButton']['bind']('isEnabled')['to'](this),this['rejectButton']['on']('execute',()=>{this['fire']('rejectSuggestion');}),this['items']['add'](this['rejectButton']),_0x31950b&&(this['suggestButton']=this['_createButton'](qs(_0x356c2f,'AI_BALLOON_SUGGEST_BUTTON'),Ir),this['suggestButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isTargetReadOnly',(_0x339f7b,_0x504b4c)=>_0x339f7b&&!_0x504b4c),this['suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['items']['add'](this['suggestButton'])),_0x17ab9c&&(this['applyButton']=this['_createButton'](qs(_0x356c2f,'AI_BALLOON_APPLY_BUTTON'),gr),this['applyButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isTargetReadOnly',(_0x3ea09e,_0x21574d)=>_0x3ea09e&&!_0x21574d),this['applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),this['items']['add'](this['applyButton'])),this['setButtonsVisibility']({'showApplyButton':_0x17ab9c,'showSuggestButton':_0x31950b});const _0x4e9828=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar',_0x4e9828['if']('isVisible','ck-hidden',_0x242e53=>!_0x242e53)]}});}get primaryActionButton(){return this['applyButton']&&this['applyButton']['isVisible']?this['applyButton']:this['suggestButton']&&this['suggestButton']['isVisible']?this['suggestButton']:this['rejectButton'];}setButtonsVisibility({showApplyButton:_0x1f8aec,showSuggestButton:_0x374791}){this['applyButton']&&(this['applyButton']['isVisible']=_0x1f8aec),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x374791);}_createButton(_0x32751d,_0x418bd1){const _0x14183c=new _0x1a9216(this['locale']);return _0x14183c['set']({'label':_0x32751d,'class':mr+'\x20'+_0x418bd1,'isVisible':!0x0,'withText':!0x0}),_0x14183c;}};const Vh=['applySuggestion','insertSuggestion','rejectSuggestion','showNext','showPrevious'];var Hh=class extends _0x2df458{['_errorView'];['children'];_streamableContentView;_contentView;_contentChildren;_toolbarContainerView;_toolbarView;['_disclaimerView'];['_miniToolbarView'];['_config'];constructor(_0x14ec89,_0x5185c7){super(_0x14ec89),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1),this['set']('width',null),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1),this['_streamableContentView']=new ho(_0x14ec89),this['_disclaimerView']=new xh(_0x14ec89),this['_miniToolbarView']=new Ph(_0x14ec89,{'showChanges':_0x5185c7['showChangesButtonMode']??'icon'}),this['_config']=_0x5185c7,this['_toolbarView']=new Mh(_0x14ec89,_0x5185c7['showApplyButton'],_0x5185c7['showSuggestButton']),this['_toolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_toolbarView']['bind']('isTargetReadOnly')['to'](this),this['_toolbarContainerView']=new Uh(_0x14ec89,[this['_miniToolbarView'],this['_toolbarView']]),this['_toggleToolbarButtonsVisibility'](_0x5185c7),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x5185c7);}),this['_contentView']=new _0x2df458(_0x14ec89),this['_contentChildren']=this['_contentView']['createCollection']([this['_streamableContentView']]),this['_contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__content']},'children':this['_contentChildren']}),this['children']=this['createCollection']([this['_contentView'],this['_disclaimerView'],this['_toolbarContainerView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon-main']},'children':this['children']});}['showBlockingError'](_0x1173bf){this['showError'](_0x1173bf);}['showError'](_0x245625){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_contentChildren']['has'](this['_errorView'])||this['_contentChildren']['add'](this['_errorView'],0x0),this['_errorMessage']=_0x245625,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}clearContent(){this['_streamableContentView']['clear']();}async updateContent(_0x23b01a){_0x23b01a?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x23b01a);}_createErrorView(){const _0x4f62a6=new _0x2df458(this['locale']),_0x1653ae=new _0x2df458(this['locale']);return _0x1653ae['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x4f62a6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x3515be=>!_0x3515be)]},'children':[_0x1653ae]}),_0x4f62a6;}_toggleToolbarButtonsVisibility({showApplyButton:_0x7a99d8,showSuggestButton:_0x2fba29}){_0x7a99d8=_0x7a99d8&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x2fba29=_0x2fba29&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x7a99d8,'showSuggestButton':_0x2fba29});}},Uh=class extends _0x2df458{['children'];constructor(_0x19a50d,_0x1a6bff){super(_0x19a50d),this['children']=this['createCollection'](_0x1a6bff),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-balloon__toolbar-container']},'children':this['children']});}};const Bh=0xa;var Gh=class extends _0x4cd5fc{static get requires(){return[Pn];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;_currentConfig;_editor;_isUpdatingMarkers=!0x1;['open'](_0xab6492){const {id:_0x418b4c}=this['_currentConfig']??{};this['_currentConfig']=_0xab6492,this['_editor']=_0xab6492['targetEditor'];const {id:_0xaa048e}=this['_currentConfig'];this['isOpen']&&_0x418b4c===_0xaa048e?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x4f7c9a=this['_editor'];if(!_0x4f7c9a)return;const _0x1e2b30=_0x4f7c9a['plugins']['get']('Dialog');_0x1e2b30['isOpen']&&this['_currentConfig']&&_0x1e2b30['id']===this['_currentConfig']['id']&&_0x1e2b30['hide']();}_updateDialog(){const _0x39f0c9=this['_editor']['plugins']['get']('Dialog');if(!_0x39f0c9['view'])return;const {icon:_0x2a93fc,title:_0x26203b,mainView:_0xbdc785}=this['_currentConfig'];this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x39f0c9['view']['headerView']&&(_0x39f0c9['view']['headerView']['label']=_0x26203b,_0x39f0c9['view']['headerView']['iconView']&&_0x2a93fc&&(_0x39f0c9['view']['headerView']['iconView']['content']=_0x2a93fc)),this['_adjustBalloonWidth'](_0xbdc785),_0x39f0c9['view']['updatePosition']();}_showFakeVisualSelection(){this['context']['plugins']['get'](Pn)['showFakeVisualSelection']({'editor':this['_editor'],'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),Pt(Array['from'](this['_editor']['editing']['view']['domRoots']['values']()))?.['removeAllRanges']();}_hideFakeVisualSelection(){this['context']['plugins']['get'](Pn)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0xf74b28=this['_editor']['plugins']['get']('Dialog'),{id:_0x26e171,title:_0x890e77,icon:_0x27fc84,class:_0x5c29a5,mainView:_0x28ef30}=this['_currentConfig'];_0x28ef30['delegate'](...Vh)['to'](this),_0xf74b28['show']({'title':_0x890e77,'icon':_0x27fc84,'hasCloseButton':!0x0,'id':_0x26e171,'position':this['_calculateDialogPosition']['bind'](this),'getRootName':this['_getCurrentDomRootName']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x5c29a5||''),'content':_0x28ef30,'onShow':_0x55ef7c=>{this['_adjustBalloonWidth'](_0x28ef30),this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x55ef7c['view']?.['updatePosition']();const _0x332828=this['_getSelectionElements']();_0x332828&&_0x332828[0x0]&&Yt({'target':_0x332828[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x55ef7c['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x26e171});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x26e171}),this['isOpen']=!0x1;}});}_calculateDialogPosition(_0x3b8548,_0x2724cb,_0x4dd0d9){const _0x432119=_0x2724cb||_0x4dd0d9;if(!_0x432119)return null;const _0x26ab5d=this['_getSelectionElements']();if(!_0x26ab5d||0x0===_0x26ab5d['length'])return{'left':Math['round'](_0x432119['left']+_0x432119['width']/0x2-_0x3b8548['width']/0x2),'top':Math['round'](_0x432119['top']+_0x432119['height']/0x2-_0x3b8548['height']/0x2)};const _0x41ad38=Math['round'](_0x432119['left']+_0x432119['width']/0x2-_0x3b8548['width']/0x2),_0x16d94e=_0x26ab5d['map'](_0xc50e1e=>new Tt(_0xc50e1e)),_0x305fc8=_0x3b8548['height'];return{'left':_0x41ad38,'top':this['_calculateOptimalTopPosition'](_0x16d94e,_0x305fc8,_0x432119)};}_calculateOptimalTopPosition(_0x3a8415,_0x208eb6,_0x546af4){const _0x4dd2d6=new Tt(Vt['window']),_0x3c13ed=_0x3a8415['map'](_0x32f34c=>_0x32f34c['getVisible']())['filter'](_0xd37723=>_0xd37723),_0x25878a=Tt['getBoundingRect'](_0x3c13ed);if(!_0x25878a)return Math['round'](_0x546af4['top']+_0x546af4['height']/0x2);const _0x32ad9f=_0x4dd2d6['getIntersection'](_0x25878a);if(!_0x32ad9f)return Math['round'](_0x546af4['top']+_0x546af4['height']/0x2);const _0x5e0333=_0x546af4['getVisible'](),_0x29758b=_0x5e0333&&_0x25878a['height']>_0x5e0333['height'],_0x54463c=_0x32ad9f['top'],_0x54e486=_0x32ad9f['bottom'];if(_0x29758b){const _0x4b27eb=_0x4dd2d6['top']+_0x4dd2d6['height']/0x2-_0x208eb6/0x2,_0x73758=_0x54463c-Bh-_0x4dd2d6['top'],_0xdf1502=_0x4dd2d6['bottom']-_0x54e486-Bh;return _0x73758>=_0x208eb6?Math['max'](Bh,_0x54463c-_0x208eb6-Bh):_0xdf1502>=_0x208eb6?_0x54e486+Bh:Math['max'](Bh,_0x4b27eb);}const _0x48f776=_0x54463c-_0x208eb6,_0xab69a2=_0x4dd2d6['bottom']-_0x54e486-Bh,_0x31f7b7=_0x54463c-Bh-_0x4dd2d6['top'];let _0x4e7553;return _0x4e7553=_0xab69a2>=_0x208eb6?_0x54e486+Bh:_0x31f7b7>=_0x208eb6?_0x48f776-Bh:_0x54463c+_0x25878a['height']/0x2-_0x208eb6/0x2,_0x4e7553;}_setupFakeVisualSelectionMarkerRemovalListener(){const _0x36eb8e=this['_editor'];this['listenTo'](_0x36eb8e['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x5b7f26,data:{newRange:_0x48da23}}of _0x36eb8e['model']['document']['differ']['getChangedMarkers']())if(_0x5b7f26['startsWith']('ai-selection:')&&(_0x48da23&&(_0x48da23['start']['isEqual'](_0x48da23['end'])||'$graveyard'==_0x48da23['root']['rootName'])||null==_0x48da23)){const _0x4eb390=qs(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x4eb390),this['fire']('selectionRemoved');}}});}_cleanupFakeVisualSelectionMarkerRemovalListener(){const _0x136a46=this['_editor'];this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x136a46['model']['document']);}_getSelectionElements(){const _0x5008ce=this['_editor'];return _0x4337d7(_0x5008ce['editing'],[..._0x5008ce['model']['markers']['getMarkersGroup']('ai-selection'),..._0x5008ce['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}_getCurrentDomRootName(){const _0x1461d1=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];return _0x1461d1&&_0x1461d1['rootName']?_0x1461d1['rootName']:null;}_adjustBalloonWidth(_0x519070){const _0x3fe355=this['_getCurrentDomRootName'](),_0x38c0b1=_0x3fe355?this['_editor']['editing']['view']['getDomRoot'](_0x3fe355):null;_0x38c0b1&&_0x519070['adjustWidthToEditable'](_0x38c0b1);}};function Wh({domRoot:_0x3276bb,innerElement:_0x1c6142,outerElement:_0xef6e11,widthCustomProperty:_0x5b077b}){if(!_0x1c6142||!_0xef6e11)return null;const _0x4cf73e=function(_0x4b5e02,_0x151e7c){let _0x35394f=0x0,_0x2dde1a=_0x4b5e02;for(;_0x2dde1a;){const {paddingLeft:_0x1a8436,paddingRight:_0x444dd9,borderLeftWidth:_0x1030cc,borderRightWidth:_0x8f4617}=Fh(_0x2dde1a);if(_0x35394f+=Kh(_0x1a8436)+Kh(_0x444dd9)+Kh(_0x1030cc)+Kh(_0x8f4617),_0x2dde1a===_0x151e7c)return _0x35394f;_0x2dde1a=Lt(_0x2dde1a);}return null;}(_0x1c6142,_0xef6e11);if(null===_0x4cf73e)return null;const _0x29d0a3=function(_0x5e4001){const {paddingLeft:_0x47868b,paddingRight:_0x16b84a}=Fh(_0x5e4001);return _0x5e4001['clientWidth']-Kh(_0x47868b)-Kh(_0x16b84a);}(_0x3276bb)+_0x4cf73e;return _0x29d0a3<=0x0?null:'var('+_0x5b077b+','+Math['min'](Math['ceil'](_0x29d0a3),0x384)+'px)';}function Fh(_0x549369){return _0x549369['ownerDocument']['defaultView']['getComputedStyle'](_0x549369);}function Kh(_0xb20e1a){return parseFloat(_0xb20e1a)||0x0;}var $h=class extends _0x2df458{constructor(_0x1a6bcc,_0x304775){super(_0x1a6bcc);const _0x1d2c9a=this['bindTemplate'];this['set']('isVisible',!0x0),this['setTemplate']({'tag':'span','attributes':{'class':['ck',_0x304775,_0x1d2c9a['if']('isVisible','ck-hidden',_0x206be7=>!_0x206be7)]}});}},Yh=class extends Hh{nextButtonView;previousButtonView;headerSeparatorView;['focusCycler'];['_focusables'];['_focusTracker'];_keystrokes;_stateView;constructor(_0xaf1641,_0x341348){super(_0xaf1641,{'showChangesButtonMode':'full',..._0x341348});const _0x7f55ac=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['set']('_outdatedReason',void 0x0),this['set']('areActionsDisabled',!0x1),this['_focusTracker']=new Et(),this['_keystrokes']=new pt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x17323b({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['headerSeparatorView']=new $h(_0xaf1641,'ck-ai-chat-balloon-header-separator'),this['_toolbarView']['bind']('isEnabled')['to'](this,'areActionsDisabled',this,'_isErrorVisible',(_0x1643f2,_0x36e1ec)=>!_0x1643f2&&!_0x36e1ec),this['_stateView']=new so(_0xaf1641),this['_stateView']['isVisible']=!0x1,this['_toolbarContainerView']['children']['add'](this['_stateView']),this['_setupMiniToolbar'](),this['on']('change:_state',(_0x1c36ca,_0x4b3787,_0x429782,_0x8bb427)=>{let _0x22d4e3,_0xfb2ce6;'pending'===_0x8bb427?(_0x22d4e3=this['_toolbarView'],_0xfb2ce6=this['_stateView']):(_0x22d4e3=this['_stateView'],_0xfb2ce6=this['_toolbarView']),this['_stateView']['setState'](_0x429782,this['_outdatedReason']),_0x22d4e3['isVisible']=!0x1,_0xfb2ce6['isVisible']=!0x0;}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon-main',_0x7f55ac['to']('_state',_0x2cf6be=>'ck-ai-chat-balloon-main_state_'+_0x2cf6be)],'style':{'width':_0x7f55ac['to']('width')}}});}['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['_toolbarView']),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['_miniToolbarView'],this['_toolbarView']]);}destroy(){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy'](),this['headerSeparatorView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}focusLast(){this['focusCycler']['focusLast']();}setState(_0x4aae8d,_0x513c75){this['_outdatedReason']=_0x513c75,this['_state']=_0x4aae8d;}toggleRotatorButtonsVisibility(_0x5cdb9f){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=this['headerSeparatorView']['isVisible']=_0x5cdb9f;}_createNextButtonView(){const _0x204b08=new _0x1a9216(this['locale']);return _0x204b08['set']({'icon':_0xcedfde,'label':qs(this['locale'],'AI_BALLOON_NEXT_LABEL'),'class':pr,'isVisible':!0x0}),_0x204b08['on']('execute',()=>{this['fire']('showNext');}),_0x204b08;}_createPreviousButtonView(){const _0x92d2b0=new _0x1a9216(this['locale']);return _0x92d2b0['set']({'icon':_0x6b5523,'label':qs(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'class':pr,'isVisible':!0x0}),_0x92d2b0['on']('execute',()=>{this['fire']('showPrevious');}),_0x92d2b0;}adjustWidthToEditable(_0x4b638b){const _0x1e8523=Wh({'domRoot':_0x4b638b,'innerElement':this['_streamableContentView']['element'],'outerElement':this['element'],'widthCustomProperty':'--ck-ai-chat-balloon-width'});_0x1e8523&&(this['width']=_0x1e8523);}_setupMiniToolbar(){this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');});}},qh=class extends _0x158c3f{static get requires(){return[_0x3fa2e4,Gh];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}_chatBalloonView;constructor(_0x451b70){super(_0x451b70),this['set']('showDiff',!0x1);}['open'](_0x13962a){const _0x393175=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x393175['plugins']['get']('AIBalloon')['open']({..._0x13962a,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x13962a['showRotator']),this['_chatBalloonView']['areActionsDisabled']=_0x13962a['areActionsDisabled'],this['_chatBalloonView']['isTargetReadOnly']=_0x13962a['isTargetReadOnly'],this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}updateContent(_0x37f573){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x37f573);}clearContent(){this['_chatBalloonView']&&this['_chatBalloonView']['clearContent']();}setState(_0x5aefa3,_0x342df9){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x5aefa3,_0x342df9);}setTargetReadOnly(_0x81cb36){this['_chatBalloonView']&&(this['_chatBalloonView']['isTargetReadOnly']=_0x81cb36);}_createChatBalloonView(){const _0x30aeee=this['editor'],_0x4203aa=_0x30aeee['plugins']['get']('AIBalloon'),_0x50791b=_0x30aeee['commands']['get']('trackChanges');let _0x4f0bcb=_0x30aeee['config']['get']('ai.availableReplyActions')||[...po];_0x30aeee['plugins']['has']('TrackChanges')||(_0x4f0bcb=_0x4f0bcb['filter'](_0x4bd3b2=>'insertSuggestion'!=_0x4bd3b2));const _0x572ecc=new Yh(_0x30aeee['locale'],{'availableActions':_0x4f0bcb,'showApplyButton':!0x0,'showSuggestButton':!!_0x50791b});return _0x572ecc['bind']('showDiff')['to'](this),_0x572ecc['delegate'](...$r)['to'](this),_0x572ecc['delegate']('showPrevious','showNext')['to'](this),_0x4203aa['delegate']('dialogClosed')['to'](this),_0x572ecc['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x572ecc['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x572ecc['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x50791b&&_0x572ecc['bind']('isTrackChangesOn')['to'](_0x50791b,'value'),_0x572ecc['render'](),_0x572ecc;}_toggleRotatorButtonsInDialogHeader(_0xc37686){const _0xddf90d=this['editor'],_0x27ad40=_0xddf90d['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0xc37686),_0x27ad40['has'](this['_chatBalloonView']['previousButtonView'])||(_0x27ad40['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView'],this['_chatBalloonView']['headerSeparatorView']],0x0),_0xddf90d['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x27ad40['remove'](this['_chatBalloonView']['previousButtonView']),_0x27ad40['remove'](this['_chatBalloonView']['nextButtonView']),_0x27ad40['remove'](this['_chatBalloonView']['headerSeparatorView']);}));}_restoreDefaultViewFocus(){this['_chatBalloonView']['focus']();}},Qh=class extends _0x158c3f{static get requires(){return[kh,qh,_0x33c035];}get['dialog'](){return this['editor']['plugins']['get'](_0x3fa2e4);}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};function Xh(_0x4196bf){const {editor:_0x5b2e65,action:_0x425184,withText:_0x4b521f=!0x1,withIcon:_0x1f82d1=!0x0,isInDropdown:_0x5e5ccf=!0x0,shouldPreventFocus:_0x565b3b=!0x1,actionButtons:_0x546769}=_0x4196bf;return()=>{const _0x33aeed=_0x5b2e65['locale'],_0x4cd1d6=new _0x1a9216(_0x33aeed),_0x3a24b3=_0x4cd1d6['bindTemplate'];_0x5e5ccf&&_0x4cd1d6['extendTemplate']({'on':{'mouseenter':_0x3a24b3['to'](()=>{_0x565b3b&&_0x565b3b()||_0x4cd1d6['focus']();})}}),_0x546769['push']({'buttonView':_0x4cd1d6,'action':_0x425184});const _0x2befd8=_0x425184['icon']??_0x425184['parent']?.['icon'];return _0x4cd1d6['set']({'label':_0x425184['label'],'withText':_0x4b521f,'role':'menuitem','icon':_0x1f82d1?_0x2befd8??_0x957fd2:void 0x0,'tooltip':!_0x4b521f,'class':'ck-ai-quick-actions-button','isEnabled':_0x425184['isEnabled']}),_0x4cd1d6['on']('execute',()=>{_0x5b2e65['editing']['view']['focus'](),_0x5b2e65['commands']['execute']('aiQuickAction',_0x425184);}),_0x4cd1d6;};}var zh=class extends _0x4bbb4c{['arrowView'];constructor(_0x331cb7,_0x1156bd){super(_0x331cb7,_0x1156bd);const _0x11bdb5=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',_0x21b999=>String(_0x21b999)),'data-cke-tooltip-disabled':_0x11bdb5['to']('isOn')},'on':{'mouseenter':_0x11bdb5['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}_createArrowView(){const _0x222cbc=new _0x5e3c18();return _0x222cbc['content']=_0x4e5c52,_0x222cbc['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x222cbc;}},jh=class extends _0x4e6fd6{_allListItems;_allSearchableItems;constructor(_0x139f5f,_0x28a10d,_0x4e8d9c){super(_0x139f5f),this['_allListItems']=_0x28a10d,this['_allSearchableItems']=_0x4e8d9c;}filter(_0x2816e3){if(!_0x2816e3)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x5009bc=_0x2816e3['source']['toLowerCase']()['trim'](),_0x1e1903=this['_allSearchableItems']['filter'](_0x4bb4c0=>(_0x4bb4c0['groupLabel']?_0x4bb4c0['label']+'\x20('+_0x4bb4c0['groupLabel']+')':_0x4bb4c0['label'])['toLowerCase']()['includes'](_0x5009bc));return this['items']['clear'](),this['items']['addMany'](_0x1e1903['sort']((_0xfde72d,_0x5af04d)=>{const _0x4e3bfe=_0xfde72d['groupLabel'],_0x4b5073=_0x5af04d['groupLabel'];return _0x4e3bfe||_0x4b5073?_0x4e3bfe?0x1:-0x1:0x0;})['map'](_0x2e8982=>_0x2e8982['item'])),this['_highlightQuery'](_0x5009bc,_0x1e1903),{'resultsCount':_0x1e1903['length'],'totalItemsCount':this['_allSearchableItems']['length']};}_highlightQuery(_0xbdd01b,_0x49589e){if(!_0xbdd01b)return;const _0x1a5252=new RegExp(_0x3df188(_0xbdd01b),'gi');_0x49589e['forEach'](_0x33a763=>{_0x33a763['highlightViews']&&_0x33a763['highlightViews']['forEach'](_0x579563=>{'function'==typeof _0x579563['highlightText']&&_0x579563['highlightText'](_0x1a5252);});});}_clearHighlight(){this['_allSearchableItems']['forEach'](_0x11ae1a=>{_0x11ae1a['highlightViews']&&_0x11ae1a['highlightViews']['forEach'](_0x590028=>{'function'==typeof _0x590028['highlightText']&&_0x590028['highlightText'](null);});});}};const Jh='menu',Zh='menuitem';var tc=class extends _0x2df458{_bodyCollection;optionsListView;_searchTextView=null;_allSearchableItems=[];['children'];['focusTracker'];keystrokes;['_focusables'];['focusCycler'];_openNestedPanels=new Set();_nestedPanels=new Set();['_hasSearch'];_actionButtons;constructor(_0x48ae76,_0x2ffba3,_0x37a4b6,_0x35d624,_0x4ee021=!0x1,_0x410cb2=[]){const _0x26cb42=_0x48ae76['locale'];super(_0x26cb42),this['_bodyCollection']=_0x35d624,this['_hasSearch']=_0x4ee021,this['_actionButtons']=_0x410cb2;const _0x1fda6d=this['_createListItems'](_0x48ae76,_0x2ffba3,_0x37a4b6);this['optionsListView']=new jh(_0x26cb42,_0x1fda6d,this['_allSearchableItems']),this['optionsListView']['role']=Jh,this['optionsListView']['items']['addMany'](_0x1fda6d),this['focusTracker']=new Et(),this['keystrokes']=new pt(),_0x4ee021&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x1fda6d,this['focusCycler']=new _0x17323b({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x4ee021&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x5d0f3c=_0x4ee021&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x15c4c2(_0x5d0f3c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x26cb42['uiLanguageDirection']},'children':this['children']});}_createSearchTextView(){return new _0x2750eb(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':qs(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':qs(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x2bc75f=this['_searchTextView']['queryView']['fieldView']['element'];return Rt(_0x2bc75f,vt(_0x2bc75f));}_createListItems(_0xb5bae8,_0x4dc3e8,_0x1d7953){const _0xe878e5=new _0x15c4c2();return _0x4dc3e8['forEach'](_0x385539=>{if('actions'in _0x385539){const {listItem:_0x118f93}=this['_createActionGroupButton'](_0xb5bae8,_0x385539,_0x1d7953);_0xe878e5['add'](_0x118f93),_0x385539['actions']['forEach'](_0xe6c8e8=>{const {listItem:_0x41f276,highlightViews:_0x31a103}=this['_createSearchResultActionButton'](_0xb5bae8,_0xe6c8e8,_0x385539['label'],_0x385539['icon']);this['_allSearchableItems']['push']({'item':_0x41f276,'label':_0xe6c8e8['label'],'groupLabel':_0x385539['label'],'highlightViews':_0x31a103});});}else{const {listItem:_0x2b83eb}=this['_createActionButton'](_0xb5bae8,_0x385539);_0xe878e5['add'](_0x2b83eb);const _0x380152=_0x2b83eb['children']['first'];if(_0x380152){const {listItem:_0x13275d,highlightViews:_0x1b4f36}=this['_createSearchResultActionButton'](_0xb5bae8,_0x385539);this['_allSearchableItems']['push']({'item':_0x13275d,'label':_0x380152['label']||'','highlightViews':_0x1b4f36});}}}),_0xe878e5;}_createActionButton(_0x39605,_0x3f5649,_0x32c1d5,_0x4d8809){const _0x4c3693=new _0xf665cb(this['locale']);if(_0x32c1d5&&_0x4d8809){const _0xadb5e8=new _0x1a9216(this['locale']),_0x22c45f=_0xadb5e8['bindTemplate'],_0x24e430=new _0x2d3d45();_0x24e430['text']=_0x3f5649['label'];const _0x1accd9=new _0x2d3d45();_0x1accd9['text']=_0x32c1d5;const _0x5259ad=new _0x5e3c18();_0x5259ad['content']=_0x4d8809,_0x5259ad['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x420ed0=new _0x2df458(this['locale']);_0x420ed0['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x4c3e94=new _0x2df458(this['locale']);return _0x4c3e94['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0xadb5e8['set']({'label':_0x3f5649['label']+'\x20('+_0x32c1d5+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1,'isEnabled':_0x3f5649['isEnabled']}),_0xadb5e8['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group',_0x22c45f['if']('isEnabled','ck-disabled',_0x5123a4=>!_0x5123a4)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x24e430,_0x420ed0,_0x5259ad,_0x1accd9,_0x4c3e94],'on':{'mouseenter':_0x22c45f['to'](()=>{this['_isSearchFocused']()||_0xadb5e8['focus']();}),'click':_0x22c45f['to'](()=>{_0xadb5e8['fire']('execute');})}}),_0xadb5e8['on']('execute',()=>{_0xadb5e8['isEnabled']&&(_0x39605['editing']['view']['focus'](),_0x39605['commands']['execute']('aiQuickAction',_0x3f5649));}),_0x4c3693['children']['add'](_0xadb5e8),this['_actionButtons']['push']({'buttonView':_0xadb5e8,'action':_0x3f5649}),{'listItem':_0x4c3693,'highlightViews':[_0x24e430,_0x1accd9]};}{const _0x4da19d=new _0x4bbfbe(),_0x26778d=new _0x1a9216(this['locale'],_0x4da19d),_0x4ba0fe=_0x26778d['bindTemplate'],_0x12a727=_0x3f5649['icon']??_0x3f5649['parent']?.['icon'],_0x243fe1=void 0x0!==_0x3f5649['icon'];return _0x26778d['set']({'label':_0x3f5649['label'],'withText':!0x0,'role':'menuitem','icon':_0x243fe1?_0x12a727??_0x957fd2:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button','isEnabled':_0x3f5649['isEnabled']}),_0x26778d['extendTemplate']({'on':{'mouseenter':_0x4ba0fe['to'](()=>{this['_isSearchFocused']()||_0x26778d['focus']();})}}),_0x26778d['on']('execute',()=>{_0x39605['editing']['view']['focus'](),_0x39605['commands']['execute']('aiQuickAction',_0x3f5649);}),_0x4c3693['children']['add'](_0x26778d),this['_actionButtons']['push']({'buttonView':_0x26778d,'action':_0x3f5649}),{'listItem':_0x4c3693,'highlightViews':[_0x4da19d]};}}_createSearchResultActionButton(_0x2705b1,_0xdee50d,_0x3b3886,_0xbdddc0){return _0x3b3886&&_0xbdddc0?this['_createSearchResultGroupedActionButton'](_0x2705b1,_0xdee50d,_0x3b3886,_0xbdddc0):this['_createSearchResultIndividualActionButton'](_0x2705b1,_0xdee50d);}_createSearchResultGroupedActionButton(_0x1d6a82,_0x14379d,_0x4f733b,_0x241afe){const _0x18d485=new _0xf665cb(this['locale']),_0x240940=new _0x1a9216(this['locale']),_0x97875b=_0x240940['bindTemplate'],{view:_0x22aa0a,highlightView:_0x27b3de}=this['_createSearchResultGroupRow'](_0x4f733b,_0x241afe),{view:_0x2bffd3,highlightView:_0x5a24b0}=this['_createSearchResultActionRow'](_0x14379d['label']),_0x45ef40=this['_createSearchResultContentView'](_0x22aa0a,_0x2bffd3);return _0x240940['set']({'label':_0x14379d['label'],'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,'isEnabled':_0x14379d['isEnabled']}),_0x240940['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',_0x97875b['if']('isEnabled','ck-disabled',_0x1f5ade=>!_0x1f5ade)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x45ef40],'on':{'mouseenter':_0x97875b['to'](()=>{this['_isSearchFocused']()||_0x240940['focus']();}),'click':_0x97875b['to'](()=>{this['_handleSearchResultButtonClick'](_0x240940);})}}),this['_setupActionButtonExecution'](_0x240940,_0x1d6a82,_0x14379d),_0x18d485['children']['add'](_0x240940),this['_actionButtons']['push']({'buttonView':_0x240940,'action':_0x14379d}),{'listItem':_0x18d485,'highlightViews':[_0x27b3de,_0x5a24b0]};}_createSearchResultIndividualActionButton(_0x3cdf9b,_0x1043eb){const _0x20379b=new _0xf665cb(this['locale']),_0x289399=new _0x4bbfbe(),_0x40d1e6=new _0x1a9216(this['locale'],_0x289399),_0x31990e=_0x40d1e6['bindTemplate'];return _0x40d1e6['set']({'label':_0x1043eb['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button','isEnabled':_0x1043eb['isEnabled']}),_0x40d1e6['extendTemplate']({'on':{'mouseenter':_0x31990e['to'](()=>{this['_isSearchFocused']()||_0x40d1e6['focus']();})}}),this['_setupActionButtonExecution'](_0x40d1e6,_0x3cdf9b,_0x1043eb),_0x20379b['children']['add'](_0x40d1e6),this['_actionButtons']['push']({'buttonView':_0x40d1e6,'action':_0x1043eb}),{'listItem':_0x20379b,'highlightViews':[_0x289399]};}_createSearchResultGroupRow(_0xc7a171,_0x46402c){const _0x1bd4ae=new _0x2df458(this['locale']),_0x5472ad=new _0x5e3c18();_0x5472ad['content']=_0x46402c,_0x5472ad['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x363187=new _0x2d3d45();return _0x363187['text']=_0xc7a171,_0x1bd4ae['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x5472ad,_0x363187]}),{'view':_0x1bd4ae,'highlightView':_0x363187};}_createSearchResultActionRow(_0xaf4f52){const _0x222009=new _0x2df458(this['locale']),_0x2df43b=new _0x2d3d45();return _0x2df43b['text']=_0xaf4f52,_0x222009['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x2df43b]}),{'view':_0x222009,'highlightView':_0x2df43b};}_createSearchResultContentView(_0x4a2628,_0x34befb){const _0x1fea21=new _0x2df458(this['locale']);return _0x1fea21['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x4a2628,_0x34befb]}),_0x1fea21;}_setupActionButtonExecution(_0x275ff4,_0x257f66,_0x19bce3){_0x275ff4['on']('execute',()=>{_0x275ff4['isEnabled']&&(_0x257f66['editing']['view']['focus'](),_0x257f66['commands']['execute']('aiQuickAction',_0x19bce3));});}_createActionGroupButton(_0x1a3245,_0x4b8910,_0x31abb3){const _0x151dcf=new _0xf665cb(this['locale']),_0x1d6fec=new _0x4bbfbe(),_0x3cfdd5=new zh(this['locale'],_0x1d6fec),_0x384f1f=_0x3cfdd5['bindTemplate'],_0x32608f=this['_getPanelKeystroke'](_0x31abb3),_0x225ecd=this['_createGroupActionsList'](_0x1a3245,_0x4b8910['actions'],_0x31abb3);_0x3cfdd5['set']({'label':_0x4b8910['label'],'withText':!0x0,'role':Zh,'icon':_0x4b8910['icon']??_0x957fd2,'isEnabled':_0x4b8910['actions']['some'](_0x199323=>_0x199323['isEnabled'])}),_0x3cfdd5['extendTemplate']({'on':{'mouseenter':_0x384f1f['to'](()=>{this['_isSearchFocused']()||_0x3cfdd5['focus']();})}});const _0xa8ed52=new Jt(this['locale']);return _0xa8ed52['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel','ck-toolbar-context']},'on':{'keydown':_0x384f1f['to'](_0x1e1fe2=>{this['_handlePanelKeydown'](_0x1e1fe2,_0x32608f,_0x3cfdd5,_0xa8ed52);})}}),_0x3cfdd5['bind']('isOn')['to'](_0xa8ed52,'isVisible'),this['_bodyCollection']['add'](_0xa8ed52),this['_nestedPanels']['add'](_0xa8ed52),_0xa8ed52['content']['add'](_0x225ecd),this['_setupGroupMenuBehavior'](_0x3cfdd5,_0xa8ed52),_0x151dcf['children']['add'](_0x3cfdd5),this['_actionButtons']['push']({'buttonView':_0x3cfdd5,'action':_0x4b8910}),{'listItem':_0x151dcf,'highlightView':_0x1d6fec};}_createGroupActionsList(_0x45f1b1,_0xa8caa0,_0x55c580){const _0x2e2fe=new _0x4e6fd6(this['locale']);return _0x2e2fe['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0xa8caa0['forEach'](_0x15d93b=>{const _0x3d9219=new _0xf665cb(this['locale']),_0x3b16c4=Xh({'editor':_0x45f1b1,'action':_0x15d93b,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused'](),'actionButtons':this['_actionButtons']})();_0x3d9219['children']['add'](_0x3b16c4),_0x55c580['focusTracker']['add'](_0x3b16c4),_0x2e2fe['items']['add'](_0x3d9219);}),_0x2e2fe;}_setupGroupMenuBehavior(_0x3ba0b3,_0x4821cd){const _0x57166c=_0x3ba0b3['bindTemplate'],_0x3830a8=this['_getButtonKeystroke'](_0x3ba0b3);_0x3ba0b3['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x57166c['to'](()=>{this['_showNestedPanel'](_0x4821cd,_0x3ba0b3);}),'mouseleave':_0x57166c['to'](_0x54a635=>{ec(_0x54a635,_0x3ba0b3,_0x4821cd)||this['_hideNestedPanel'](_0x4821cd);}),'keydown':_0x57166c['to'](_0x5e5f98=>{_0x5e5f98['key']==_0x3830a8&&(this['_showNestedPanel'](_0x4821cd,_0x3ba0b3),_0x4821cd['content']['get'](0x0)['focus']());})}}),_0x4821cd['on']('render',()=>{this['listenTo'](_0x4821cd['element'],'mouseleave',(_0x13d3b4,_0x3dd323)=>{ec(_0x3dd323,_0x3ba0b3,_0x4821cd)||this['_hideNestedPanel'](_0x4821cd);});});}_showNestedPanel(_0xc99519,_0x515621){this['_openNestedPanels']['forEach'](_0x2154e2=>{_0x2154e2!==_0xc99519&&_0x2154e2['isVisible']&&_0x2154e2['hide']();}),_0xc99519['show'](),_0xc99519['pin']({'positions':[_0x592d61['eastSouth']],'target':_0x515621['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0xc99519);}_hideNestedPanel(_0x22a7a6){_0x22a7a6['hide'](),this['_openNestedPanels']['delete'](_0x22a7a6);}_hideAllNestedPanels(){this['_openNestedPanels']['forEach'](_0x322e92=>_0x322e92['hide']()),this['_openNestedPanels']['clear']();}resetSearch(){this['_searchTextView']&&this['_searchTextView']['reset']();}destroy(){this['_hideAllNestedPanels']();for(const _0x2e3c4a of this['_nestedPanels'])this['_bodyCollection']['has'](_0x2e3c4a)&&this['_bodyCollection']['remove'](_0x2e3c4a),_0x2e3c4a['destroy']();this['_nestedPanels']['clear'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}_getPanelKeystroke(_0x13004f){return'rtl'===_0x13004f['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}_getButtonKeystroke(_0x5d880d){return'rtl'===_0x5d880d['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0xb20e95,_0x35a1be,_0xb7224f,_0x35cdd4){_0xb20e95['key']==_0x35a1be&&(_0xb7224f['focus'](),this['_hideNestedPanel'](_0x35cdd4));}_handleSearchResultButtonClick(_0x2880b1){_0x2880b1['fire']('execute');}};function ec(_0x29c1,_0x2778e6,_0x1992ca){return[_0x2778e6['element'],_0x1992ca['element']]['filter'](_0x4554a4=>!!_0x4554a4)['some'](_0x4c3994=>_0x299f8c(_0x4c3994,_0x29c1));}function ic(_0x58afcc){const {editor:_0x5c614c,content:_0x5003eb,buttonDefinition:_0x47d0c0,bodyCollection:_0x19c56c,hasSearch:_0x117d77=!0x1,actionButtons:_0x114b8e}=_0x58afcc;return()=>{const _0x326f9e=_0x5c614c['locale'],_0x5d1ae8=_0x5c614c['commands']['get']('aiQuickAction'),_0x111c2d=_0x4c754a(_0x326f9e);_0x111c2d['bind']('isEnabled')['to'](_0x5d1ae8),_0x111c2d['buttonView']['set']({'icon':_0x47d0c0['icon']??_0x957fd2,'label':_0x47d0c0['label'],'tooltip':!0x0}),_0x111c2d['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x4c79fa=new tc(_0x5c614c,_0x5003eb,_0x111c2d,_0x19c56c,_0x117d77,_0x114b8e);return _0x111c2d['panelView']['children']['add'](_0x4c79fa),_0x117d77&&_0x111c2d['on']('change:isOpen',(_0x2e50dd,_0x41d4e8,_0x5eb3c4)=>{if(_0x5eb3c4){if(_0x5c614c['plugins']['has']('AIEditing')){const _0x5a44bb=_0x5c614c['plugins']['get'](Pn),_0x164f8a=_0x5c614c['model']['document']['selection'],_0xf50e8=Array['from'](_0x164f8a['getRanges']());_0xf50e8['length']>0x0&&_0x5a44bb['showFakeVisualSelection']({'editor':_0x5c614c,'ranges':_0xf50e8,'id':'quick-action','priority':0x14});}}else _0x5c614c['plugins']['has']('AIEditing')&&_0x5c614c['plugins']['get'](Pn)['hideFakeVisualSelection']('quick-action'),_0x4c79fa['resetSearch']();}),_0x111c2d;};}const sc='<task>Explain\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x20plain,\x20simple\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).-\x20Avoid\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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20explanation,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant,\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',nc='<task>Summarize\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x202–4\x20clear\x20sentences,\x20capturing\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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20summary,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',rc='<task>Extract\x20and\x20present\x20the\x20key\x20points\x20from\x20the\x20selected\x20part\x20of\x20the\x20document\x20as\x20a\x20concise\x20bulleted\x20list.</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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20key\x20points\x20list,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',oc=/* #__PURE__ -- @preserve */
37
+ ((()=>({'chat':'AIChat','action':'AIActions'}))());var ac=class AIQuickActionsUI extends _0x158c3f{_actionButtons=[];['_menuBarGroupViews']=[];_reporter;static get requires(){return[Zt,$s,dr,Js];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_reporter']=this['editor']['plugins']['get'](dr)['createReporter']('aiquickactions');const _0x72c6e9=this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x72c6e9),this['_initializeQuickActionsComponentsAndCommands'](),this['_initActionTypeQuickActions'](),this['_initChatTypeQuickActions']();}static getDefaultQuickActions(_0x3aa528){return function(_0x21fd99){const _0x1ad460=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x21fd99['uiLanguage'])||'English';return[{'id':'ask-ai','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x1e0a0c},{'id':'chat-commands','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x1e0a0c,'actions':[{'id':'explain','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':qs(_0x21fd99,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':sc['replace']('%0',_0x1ad460),'type':'chat'},{'id':'summarize','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':qs(_0x21fd99,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':nc['replace']('%0',_0x1ad460),'type':'chat'},{'id':'highlight-key-points','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':qs(_0x21fd99,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':rc['replace']('%0',_0x1ad460),'type':'chat'}]},{'id':'improve-writing','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x6ea41f},{'id':'continue','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x21f936},{'id':'fix-grammar','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x2315ac},{'id':'adjust-length','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x435456,'actions':[{'id':'make-shorter','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x59af22,'actions':[{'id':'make-tone-casual','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x46b415,'actions':[{'id':'translate-to-english','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_OTHER'),'icon':_0xd0155a,'actions':[]}];}(_0x3aa528);}_getDefaultAndCustomActions(){const _0x41815b=AIQuickActionsUI['getDefaultQuickActions'](this['editor']['locale']),_0x3e97cc=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x1473ac=>({..._0x1473ac,'type':'chat'===_0x1473ac['type']?'chat':'action','icon':void 0x0}));return _0x41815b['find'](_0x37f643=>'other'===_0x37f643['id'])['actions']['push'](..._0x3e97cc),_0x41815b;}async _initActionTypeQuickActions(){try{const _0x4ae1b5=this['editor']['plugins']['get'](Js),_0x3422c3=await _0x4ae1b5['models']['getAllModels'](),_0x4b704b=(await _0x4ae1b5['models']['getDefault']())?.['id'];this['_assignDefaultModelToCustomActions'](_0x4b704b),this['_enableButtonsByType']('action',_0x396e84=>!!_0x3422c3['find'](_0x52e97e=>_0x52e97e['id']===_0x396e84['model'])||void 0x0===_0x396e84['model']);}catch(_0x387c43){const _0x2b6580=new dt('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x387c43});this['_reporter']['logError'](_0x2b6580);}}_initChatTypeQuickActions(){if(!this['editor']['plugins']['has']('AIChatController'))return;const _0x120ff1=this['editor']['plugins']['get']('AIChatController'),_0x232016=this['editor']['plugins']['has']('AIChatUI')?this['editor']['plugins']['get']('AIChatUI'):null;this['listenTo'](_0x120ff1,'change:isConversationReady',(_0x3376c0,_0x406ceb,_0x2977b9)=>{this['_enableButtonsByType']('chat',()=>_0x2977b9&&!_0x232016?.['isBusy']);}),_0x232016&&this['listenTo'](_0x232016,'change:isBusy',(_0x47518c,_0x4d9687,_0x5f4561)=>{this['_enableButtonsByType']('chat',()=>_0x120ff1['isConversationReady']&&!_0x5f4561);}),this['_enableButtonsByType']('chat',()=>_0x120ff1['isConversationReady']&&!_0x232016?.['isBusy']);}_enableButtonsByType(_0x29b6d3,_0x154f16){this['_quickActionsDefinition']['forEach'](_0x3492f5=>{'actions'in _0x3492f5?_0x3492f5['actions']['forEach'](_0x5b9f42=>{_0x5b9f42['type']===_0x29b6d3&&(_0x5b9f42['isEnabled']=_0x154f16(_0x5b9f42));}):_0x3492f5['type']===_0x29b6d3&&(_0x3492f5['isEnabled']=_0x154f16(_0x3492f5));}),this['_actionButtons']['forEach'](_0x32aff1=>{if(hc(_0x32aff1['action']))return;if(_0x32aff1['action']['type']!==_0x29b6d3)return;const _0x40fc7e=_0x154f16(_0x32aff1['action']);if(_0x32aff1['action']['isEnabled']=_0x40fc7e,_0x32aff1['buttonView']['isEnabled']=_0x40fc7e,'action'===_0x29b6d3&&!_0x40fc7e&&_0x32aff1['action']['model']){const _0x207dab=new dt('ai-quick-actions-unavailable-model',this,{'actionId':_0x32aff1['action']['id'],'modelId':_0x32aff1['action']['model']});this['_reporter']['logError'](_0x207dab);}}),this['_actionButtons']['filter'](_0xabd0aa=>hc(_0xabd0aa['action']))['forEach'](_0x299923=>{_0x299923['buttonView']['isEnabled']=_0x299923['action']['actions']['some'](_0x5a701c=>_0x5a701c['isEnabled']);}),this['_menuBarGroupViews']['forEach'](({view:_0x43db2f,group:_0x8a5b2d})=>{_0x43db2f['isEnabled']=_0x8a5b2d['actions']['some'](_0xa93aed=>_0xa93aed['isEnabled']);});}_enableButtonById(_0x5093da,_0x20510f){this['_quickActionsDefinition']['forEach'](_0x32953d=>{'actions'in _0x32953d?_0x32953d['actions']['forEach'](_0x2f83a3=>{_0x2f83a3['id']===_0x5093da&&(_0x2f83a3['isEnabled']=_0x20510f(_0x2f83a3));}):_0x32953d['id']===_0x5093da&&(_0x32953d['isEnabled']=_0x20510f(_0x32953d));}),this['_actionButtons']['forEach'](_0x25bfdb=>{if(hc(_0x25bfdb['action']))return;if(_0x25bfdb['action']['id']!==_0x5093da)return;const _0x323dd3=_0x20510f(_0x25bfdb['action']);_0x25bfdb['action']['isEnabled']=_0x323dd3,_0x25bfdb['buttonView']['isEnabled']=_0x323dd3;});}_assignDefaultModelToCustomActions(_0x168b03){this['_actionButtons']['forEach'](_0x2f7243=>{hc(_0x2f7243['action'])||'action'===_0x2f7243['action']['type']&&(_0x2f7243['action']['model']||(_0x2f7243['action']['model']=_0x168b03));});}_initializeQuickActionsComponentsAndCommands(){const _0x3b8fbc=this['editor']['ui']['view']['body'];this['_initializeQuickActionsDropdown'](_0x3b8fbc),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x3b8fbc);}_initializeQuickActionsDropdown(_0x37c5d4){const _0x4b4671=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',ic({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x957fd2,'label':qs(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x37c5d4,'hasSearch':_0x4b4671,'actionButtons':this['_actionButtons']}));}_prepareQuickActionsDefinition(_0x4e7822){this['_quickActionsDefinition']=_0x4e7822['map'](_0x4307b9=>{if('actions'in _0x4307b9){const _0x145ce6=_0x4307b9;return{..._0x145ce6,'actions':_0x145ce6['actions']['map'](_0x5c0492=>{const {actions:_0x17230b,..._0x1ae99b}=_0x145ce6;return{..._0x5c0492,'isEnabled':!0x1,'parent':_0x1ae99b};})['filter'](_0x16618c=>this['_shouldIncludeAction'](_0x16618c))};}return{..._0x4307b9,'isEnabled':!0x1};})['filter'](_0x5744c3=>'actions'in _0x5744c3?_0x5744c3['actions']['length']>0x0:this['_shouldIncludeAction'](_0x5744c3));}_shouldIncludeAction(_0x74bc44){const _0xc60cd2=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](oc[_0x74bc44['type']])&&!_0xc60cd2['includes'](_0x74bc44['id'])&&!('chat'===_0x74bc44['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}_initializeQuickActionsComponents(_0x17592e){this['_quickActionsDefinition']['forEach'](_0x5e9c3f=>{if('actions'in _0x5e9c3f){const _0x43f264=ic({'editor':this['editor'],'content':_0x5e9c3f['actions'],'buttonDefinition':_0x5e9c3f,'bodyCollection':_0x17592e,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x5e9c3f['id'],_0x43f264),_0x5e9c3f['actions']['forEach'](_0x599ab7=>{const _0x4a81d2=Xh({'editor':this['editor'],'action':_0x599ab7,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x599ab7['id'],_0x4a81d2);});}else{const _0x3e3d8d=Xh({'editor':this['editor'],'action':_0x5e9c3f,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x5e9c3f['id'],_0x3e3d8d);}});}_initializeQuickActionsMenuBar(){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x3aac6e=>{const _0x611ae2=this['editor']['commands']['get']('aiQuickAction'),_0x5bf99c=new _0x5e7fd5(_0x3aac6e),_0x14d582=qs(_0x3aac6e,'AI_QUICK_ACTIONS_HEADING');_0x5bf99c['buttonView']['set']({'label':_0x14d582,'icon':_0x957fd2});const _0x337614=new _0x1969ff(_0x3aac6e);return _0x337614['set']({'ariaLabel':_0x14d582,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x36229d=>{if('actions'in _0x36229d){const _0x415f8a=_0x36229d,_0x5e028f=new _0x5d5b51(_0x3aac6e,_0x5bf99c),_0x19c805=new _0x5e7fd5(_0x3aac6e),_0x379235=new _0x1969ff(_0x3aac6e);_0x19c805['buttonView']['set']({'label':_0x415f8a['label'],'icon':_0x415f8a['icon']}),_0x415f8a['actions']['forEach'](_0x2592cd=>{const _0x6b8b9e=new _0x5d5b51(_0x3aac6e,_0x19c805),_0x5084b5=new _0x410c15(_0x3aac6e);_0x5084b5['set']({'label':_0x2592cd['label'],'icon':_0x2592cd['icon'],'role':'menuitem','isEnabled':_0x2592cd['isEnabled']}),_0x5084b5['on']('execute',()=>{this['_executeQuickAction'](_0x2592cd);}),this['_actionButtons']['push']({'buttonView':_0x5084b5,'action':_0x2592cd}),_0x5084b5['delegate']('execute')['to'](_0x19c805),_0x6b8b9e['children']['add'](_0x5084b5),_0x379235['items']['add'](_0x6b8b9e);}),_0x19c805['isEnabled']=_0x415f8a['actions']['some'](_0xed05a8=>_0xed05a8['isEnabled']),this['_menuBarGroupViews']['push']({'view':_0x19c805,'group':_0x415f8a}),_0x19c805['panelView']['children']['add'](_0x379235),_0x5e028f['children']['add'](_0x19c805),_0x337614['items']['add'](_0x5e028f);}else{const _0x13d82f=_0x36229d,_0x64ccad=new _0x5d5b51(_0x3aac6e,_0x5bf99c),_0x3ea080=new _0x410c15(_0x3aac6e);_0x3ea080['set']({'label':_0x13d82f['label'],'icon':_0x13d82f['icon'],'role':'menuitem','isEnabled':_0x13d82f['isEnabled']}),this['_actionButtons']['push']({'buttonView':_0x3ea080,'action':_0x13d82f}),_0x3ea080['on']('execute',()=>{this['_executeQuickAction'](_0x13d82f);}),_0x3ea080['delegate']('execute')['to'](_0x5bf99c),_0x64ccad['children']['add'](_0x3ea080),_0x337614['items']['add'](_0x64ccad);}}),Object['values'](oc)['some'](_0x52e20a=>this['editor']['plugins']['has'](_0x52e20a))?_0x5bf99c['bind']('isEnabled')['to'](_0x611ae2):_0x5bf99c['set']({'isEnabled':!0x1}),_0x5bf99c['panelView']['children']['add'](_0x337614),_0x5bf99c;});}_executeQuickAction(_0xfb5849){const _0x2b77de=this['editor'];_0x2b77de['editing']['view']['focus'](),_0x2b77de['commands']['execute']('aiQuickAction',_0xfb5849);const _0x5579aa=_0x2b77de['ui']['view']['menuBarView'];_0x5579aa&&_0x5579aa['close']&&_0x5579aa['close']();}};function hc(_0xc9bd55){return'actions'in _0xc9bd55;}function cc(_0x2a534a,_0x2d615e){const _0x41df7d=_0x2a534a['plugins']['get']('AITabs')['view'];return _0x41df7d['isVisible']=!0x0,_0x41df7d['activateTabAwaitingConfirmation'](_0x2d615e);}var lc=class extends _0x3f0a57{execute(_0x1f3750){switch(_0x1f3750['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x560bb8=qs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new dt('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x560bb8});}this['_handleAIChatAction'](_0x1f3750);break;case'action':if(this['_expandSelectionIfCollapsed'](),!this['editor']['plugins']['has']('AIActions')){const _0x5afb11=qs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new dt('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5afb11});}this['_handleAIActionsAction'](_0x1f3750);}}async _handleAIChatAction(_0x28217d){const _0x3eccfb=this['editor']['plugins']['get']('AIChatController');if(await cc(this['editor'],'chat')){if(this['_expandSelectionIfCollapsed'](),'ask-ai'===_0x28217d['id'])_0x3eccfb['removeSelectionFromChatContext'](),_0x3eccfb['addSelectionToChatContext'](this['editor']),_0x3eccfb['focusPromptInput']();else await _0x3eccfb['startConversation']({'modelId':_0x28217d['model'],'contexts':this['_resolveActionContexts'](_0x28217d)}),_0x3eccfb['removeSelectionFromChatContext'](),_0x3eccfb['addSelectionToChatContext'](this['editor']),_0x3eccfb['focusPromptInput'](),await _0x3eccfb['sendMessage']({'message':_0x28217d['prompt']||_0x28217d['displayedPrompt']||_0x28217d['label'],'attributes':{'quickActionData':{'id':_0x28217d['id']},'displayedPrompt':_0x28217d['displayedPrompt']}});}}_expandSelectionIfCollapsed(){const _0x5a29cb=this['editor'],_0x27a9d2=_0x5a29cb['model']['document']['selection'];if(!_0x27a9d2['isCollapsed'])return;const _0xbe2b5b=Ot(_0x27a9d2['getSelectedBlocks']())||_0x5a29cb['model']['schema']['getLimitElement'](_0x27a9d2);_0x5a29cb['model']['change'](_0x16819b=>{_0x16819b['setSelection'](_0xbe2b5b,'in');});}_handleAIActionsActionLabel(_0x2ea769){return _0x2ea769['parent']?.['label']&&'other'!==_0x2ea769['parent']?.['id']?_0x2ea769['parent']['label']+':\x20'+_0x2ea769['label']:_0x2ea769['label'];}async _handleAIActionsAction(_0x29bb8d){const _0x3d5a24=this['editor']['plugins']['get']('AIActions'),_0x328f78=this['_resolveActionContexts'](_0x29bb8d);let _0x542358;_0x542358=_0x29bb8d['prompt']?{'userMessage':_0x29bb8d['prompt'],'model':_0x29bb8d['model'],'contexts':_0x328f78}:_0x29bb8d['context']?{'model':_0x29bb8d['model'],'contexts':_0x328f78}:{'actionName':_0x29bb8d['actionName']||_0x29bb8d['id'],'args':_0x29bb8d['args'],'contexts':_0x328f78};const _0x45eb4f=this['_handleAIActionsActionLabel'](_0x29bb8d);await _0x3d5a24['executeAction'](_0x542358,_0x45eb4f,_0x29bb8d['icon']);}_resolveActionContexts(_0x532230){const _0x4d517a=_0x532230['parent']?.['id']?[_0x532230['id'],_0x532230['parent']['id']]:[_0x532230['id']];return this['editor']['plugins']['get'](Js)['contextLibrary']['resolveContext']({'feature':'quickActions','ids':_0x4d517a,'extraContexts':_0x532230['context']?[_0x532230['context']]:[],'context':new nr()})['refs'];}},uc=class extends _0x158c3f{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0xf224c8=this['editor'],_0x2eeba4=new lc(this['editor']);if(_0xf224c8['commands']['add']('aiQuickAction',_0x2eeba4),_0xf224c8['plugins']['has']('AIChat')){const _0x3d1902=this['editor']['plugins']['get']('AIChatController');_0xf224c8['model']['document']['selection']['on']('change:range',(_0x20efb2,_0x579d42)=>{_0x579d42['directChange']&&_0x3d1902['removeSelectionFromChatContext']();});}}},dc=class extends Nr{appendContent(_0x2ce918,_0x4bf8b1='text'){'modification'===this['type']&&'text'===_0x4bf8b1&&(_0x4bf8b1=this['documentContextContent']['keys']()['next']()['value']),super['appendContent'](_0x2ce918,_0x4bf8b1);}updateChangeGroups(_0x5a5f58){const _0x502190=this['parsedContent']['get'](_0x5a5f58)['cloneNode'](!0x0);if(this['parsedMergedContent']['set'](_0x5a5f58,_0x502190),this['changeGroups']=[],0x0==_0x502190['childNodes']['length'])return;qn(this['documentContextContent']['get'](_0x5a5f58),this['parsedMergedContent']['get'](_0x5a5f58));const _0x474e60=this['documentContextContent']['get'](_0x5a5f58)['children']['map'](_0x794424=>({'node':_0x794424,'id':ln(_0x794424,'data-id')})),_0x3d8ac2=_0x502190['children']['map'](_0x4ab90d=>({'node':_0x4ab90d,'id':ln(_0x4ab90d,'data-id')||Xt()})),_0x2539ff=_0x3874b5(_0x474e60,_0x3d8ac2,{'comparator':(_0x11ba49,_0x32cd81)=>_0x11ba49['id']==_0x32cd81['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x2539ff['length']&&_0x2539ff[_0x2539ff['length']-0x1]['removed'];)_0x2539ff['pop']();}const _0x35d865=_0x2539ff['map'](_0x4c4eda=>{const _0x7e9822=_0x4c4eda['added']?'new':_0x4c4eda['removed']?'removed':'modified';return{'node':_0x4c4eda['value'][0x0]['node'],'type':_0x7e9822,'id':_0x4c4eda['value'][0x0]['id']};}),_0x1d8c51=this['_documentIdToSource']['get'](_0x5a5f58);this['changeGroups']['push']({'changes':_0x35d865,'state':'pending','index':this['changeGroups']['length'],'editor':_0x1d8c51['editor'],'rootName':_0x1d8c51['rootName'],'documentId':_0x5a5f58});}_getDifferentChangeGroups(_0x444a00,_0x119838){return _0x119838;}},_c=class extends Lr{content;['version'];editor;rootName;actionName;['args'];['userMessage'];['model'];context;['hasError']=!0x1;stoppedExplicitly=!0x1;constructor(_0x2c50f7){super(_0x2c50f7),this['content']=_0x2c50f7['content'],this['version']=_0x2c50f7['version'],this['editor']=_0x2c50f7['editor'],this['rootName']=_0x2c50f7['rootName'],this['actionName']=_0x2c50f7['actionName'],this['args']=_0x2c50f7['args'],this['userMessage']=_0x2c50f7['userMessage'],this['model']=_0x2c50f7['model'],this['context']=new nr(_0x2c50f7['contexts']),this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}sendRequest(){const _0x2a566a=this['context']['toRequestContexts']();return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args'],'contexts':_0x2a566a}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html','contexts':_0x2a566a});}getDocumentContext(){return{'type':'document','documents':[{'id':this['id'],'content':this['content'],'version':this['version'],'rootName':this['rootName'],'sessionId':Xt(),'channelId':this['editor']['config']['get']('collaboration.channelId'),'selectionSignature':''}],'label':'Current\x20document','uiId':'current-document'};}createReply(_0x16d08a){const _0x4dccbd=this['editor']['config']['get']('collaboration.channelId'),_0x49e6d3=new dc({..._0x16d08a,'locale':this['locale'],'documentContextContent':[{'id':this['id'],'content':this['content'],'channelId':_0x4dccbd,'rootName':this['rootName']}],'channelsToEditors':new Map([[_0x4dccbd,this['editor']]])});return this['replies']['push'](_0x49e6d3),_0x49e6d3['delegate'](...xr)['to'](this),this['fire']('replyCreated',_0x49e6d3),_0x49e6d3;}},gc=class extends Hh{['focusCycler'];_skeletonView;['_focusTracker'];_keystrokes;['_focusables'];_navigationPreviousButton;_navigationNextButton;_navigationTryAgainButton;_navigationCounter;constructor(_0x2e8c39,_0x2cd2d4){super(_0x2e8c39,{'showChangesButtonMode':'icon',..._0x2cd2d4}),this['set']('isBusy',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_focusTracker']=new Et(),this['_keystrokes']=new pt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x17323b({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_setupToolbar'](),this['_createSkeletonView'](),this['_setupMiniToolbar'](),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_miniToolbarView'],this['_toolbarView']]),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main'],'style':{'width':this['bindTemplate']['to']('width')}}});}['render'](){super['render']();for(const _0x2550b0 of this['_focusables'])this['_focusTracker']['add'](_0x2550b0['element']);this['_keystrokes']['listenTo'](this['element']);}['focus'](_0x17dfb3){-0x1===_0x17dfb3?this['focusCycler']['focusLast']():this['_toolbarView']['primaryActionButton']['focus']();}setErrorState(){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}clearErrorState(){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x479da8){super['showBlockingError'](_0x479da8),this['setErrorState']();}addMiniToolbarItem(_0x560a04){this['_miniToolbarView']['items']['has'](_0x560a04)||this['_miniToolbarView']['items']['add'](_0x560a04);}removeMiniToolbarItem(_0x2bbd68){this['_miniToolbarView']['items']['has'](_0x2bbd68)&&this['_miniToolbarView']['items']['remove'](_0x2bbd68);}setIsLoading(_0x4e61cc){this['_isLoading']=_0x4e61cc;}finalizeContent(){this['_streamableContentView']['cleanUpStreamingArtifacts']();}_setupToolbar(){this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x3ea6f6,_0x2d7dbb,_0x2216d2)=>!(_0x3ea6f6||_0x2d7dbb||_0x2216d2));}_setupMiniToolbar(){this['_miniToolbarView']['delegate'](...$r)['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',(_0x4545a1,_0x3b04b5)=>!(_0x4545a1||_0x3b04b5));}_createSkeletonView(){this['_skeletonView']=new lo(this['locale'],uo['aiActionsBalloon']),this['_skeletonView']['bind']('isVisible')['to'](this,'_isLoading',this,'_isErrorVisible',(_0x444444,_0x60e326)=>_0x444444&&!_0x60e326),this['_contentChildren']['add'](this['_skeletonView']);}_setupMiniToolbarButtons(){const _0x39f4e6=new _0x1a9216(this['locale']),_0x4ac700=new _0x1a9216(this['locale']),_0x2f95ae=new Ic(this['locale']),_0x562d98=new _0x1a9216(this['locale']);_0x39f4e6['set']({'icon':_0x34fe5e,'label':qs(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':Ar}),_0x4ac700['set']({'icon':_0x33c89a,'tooltip':qs(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+Ar}),_0x562d98['set']({'icon':_0x4273a3,'tooltip':qs(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+Ar}),_0x39f4e6['bind']('isEnabled')['to'](this,'isBusy',_0x3b3b2f=>!_0x3b3b2f),_0x39f4e6['on']('execute',()=>{this['fire']('tryAgain');}),_0x4ac700['bind']('isEnabled')['to'](this,'isBusy',_0x2fed1b=>!_0x2fed1b),_0x4ac700['on']('execute',()=>{this['fire']('showPrevious');}),_0x562d98['bind']('isEnabled')['to'](this,'isBusy',_0x31a995=>!_0x31a995),_0x562d98['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x4ac700,this['_navigationCounter']=_0x2f95ae,this['_navigationNextButton']=_0x562d98,this['_navigationTryAgainButton']=_0x39f4e6;}updateMiniToolbarButtons(_0x4ec08a,_0x47da5c){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x1633a7=_0x4ec08a>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x1633a7){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x2b02d1=_0x4ec08a-_0x47da5c;this['_navigationCounter']['setInteractionCount'](_0x2b02d1,_0x4ec08a),this['_navigationPreviousButton']['isEnabled']=_0x47da5c<_0x4ec08a-0x1,this['_navigationNextButton']['isEnabled']=_0x47da5c>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;}setShowChangesButton(_0xa70836){this['_miniToolbarView']['isShowChangesOn']=_0xa70836;}adjustWidthToEditable(_0x52e631){const _0x5bc17b=Wh({'domRoot':_0x52e631,'innerElement':this['_streamableContentView']['element'],'outerElement':this['element'],'widthCustomProperty':'--ck-ai-actions-balloon-width'});_0x5bc17b&&(this['width']=_0x5bc17b);}},Ic=class extends _0x2df458{constructor(_0xc3eb1f){super(_0xc3eb1f);const _0x3aa092=this['bindTemplate'];this['set']('currentInteraction',0x1),this['set']('totalInteractions',0x1),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x3aa092['to']('currentInteraction')},{'text':_0x3aa092['to']('totalInteractions',_0x3f9400=>'\x20/\x20'+_0x3f9400)}]});}setInteractionCount(_0x3e4e5f,_0x60e369){this['set']({'currentInteraction':_0x3e4e5f,'totalInteractions':_0x60e369});}},Ac=class extends _0x158c3f{static get requires(){return[$s,dr,_0x3fa2e4,Pn,Gh,Un];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}_aiConnector;_interactions=[];_currentInteractionIndex=0x0;_interactionParams;['_balloonShowDiff']=!0x0;['_promiseQueue'];get _interaction(){return this['_interactions'][this['_interactions']['length']-0x1];}_actionsBalloonView;_reporter;constructor(_0xe50a64){super(_0xe50a64),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['_reporter']=this['editor']['plugins']['get'](dr)['createReporter']('aiactions'),this['set']('isBusy',!0x1),this['_promiseQueue']=new Ao();}stopInteraction(){this['_stopInteraction']();}async executeAction(_0x4e825c,_0x342dc8,_0xfde829){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')&&this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x5bcb27,anchorData:_0x343f82,root:_0x53c12b}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x4e825c,_0x5bcb27,_0x343f82,_0x53c12b,_0x342dc8,_0xfde829);}const {modelFragment:_0x3bbdde,anchorData:_0x4486a0,root:_0x194cb0}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x4e825c,_0x3bbdde,_0x4486a0,_0x194cb0,_0x342dc8,_0xfde829);}async destroy(){return this['_stopInteraction'](),super['destroy']();}_createActionsBalloonView(){const _0x18a180=this['editor']['plugins']['has']('TrackChanges');let _0x2c71f1=this['editor']['config']['get']('ai.availableReplyActions')||[...po];_0x18a180||(_0x2c71f1=_0x2c71f1['filter'](_0x55cfe9=>'insertSuggestion'!=_0x55cfe9));const _0x7a6653=this['editor']['commands']['get']('trackChanges'),_0x1ab45d=new gc(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x18a180,'availableActions':_0x2c71f1});return _0x1ab45d['bind']('isBusy')['to'](this),_0x1ab45d['setShowChangesButton'](this['_balloonShowDiff']),_0x1ab45d['bind']('isTargetReadOnly')['to'](this['editor'],'isReadOnly'),_0x7a6653&&_0x1ab45d['bind']('isTrackChangesOn')['to'](_0x7a6653,'value'),_0x1ab45d['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x1ab45d['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x1ab45d['on']('showNext',()=>{this['_navigateToNext']();}),_0x1ab45d;}_normalizeSelectionStart(){const _0x1d15ff=this['editor']['model'],_0x5e356a=_0x1d15ff['document']['selection'],_0x1743bb=_0x5e356a['getFirstRange']();if(!_0x1743bb||_0x1743bb['isCollapsed'])return;const _0x3738d5=Ot(_0x5e356a['getSelectedBlocks']());if(!_0x3738d5)return;const _0x43e7e0=_0x1d15ff['createPositionAt'](_0x3738d5,0x0);_0x43e7e0['isAfter'](_0x1743bb['start'])&&_0x1d15ff['change'](_0x1e1d57=>{_0x1e1d57['setSelection'](_0x1e1d57['createRange'](_0x43e7e0,_0x1743bb['end']));});}_getExecuteDataRegular(){const _0x9f6b3a=this['editor']['model']['document']['selection'],_0x173207=_0x9f6b3a['getFirstRange']()['start']['root'];if(_0x9f6b3a['isCollapsed']){const _0x17b1ea=Ot(_0x9f6b3a['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x9f6b3a);this['editor']['model']['change'](_0x3e2f99=>{_0x3e2f99['setSelection'](_0x17b1ea,'in');});}this['_normalizeSelectionStart']();const _0x3f1e1e=_0x9f6b3a['getFirstRange'](),_0x52450b=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x9f6b3a),_0x3f1e1e['start'],_0x3f1e1e['end']);this['_copyMarkersToFragment'](_0x52450b,_0x9f6b3a,{'isTableSelection':!0x1});const _0x1cb6df=_0x9f6b3a['getFirstRange']()['start'],_0x2c3de8=new Map();let _0xaa8561=_0x52450b;for(let _0x1088f5=0x0;_0x1088f5<_0x1cb6df['path']['length'];_0x1088f5++)_0x2c3de8['set'](_0xaa8561,_0x1cb6df['path'][_0x1088f5]),_0xaa8561=_0xaa8561['getChild'](0x0);return{'modelFragment':_0x52450b,'anchorData':_0x2c3de8,'root':_0x173207};}_getExecuteDataInTable(){const _0x4b0457=this['editor']['model']['document']['selection'],_0xbdffc0=this['editor']['plugins']['get']('TableSelection'),_0x5c5d3f=_0x4b0457['getFirstRange']()['start']['root'],_0x5bcfff=_0xbdffc0['getSelectionAsFragment'](),_0x1e460e=_0x4b0457['getFirstRange']()['start']['parent']['parent'],_0x58490c=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x1e460e),this['editor']['model']['createPositionAfter'](_0x1e460e)),_0xa8bf3=this['_wrapWithCommonAncestors'](_0x5bcfff,_0x58490c['start'],_0x58490c['end']);this['_copyMarkersToFragment'](_0xa8bf3,_0x4b0457,{'isTableSelection':!0x0});const _0xf92072=_0x4b0457['getFirstRange']()['start'],_0x5f02e2=new Map();let _0x3e92e9=_0xa8bf3;for(let _0x17bf5e=0x0;_0x17bf5e<_0xf92072['path']['length'];_0x17bf5e++)if(_0x5f02e2['set'](_0x3e92e9,_0xf92072['path'][_0x17bf5e]),_0x17bf5e<_0xf92072['path']['length']-0x1)_0x3e92e9=_0x3e92e9['getChild'](0x0);else{let _0x4d73ad=_0x3e92e9['nextSibling'];for(;_0x4d73ad;)_0x5f02e2['set'](_0x4d73ad,_0xf92072['path'][_0x17bf5e]),_0x4d73ad=_0x4d73ad['nextSibling'];}return{'modelFragment':_0xa8bf3,'anchorData':_0x5f02e2,'root':_0x5c5d3f};}async _executeAction(_0x4eaa94,_0x629f47,_0x4f3244,_0x393c16,_0x1a863c,_0x1d9fa4){const _0x326c01=this['editor']['plugins']['get'](Pn),_0xe8bf43=this['editor']['plugins']['get'](Gh),_0x15bf3c=this['editor']['model']['document']['selection'],_0x19053f=await _0x326c01['modelToDataWithIds'](_0x629f47,this['editor'],_0x393c16['rootName']),_0x567258=this['editor']['model']['document']['version'],_0x2a1baa=[..._0x15bf3c['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0xe8bf43['open']({'targetEditor':this['editor'],'index':0x3e8*Math['random']()%0x3e8,'title':_0x1a863c,'icon':_0x1d9fa4||_0x957fd2,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x2a1baa,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xe8bf43),this['_interactionParams']={'action':_0x4eaa94,'content':_0x19053f,'version':_0x567258,'aiBalloon':_0xe8bf43,'modelFragment':_0x629f47,'anchorData':_0x4f3244,'root':_0x393c16},this['_setupApplyListeners'](),this['listenTo'](_0xe8bf43,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0xe8bf43,'dialogClosed',(_0x3df1d9,{id:_0x58eb8e})=>{if('aiActionsBalloon'===_0x58eb8e){for(const _0x77a667 of this['_interactions']){if(0x0===_0x77a667['replies']['length']||_0x77a667['stoppedExplicitly'])continue;const _0x449b7b=_0x77a667['replies'][_0x77a667['replies']['length']-0x1],_0x332cf0=_0x449b7b['changeGroups'][0x0];_0x332cf0&&'pending'===_0x332cf0['state']&&_0x449b7b['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xe8bf43);}}),this['_createInteraction'](_0x19053f,_0x567258,_0xe8bf43,_0x4eaa94);}_setupApplyListeners(){if(!this['_interactionParams'])return;const {modelFragment:_0x33d95a,anchorData:_0x4c0e8a,root:_0xde8a36}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x33d95a,_0x4c0e8a,_0xde8a36,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x33d95a,_0x4c0e8a,_0xde8a36,!0x0);}),this['listenTo'](this['_actionsBalloonView'],'rejectSuggestion',()=>{this['editor']['plugins']['get']('AIBalloon')['close']();});}_wrapWithCommonAncestors(_0x5ce274,_0x109000,_0x4576ab){const _0x273a36=this['editor']['model']['createRange'](_0x109000,_0x4576ab)['getCommonAncestor'](),_0x20c783=_0x273a36['is']('documentFragment')?[]:_0x273a36['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x20c783['length']){const _0x5511e1=_0x20c783['map'](_0x57f249=>_0x57f249['_clone'](!0x1));for(let _0x3f6dfe=0x1;_0x3f6dfe<_0x5511e1['length'];_0x3f6dfe++)_0x5511e1[_0x3f6dfe-0x1]['_appendChild'](_0x5511e1[_0x3f6dfe]);return _0x5511e1[_0x5511e1['length']-0x1]['_appendChild'](_0x5ce274),new _0x1f9306(_0x5511e1[0x0]);}return _0x5ce274;}_copyMarkersToFragment(_0x2964b2,_0x11c79c,_0x1c79e7={'isTableSelection':!0x1}){const _0x24f03a=this['editor']['model'],_0x3be9b=Array['from'](_0x11c79c['getRanges']()),_0x4c3e75=_0x11c79c['getFirstRange']()['start'];for(const _0x13d5bc of _0x24f03a['markers']){if(_0x13d5bc['name']['startsWith']('ai-selection')||!_0x13d5bc['affectsData'])continue;const _0x1986c4=_0x13d5bc['getRange']();if(!_0x3be9b['some'](_0x4a8e7f=>_0x4a8e7f['containsRange'](_0x1986c4,!0x0)))continue;const _0x35a8f8=this['_regularCalculateMarkerPath'](_0x1986c4['start'],_0x4c3e75,_0x1c79e7['isTableSelection']),_0x16dbf5=this['_regularCalculateMarkerPath'](_0x1986c4['end'],_0x4c3e75,_0x1c79e7['isTableSelection']),_0x4c04eb=_0x24f03a['createPositionFromPath'](_0x2964b2,_0x35a8f8),_0x1d76d7=_0x24f03a['createPositionFromPath'](_0x2964b2,_0x16dbf5);if(!_0x4c04eb['isEqual'](_0x1d76d7)){const _0x16f9db=_0x24f03a['createRange'](_0x4c04eb,_0x1d76d7);_0x2964b2['markers']['set'](_0x13d5bc['name'],_0x16f9db);}}}_regularCalculateMarkerPath(_0x29cf62,_0x751a03,_0x281701=!0x1){const _0x450d27=[..._0x29cf62['path']['slice']()];for(let _0x549662=0x0;_0x549662<Math['max'](_0x751a03['path']['length'],_0x29cf62['path']['length']);_0x549662++){const _0x5cd94c=_0x751a03['path'][_0x549662]||0x0,_0x493612=(_0x29cf62['path'][_0x549662]||0x0)-_0x5cd94c;if(_0x450d27[_0x549662]=_0x493612,0x0!==_0x493612&&!_0x281701)break;}return _0x450d27;}async _createInteraction(_0x38ee8e,_0x109a34,_0x4791fe,_0x527e3e){const _0x449294=this['editor'],_0x890f30=_0x449294['model']['document']['selection']['getFirstRange']()['start']['root'];this['_interactionParams']||(this['_interactionParams']={'action':_0x527e3e,'content':_0x38ee8e,'version':_0x109a34,'aiBalloon':_0x4791fe,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':_0x890f30});const _0x1cfc22=new _c({'connector':this['_aiConnector'],'locale':_0x449294['locale'],'content':_0x38ee8e,'version':_0x109a34,'editor':_0x449294,'rootName':_0x890f30['rootName'],..._0x527e3e});this['_interactions']['push'](_0x1cfc22);const _0x11e642=(_0xed1fe5,_0x49bf31=this['_balloonShowDiff'])=>this['_promiseQueue']['enqueue'](async _0x4a1604=>{try{if(this['_isUnsupportedInlineRootChange'](_0xed1fe5,_0x890f30))return this['_actionsBalloonView']['showBlockingError'](qs(_0x449294['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')),void this['_actionsBalloonView']['finalizeContent']();const _0x3bd558=wr({'changeGroups':_0xed1fe5['changeGroups'],'documentContextContent':_0xed1fe5['documentContextContent'],'showDiff':_0x49bf31,'trimUnchanged':!0x1});_0x3bd558['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x3bd558[0x0],'renderingStrategy':'static','abortSignal':_0x4a1604,'keepErrors':!_0xed1fe5['isComplete']}),this['_actionsBalloonView']['finalizeContent']();}catch(_0xbda798){if(lr(_0xbda798))return;throw _0xbda798;}});_0x1cfc22['on']('replyContentUpdated',(_0x4bf105,_0x589792)=>{_0x589792['isDone']&&_0x11e642(_0x589792)['catch'](_0x200434=>{this['_reporter']['logError'](_0x200434,{'context':{'operation':'reply-update'}}),this['_setErrorState'](_0x1cfc22,_0x200434);});}),_0x1cfc22['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x5eb8b3){this['_reporter']['logError'](_0x5eb8b3,{'context':{'operation':'interaction-finish'}}),this['_setErrorState'](_0x1cfc22,_0x5eb8b3);}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x1a3733,{showDiff:_0x1a196f})=>{try{this['_balloonShowDiff']=_0x1a196f;const _0xc57817=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0xc57817&&await _0x11e642(_0xc57817,_0x1a196f);}catch(_0x3b4560){this['_reporter']['logError'](_0x3b4560,{'context':{'operation':'toggle-suggestion-display'}}),this['_setErrorState'](_0x1cfc22,_0x3b4560);}}),_0x1cfc22['on']('replyChangeGroupStateUpdated',()=>{const _0x4fa6b7={'positiveCount':_0x1cfc22['replies']['reduce']((_0x26e19c,_0x573ae3)=>_0x26e19c+_0x573ae3['changeGroups']['filter'](_0x31e391=>'accepted'===_0x31e391['state'])['length'],0x0),'totalCount':_0x1cfc22['replies']['reduce']((_0x74460a,_0x3d9a73)=>_0x74460a+_0x3d9a73['changeGroups']['length'],0x0)},_0x44c5af=_0x1cfc22['actionCallId'],_0x451a76=_0x1cfc22['actionName'];_0x451a76?this['_aiConnector']['upsertAIActionRating'](_0x451a76,_0x44c5af,_0x4fa6b7):this['_aiConnector']['upsertCustomAIActionRating'](_0x44c5af,_0x4fa6b7);}),this['_setLoadingState']();try{const _0x141035=await _0x1cfc22['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x141035;}catch(_0x457fd5){lr(_0x457fd5)||this['_actionsBalloonView']['setIsLoading'](!0x1),this['_reporter']['logError'](_0x457fd5,{'context':{'operation':'create-interaction'}}),this['_setErrorState'](_0x1cfc22,_0x457fd5);}}_isUnsupportedInlineRootChange(_0x4205a8,_0x5d0117){const _0x1d1b08=this['editor'];if(!En(_0x1d1b08,_0x5d0117['rootName']))return!0x1;return!wn(_0x1d1b08,new _0x47233a((_0x4205a8['changeGroups'][0x0]?.['changes']??[])['filter'](_0x2f96ee=>'removed'!==_0x2f96ee['type'])['map'](_0xd0b808=>_0xd0b808['node']['cloneNode'](!0x0))));}['_applyChanges'](_0x36267f,_0x3ac0ad,_0x7f1b08,_0x10f157){const _0x545ae6=this['editor'];if(_0x10f157&&!_0x545ae6['plugins']['has']('TrackChanges'))throw new dt('ai-no-track-changes',null);const _0x41f36e=this['editor']['plugins']['get'](Un),_0x3957fb=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x3957fb||!_0x3957fb['replies']['length'])return;const _0x224cfe=_0x3957fb['replies'][_0x3957fb['replies']['length']-0x1];if(this['_isUnsupportedInlineRootChange'](_0x224cfe,_0x7f1b08))return void this['_actionsBalloonView']['showBlockingError'](qs(_0x545ae6['locale'],'AI_SUGGESTION_NO_PARTS_WARNING'));_0x224cfe['setChangeGroupState'](0x0,'accepted');const _0x5a2e8d=Gr({'documentSuggestions':Wr({'groups':[_0x224cfe['changeGroups'][0x0]],'documentContextContent':_0x224cfe['documentContextContent'],'documents':_0x3957fb['getDocumentContext']()['documents']}),'transform':!0x1,'documentChanges':_0x41f36e,'documentChangesOptions':{'anchor':_0x545ae6['model']['createPositionAt'](_0x36267f,0x0),'markDeletions':_0x10f157}})['values']()['next']()['value']??[],_0x3ce61f=this['_filterOperationsOutsideRange'](_0x5a2e8d,_0x3ac0ad);for(const _0x22fd78 of _0x3ce61f)this['_anchorOperation'](_0x3ac0ad,_0x22fd78,_0x7f1b08);const _0x42ace4=_0x3957fb['getDocumentContext']()['documents'][0x0]['version'],_0x3f5c93=_0x545ae6['model']['document']['history']['getOperations'](_0x42ace4),_0x175f2a={'document':_0x545ae6['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x30a101=_0x3e782f(_0x3ce61f,_0x3f5c93,_0x175f2a)['operationsA'];jn(_0x30a101,'quickActions');try{_0x545ae6['model']['change'](_0x19989f=>{_0x19989f['setSelection'](_0x545ae6['model']['document']['selection']['focus']),_0x10f157?_0x545ae6['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x30a101):_0x41f36e['applyOperations'](_0x19989f,_0x30a101);});}catch(_0x4540eb){throw this['_reporter']['logError'](new ur({'code':'ai-applying-suggestion-failed','type':'runtime','cause':_0x4540eb})),_0x4540eb;}this['editor']['plugins']['get']('AIBalloon')['close']();}_filterOperationsOutsideRange(_0xc47264,_0x2020a8){return _0xc47264['filter'](_0x14c28c=>{if('rename'==_0x14c28c['type']){const _0x393d60=_0x14c28c['position']['nodeAfter'];return!_0x2020a8['has'](_0x393d60);}if(_0x14c28c['type']['indexOf']('Attribute')>-0x1){const _0x201868=_0x14c28c['range']['start']['nodeAfter'];return!_0x2020a8['has'](_0x201868);}return!0x0;});}_anchorOperation(_0x5b9667,_0x118def,_0x420ffd){const _0x23c7f9=_0x118def['clone']();for(const _0x28c87b in _0x118def){const _0x2c455a=_0x118def[_0x28c87b];_0x2c455a instanceof _0x3aaa22?_0x118def[_0x28c87b]=new _0x3aaa22(_0x5b9bdf(_0x2c455a['start']),_0x5b9bdf(_0x2c455a['end'])):_0x2c455a instanceof _0x265910&&(_0x118def[_0x28c87b]=_0x5b9bdf(_0x2c455a));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x23c7f9['type'])){if(_0x23c7f9['isDocumentOperation']=!0x1,_0x23c7f9['baseVersion']=null,'remove'==_0x23c7f9['type']){const _0x205f9e=_0x23c7f9['sourcePosition'],_0x88e6ce=_0x23c7f9['howMany'];new _0x500e5d(_0x205f9e,_0x88e6ce)['_execute']();}else _0x23c7f9['_execute']();}function _0x5b9bdf(_0x31b8e3){if('$graveyard'==_0x31b8e3['root']['rootName'])return _0x31b8e3;const _0x3c31bd=[];let _0x540338=_0x31b8e3['root'];for(let _0x5adce3=0x0;_0x5adce3<_0x31b8e3['path']['length'];_0x5adce3++){const _0x1747f0=_0x5b9667['get'](_0x540338)||0x0;_0x3c31bd[_0x5adce3]=_0x31b8e3['path'][_0x5adce3]+_0x1747f0,_0x540338=_0x540338['getChildAtOffset'](_0x31b8e3['path'][_0x5adce3]);}return new _0x265910(_0x420ffd,_0x3c31bd,_0x31b8e3['stickiness']);}}_refreshInteraction(){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0;const {action:_0x2d425c,content:_0x1f0964,version:_0x3fa7fa,aiBalloon:_0x5c55e8}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['setIsLoading'](!0x0),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x1f0964,_0x3fa7fa,_0x5c55e8,_0x2d425c)['catch'](_0x517df4=>{this['_reporter']['logError'](_0x517df4,{'context':{'operation':'refresh-interaction'}});});}_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['_actionsBalloonView']&&!this['_actionsBalloonView']['_isErrorVisible']&&this['_actionsBalloonView']['setIsLoading'](!0x1);}_navigateToPrevious(){const _0x3444d4=this['_interactions']['length'];this['_currentInteractionIndex']<_0x3444d4-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}_navigateToNext(){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async _displayInteractionAtIndex(_0x29e09a){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x29e09a;const _0x4c2d55=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x4c2d55)return;if(_0x4c2d55['hasError'])return this['_setErrorState'](_0x4c2d55),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x4c2d55['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x2b6244=_0x4c2d55['replies'][_0x4c2d55['replies']['length']-0x1];if(_0x2b6244)try{const _0x26966a=wr({'changeGroups':_0x2b6244['changeGroups'],'documentContextContent':_0x2b6244['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x2a558a=>setTimeout(_0x2a558a,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x26966a[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x213091){this['_reporter']['logError'](_0x213091,{'context':{'operation':'navigation-update'}});}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}_setLoadingState(){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async _setErrorState(_0x2850c5,_0x3c2276){if(void 0x0!==_0x3c2276&&lr(_0x3c2276))return;const _0x402fd3=qs(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x402fd3),_0x2850c5['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['setIsLoading'](!0x0);}_clearErrorState(){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['setIsLoading'](!0x1);}async _clearLoadingState(){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}},Ec=class extends _0x158c3f{static get requires(){return[ac,uc,Ac];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x515f76){super(_0x515f76),_0x515f76['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}},pc=class extends _0x2df458{['dropdownView'];constructor(_0x3c039c,_0xb9bbb2){super(_0x3c039c),this['set']('hasPendingChanges',!0x0),this['dropdownView']=this['_createDropdown'](_0x3c039c,_0xb9bbb2),this['setTemplate']({'tag':'div','children':[this['dropdownView']],'attributes':{'class':[this['bindTemplate']['if']('isVisible','ck-hidden',_0x50ce2f=>!_0x50ce2f)]}});}_createDropdown(_0xf3a83e,_0x4b7c5b){const _0x46d68e=_0x4c754a(_0xf3a83e);_0x46d68e['set']({'class':'ck-ai_review__complete-review-dropdown'}),_0x46d68e['panelPositionLimiter']=()=>{const _0x3ef3ef=_0x46d68e['buttonView']['element'];return _0x3ef3ef&&St(_0x3ef3ef);},_0x46d68e['on']('execute',_0x30df0=>{_0x30df0['source']['onClick']();}),_0x46d68e['buttonView']['set']({'label':qs(_0xf3a83e,'AI_REVIEW_MODE_COMPLETE_REVIEW'),'class':_0x4b7c5b,'withText':!0x0});const _0x1caa01=new _0x13bdb1({'withText':!0x0,'role':'menuitem','onClick':()=>this['fire']('acceptAllChanges')});_0x1caa01['bind']('label')['to'](this,'isAnyResultReviewed',_0x417d5e=>qs(_0xf3a83e,_0x417d5e?'AI_REVIEW_MODE_ACCEPT_REMAINING':'AI_REVIEW_MODE_ACCEPT_ALL')),_0x1caa01['bind']('isEnabled')['to'](this,'hasPendingChanges');const _0x5bddfc=new _0x13bdb1({'withText':!0x0,'role':'menuitem','onClick':()=>this['fire']('rejectAllChanges')});_0x5bddfc['bind']('label')['to'](this,'isAnyResultReviewed',_0x865632=>qs(_0xf3a83e,_0x865632?'AI_REVIEW_MODE_REJECT_REMAINING':'AI_REVIEW_MODE_REJECT_ALL')),_0x5bddfc['bind']('isEnabled')['to'](this,'hasPendingChanges');const _0x50cf5e=new _0x13bdb1({'withText':!0x0,'label':qs(_0xf3a83e,'AI_REVIEW_MODE_EXIT_REVIEW'),'role':'menuitem','onClick':()=>this['fire']('leaveReviewCoreResultList')}),_0x5ca60c=new _t([{'type':'button','model':_0x1caa01},{'type':'button','model':_0x5bddfc},{'type':'separator'},{'type':'button','model':_0x50cf5e}]);return _0x34e876(_0x46d68e,_0x5ca60c,{'role':'menu'}),_0x46d68e;}};const mc={'title':'AI_REVIEW_MODE_CONTENT_PART_TITLE','apply':'AI_REVIEW_MODE_ACCEPT_CHANGE','suggest':'AI_REVIEW_MODE_SUGGEST_CHANGE','reject':'AI_REVIEW_MODE_DISMISS_CHANGE','stateAccepted':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','stateRejected':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','stateOutdated':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'};var Tc=class AIReviewCoreNavigationPanelView extends Jt{_previousButtonView;_nextButtonView;_toggleDiffButtonView;_completeReviewDropdownView;_acceptButtonView;_suggestButtonView;_dismissButtonView;_stateView;['_changeId']='';_pinOptions=void 0x0;_getTarget;['_reflowObservers']=[];constructor(_0x28be19,_0x26e6bd){super(_0x28be19),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['set']('changeIndex',0x0),this['set']('changesCount',0x0),this['set']('hasChangesToNavigate',!0x1),this['set']('isDiffOn',!0x1),this['set']('isAnyResultReviewed',!0x1),this['set']('hasPendingChanges',!0x1),this['set']('isError',!0x1),this['set']('isResultReady',!0x1),this['set']('changeStatus','pending'),this['bind']('counterLabel')['to'](this,'changeIndex',this,'changesCount',(_0x919758,_0x3ba594)=>qs(this['locale'],'AI_REVIEW_MODE_NAVIGATION_COUNTER',[_0x919758,_0x3ba594])),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-navigation-panel-balloon'],'tabindex':'-1'}}),this['content']['add'](this['_createContentView']()),_0x26e6bd['add'](this);}get['changeId'](){return this['_changeId'];}updateContent(_0x4762ac){this['_acceptButtonView']['isVisible']=_0x4762ac['isAcceptButtonVisible'],this['_suggestButtonView']['isVisible']=_0x4762ac['isSuggestButtonVisible'],this['_changeId']=_0x4762ac['change']['id'],this['changeStatus']=_0x4762ac['change']['status'],this['updateChangePosition'](_0x4762ac['position']);}updateChangePosition(_0x46587b){this['changeIndex']=_0x46587b['index'],this['changesCount']=_0x46587b['total'],this['hasChangesToNavigate']=_0x46587b['pendingCount']>('pending'===this['changeStatus']?0x1:0x0);}updateChangeState(_0x3955a6,_0x7e96ec){_0x3955a6===this['_changeId']&&(this['changeStatus']=_0x7e96ec);}['showPanel'](_0x57e138){const {getTarget:_0x14b99c,domEvent:_0x4029f9,limiter:_0x4454d7,viewportOffset:_0x388313}=_0x57e138;this['updateContent'](_0x57e138);const _0xbb2de1=_0x14b99c();if(!_0xbb2de1)return void this['hidePanel']();this['_prepareMoveAnimation'](),this['_getTarget']=_0x14b99c,this['show']();const _0x1aaca4=Array['from'](_0xbb2de1['getClientRects']())['reverse'](),_0x5c34ce=this['_getPointedRectIndexFromEvent'](_0x4029f9,_0x1aaca4),_0x3ebed1=_0x1aaca4[_0x5c34ce??0x0];this['_pinOptions']={'target':()=>(this['_stretchToDocument'](_0x4454d7),this['_getBestRectPosition'](_0x14b99c(),_0x5c34ce,_0x4454d7,_0x388313)||_0x3ebed1),'positions':this['_createPanelPositions'](),..._0x4454d7?{'limiter':_0x4454d7}:{}},this['pin'](this['_pinOptions']),this['_observeDocumentResize'](_0x4454d7),this['_endMoveAnimation']();}_prepareMoveAnimation(){const _0x732104=new Tt(Vt['window']),_0x51e364=this['isVisible']?new Tt(this['element']):null,_0x5c7d61=[];let _0x4b25a0=!!_0x51e364;if(this['element']['style']['transition']='none',_0x51e364&&!_0x51e364['getIntersection'](_0x732104)){const _0x36df78=this['_getTarget'](),_0x4dc219=_0x36df78?new Tt(_0x36df78):null;_0x4dc219&&_0x4dc219['bottom']<=_0x732104['top']?(this['top']=Vt['window']['scrollY']-_0x51e364['height'],_0x5c7d61['push']('top')):_0x4dc219&&_0x4dc219['top']>=_0x732104['bottom']&&(this['top']=Vt['window']['scrollY']+_0x732104['height'],_0x5c7d61['push']('top')),_0x4dc219&&_0x4dc219['right']<=_0x732104['left']?(this['left']=Vt['window']['scrollX']-_0x51e364['width'],_0x5c7d61['push']('left')):_0x4dc219&&_0x4dc219['left']>=_0x732104['right']&&(this['left']=Vt['window']['scrollX']+_0x732104['width'],_0x5c7d61['push']('left')),_0x4b25a0=_0x5c7d61['length']>0x0;}this['element']['getBoundingClientRect'](),this['element']['style']['transition']=_0x4b25a0?'':'none',_0x5c7d61['length']&&(this['element']['style']['transitionProperty']=_0x5c7d61['join'](',\x20'));}_endMoveAnimation(){const _0x2ae463=this['element'],_0x366d76=_0x2ae463['getAnimations']();_0x366d76['length']?Promise['allSettled'](_0x366d76['map'](_0x4471cb=>_0x4471cb['finished']))['then'](()=>this['_endMoveAnimation']()):_0x2ae463['style']['transition']='none';}_stretchToDocument(_0x350851){this['element']['style']['width']=_0x350851?new Tt(_0x350851)['width']+'px':'';}_createPanelPositions(){return[(_0x4afc81,_0x4032f6,_0x13eeb3,_0x4c3e52)=>({'top':_0x4afc81['bottom']+AIReviewCoreNavigationPanelView['verticalOffset'],'left':this['_getLeftFollowingChange'](_0x4afc81,_0x4032f6,_0x4c3e52||_0x13eeb3),'name':'arrow_n','config':{'withArrow':!0x1}}),(_0xc9de33,_0x3d54a7,_0x17a854,_0x2281e4)=>({'top':_0xc9de33['top']-_0x3d54a7['height']-AIReviewCoreNavigationPanelView['verticalOffset'],'left':this['_getLeftFollowingChange'](_0xc9de33,_0x3d54a7,_0x2281e4||_0x17a854),'name':'arrow_s','config':{'withArrow':!0x1}})];}_getLeftFollowingChange(_0x3e0d52,_0x358195,_0x19b9b2){const _0x4f742f=parseFloat(Vt['window']['getComputedStyle'](this['content']['first']['element'])['marginInlineStart']),_0x2e875d='rtl'===this['locale']['contentLanguageDirection']?_0x3e0d52['right']+_0x4f742f-_0x358195['width']:_0x3e0d52['left']-_0x4f742f;return Math['max'](_0x19b9b2['left'],Math['min'](_0x2e875d,_0x19b9b2['right']-_0x358195['width']));}['hidePanel'](){this['hide'](),this['unpin'](),this['_stopObservingReflow'](),this['_pinOptions']=void 0x0;}isInViewport(){return this['isVisible']&&!!new Tt(this['element'])['getIntersection'](new Tt(Vt['window']));}destroy(){this['_stopObservingReflow'](),super['destroy']();}_observeDocumentResize(_0xca747e){this['_stopObservingReflow']();const _0xe5c860=()=>{this['isVisible']&&this['_pinOptions']&&this['attachTo'](this['_pinOptions']);};for(const _0x4b0200 of[_0xca747e,Vt['document']['body']])_0x4b0200&&this['_reflowObservers']['push'](new wt(_0x4b0200,_0xe5c860));}_stopObservingReflow(){for(const _0x294d7c of this['_reflowObservers'])_0x294d7c['destroy']();this['_reflowObservers']=[];}_createActionButtonView(_0xd72ecc,_0x2b69e4,_0x21bf47){const _0x368e0e=new _0x1a9216(this['locale']);return _0x368e0e['set']({'label':qs(this['locale'],_0xd72ecc),'withText':!0x0,'class':_0x2b69e4+'\x20'+pr}),_0x368e0e['on']('execute',_0x21bf47),_0x368e0e;}_createIconButtonView(_0xa1fb01,_0x5c9751,_0x5786d2){const _0x5f01e3=new _0x1a9216(this['locale']);return _0x5f01e3['set']({'label':qs(this['locale'],_0xa1fb01),'icon':_0x5c9751,'tooltip':!0x0,'class':Ar+'\x20'+pr}),_0x5f01e3['on']('execute',_0x5786d2),_0x5f01e3;}_createNavigationButtonViews(){this['_previousButtonView']=this['_createIconButtonView']('AI_REVIEW_MODE_NAVIGATION_PREVIOUS_CHANGE',_0x6b5523,()=>this['fire']('navigateChange',{'direction':'previous'})),this['_nextButtonView']=this['_createIconButtonView']('AI_REVIEW_MODE_NAVIGATION_NEXT_CHANGE',_0xcedfde,()=>this['fire']('navigateChange',{'direction':'next'}));for(const _0x5de67e of[this['_previousButtonView'],this['_nextButtonView']])_0x5de67e['bind']('isEnabled')['to'](this,'hasChangesToNavigate');const _0x17f65f=new _0x2df458(this['locale']);return _0x17f65f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review-navigation-panel__navigation']},'children':[this['_previousButtonView'],this['_nextButtonView']]}),_0x17f65f;}_createToggleDiffButtonView(){const _0x3dbbd2=this['_createIconButtonView']('AI_REVIEW_MODE_SHOW_CHANGES',_0x41fd30,()=>{this['isDiffOn']=!this['isDiffOn'],this['fire']('toggleDiff',{'on':this['isDiffOn'],'changeId':this['_changeId']});}),_0x490471=qs(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x203222=qs(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x3dbbd2['set']({'isToggleable':!0x0}),_0x3dbbd2['bind']('isOn')['to'](this,'isDiffOn'),_0x3dbbd2['bind']('icon')['to'](this,'isDiffOn',_0x3db404=>_0x3db404?_0x508a5c:_0x41fd30),_0x3dbbd2['bind']('label')['to'](this,'isDiffOn',_0x427d2c=>_0x427d2c?_0x490471:_0x203222),_0x3dbbd2;}_createHeaderView(){const _0x507c6c=new _0x2df458(this['locale']);this['_completeReviewDropdownView']=this['_createCompleteReviewDropdownView']();const _0xa01056=new _0x5e3c18();return _0xa01056['content']=_0x61b11,_0xa01056['extendTemplate']({'attributes':{'class':'ck-ai_review-navigation-panel__header__icon'}}),_0x507c6c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review-navigation-panel__header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review-navigation-panel__header__notice']},'children':[_0xa01056,{'text':qs(this['locale'],'AI_REVIEW_MODE_NAVIGATION_READ_ONLY_NOTICE')}]},this['_completeReviewDropdownView']]}),_0x507c6c;}_createCompleteReviewDropdownView(){const _0x433c14=new pc(this['locale'],Ir+'\x20'+pr);return _0x433c14['set']('isVisible',!0x0),_0x433c14['extendTemplate']({'attributes':{'class':'ck-ai_review-navigation-panel__complete-container'}}),_0x433c14['bind']('isAnyResultReviewed')['to'](this,'isAnyResultReviewed'),_0x433c14['bind']('hasPendingChanges')['to'](this,'hasPendingChanges',this,'isError',this,'isResultReady',(_0xd588b3,_0x4652bd,_0x53b350)=>_0xd588b3&&!_0x4652bd&&_0x53b350),_0x433c14['delegate']('acceptAllChanges')['to'](this),_0x433c14['delegate']('rejectAllChanges')['to'](this),_0x433c14['delegate']('leaveReviewCoreResultList')['to'](this),_0x433c14;}_createContentView(){const _0x437870=new _0x2df458(this['locale']);return this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_acceptButtonView']=this['_createActionButtonView']('AI_REVIEW_MODE_ACCEPT_CHANGE',gr,()=>this['fire']('acceptChange',{'id':this['_changeId']})),this['_suggestButtonView']=this['_createActionButtonView']('AI_REVIEW_MODE_SUGGEST_CHANGE',Ir,()=>this['fire']('suggestChange',{'changeId':this['_changeId']})),this['_dismissButtonView']=this['_createActionButtonView']('AI_REVIEW_MODE_DISMISS_CHANGE',Ar,()=>this['fire']('dismissChange',{'id':this['_changeId']})),this['_stateView']=this['_createStateView'](),_0x437870['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-navigation-panel']},'children':[this['_createHeaderView'](),{'tag':'div','attributes':{'class':['ck-ai_review-navigation-panel__body']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review-navigation-panel__controls']},'children':[this['_createNavigationButtonViews'](),new $h(this['locale'],'ck-ai_review-navigation-panel__divider'),{'tag':'span','attributes':{'class':['ck-ai_review-navigation-panel__counter'],'aria-live':'polite'},'children':[{'text':this['bindTemplate']['to']('counterLabel')}]},new $h(this['locale'],'ck-ai_review-navigation-panel__divider'),this['_toggleDiffButtonView']]},{'tag':'div','attributes':{'class':['ck-ai_review-navigation-panel__actions',this['bindTemplate']['if']('changeStatus','ck-hidden',_0x50789a=>'pending'!==_0x50789a)]},'children':[this['_dismissButtonView'],this['_suggestButtonView'],this['_acceptButtonView']]},this['_stateView']]}]}),_0x437870;}_createStateView(){const _0x4e8c0a=new so(this['locale'],mc);return _0x4e8c0a['bind']('isVisible')['to'](this,'changeStatus',_0x15a4fb=>'pending'!==_0x15a4fb),_0x4e8c0a['bind']('state')['to'](this,'changeStatus',_0xaaf5b6=>'pending'===_0xaaf5b6?'outdated':_0xaaf5b6),_0x4e8c0a;}_getBestRectPosition(_0x4e52c6,_0x22bbc5,_0x2f5396,_0x252773){if(!_0x4e52c6)return null;const _0x515470=this['position']['replace']('arrow_',''),_0x48fb89=Array['from'](_0x4e52c6['getClientRects']());if(!_0x48fb89['length'])return _0x4e52c6['getBoundingClientRect']();const _0x4a7b19=[..._0x48fb89]['reverse'](),_0x5207b9=void 0x0===_0x22bbc5?void 0x0:_0x4a7b19[_0x22bbc5];let _0x283067;return _0x5207b9&&this['_isPinnedRectVisible'](_0x5207b9,_0x2f5396,_0x252773)?_0x283067=_0x5207b9:void 0x0===_0x22bbc5&&this['_isPinnedRectVisible'](_0x4a7b19[0x0],_0x2f5396,_0x252773)?_0x283067=_0x4a7b19[0x0]:('s'==_0x515470[0x0]?_0x48fb89:_0x4a7b19)['forEach'](_0x507175=>{this['_isPinnedRectVisible'](_0x507175,_0x2f5396,_0x252773)&&(_0x283067=_0x507175);}),_0x283067||_0x4e52c6;}_getPointedRectIndexFromEvent(_0x37ab5c,_0x423df7){if(_0x37ab5c)for(let _0x4814e7=0x0;_0x4814e7<_0x423df7['length'];_0x4814e7++){const _0x5ca59b=_0x423df7[_0x4814e7];if(_0x37ab5c['clientX']>=_0x5ca59b['left']-0x3&&_0x37ab5c['clientX']<=_0x5ca59b['right']+0x3&&_0x37ab5c['clientY']>=_0x5ca59b['top']-0x3&&_0x37ab5c['clientY']<=_0x5ca59b['bottom']+0x3)return _0x4814e7;}}_isPinnedRectVisible(_0x130d36,_0x41a9ea,_0x1f1e88){const _0x332678=new Tt(_0x130d36),_0x5e3af2=_0x41a9ea||document['documentElement'],_0x1281bf=_0x332678['getIntersection'](yt(_0x1f1e88)),_0x1841ab=new Tt(_0x5e3af2)['getVisible'](),_0x351a77=_0x1841ab&&_0x1841ab['getIntersection'](_0x332678);return!!(_0x1281bf&&_0x351a77&&_0x332678['width']>0x0);}static verticalOffset=0x8;};const wc=['getReviewCheckList','runReviewCheck','abortReviewStream','acceptAllChanges','rejectAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','suggestChange','learnMore','finishReview','retryReview'];var Cc=class extends _0x4cd5fc{['_mainView'];_navigationPanelView;_bodyCollection;static get requires(){return[Ks];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4bdd94){super(_0x4bdd94),this['_bodyCollection']=this['context']['plugins']['get'](Ks)['bodyCollection'];}init(){this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...wc)['to'](this),this['_navigationPanelView']=new Tc(this['context']['locale'],this['_bodyCollection']),this['_navigationPanelView']['bind']('isAnyResultReviewed')['to'](this['_mainView']['reviewCheckResultsView'],'isAnyResultReviewed'),this['_navigationPanelView']['bind']('hasPendingChanges')['to'](this['_mainView']['reviewCheckResultsView'],'hasPendingChanges'),this['_navigationPanelView']['bind']('isError')['to'](this['_mainView']['reviewCheckResultsView'],'isError'),this['_navigationPanelView']['bind']('isResultReady')['to'](this['_mainView']['reviewCheckResultsView'],'isResultReady'),this['_navigationPanelView']['delegate']('acceptChange','dismissChange','suggestChange','navigateChange','toggleDiff','acceptAllChanges','rejectAllChanges','leaveReviewCoreResultList')['to'](this),this['toggleLoadingSkeleton'](!0x0);const _0x5454cc=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x5454cc);}setAvailableChecks(_0x31d977){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x14757f=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x31d977,_0x14757f);}this['_mainView']['showReviewCheckListView']();}toggleLoadingSkeleton(_0x584f05){this['_mainView']['toggleLoadingSkeleton'](_0x584f05);}showReviewCheckList(){this['fire']('getReviewCheckList');}showCheckRunResults(_0x2eb1de){_0x2eb1de&&('error-general'!==_0x2eb1de['status']?'error-chunk'!==_0x2eb1de['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}showCheckRunResult(_0x462c50){this['_mainView']['addCheckRunResult'](_0x462c50,this['_isAcceptButtonVisibleForChange'](),this['_isSuggestButtonVisibleForChange']());}showGeneralResultsErrorView(){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x436453){this['_mainView']['showGeneralReviewCoreErrorView'](_0x436453??qs(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}showUnsupportedInlineChangeView(){this['_mainView']['showUnsupportedInlineChangeView']();}setCheckResultTitle(_0xcd76ad,_0x29e82e){this['_mainView']['reviewCheckResultsView']['setTitle'](_0xcd76ad,_0x29e82e);}setHasPendingChanges(_0x4bef83){this['_mainView']['reviewCheckResultsView']['hasPendingChanges']=_0x4bef83;}setActiveStateInResults(_0x3260f3){this['_mainView']['reviewCheckResultsView']['setActiveResult'](_0x3260f3);}resetActiveStateInResults(){this['_mainView']['reviewCheckResultsView']['resetActiveResults']();}updateChangeState(_0x4f5c14,_0x59a9bd){this['_navigationPanelView']['updateChangeState'](_0x4f5c14,_0x59a9bd),this['_mainView']['reviewCheckResultsView']['updateChangeState'](_0x4f5c14,_0x59a9bd);}updateProgress(_0x3cb495,_0x151898){this['_mainView']['reviewCheckResultsView']['updateProgress'](_0x3cb495,_0x151898);}showReviewCompletedView(){this['_mainView']['showReviewCompletedView']();}showActionsWhenResultIsReady(){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}hideActionsWhenResultIsReady(){this['_mainView']['hideActionsWhenResultIsReady']();}showNavigationPanel(_0x3af29b){this['_navigationPanelView']['showPanel']({..._0x3af29b,'isAcceptButtonVisible':this['_isAcceptButtonVisibleForChange'](),'isSuggestButtonVisible':this['_isSuggestButtonVisibleForChange']()});}hideNavigationPanel(){this['_navigationPanelView']['hidePanel']();}isNavigationPanelInViewport(){return this['_navigationPanelView']['isInViewport']();}updateNavigationPanelPosition(_0x513384){this['_navigationPanelView']['updateChangePosition'](_0x513384);}getNavigationPanelChangeId(){return this['_navigationPanelView']['changeId'];}scrollResultsToChange(_0x35bd75){this['_mainView']['reviewCheckResultsView']['scrollToResult'](_0x35bd75);}_isAcceptButtonVisibleForChange(){return!0x0;}_isSuggestButtonVisibleForChange(){return!0x1;}showLeaveConfirmationDialog(_0x4731e8,_0x513d31,_0x141c3d){const _0x4aeb83=tn(this['context']),_0xd00171=new _0x2df458(_0x4aeb83['locale']);_0xd00171['setTemplate']({'tag':'div','attributes':{'style':{'padding':'var(--ck-spacing-large)','whiteSpace':'initial'}},'children':[_0x4731e8['content']]}),function(_0xce8bea,_0x3fca27,_0x5f1da3,_0x2c143e,_0x35431c){if(!_0xce8bea['plugins']['has']('AIEditorIntegration'))return void _0x2c143e();const _0x453716=_0xce8bea['plugins']['get']('AIEditorIntegration')['dialog'];let _0x487171=!0x1;_0x453716['show']({'id':_0x3fca27['dialogId'],'isModal':!0x0,'hasCloseButton':!0x0,'className':'ck-ai-leave-confirmation','title':_0x3fca27['title'],'content':_0x5f1da3,'actionButtons':[{'label':_0x3fca27['exitButton'],'withText':!0x0,'onExecute':()=>{_0x487171=!0x0,_0x453716['hide'](),_0x2c143e();}},{'label':_0x3fca27['stayButton'],'class':gr,'withText':!0x0,'onExecute':()=>_0x453716['hide']()}],'onHide':()=>{_0x487171||_0x35431c?.();}});}(_0x4aeb83,_0x4731e8,_0xd00171,_0x513d31,_0x141c3d);}},fc=class extends _0x2df458{constructor(_0x5cc737){super(_0x5cc737),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0xbda9bc=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0xbda9bc['if']('isVisible','ck-hidden',_0x59d918=>!_0x59d918)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0xbda9bc['to']('errorMessage')}]}]});}},Rc=class extends _0x2df458{['reviewCoreHeader'];['generalErrorView'];reviewCheckListView;reviewCheckResultsView;reviewCompletedView;constructor(_0x116432,_0x51d537){super(_0x116432),this['reviewCoreHeader']=_0x51d537['header'],this['generalErrorView']=new fc(_0x116432),this['reviewCheckListView']=_0x51d537['list'],this['reviewCheckListView']['delegate'](...wc)['to'](this),this['reviewCheckResultsView']=_0x51d537['results'],this['reviewCheckResultsView']['delegate'](...wc)['to'](this),this['reviewCompletedView']=_0x51d537['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['set']('isLoadingSkeletonVisible',!0x1),this['reviewCoreHeader']['bind']('isLoadingSkeletonVisible')['to'](this,'isLoadingSkeletonVisible'),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'],this['_createLoadingSkeletonView']()]});}toggleLoadingSkeleton(_0x3376d3){this['set']('isLoadingSkeletonVisible',_0x3376d3);}_createLoadingSkeletonView(){const _0x3422e6=new lo(this['locale'],uo['aiReviewInitCheck']);return _0x3422e6['extendTemplate']({'attributes':{'class':['ck-ai_review__init-skeleton']}}),_0x3422e6['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x3422e6;}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(_0x349679,_0x30e281,_0x24efa6){this['reviewCheckResultsView']['addResult'](_0x349679,_0x30e281,_0x24efa6),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'](_0x8e6021){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x8e6021;}showGeneralResultsErrorView(){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}showUnsupportedInlineChangeView(){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showUnsupportedInlineChangeMessage']();}},bc=class extends _0x2df458{resultResponseView;acceptButtonView;dismissButtonView;infoButtonView;outdatedButtonView;suggestButtonView;constructor(_0x56d31b,_0x4210dc,_0x53e54d,_0x1d7d74){super(_0x56d31b),this['id']=_0x4210dc,this['set']('status','pending'),this['set']('changeId',_0x4210dc),this['set']('isAcceptButtonVisible',_0x53e54d),this['set']('isSuggestButtonVisible',_0x1d7d74),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['suggestButtonView']=this['_createSuggestButtonView'](),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['suggestButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x4886b6,_0x4825ff)=>{_0x4825ff&&_0x4825ff['target']&&'A'===_0x4825ff['target']['tagName']&&_0x4825ff['preventDefault'](),this['fire']('activateChange',{'id':_0x4210dc,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x4210dc,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x4210dc,'source':this});}),this['on']('change:showDiff',()=>this['_syncResponseVisibility']());}['render'](){super['render'](),this['_syncResponseVisibility']();}setItemAsActive(){this['isActive']=!0x0;}setItemAsInactive(){this['isActive']=!0x1;}_createResultResponseView(){const _0xc7dc0f=new _0x2df458(this['locale']);return _0xc7dc0f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response']}}),_0xc7dc0f;}updateResponseContent(_0x2d30b2,_0x3b7f36){const _0x85fcc0=_0x3b7f36||'div',_0x191a49=this['resultResponseView']['element'];if(_0x191a49['tagName']['toLowerCase']()!==_0x85fcc0){const _0x500011=new _0x4e263f({'tag':_0x85fcc0,'attributes':{'class':_0x191a49['className']}})['render']();_0x191a49['replaceWith'](_0x500011),this['resultResponseView']['element']=_0x500011,this['_syncResponseVisibility']();}this['resultResponseView']['element']['innerHTML']=Qt(_0x2d30b2);}_syncResponseVisibility(){this['resultResponseView']['element']?.['classList']['toggle']('ck-hidden',!this['showDiff']);}_createAcceptButtonView(){const _0x57569e=new _0x1a9216(this['locale']);return _0x57569e['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x57569e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xcace95=>{_0xcace95['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status',gr,_0x1e87f=>'pending'===_0x1e87f),this['bindTemplate']['if']('status',Ar,_0x334545=>'pending'!==_0x334545),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x8e84ab=>'accepted'===_0x8e84ab),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button_success',_0x5c62b5=>'accepted'===_0x5c62b5)]}}),_0x57569e['bind']('isVisible')['to'](this,'isAcceptButtonVisible',this,'status',(_0x4c645c,_0x434eb5)=>'accepted'===_0x434eb5||_0x4c645c&&'pending'===_0x434eb5),_0x57569e['bind']('isEnabled')['to'](this,'status',_0x3a28a4=>'pending'===_0x3a28a4),_0x57569e['on']('execute',()=>{this['fire']('acceptChange',{'id':this['changeId']});}),this['on']('change:status',(_0x386bb6,_0x1499ea,_0x48db35)=>{'accepted'===_0x48db35&&(_0x57569e['label']=qs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x57569e['icon']=_0x42448e);}),_0x57569e;}_createDismissButtonView(){const _0x28f579=new _0x1a9216(this['locale']);return _0x28f579['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x28f579['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2e284e=>{_0x2e284e['stopPropagation']();})},'attributes':{'class':[Ar,this['bindTemplate']['if']('status','ck-hidden',_0x4c48ff=>'pending'!==_0x4c48ff&&'rejected'!==_0x4c48ff),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x3e2cff=>'pending'===_0x3e2cff),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x3ae775=>'rejected'===_0x3ae775),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button_error',_0xfe8ebf=>'rejected'===_0xfe8ebf)]}}),_0x28f579['on']('execute',()=>{this['fire']('dismissChange',{'id':this['changeId']});}),this['on']('change:status',(_0x109987,_0x20f657,_0x1d50db)=>{_0x28f579['isEnabled']='pending'===_0x1d50db,'rejected'===_0x1d50db&&(_0x28f579['label']=qs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x28f579['icon']=_0x29be46);}),_0x28f579;}_createInfoButtonView(){const _0x566675=new _0x1a9216(this['locale']);return _0x566675['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x14d28a,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':Ar+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x566675['bind']('isOn')['to'](this,'isInfoToggleOn',_0x468ee3=>_0x468ee3),_0x566675['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x566675;}_createOutdatedButtonView(){const _0x4a7053=new _0x1a9216(this['locale']);return _0x4a7053['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x230d59,'withText':!0x0,'isEnabled':!0x1}),_0x4a7053['extendTemplate']({'attributes':{'class':[Ar,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x459c90=>'outdated'!==_0x459c90)],'disabled':'disabled'}}),_0x4a7053;}_createSuggestButtonView(){const _0x430477=new _0x1a9216(this['locale']);return _0x430477['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_SUGGEST_CHANGE'),'withText':!0x0}),_0x430477['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x40ead1=>{_0x40ead1['stopPropagation']();})},'attributes':{'class':[Ir]}}),_0x430477['on']('execute',()=>{this['fire']('suggestChange',{'changeId':this['changeId']});}),_0x430477['bind']('isVisible')['to'](this,'isSuggestButtonVisible',this,'status',(_0x5ca995,_0x479fc0)=>_0x5ca995&&'pending'===_0x479fc0),_0x430477['bind']('isEnabled')['to'](this,'status',_0xdc0d29=>'pending'===_0xdc0d29),_0x430477;}},Sc=class extends _0x1a9216{constructor(_0x281a54,_0x2f2241){super(_0x2f2241),this['set']({'label':_0x281a54,'withText':!0x0,'class':gr}),this['on']('execute',()=>{this['fire']('finishReview');});}},Oc=class extends _0x2df458{['_labelView'];constructor(_0x1727a8){super(_0x1727a8),this['_labelView']=new _0x2df458(_0x1727a8),this['_labelView']['setTemplate']({'tag':'span','attributes':{'class':['ck-ai_review__progress-bar-label']}}),this['_labelView']['render'](),this['set']('isVisible',!0x1),this['set']('_percentageDone',0x0);const _0x49448e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__progress-bar-container',_0x49448e['if']('isVisible','ck-hidden',_0x4f85d6=>!_0x4f85d6)]},'children':[this['_labelView'],{'tag':'div','attributes':{'class':['ck-ai_review__progress-bar-track']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__progress-bar-fill'],'style':{'width':_0x49448e['to']('_percentageDone',_0x1298ef=>_0x1298ef+'%')}}}]}]});}updateProgress(_0x1d5f34,_0x37230c){this['_percentageDone']=_0x37230c?Math['round'](_0x1d5f34/_0x37230c*0x64):0x0,this['_labelView']['element']['innerHTML']=Qt(qs(this['locale'],'AI_REVIEW_MODE_PROGRESS',['<strong>'+_0x1d5f34+'</strong>',_0x37230c]));}},vc=class extends _0xf665cb{_resultViews;get _tileViews(){return Array['from'](this['_resultViews']);}_resultsHeader;_resultsBody;['reviewDisclaimer'];_titleContentResizeObserver=null;_cancelButtonView;['_errorMessageView'];_finishReviewButtonView;_completeReviewDropdownView;['_progressBarView'];_contents;constructor(_0x55c4c3,_0x219322){super(_0x55c4c3),this['_contents']=_0x219322,this['_resultViews']=new _0x15c4c2(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_completeReviewDropdownView']=this['_createCompleteReviewDropdownView'](),this['_progressBarView']=this['_createProgressBarView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_resultsBody']=this['_createResultsBodyView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new nh(_0x55c4c3),this['set']('isLoading',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('headerSubtitle',''),this['set']('_headerTitleTooltipText',''),this['set']('_headerSubtitleTooltipText',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general'),this['set']('isCompleted',!0x1),this['set']('hasPendingChanges',!0x1),this['set']('isAnyResultReviewed',!0x1);const _0x4377ef=this['_createCombinedSkeletonLoader'](),_0x18cb8f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x18cb8f['if']('isLoading','ck-ai_review__check-run_loading',_0x24a0a2=>_0x24a0a2),_0x18cb8f['if']('isVisible','ck-hidden',_0xaeba7a=>!_0xaeba7a)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x4377ef,this['reviewDisclaimer']]});}['render'](){super['render']();const _0x59756d=this['element']['querySelector']('.ck-ai_review__check-run-results-header-title-content');this['_titleContentResizeObserver']=new wt(_0x59756d,()=>{this['_updateTitleTooltipText'](),this['_updateSubtitleTooltipText']();}),this['listenTo'](this,'change:headerTitle',()=>this['_updateTitleTooltipText']()),this['listenTo'](this,'change:headerSubtitle',()=>this['_updateSubtitleTooltipText']());}destroy(){super['destroy'](),this['_titleContentResizeObserver']&&this['_titleContentResizeObserver']['destroy']();}clearResults(){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}updateProgress(_0x13efb7,_0x1951bc){this['isAnyResultReviewed']=_0x13efb7>0x0,this['_progressBarView']['updateProgress'](_0x13efb7,_0x1951bc);}getResults(){return this['_resultViews'];}setActiveResult(_0x2e5440){for(const _0xbd0e17 of this['_tileViews'])_0xbd0e17['id']===_0x2e5440&&_0xbd0e17['setItemAsActive']();}resetActiveResults(){for(const _0x6d1caa of this['_tileViews'])_0x6d1caa['setItemAsInactive']();}scrollToResult(_0x1f9b01){const _0xadf9ff=this['_resultsBody']['element'],_0x162464=this['getResultElement'](_0x1f9b01);if(!_0xadf9ff||!_0x162464)return;const _0x1c659b=_0x162464['getBoundingClientRect']()['top']-_0xadf9ff['getBoundingClientRect']()['top'];_0xadf9ff['scrollTo']({'top':_0xadf9ff['scrollTop']+_0x1c659b,'behavior':'smooth'});}getResultElement(_0x10e7e4){const _0x11f8c4=this['_tileViews']['find'](_0x370984=>_0x370984['id']===_0x10e7e4);return _0x11f8c4?_0x11f8c4['element']:null;}addResult(_0x353f54,_0x108c7f,_0x1c4fc9){const _0x426e56=new bc(this['locale'],_0x353f54['id'],_0x108c7f,_0x1c4fc9);_0x426e56['delegate']('acceptChange','dismissChange','activateChange','deactivateChange','suggestChange')['to'](this),this['_resultViews']['add'](_0x426e56),_0x426e56['updateResponseContent'](_0x353f54['contentDiffed'],_0x353f54['wrapperTag']);}updateChangeState(_0x1123f0,_0x4a3f5d){const _0x5413be=this['_tileViews']['find'](_0x4db104=>_0x4db104['id']===_0x1123f0);_0x5413be&&(_0x5413be['status']=_0x4a3f5d,_0x5413be['element']?.['classList']['toggle']('ck-ai_review__check-run-result_grayout','pending'!==_0x4a3f5d));}setTitle(_0x3480ec,_0x1451d8){this['headerTitle']=_0x3480ec,this['headerSubtitle']=_0x1451d8||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}showUnsupportedInlineChangeMessage(){this['errorType']='unsupported-inline',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}resetErrorState(){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}_createCombinedSkeletonLoader(){const _0x44c778=new lo(this['locale'],this['_getSkeletonDefinition']());return _0x44c778['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-container']}}),_0x44c778['bind']('isVisible')['to'](this,'isLoading'),_0x44c778;}_getSkeletonDefinition(){return uo['aiReviewChecks'];}_createResultsBodyView(){const _0x4c7264=new _0x2df458(this['locale']);return _0x4c7264['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x358923=>_0x358923)]},'children':this['_resultViews']}),_0x4c7264;}_createErrorView(){const _0x2033d4=new _0x2df458(this['locale']),_0x5e5ef4=new _0x1a9216(this['locale']),t=this['locale']['t'];return _0x2033d4['delegate']('retryReview')['to'](this),_0x5e5ef4['set']({'label':t('Try\x20again'),'withText':!0x0,'class':Ir}),_0x5e5ef4['on']('execute',()=>{this['fire']('retryReview');}),_0x2033d4['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x4c982d=>!_0x4c982d),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x566b91=>'chunk'===_0x566b91)]},'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',_0x275d7c=>'chunk'===_0x275d7c||'unsupported-inline'===_0x275d7c)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x7c02f2=>'general'!==_0x7c02f2)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x415c7a=>'chunk'!==_0x415c7a)]},'children':[{'text':qs(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x5dda1b=>'unsupported-inline'!==_0x5dda1b)]},'children':[{'text':qs(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')}]}]},_0x5e5ef4]}),_0x2033d4;}_createCancelButtonView(){const _0x134639=new _0x1a9216(this['locale']);return _0x134639['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[Ir+'\x20ck-ai-button-stop-generating'],'icon':rt}),_0x134639['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x33aae0=>_0x33aae0),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x97e295=>_0x97e295)]}}),_0x134639['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x134639;}_createHeaderControlViews(){return[this['_cancelButtonView'],this['_completeReviewDropdownView'],this['_finishReviewButtonView']];}_createResultHeaderView(){const _0x401a3d=new _0x2df458(this['locale']),_0x331ebb=this['_createTitleView']();return _0x401a3d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x1710c9=>_0x1710c9)]},'children':[_0x331ebb,{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x29932c=>!_0x29932c)],'title':qs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')},'children':[{'text':qs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':this['_createHeaderControlViews']()},...this['_createProgressBarViewList']()]}),_0x401a3d;}_createTitleView(){const _0x18e26f=new _0x2df458(this['locale']);return _0x18e26f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1265a8=>_0x1265a8)]},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title'],'data-cke-tooltip-text':this['bindTemplate']['to']('_headerTitleTooltipText'),'data-cke-tooltip-class':'ck-tooltip_multi-line'},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle'],'data-cke-tooltip-text':this['bindTemplate']['to']('_headerSubtitleTooltipText'),'data-cke-tooltip-class':'ck-tooltip_multi-line'},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]}]}),_0x18e26f;}_updateTitleTooltipText(){const _0x3337dc=this['element']['querySelector']('.ck-ai_review__check-run-results-header-title');this['_headerTitleTooltipText']=_0x3337dc['scrollWidth']>_0x3337dc['clientWidth']?this['headerTitle']:'';}_updateSubtitleTooltipText(){const _0x141936=this['element']['querySelector']('.ck-ai_review__check-run-results-header-subtitle');this['_headerSubtitleTooltipText']=_0x141936['scrollWidth']>_0x141936['clientWidth']?this['headerSubtitle']:'';}_createProgressBarView(){const _0x121970=new Oc(this['locale']);return _0x121970['bind']('isVisible')['to'](this,'isResultReady'),_0x121970;}_createProgressBarViewList(){return[this['_progressBarView']];}_createFinishReviewButtonView(){const _0x1de345=new Sc(qs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x1de345['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1001af=>!_0x1001af)]}}),_0x1de345['delegate']('finishReview')['to'](this),_0x1de345;}_createCompleteReviewDropdownView(){const _0x1880a6=new pc(this['locale'],gr);return _0x1880a6['bind']('isAnyResultReviewed')['to'](this,'isAnyResultReviewed'),_0x1880a6['bind']('isVisible')['to'](this,'isCompleted',this,'isResultReady',(_0x1ff051,_0x4ad1d0)=>!_0x1ff051&&_0x4ad1d0),_0x1880a6['bind']('hasPendingChanges')['to'](this,'hasPendingChanges',this,'isError',(_0x2f5c0d,_0x4a75e4)=>_0x2f5c0d&&!_0x4a75e4),_0x1880a6['delegate']('acceptAllChanges')['to'](this),_0x1880a6['delegate']('rejectAllChanges')['to'](this),_0x1880a6['delegate']('leaveReviewCoreResultList')['to'](this),_0x1880a6;}},yc=class extends vc{_changeIdByPartIndex=new Map();clearResults(){super['clearResults'](),this['_changeIdByPartIndex']['clear']();}addResult(_0x569074,_0x4fb4ad,_0x1571a9){const _0x3db587=this['_resultViews']['length'],_0x582fae=function(_0x407f15,_0x4a7ca3){return{'type':'modified','index':_0x4a7ca3,'state':_0x407f15['status'],'content':en(_0x407f15['contentDiffed']),'hasChanges':!0x0,'wrapperTag':_0x407f15['wrapperTag']};}(_0x569074,_0x3db587);this['_changeIdByPartIndex']['set'](_0x3db587,_0x569074['id']);const _0xdde25=new co(this['locale'],{'part':_0x582fae,'uiIndex':_0x3db587+0x1,'areActionsDisabled':!0x1,'availableActions':[...po],'translationKeys':mc});_0xdde25['isApplyVisible']=_0x4fb4ad,_0xdde25['isSuggestVisible']=_0x1571a9,_0xdde25['on']('applySuggestion',()=>this['fire']('acceptChange',{'id':_0x569074['id']})),_0xdde25['on']('insertSuggestion',()=>this['fire']('suggestChange',{'changeId':_0x569074['id']})),_0xdde25['on']('rejectSuggestion',()=>this['fire']('dismissChange',{'id':_0x569074['id']})),_0xdde25['on']('showChangeInText',()=>this['fire']('activateChange',{'id':_0x569074['id'],'source':_0xdde25,'uiInteraction':'click'})),_0xdde25['on']('mouseOverSuggestion',()=>this['fire']('activateChange',{'id':_0x569074['id'],'source':_0xdde25,'uiInteraction':'hover'})),_0xdde25['on']('mouseLeaveSuggestion',()=>this['fire']('deactivateChange',{'origin':'panel','id':_0x569074['id'],'source':_0xdde25})),this['_resultViews']['add'](_0xdde25),_0xdde25['markAsDone'](),_0xdde25['updateContent']({'part':_0x582fae})['catch'](_0x56f83a=>Wt('ai-review-content-part-render-failed',_0x56f83a));}updateChangeState(_0x3412fe,_0x2c7dbf){const _0x5e0314=this['_getPartView'](_0x3412fe);_0x5e0314&&(_0x5e0314['state']=_0x2c7dbf);}setActiveResult(_0xd7895a){for(const _0x5cd315 of this['_partViews'])_0x5cd315['isActive']=this['_changeIdByPartIndex']['get'](_0x5cd315['partDefinition']['index'])===_0xd7895a;}resetActiveResults(){for(const _0x4bcff1 of this['_partViews'])_0x4bcff1['isActive']=!0x1;}getResultElement(_0x40a77d){return this['_getPartView'](_0x40a77d)?.['element']??null;}get _partViews(){return Array['from'](this['_resultViews']);}_getPartView(_0x467822){for(const _0x568078 of this['_partViews'])if(this['_changeIdByPartIndex']['get'](_0x568078['partDefinition']['index'])===_0x467822)return _0x568078;return null;}},Nc=class extends _0xf665cb{_resultsHeader;_finishReviewButtonView;constructor(_0x4a3ab3,_0x849668){super(_0x4a3ab3),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x849668['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x849668['headerText']);const _0x3212b8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x3212b8['if']('isVisible','ck-hidden',_0x11e4a7=>!_0x11e4a7)]},'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':_0x849668['emptyResultsText']}]}]}]});}_createFinishReviewButtonView(_0x55597a){const _0x4e3d63=new Sc(_0x55597a,this['locale']);return _0x4e3d63['delegate']('finishReview')['to'](this),_0x4e3d63;}_createResultHeaderView(_0x9f2e68){const _0x52933c=new _0x2df458(this['locale']);return _0x52933c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title'],'title':_0x9f2e68},'children':[{'text':_0x9f2e68}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x52933c;}},kc=class extends _0x2df458{['_dropdownView'];_defaultValue;_defaultLabel;constructor(_0x5c0ce6,_0x3ff393){super(_0x5c0ce6),this['_defaultValue']=_0x3ff393['default']||(_0x3ff393['data']['length']>0x0?_0x3ff393['data'][0x0]['id']:''),this['_defaultLabel']=_0x3ff393['data']['find'](_0xe0034=>_0xe0034['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x4c754a(this['locale']);const _0x4aec01=this['_prepareListOptions'](_0x3ff393['data']);_0x34e876(this['_dropdownView'],_0x4aec01,{'role':'menu','ariaLabel':_0x3ff393['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2da334=>{_0x2da334['stopPropagation']();})}}),this['_dropdownView']['panelPositionLimiter']=()=>{const _0x3ae531=this['_dropdownView']['buttonView']['element'];return _0x3ae531&&St(_0x3ae531);},this['listenTo'](this['_dropdownView'],'execute',_0x13dab4=>{this['formValue']=_0x13dab4['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x13dab4['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(_0x18b03b=[]){const _0x353f22=new _t();this['resetToDefault']();for(const _0x5cdca9 of _0x18b03b){const _0x367222=new _0x13bdb1({'label':_0x5cdca9['label'],'withText':!0x0,'role':'menuitemradio','id':_0x5cdca9['id'],'model':_0x5cdca9});_0x367222['bind']('isOn')['to'](this,'formValue',_0x321199=>_0x321199===_0x367222['id']);const _0x19fdb7={'type':'button','model':_0x367222};_0x353f22['add'](_0x19fdb7);}return _0x353f22;}},xc=class extends _0xf665cb{_formItem=null;constructor(_0x52e762,_0x455fec,_0x533609){if(super(_0x52e762),this['argsKey']=_0x455fec?.['argsKey'],'dropdown'===_0x455fec['formType'])this['_formItem']=new kc(this['locale'],_0x455fec);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x775e6c=new _0x57ecc8(this['locale'],{'children':[this['_formItem']],'class':[_0x533609?'ck-form__row_with-submit':'']});_0x533609&&_0x775e6c['children']['add'](_0x533609),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x775e6c]});}resetToDefault(){this['_formItem']['resetToDefault']();}},Lc=class AIReviewCorePromptInputView extends _0x1e334c{keystrokes;static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x10c1ce){super(_0x10c1ce),this['set']('isEmpty',!0x0),this['keystrokes']=new pt(),this['minRows']=AIReviewCorePromptInputView['MIN_ROWS'],this['maxRows']=AIReviewCorePromptInputView['MAX_ROWS'],this['placeholder']=qs(_0x10c1ce,'AI_REVIEW_MODE_CUSTOM_PROMPT_PLACEHOLDER'),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']);}},Dc=class extends _0x2df458{['focusTracker']=new Et();keystrokes=new pt();['focusCycler'];['_focusables']=new _0x15c4c2();submitButtonView;cancelButtonView;promptInputView;actionsFooterView;_modelSelector;['_check'];constructor(_0x5cd012,_0x4b5dd2,_0x479def=!0x1){super(_0x5cd012),this['_check']=_0x4b5dd2,this['set']('prompt',''),this['set']('modelId',''),this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x187ed8(this['locale'],()=>new Lc(_0x5cd012)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelector']=new la(_0x5cd012,{'panelPosition':'auto','dropdownClass':'ck-ai_review__check-list-item-model-dropdown','nameClass':'ck-ai_review__check-list-item-model-name','itemClasses':{'name':'ck-ai_review__check-list-item-model-dropdown-name','description':'ck-ai_review__check-list-item-model-dropdown-description'}}),this['listenTo'](this['_modelSelector'],'selectModel',(_0x477d27,_0x198684)=>{this['modelId']=_0x198684['id'],this['_modelSelector']['setSelectedModel'](_0x198684);}),this['_setModelList'](_0x479def),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-rows']},'children':[new _0x57ecc8(this['locale'],{'children':[this['promptInputView']]}),new _0x57ecc8(this['locale'],{'children':[this['actionsFooterView']]})]}]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x47b146,_0x153661)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x153661()):_0x153661();}),this['focusCycler']=new _0x17323b({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),[this['promptInputView'],this['_modelSelector']['dropdownView'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x5a46d3=>{this['_focusables']['add'](_0x5a46d3),this['focusTracker']['add'](_0x5a46d3['element']);}),this['keystrokes']['listenTo'](this['element']);}resetToDefault(){this['prompt']='',this['modelId']=this['_check']['defaultModel']?.['id']??'',this['_check']['defaultModel']&&this['_modelSelector']['setSelectedModel'](this['_check']['defaultModel']),this['resetFormValidationStatus']();}resetFormValidationStatus(){this['promptInputView']['errorText']='';}['_isValid'](){this['resetFormValidationStatus']();for(const _0x16f6e9 of this['_getFormValidators']()){const _0x4a102e=_0x16f6e9();if(_0x4a102e)return this['promptInputView']['errorText']=_0x4a102e,!0x1;}return!0x0;}_getFormValidators(){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return qs(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}_createSubmitButtonView(){const _0xd170bb=new _0x1a9216(this['locale']);return _0xd170bb['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_RUN_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':gr+'\x20'+pr}),_0xd170bb['bind']('isEnabled')['to'](this,'prompt',_0x43846d=>_0x43846d['trim']()['length']>0x0),_0xd170bb['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0xd170bb;}_createCancelButtonView(){const _0x44ae5a=new _0x1a9216(this['locale']),t=this['locale']['t'];return _0x44ae5a['set']({'label':t('Cancel'),'withText':!0x0,'class':Ar+'\x20'+pr}),_0x44ae5a['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x24c9a1=>{_0x24c9a1['stopPropagation']();})}}),_0x44ae5a['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x44ae5a;}_setModelList(_0x6b1505){this['_modelSelector']['setModels'](this['_check']['models'],!_0x6b1505),this['resetToDefault']();}_createActionsFooterView(){const _0xf140da=new _0x2df458(this['locale']);return _0xf140da['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelector'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0xf140da;}},Pc=class extends _0xf665cb{_formItemsCollection=new _0x15c4c2();_customCheckView=null;['_headerView'];_contentFormView;['_hideModels']=!0x1;['check'];constructor(_0x1d65ea,_0x386323,_0x2563e5,_0x3b8079=!0x1){super(_0x1d65ea),this['_hideModels']=_0x3b8079,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x386323['isParameterized']),this['check']=_0x386323,this['_headerView']=this['_createHeaderView'](_0x386323),this['_contentFormView']=this['_createContentFormView'](),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x2594dc=>_0x2594dc),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x3306ce=>_0x3306ce)],'style':{'--ck-ai-review-check-list-item-index':_0x2563e5}},'on':{'keydown':this['bindTemplate']['to'](_0x1c84ea=>{const _0x9d1e41=_0x1c84ea;'ArrowUp'!==_0x9d1e41['key']&&'ArrowDown'!==_0x9d1e41['key']||this['_headerView']['element']['contains'](_0x1c84ea['target'])||_0x1c84ea['stopPropagation']();}),'click':this['bindTemplate']['to'](_0x3e3a82=>{_0x3e3a82['target']===_0x3e3a82['currentTarget']&&(this['focus'](),this['fire']('click',_0x3e3a82));})},'children':[this['_headerView'],...this['_contentFormView']?[this['_contentFormView']]:[]]}),this['on']('click',()=>{_0x386323['isParameterized']?this['isParametrizedViewOpen']=!this['isParametrizedViewOpen']:this['fire']('runReviewCheck',{'id':_0x386323['id'],'args':_0x386323['useArgs']?_0x386323['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['focus'](){this['_headerView']['element']['focus']();}resetToDefault(){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x494d08=>{_0x494d08['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}_createHeaderView(_0xb381a){const _0x44e1a9=new _0x2df458(),_0x515296=this['_createIconView']();return _0x44e1a9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content'],'tabindex':'-1','role':'button',..._0xb381a['isParameterized']?{'aria-expanded':this['bindTemplate']['to']('isParametrizedViewOpen',_0x56e71d=>String(_0x56e71d))}:{}},'on':{'click':this['bindTemplate']['to']('click'),'keydown':this['bindTemplate']['to'](_0x3a9ce0=>{const _0x47512d=_0x3a9ce0;_0x3a9ce0['target']!==_0x3a9ce0['currentTarget']||'Enter'!==_0x47512d['key']&&'\x20'!==_0x47512d['key']||(_0x3a9ce0['preventDefault'](),this['fire']('click',_0x3a9ce0));})},'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':_0xb381a['title']}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0xb381a['description']?[{'text':_0xb381a['description']}]:[]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-icon-wrapper']},'children':[_0x515296]}]}),_0x44e1a9;}_createIconView(){const _0x1f7e38=new _0x5e3c18();return _0x1f7e38['content']=_0x4e5c52,_0x1f7e38['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x1f7e38;}_createParameterizedView(_0x7c5709){const _0xb0c164=new _0x2df458(),_0x186d9a=this['_createFormView'](_0x7c5709);return _0xb0c164['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x1fa813=>!_0x1fa813)]},'children':[_0x186d9a]}),_0xb0c164;}_createFormView(_0xb72854){const _0x5c4692=new _0x2df458(),_0x4377b3=Array['isArray'](_0xb72854['options'])?_0xb72854['options']:[],_0x395db2=new _0x1a9216(this['locale']);_0x395db2['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_RUN_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':gr}),_0x395db2['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x64802a=>{_0x64802a['stopPropagation']();})}}),_0x395db2['on']('execute',()=>{const _0x2e82b7=[],_0x54aeef={};this['_formItemsCollection']['forEach'](_0x124324=>{_0x2e82b7['push'](_0x124324['value']),_0xb72854['useArgs']&&_0xb72854['options']&&(_0x54aeef[_0x124324['argsKey']]=_0x124324['value']);}),this['fire']('runReviewCheck',{'id':_0xb72854['id'],'params':_0x2e82b7['length']?_0x2e82b7:void 0x0,'args':Object['keys'](_0x54aeef)['length']?_0x54aeef:void 0x0});});const _0x3882e3=_0x4377b3['length'];return _0x4377b3['forEach']((_0x522342,_0x30538c)=>{const _0x9ff839=_0x30538c===_0x3882e3-0x1;this['_formItemsCollection']['add'](new xc(this['locale'],_0x522342,_0x9ff839?_0x395db2:null));}),_0x5c4692['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x5c4692;}_createCustomView(_0x29202c,_0x102efa=!0x1){return this['_customCheckView']=new Dc(this['locale'],_0x29202c,_0x102efa),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',_0x327778=>!_0x327778)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x5025be,_0x1ccd71,_0x50d56a)=>{_0x50d56a||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}_createContentFormView(){return'custom'===this['check']['id']?this['_createCustomView'](this['check'],this['_hideModels']):this['check']['isParameterized']?this['_createParameterizedView'](this['check']):null;}},Mc=class extends _0x4e6fd6{constructor(_0x46146a){super(_0x46146a),this['set']('isVisible',!0x0);}setChecks(_0x463ca1,_0x595384=!0x1){this['_clearCheckViews']();for(const [_0x4b987a,_0x2100af]of this['_getVisualOrder'](_0x463ca1)['entries']()){const _0x395f1c=this['_createCheckView'](_0x2100af,_0x4b987a,_0x595384);this['_addCheckView'](_0x395f1c);}this['_onChecksSet']();}_getVisualOrder(_0x3d0307){return _0x3d0307;}_onChecksSet(){}_createCheckView(_0x2e8f8d,_0x85e5d2,_0x4fcf74){const _0x5cf137=new Pc(this['locale'],_0x2e8f8d,_0x85e5d2,_0x4fcf74);return _0x5cf137['delegate']('runReviewCheck')['to'](this),this['listenTo'](_0x5cf137,'change:isParametrizedViewOpen',(_0x58f0c0,_0x17801c,_0x5e19b7)=>{_0x5e19b7&&this['_closeCheckViewsOtherThan'](_0x5cf137);}),_0x5cf137;}_closeCheckViewsOtherThan(_0x1c6bd2=null){for(const _0x1995a8 of this['getCheckViews']())_0x1995a8!==_0x1c6bd2&&_0x1995a8['isParametrizedViewOpen']&&(_0x1995a8['isParametrizedViewOpen']=!0x1);}['render'](){super['render'](),_0x314252({'emitter':this,'activator':()=>this['getCheckViews']()['some'](_0x2e019e=>_0x2e019e['isParametrizedViewOpen']),'contextElements':()=>this['getCheckViews']()['filter'](_0x4eb6b3=>_0x4eb6b3['isItemParametrized'])['map'](_0x5e304a=>_0x5e304a['element']),'callback':()=>this['_closeCheckViewsOtherThan']()});}getCheckViewById(_0x243857){return this['getCheckViews']()['find'](_0x227b08=>_0x227b08['check']['id']===_0x243857);}['hasChecks'](){return this['getCheckViews']()['length']>0x0;}resetAllParameterizedChecks(){for(const _0x303c4b of this['getCheckViews']())_0x303c4b['isItemParametrized']&&_0x303c4b['resetToDefault']();}},Vc=class extends Mc{_parameterizedCheckViews;_nonParameterizedCheckViews;constructor(_0x38378a){super(_0x38378a),this['_parameterizedCheckViews']=new _0x340eed(_0x38378a),this['_parameterizedCheckViews']['label']=qs(_0x38378a,'AI_REVIEW_MODE_REVIEW_CATEGORY_TITLE_PARAMETERIZED'),this['_parameterizedCheckViews']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-group']}}),this['_nonParameterizedCheckViews']=new _0x340eed(_0x38378a),this['_nonParameterizedCheckViews']['label']=qs(_0x38378a,'AI_REVIEW_MODE_REVIEW_CATEGORY_TITLE_NON_PARAMETERIZED'),this['_nonParameterizedCheckViews']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-group']}}),this['_setupTemplate']();}_getVisualOrder(_0x2577be){return[..._0x2577be['filter'](_0xc38b69=>!_0xc38b69['isParameterized']),..._0x2577be['filter'](_0x52ebb6=>_0x52ebb6['isParameterized'])];}['_clearCheckViews'](){this['_parameterizedCheckViews']['items']['clear'](),this['_nonParameterizedCheckViews']['items']['clear'](),this['items']['clear']();}['_addCheckView'](_0x5ca425){_0x5ca425['isItemParametrized']?this['_parameterizedCheckViews']['items']['add'](_0x5ca425):this['_nonParameterizedCheckViews']['items']['add'](_0x5ca425),this['items']['add'](_0x5ca425);}_onChecksSet(){this['_parameterizedCheckViews']['isVisible']=this['_parameterizedCheckViews']['items']['length']>0x0,this['_nonParameterizedCheckViews']['isVisible']=this['_nonParameterizedCheckViews']['items']['length']>0x0;}getCheckViews(){return[...this['_nonParameterizedCheckViews']['items'],...this['_parameterizedCheckViews']['items']]['filter'](_0x551437=>_0x551437 instanceof Pc);}_setupTemplate(){const _0x3ac516=this['bindTemplate'];this['setTemplate']({'tag':'ul','attributes':{'class':['ck-ai_review__check-list',_0x3ac516['if']('isVisible','ck-hidden',_0x4e61ad=>!_0x4e61ad)]},'children':[this['_nonParameterizedCheckViews'],this['_parameterizedCheckViews']]});}};function Hc(_0x53c5c5){const _0x37bcd2=Zs(_0x53c5c5);return _0x37bcd2['length']>0x0&&_0x37bcd2['every'](_0x2b12c1=>_0x2b12c1['plugins']['has']('TrackChanges'));}function Uc(_0x376d4d){return Zs(_0x376d4d)['some'](_0x482e6b=>function(_0x256d6c){return Boolean(_0x256d6c['commands']['get']('trackChanges')?.['value']);}(_0x482e6b));}var Bc=class extends Cc{static get['pluginName'](){return'AIReviewModeUI';}createMainView(){const _0x517d98=this['context']['plugins']['get']('AITabs'),_0x18e04f=this['context']['locale'],_0x23e6e0=new sh(_0x18e04f,{'label':qs(_0x18e04f,'AI_REVIEW_MODE'),'icon':_0x2c00e7,'class':'ck-ai-header_review','showResizeButton':_0x517d98['showResizeButton']});_0x23e6e0['delegate']('resizeTabs')['to'](_0x517d98),_0x23e6e0['bind']('isMaximized')['to'](_0x517d98['view'],'isMaximized',_0xb87ea5=>_0xb87ea5);const _0x1e7758=new Rc(this['context']['locale'],{'header':_0x23e6e0,'list':new Vc(_0x18e04f),'results':new yc(_0x18e04f,{'generalErrorText':qs(_0x18e04f,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new Nc(_0x18e04f,{'headerText':qs(_0x18e04f,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':qs(_0x18e04f,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':qs(_0x18e04f,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});return _0x1e7758['extendTemplate']({'attributes':{'class':'ck-ai-review-mode'}}),_0x1e7758;}registerTab(){const _0x38d910=this['context']['plugins']['get']('AITabs');_0x38d910['view']['on']('activateTab',(_0x3d1cc3,{newTab:_0x585689,oldTab:_0xdd0821})=>{_0x585689===Sh?this['fire']('getReviewCheckList'):_0xdd0821===Sh&&this['fire']('leaveReview');}),_0x38d910['view']['addTab']({'id':Sh,'buttonLabel':qs(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x2c00e7,'order':0x0,'content':this['_mainView']});}_isSuggestButtonVisibleForChange(){return Hc(this['context']);}_isAcceptButtonVisibleForChange(){return!this['_isSuggestButtonVisibleForChange']()||!Uc(this['context']);}},Gc=class extends or{_affectedBlocks=[];get affectedBlocks(){return this['_affectedBlocks']['slice']();}set affectedBlocks(_0x417f19){this['_affectedBlocks']=_0x417f19;}};const Wc='review-',Fc=['softBreak'],Kc=['htmlScript','htmlStyle','htmlCustomElement'];var $c=class extends _0x4cd5fc{static get requires(){return[Un,Pn];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();_activeMarkers=new Set();_domEmitter;_eventEmitter;shadowRootRegistry=new Ct();_reviewEditingAttachedEditors=new WeakSet();_boundEditables=new WeakMap();_inlineRootDataIds=new WeakMap();['_markerBlurHandler']=null;constructor(_0x628627){super(_0x628627),this['_domEmitter']=new(gt())(),this['_eventEmitter']=new(It())();}get emitter(){return this['_eventEmitter'];}afterInit(){const _0x3aa29d=_0x518468=>this['_scheduleAttachReviewEditingToEditor'](_0x518468);if(this['_registerGlobalMarkerBlurHandler'](),this['context']instanceof _0x553634)return void _0x3aa29d(this['context']);const _0x328437=this['context'];for(const _0x32f5c7 of _0x328437['editors'])_0x3aa29d(_0x32f5c7);this['listenTo'](_0x328437['editors'],'add',(_0x462835,_0x5bf75e)=>{_0x3aa29d(_0x5bf75e);}),this['listenTo'](_0x328437['editors'],'remove',(_0x48db98,_0x1e9ac6)=>{for(const [_0xe93c79,_0x525d11]of this['_markers'])_0x525d11['editor']===_0x1e9ac6&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0xe93c79,'changeId':_0x525d11['groupId']}),this['_markers']['delete'](_0xe93c79));});}destroy(){super['destroy'](),this['_domEmitter']['stopListening'](),this['shadowRootRegistry']['destroy'](),this['_markerBlurHandler']?.['cancel']();}_scheduleAttachReviewEditingToEditor(_0x462d32){const _0x6c388f=()=>{'destroyed'!==_0x462d32['state']&&_0x462d32['conversion']&&this['_attachReviewEditingToEditor'](_0x462d32);};if('ready'===_0x462d32['state'])return void _0x6c388f();const _0x561c5c=()=>{this['stopListening'](_0x462d32,'ready',_0x561c5c),_0x6c388f();};this['listenTo'](_0x462d32,'ready',_0x561c5c);}_attachReviewEditingToEditor(_0x5658a0){this['_reviewEditingAttachedEditors']['has'](_0x5658a0)||(_0x5658a0['conversion']['for']('editingDowncast')['markerToElement']({'model':Wc+'insert','view':(_0x54f8c3,{writer:_0x43536e})=>{const _0x4cd772=this['_markers']['get'](_0x54f8c3['markerName']),_0x5bdba0={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x4cd772?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x54f8c3['markerName']};return _0x43536e['createUIElement']('span',_0x5bdba0,function(_0x145621){const _0x41186c=this['toDomElement'](_0x145621);return _0x41186c['innerHTML']=Qt(_0x4cd772?.['content']?.['asString']||''),_0x41186c;});}}),_0x5658a0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Wc+'remove-only','view':_0xd92147=>{const _0x411d9e=this['_markers']['get'](_0xd92147['markerName']),_0x1dcc24=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x411d9e?.['id']||'')&&_0x1dcc24['push']('ck-ai_review__change_active'),{'classes':_0x1dcc24,'attributes':{'data-marker-id':_0xd92147['markerName']}};}}),_0x5658a0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Wc+'remove-context','view':_0x4b2e5b=>{const _0x5b64b7=this['_markers']['get'](_0x4b2e5b['markerName']),_0x170708=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x5b64b7?.['id']||'')&&_0x170708['push']('ck-ai_review__change_active'),{'classes':_0x170708,'attributes':{'data-marker-id':_0x4b2e5b['markerName']}};}}),_0x5658a0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Wc+'remove-text','view':_0xf45d71=>{const _0x4e5202=this['_markers']['get'](_0xf45d71['markerName']),_0x1200b1=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x4e5202?.['id']||'')&&_0x1200b1['push']('ck-ai_review__change_active'),{'classes':_0x1200b1,'attributes':{'data-marker-id':_0xf45d71['markerName']}};}}),_0x5658a0['conversion']['for']('dataDowncast')['markerToElement']({'model':Wc+'suggestion-context','view':(_0x1100ee,{writer:_0x2092ab})=>_0x2092ab['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x1100ee['isOpening']?'start':'end')})}),_0x5658a0['conversion']['for']('downcast')['attributeToAttribute']({'model':Vn,'view':Hn}),this['_updateMouseMarkerInteractionListeners'](_0x5658a0),this['listenTo'](_0x5658a0,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x5658a0),{'priority':'lowest'}),this['listenTo'](_0x5658a0,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x5658a0),{'priority':'lowest'}),_0x5658a0['model']['document']['registerPostFixer'](_0x582b6e=>this['_validateMarkers'](_0x5658a0,_0x582b6e)),_0x5658a0['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x5658a0)),this['_reviewEditingAttachedEditors']['add'](_0x5658a0));}_updateMouseMarkerInteractionListeners(_0x54e4ad){let _0x48b926=this['_boundEditables']['get'](_0x54e4ad);_0x48b926||(_0x48b926=new Map(),this['_boundEditables']['set'](_0x54e4ad,_0x48b926));const _0x12ffbf=new Set(_0x54e4ad['ui']['getEditableElementsNames']());for(const _0x4bbdc3 of _0x12ffbf){if(_0x48b926['has'](_0x4bbdc3))continue;const _0x44f91e=_0x54e4ad['ui']['getEditableElement'](_0x4bbdc3);_0x48b926['set'](_0x4bbdc3,_0x44f91e),this['_attachMouseMarkerInteractionListeners'](_0x44f91e),this['shadowRootRegistry']['registerNode'](_0x44f91e);}for(const [_0x394d57,_0x43cee3]of _0x48b926)_0x12ffbf['has'](_0x394d57)||(_0x48b926['delete'](_0x394d57),this['_domEmitter']['stopListening'](_0x43cee3),this['shadowRootRegistry']['unregisterNode'](_0x43cee3));}_attachMouseMarkerInteractionListeners(_0x1fa5d9){this['_domEmitter']['listenTo'](_0x1fa5d9,'mouseup',(_0xa56af7,_0xc5d857)=>{const _0xa736bc=_0xc5d857['target'],_0x2f6b49=this['_findMarkerElement'](_0xa736bc);if(!_0x2f6b49)return;const _0x54741d=_0x2f6b49['getAttribute']('data-marker-id'),_0x1f593d=_0x54741d['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x54741d,'changeId':_0x1f593d,'markerElement':()=>this['_findMarkerElementById'](_0x54741d),'domEvent':_0xc5d857});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x1fa5d9,'mouseover',(_0x5931ec,_0x141200)=>{const _0xe152cf=_0x141200['target'],_0x2ee9e2=_0x141200['relatedTarget'];let _0x2f724f=this['_findMarkerElement'](_0xe152cf);if(!_0x2f724f&&_0x2ee9e2&&(_0x2f724f=this['_findMarkerElement'](_0x2ee9e2)),!_0x2f724f)return;const _0x316ef5=_0x2f724f['getAttribute']('data-marker-id'),_0x485db2=_0x316ef5['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x485db2,'markerElement':()=>this['_findMarkerElementById'](_0x316ef5),'domEvent':_0x141200});});}_registerGlobalMarkerBlurHandler(){const _0x4987d0=_0x2fd977((_0x35c41e,_0x164bdb)=>{const _0x4dd13e=this['_getHoveredElement'](_0x164bdb);_0x4dd13e&&(this['_findMarkerElement'](_0x4dd13e)||this['_eventEmitter']['fire']('changeMarkerBlurred'));},0xc8);this['_markerBlurHandler']=_0x4987d0,this['_domEmitter']['listenTo'](document,'mouseover',_0x4987d0),Gt(this['shadowRootRegistry'],{'emitter':this['_domEmitter'],'event':'mouseover','callback':_0x4987d0});}_getHoveredElement(_0x49300e){return this['shadowRootRegistry']['refresh'](),Nt(_0x49300e['clientX'],_0x49300e['clientY'],Array['from'](this['shadowRootRegistry']['getShadowRoots']()));}getDocumentData(_0x34c455){const _0x3de101=this['context']['plugins']['get']('AIEditing'),_0x21ba9d=Zs(this['context']);if(!_0x21ba9d['length'])throw new dt('ai-get-editor-from-context-no-editor',this);const _0x4a2034=_0x34c455?.['roots'];if(_0x4a2034&&0x0===_0x4a2034['length'])throw new dt('ai-reviewcoreediting-empty-roots',this);const _0x4bc3d5=_0x4a2034?new Set(_0x4a2034['map'](_0x497556=>_0x497556['channelId']+'\x00'+_0x497556['rootName'])):null,_0x4b5cb7=_0x4bc3d5?new Set():null,_0x55c8bb=new Set(),_0x246a36=[],_0x96878d=new Map(),_0x7e8a57=[];for(const _0xfa9b81 of _0x21ba9d){const _0x869ff4=_0xfa9b81['config']['get']('collaboration.channelId');for(const _0x1f1a94 of _0xfa9b81['model']['document']['getRoots']()){const _0x385d42=_0x869ff4+'\x00'+_0x1f1a94['rootName'];if(_0x4bc3d5&&!_0x4bc3d5['has'](_0x385d42))continue;const _0x416527=this['_buildDocumentDataSliceForRoot'](_0xfa9b81,_0x1f1a94,_0x3de101,_0x55c8bb);_0x246a36['push'](_0x416527['content']);for(const [_0x31e996,_0x546e2f]of _0x416527['elements'])_0x96878d['set'](_0x31e996,_0x546e2f);_0x7e8a57['push']({'channelId':_0x869ff4,'rootName':_0x1f1a94['rootName'],'content':_0x416527['content'],'documentVersion':_0x416527['documentVersion']}),_0x4b5cb7?.['add'](_0x385d42);}}if(_0x4a2034&&_0x4b5cb7['size']!==_0x4bc3d5['size']){const _0x34537e=_0x4a2034['find'](_0x271be0=>!_0x4b5cb7['has'](_0x271be0['channelId']+'\x00'+_0x271be0['rootName']));throw new dt('ai-reviewcoreediting-root-not-found',this,{'channelId':_0x34537e['channelId'],'rootName':_0x34537e['rootName']});}return{'elements':_0x96878d,'content':_0x246a36['join'](''),'roots':_0x7e8a57};}async['runCheck'](_0xd7b81b,_0x4c4786){const _0x12abb4=new hr(),_0x3a7119=_0x4c4786?.['signal'];let _0x3ae4dd;const _0x37fc1f=()=>{_0x12abb4['abort'](),_0xd7b81b['abort']();};if(_0x3a7119){if(_0x3a7119['aborted'])return _0x37fc1f(),_0x12abb4;_0x3a7119['addEventListener']('abort',_0x37fc1f),_0x3ae4dd=()=>_0x3a7119['removeEventListener']('abort',_0x37fc1f);}const _0x27115c={'apiId':_0xd7b81b['sourceCheck']['apiId']};try{_0xd7b81b['on']('reviewCheckRunUpdated',(_0x2e8753,_0x1d7108)=>{'aborted'===_0x1d7108['status']?_0x12abb4['abort']():'error-general'!==_0x1d7108['status']&&'error-chunk'!==_0x1d7108['status']||(_0x12abb4['error']=rr(_0x1d7108['error'],'ai-reviewcoreediting-check-run-failed',this,_0x27115c));}),'aborted'!==_0x12abb4['status']&&await _0xd7b81b['start']();}catch(_0x534ff2){_0x12abb4['error']=rr(_0x534ff2,'ai-reviewcoreediting-check-run-failed',this,_0x27115c);}finally{_0x3ae4dd&&_0x3ae4dd();}return'error'===_0x12abb4['status']||'aborted'===_0x12abb4['status']||(_0x12abb4['addResult'](...this['_buildPerRootResults'](_0xd7b81b)),_0x12abb4['status']='completed'),_0x12abb4;}buildErrorContext(_0x53ee43){return{'apiId':_0x53ee43['sourceCheck']['apiId']};}_buildPerRootResults(_0x45cf9a){const _0x539709=this['buildErrorContext'](_0x45cf9a),_0x39a9d5=this['context']['plugins']['get']('AIEditing'),_0x2db3fd=this['context']['plugins']['get']('AIGateway'),_0x5658ab=new Map();for(const _0x10ddde of Zs(this['context']))_0x5658ab['set'](_0x10ddde['config']['get']('collaboration.channelId'),_0x10ddde);return _0x45cf9a['documentData']['roots']['map'](({channelId:_0x570728,rootName:_0x55a18f,content:_0x4fdbf1,documentVersion:_0x5cb7b2})=>{const _0x143967=_0x5658ab['get'](_0x570728),_0x1ddd06=new Gc({'editor':_0x143967,'rootName':_0x55a18f,'channelId':_0x570728,'sessionId':_0x39a9d5['getSessionId'](_0x143967)});_0x1ddd06['contentRawOld']=_0x4fdbf1,_0x1ddd06['documentVersion']=_0x5cb7b2;const _0x5d6a5b=this['_collectResultAffectedBlocks'](_0x1ddd06,_0x45cf9a['results'],_0x45cf9a['documentData']['elements']);_0x1ddd06['affectedBlocks']=_0x5d6a5b;try{_0x1ddd06['contentRawNew']=sn(_0x2db3fd['mergeChangesIntoContent'](_0x5d6a5b,_0x1ddd06['contentRawOld']));}catch(_0x380de3){_0x1ddd06['error']=rr(_0x380de3,'ai-reviewcoreediting-check-run-failed',this,_0x539709);}return _0x1ddd06;});}_collectResultAffectedBlocks(_0x477556,_0x212ada,_0x329821){return _0x212ada['filter'](_0x5988bc=>{const _0x4bb70b=_0x329821['get'](_0x5988bc['id']);return!!_0x4bb70b&&_0x4bb70b['editor']===_0x477556['editor']&&_0x4bb70b['rootName']===_0x477556['rootName'];})['map'](_0x85fab=>({'id':_0x85fab['id'],'content':_0x85fab['contentNew']}));}_buildDocumentDataSliceForRoot(_0x1795bd,_0x31e492,_0x2e89d2,_0x1b11fc){const _0x297486=_0x1795bd['model'],_0x37b12e=new _0x1f9306();for(const _0x2593cb of _0x31e492['getChildren']())_0x37b12e['_appendChild'](_0x2593cb['_clone'](!0x0));for(const _0x62f821 of _0x297486['markers']){const _0x31ab7c=_0x62f821['getRange']();_0x31ab7c&&_0x31ab7c['root']['rootName']===_0x31e492['rootName']&&_0x37b12e['markers']['set'](_0x62f821['name'],this['_changeRangeOwnerDocument'](_0x31ab7c['clone'](),_0x37b12e));}const _0x4355d7=new Map(),_0x5732b5=_0x297486['document']['version'];if(En(_0x1795bd,_0x31e492['rootName'])){let _0x5168d8=this['_inlineRootDataIds']['get'](_0x31e492);_0x5168d8?_0x1b11fc['add'](_0x5168d8):(_0x5168d8=_0x2e89d2['_nextDataId'](_0x1b11fc),this['_inlineRootDataIds']['set'](_0x31e492,_0x5168d8));const _0x1ae4bc=pn(_0x1795bd['data']['processor']['toData'](_0x1795bd['data']['toView'](_0x37b12e)),_0x5168d8);return _0x4355d7['set'](_0x5168d8,{'editor':_0x1795bd,'rootName':_0x31e492['rootName'],'path':[],'documentVersion':_0x5732b5,'getContent':()=>_0x1ae4bc}),{'content':_0x1ae4bc,'documentVersion':_0x5732b5,'elements':_0x4355d7};}const _0x37dff5=new _0x3d1b58({'ignoreElementEnd':!0x0,'startPosition':_0x297486['createPositionAt'](_0x37b12e,0x0)});for(const {item:_0x3786bc}of _0x37dff5){if(_0x3786bc['is']('element')&&_0x3786bc['name']&&Kc['includes'](_0x3786bc['name'])){const _0x22a1c9=this['_upsertDataId'](_0x3786bc,()=>_0x2e89d2['_nextDataId'](_0x1b11fc));_0x1b11fc['add'](_0x22a1c9);}if(!_0x3786bc['is']('$textProxy'))continue;const _0x5856db=_0x3786bc['parent'];if(!_0x5856db||!_0x5856db['is']('element'))continue;const _0x38bbb6=this['_upsertDataId'](_0x5856db,()=>_0x2e89d2['_nextDataId'](_0x1b11fc));_0x1b11fc['add'](_0x38bbb6);for(const _0x58d7a4 of _0x5856db['getChildren']())_0x58d7a4['is']('element')&&(_0x58d7a4['name']&&Fc['includes'](_0x58d7a4['name'])||_0x1b11fc['add'](this['_upsertDataId'](_0x58d7a4,()=>_0x2e89d2['_nextDataId'](_0x1b11fc))));let _0x472c56=_0x5856db;for(;_0x472c56['parent']&&!_0x472c56['parent']['is']('documentFragment');)_0x472c56=_0x472c56['parent'],_0x472c56['hasAttribute']('$elementId')&&_0x472c56['_removeAttribute'](Vn);_0x4355d7['set'](_0x38bbb6,{'editor':_0x1795bd,'rootName':_0x31e492['rootName'],'path':_0x5856db['getPath'](),'documentVersion':_0x5732b5,'getContent':this['_createGetContentUsingDataIdFn'](_0x472c56['_clone'](!0x0),_0x38bbb6,_0x1795bd['data'])}),_0x37dff5['jumpTo'](_0x297486['createPositionAfter'](_0x5856db));}return{'content':_0x1795bd['data']['processor']['toData'](_0x1795bd['data']['toView'](_0x37b12e)),'documentVersion':_0x5732b5,'elements':_0x4355d7};}diffContent(_0x3614eb,_0x5955e9,_0x5ef25a,_0x14bf1c=!0x1){const {contentInitial:_0x3c2c0d,contentNew:_0x1d8410}=this['_neutralizeChangesOnUnsupportedElements'](_0x5955e9,_0x5ef25a),_0x1e51a9=[],_0x580ed1=_0x3614eb['data']['parse'](_0x1d8410,'$documentFragment'),_0x25bc9c=_0x3614eb['data']['parse'](_0x3c2c0d,'$documentFragment'),_0x217630=_0x3614eb['model']['createPositionAt'](_0x25bc9c,0x0);if(this['_haveSingleTopLevelElement'](_0x580ed1)){if(!this['_hasSameTopLevelElement'](_0x25bc9c,_0x580ed1))return _0x1e51a9;}else{const _0x29dc29=_0x3614eb['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x25bc9c,_0x29dc29)||!this['_haveOnlyInlineContent'](_0x580ed1,_0x29dc29))return _0x1e51a9;}const _0x392266=this['context']['plugins']['get']('DocumentChanges')['getDiff'](_0x3c2c0d,_0x1d8410,{'targetEditor':_0x3614eb,'anchor':_0x217630,'markDeletions':!0x0})['filter'](_0x442da7=>'insert'===_0x442da7['type']||'marker'===_0x442da7['type']&&_0x442da7['name']['startsWith']('$markedRemove')),_0x1dd144=this['_groupAdjacentOperations'](_0x392266),_0x2aedbf=[];if(_0x14bf1c){if(_0x1dd144['length']){const _0x36f456=_0x1dd144[0x0]['operations'][0x0],_0x3a4cef='insert'===_0x36f456['type']?_0x36f456['position']:_0x36f456['newRange']['start'],_0x9eaa22=this['_getPositionLimitingRange'](_0x3a4cef,_0x3614eb,'inside'),_0x1fe5e2=_0x9eaa22?_0x9eaa22['start']['parent']:_0x25bc9c,_0x53091a=_0x9eaa22?_0x580ed1['getChild'](0x0):_0x580ed1;let _0x47af12=_0x53091a['getChildren'](),_0x26a273=_0x9eaa22||_0x3614eb['model']['createRangeIn'](_0x25bc9c);const _0x53be60=this['_getTrailingSoftBreaks'](_0x1fe5e2),_0x2dc643=this['_getTrailingSoftBreaks'](_0x53091a),_0x598028=Math['min'](_0x53be60['length'],_0x2dc643['length']);if(_0x598028>0x0){const _0x41b27f=_0x53be60[_0x53be60['length']-_0x598028]['startOffset'],_0x4f0e2c=_0x2dc643[_0x2dc643['length']-_0x598028]['startOffset'];_0x26a273=new _0x3aaa22(_0x26a273['start'],_0x3614eb['model']['createPositionAt'](_0x1fe5e2,_0x41b27f)),_0x47af12=Array['from'](_0x47af12)['filter'](_0x2f47ba=>_0x2f47ba['startOffset']<_0x4f0e2c);}const _0x4ba144=[new _0x2070bd('$markedRemove:synthetic'+Xt(),null,_0x26a273,_0x3614eb['model']['document']['model']['markers'],!0x0,_0x3614eb['model']['document']['version']+0x1),new _0x38210e(_0x26a273['end'],_0x47af12,_0x3614eb['model']['document']['version']+0x2)];_0x2aedbf['push']({'operations':_0x4ba144,'operationsIsolated':_0x4ba144,'groupOffset':0x0});}}else _0x2aedbf['push'](..._0x1dd144);let _0x27de4c=0x0;return _0x3614eb['model']['change'](_0x7a3d40=>{for(let _0x3f112f=0x0;_0x3f112f<_0x2aedbf['length'];_0x3f112f++){const _0x1ddb96=_0x2aedbf[_0x3f112f],_0x3d67fa=_0x7a3d40['createDocumentFragment']();for(const _0x3b6fc8 of _0x25bc9c['getChildren']())_0x7a3d40['append'](_0x3b6fc8['_clone'](!0x0),_0x3d67fa);for(const _0x2f012b of _0x1ddb96['operationsIsolated'])if('insert'===_0x2f012b['type']){const _0x1d4389=_0x2f012b;_0x1d4389['baseVersion']=null,_0x1d4389['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x1d4389,_0x3d67fa),_0x7a3d40['batch']['addOperation'](_0x2f012b),_0x3614eb['model']['applyOperation'](_0x2f012b);const _0x5baf66='suggestion:insertion:id:authorId:'+_0x27de4c++,_0x210f9a=_0x3614eb['model']['createRange'](_0x1d4389['position'],_0x1d4389['position']['getShiftedBy'](_0x1d4389['howMany']));_0x3d67fa['markers']['set'](_0x5baf66,_0x210f9a);}else{if('marker'===_0x2f012b['type']&&_0x2f012b['name']['startsWith']('$markedRemove')){const _0x471071=_0x2f012b,_0xd89a6e='suggestion:deletion:id:authorId:'+_0x27de4c++;this['_changeOperationOwnerDocument'](_0x471071,_0x3d67fa),_0x3d67fa['markers']['set'](_0xd89a6e,_0x471071['newRange']);}}if(_0x14bf1c)_0x1e51a9['push']({..._0x1ddb96,'context':this['_createGetContentFn'](_0x25bc9c,_0x3614eb['data']),'content':this['_createGetContentFn'](_0x25bc9c,_0x3614eb['data'])});else{const _0xe49b58=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x1ddb96['operationsIsolated'][0x0]),_0x3d67fa),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x1ddb96['operationsIsolated'][_0x1ddb96['operationsIsolated']['length']-0x1]),_0x3d67fa),_0x3614eb);_0x3d67fa['markers']['set'](Wc+'suggestion-context',new _0x3aaa22(_0xe49b58['start'],_0xe49b58['end'])),_0x1e51a9['push']({..._0x1ddb96,'context':this['_createGetContextFn'](_0x3d67fa,_0x3614eb['data'],{'ellipsisBefore':_0xe49b58['hasContentBefore'],'ellipsisAfter':_0xe49b58['hasContentAfter']}),'content':this['_createGetContentFn'](_0x3d67fa,_0x3614eb['data'])});}}}),_0x1e51a9;}markChangePositionInEditorContent(_0x3b38cd,_0x165014){if(!_0x3b38cd['length'])return;const _0x102585=_0x3b38cd[0x0]['parent']['id'],_0x265fa2=_0x165014['elements']['get'](_0x102585);if(!_0x265fa2)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x102585);const _0x3d7d7f=_0x265fa2['path'],_0x1496f8=_0x265fa2['editor'],_0x1c63e6=_0x1496f8['model']['document']['getRoot'](_0x265fa2['rootName']);if(!_0x1c63e6)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x265fa2['rootName']);const _0xd2902d=_0x1496f8['model']['document']['history']['getOperations'](_0x265fa2['documentVersion']),_0x56a459=[];for(const _0x53d8e0 of _0x3b38cd){const _0x8a8afe=_0x53d8e0['operationsIsolated']['map'](_0x4f7fa3=>this['_translateOperationToEditorContent'](_0x4f7fa3,_0x3d7d7f,_0x1c63e6));if(!_0x8a8afe||!_0x8a8afe['length'])continue;const _0x36727f=_0x8a8afe['every'](_0x5bea71=>'marker'===_0x5bea71['type']&&_0x5bea71['name']['startsWith']('$markedRemove')),_0x2a3fe0={'document':_0x1496f8['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x51c000=_0x3e782f(_0x8a8afe,_0xd2902d,_0x2a3fe0)['operationsA'];for(const _0x167efd of _0x51c000)if('insert'===_0x167efd['type']){const _0x1a389f=_0x167efd;_0x1a389f['position']=this['_clampPositionToParent'](_0x1a389f['position']);const _0x3eb5f1=_0x1a389f['nodes'];_0x1496f8['model']['change'](_0x20bdf9=>{const _0x4655c1=_0x20bdf9['createDocumentFragment']();for(const _0x1fb9e8 of _0x3eb5f1)_0x20bdf9['append'](_0x1fb9e8['_clone'](!0x0),_0x4655c1);_0x56a459['push']({'start':_0x1a389f['position'],'end':_0x1a389f['position'],'type':'insert','groupId':_0x53d8e0['id'],'content':{'asString':this['_createGetContentFn'](_0x4655c1,_0x1496f8['data'])(),'asFragment':_0x4655c1}});});}else{if('marker'===_0x167efd['type']&&_0x167efd['name']['startsWith']('$markedRemove')){const _0x32c707=_0x167efd;_0x32c707['newRange']=new _0x3aaa22(this['_clampPositionToParent'](_0x32c707['newRange']['start']),this['_clampPositionToParent'](_0x32c707['newRange']['end']));let _0x1d0ea7='remove-text';if(_0x36727f){const _0xcc810f=this['_findAdjacentContextDistance'](_0x32c707['newRange']['start'],'backward',_0x1496f8['model']['schema']),_0x2dd6aa=this['_findAdjacentContextDistance'](_0x32c707['newRange']['end'],'forward',_0x1496f8['model']['schema']);if(_0xcc810f||_0x2dd6aa){const _0x566a35=_0x32c707['newRange']['start']['getShiftedBy'](-_0xcc810f),_0xa18402=_0x32c707['newRange']['end']['getShiftedBy'](_0x2dd6aa);_0x56a459['push']({'start':_0x566a35,'end':_0xa18402,'groupId':_0x53d8e0['id'],'type':'remove-context'});}else _0x1d0ea7='remove-only';}_0x56a459['push']({'start':_0x32c707['newRange']['start'],'end':_0x32c707['newRange']['end'],'groupId':_0x53d8e0['id'],'type':_0x1d0ea7});}}}this['_insertMarkers'](_0x56a459,_0x1496f8);}['clearAllMarkers'](){const _0x4998b7=new Map();for(const _0x3084f9 of this['_markers']['keys']()){const _0xef4d03=this['_markers']['get'](_0x3084f9);_0xef4d03?.['editor']&&(_0x4998b7['has'](_0xef4d03['editor'])||_0x4998b7['set'](_0xef4d03['editor'],[]),_0x4998b7['get'](_0xef4d03['editor'])['push'](_0x3084f9));}for(const [_0x50f5e1,_0x373bc2]of _0x4998b7)_0x50f5e1['model']['change'](_0x401289=>{for(const _0x1bdda3 of _0x373bc2)_0x50f5e1['model']['markers']['get'](_0x1bdda3)&&_0x401289['removeMarker'](_0x1bdda3);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}switchToReadOnly(){for(const _0x281abc of this['getEditors']())_0x281abc['enableReadOnlyMode']('ai-review');}switchToEdit(){for(const _0x57a5a4 of this['getEditors']())_0x57a5a4['disableReadOnlyMode']('ai-review');}['applyChange'](_0x376720,_0x1ef812=null){const _0x555ca8=_0x376720['map'](_0x157f23=>this['_getMarkersDataForGroup'](_0x157f23))['flat'](),_0x3b6ef1=new Map();for(const _0x5cccff of _0x555ca8)_0x3b6ef1['has'](_0x5cccff['editor'])||_0x3b6ef1['set'](_0x5cccff['editor'],[]),_0x3b6ef1['get'](_0x5cccff['editor'])['push'](_0x5cccff);for(const [_0x5595c5,_0x3cbea7]of _0x3b6ef1){const _0x34114c=_0x5595c5['model'],_0x2bf2a9=_0x5595c5['plugins']['has']('TrackChangesEditing')?_0x5595c5['plugins']['get']('TrackChangesEditing'):null;_0x34114c['change'](_0x3eafd4=>{for(const _0x3db86b of _0x3cbea7){const _0x302e3b=_0x5595c5['model']['markers']['get'](_0x3db86b['id']);if(!_0x302e3b)continue;const _0x51bece=_0x3eafd4['batch']['operations']['length'];if('insert'===_0x3db86b['type']){if(!_0x3db86b['content'])continue;_0x34114c['insertContent'](_0x3db86b['content']['asFragment']||null,_0x302e3b['getRange']()['start']);}else'remove-text'!==_0x3db86b['type']&&'remove-only'!==_0x3db86b['type']||_0x34114c['deleteContent'](_0x34114c['createSelection'](_0x302e3b['getRange']()));if(_0x3eafd4['removeMarker'](_0x3db86b['id']),this['_markers']['delete'](_0x3db86b['id']),!_0x1ef812)continue;const _0x3ea669=_0x3eafd4['batch']['operations']['slice'](_0x51bece),_0x4a4772=[],_0x4f3d98=new Set();for(const _0x16b189 of _0x3ea669){if('marker'!=_0x16b189['type']||null!==_0x16b189['oldRange'])continue;const _0x2cb661=_0x16b189['name'],{group:_0x326590,id:_0x2ad9e4}=_0x3940d0(_0x2cb661);if('suggestion'!=_0x326590||!_0x2bf2a9||!_0x2bf2a9['hasSuggestion'](_0x2ad9e4))continue;const _0x123b34=_0x2bf2a9['getSuggestion'](_0x2ad9e4);null===_0x123b34['_originalSuggestionId']&&(_0x4a4772['push'](_0x123b34),_0x4f3d98['add'](_0x2cb661));}const _0x3627f6='insert'===_0x3db86b['type']&&_0x4f3d98['size']>0x0;jn(_0x3ea669['filter'](_0x9e9460=>'marker'==_0x9e9460['type']?_0x4f3d98['has'](_0x9e9460['name']):!_0x3627f6),_0x1ef812);for(const _0x289c90 of _0x4a4772)_0x289c90['setAttribute']('@ai',{'type':_0x1ef812});}});}}applyChangesAsSuggestions(_0xd560f3,_0x4797df=null){const _0x5e992b=_0xd560f3['map'](_0x4b8658=>this['_getMarkersDataForGroup'](_0x4b8658))['flat'](),_0x25006b=new Map();for(const _0x549c49 of _0x5e992b)_0x25006b['has'](_0x549c49['editor'])||_0x25006b['set'](_0x549c49['editor'],[]),_0x25006b['get'](_0x549c49['editor'])['push'](_0x549c49);for(const _0x52f5d2 of _0x25006b['keys']())if(!_0x52f5d2['plugins']['has']('TrackChangesEditing'))throw new dt('ai-no-track-changes',this);for(const [_0x9aed63,_0x12a7f3]of _0x25006b){const _0x32cf39=_0x9aed63['plugins']['get']('TrackChangesEditing');_0x9aed63['model']['change'](_0xdab538=>{for(const _0x2106ff of _0x12a7f3){const _0x459128=_0x9aed63['model']['markers']['get'](_0x2106ff['id']);if(_0x459128){const _0x55b0f8=this['_buildSuggestionOperationForMarker'](_0x2106ff,_0x459128,_0x9aed63);_0x55b0f8&&(_0x4797df&&jn([_0x55b0f8],_0x4797df),_0x32cf39['_applyOperationsAsSuggestions']([_0x55b0f8])),_0xdab538['removeMarker'](_0x2106ff['id']);}this['_markers']['delete'](_0x2106ff['id']);}});}}_buildSuggestionOperationForMarker(_0x20e062,_0x527d14,_0x3f1ff4){if('insert'===_0x20e062['type']){if(!_0x20e062['content'])return null;const _0x392b90=Array['from'](_0x20e062['content']['asFragment']['getChildren']())['map'](_0x4d57f1=>_0x4d57f1['_clone'](!0x0));return _0x392b90['length']?new _0x38210e(_0x527d14['getRange']()['start'],_0x392b90,_0x3f1ff4['model']['document']['version']):null;}if('remove-text'===_0x20e062['type']||'remove-only'===_0x20e062['type']){const _0x56eabc=_0x527d14['getRange']();return _0x56eabc['isCollapsed']?null:new _0x2070bd('$markedRemove:aireview'+Xt(),null,_0x56eabc,_0x3f1ff4['model']['markers'],!0x0,_0x3f1ff4['model']['document']['version']);}return null;}rejectChange(_0xe4db21){this['_rejectMarkersForChanges']([_0xe4db21]);}rejectAllChanges(_0x51e939){this['_rejectMarkersForChanges'](_0x51e939);}_rejectMarkersForChanges(_0x3058ca){const _0x1cd4d1=_0x3058ca['map'](_0x41b8a8=>this['_getMarkersDataForGroup'](_0x41b8a8))['flat'](),_0x449223=new Map();for(const _0x231e43 of _0x1cd4d1)_0x449223['has'](_0x231e43['editor'])||_0x449223['set'](_0x231e43['editor'],[]),_0x449223['get'](_0x231e43['editor'])['push'](_0x231e43);for(const [_0x500b87,_0x425013]of _0x449223)_0x500b87['model']['change'](_0x5751fb=>{for(const _0x6a5bcc of _0x425013)_0x500b87['model']['markers']['get'](_0x6a5bcc['id'])&&(_0x5751fb['removeMarker'](_0x6a5bcc['id']),this['_markers']['delete'](_0x6a5bcc['id']));});}getEditor(){return tn(this['context']);}getEditors(){return Zs(this['context']);}getEditorForChange(_0x3cc29e){return this['_getMarkersDataForGroup'](_0x3cc29e)[0x0]?.['editor'];}getMarkerElementForChange(_0x38a594){const _0x2c42aa=Array['from'](this['_markers']['values']())['filter'](_0x3169cc=>_0x3169cc['groupId']===_0x38a594);if(!_0x2c42aa['length'])return null;const _0x5cc48a=0x1===_0x2c42aa['length']?_0x2c42aa[0x0]:this['_sortMarkers'](_0x2c42aa)[0x0],_0x495c87=_0x5cc48a['editor']['model']['markers']['get'](_0x5cc48a['id']);return _0x495c87?{'modelRange':_0x495c87['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x5cc48a['id'])}:null;}getContentElementForChange(_0x39e0ae){const _0x41e1b4=Array['from'](this['_markers']['values']())['filter'](_0x30ada9=>_0x30ada9['groupId']===_0x39e0ae);if(!_0x41e1b4['length'])return null;const _0x2acaf9=0x1===_0x41e1b4['length']?_0x41e1b4[0x0]:this['_sortMarkers'](_0x41e1b4)[0x0],_0x39b2cb=_0x2acaf9['editor'],_0x1860d4=_0x39b2cb['model']['markers']['get'](_0x2acaf9['id']);if(!_0x1860d4)return null;const _0x106eb9=_0x1860d4['getRange'](),_0x55325b=_0x39b2cb['editing']['view']['getDomRoot'](_0x106eb9['root']['rootName'])||_0x39b2cb['editing']['view']['getDomRoot']();if(!_0x55325b||!_0x106eb9)return null;let _0x42975f=_0x106eb9['start']['parent'];for(;_0x42975f['parent']&&!_0x42975f['parent']['is']('rootElement');)_0x42975f=_0x42975f['parent'];if(!_0x42975f||!_0x42975f['name'])return null;const _0x2cfde4=_0x55325b['querySelector']('[data-marker-id=\x22'+_0x2acaf9['id']+'\x22]');if(!_0x2cfde4)return null;if(_0x42975f['is']('rootElement'))return _0x2cfde4;let _0x511229=null;_0x39b2cb['model']['change'](_0x122389=>{_0x511229=_0x122389['createDocumentFragment'](),_0x122389['append'](_0x42975f['_clone'](!0x0),_0x511229);});const _0x46b847=_0x39b2cb['data']['toView'](_0x511229)['getChild'](0x0);return _0x2cfde4['closest'](_0x46b847['name']);}reactivateMarkers(_0x1a7c25){const _0x4fe6de=this['_getMarkersDataForGroup'](_0x1a7c25);if(!_0x4fe6de['length'])return;const _0x4249e1=Array['from'](this['_activeMarkers'])['sort'](),_0x2250f8=Array['from'](new Set(_0x4fe6de['map'](_0x315bf9=>_0x315bf9['id'])))['sort']();_0x4249e1['join']('|')!==_0x2250f8['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x1a7c25));}setMarkersInElementAsActive(_0x17381e){const _0x483533=this['_getMarkersDataForGroup'](_0x17381e);if(!_0x483533['length'])return;const _0x4bb253=_0x483533[0x0]['editor'],_0x37001b=new Set(_0x483533['map'](_0x59ffe3=>_0x59ffe3['id'])),_0x48cd6f=Array['from'](_0x37001b['values']())['map'](_0x11ad68=>_0x4bb253['model']['markers']['get'](_0x11ad68))['filter'](_0xaf3e9a=>!!_0xaf3e9a);_0x37001b['forEach'](_0x22e429=>{this['_activeMarkers']['add'](_0x22e429);}),_0x4bb253['model']['change'](()=>{_0x48cd6f['forEach'](_0x352d7c=>{_0x4bb253['editing']['reconvertMarker'](_0x352d7c);});});}setAllMarkersAsInactive(){const _0x454455=Array['from'](this['_activeMarkers']);if(!_0x454455['length'])return;this['_activeMarkers']['clear']();const _0x38f4f9=new Map();for(const _0x98538c of _0x454455){const _0x3f2589=this['_markers']['get'](_0x98538c);if(!_0x3f2589)continue;const _0x1573e2=_0x3f2589['editor'],_0x58a7e8=_0x1573e2['model']['markers']['get'](_0x98538c);_0x58a7e8&&(_0x38f4f9['has'](_0x1573e2)||_0x38f4f9['set'](_0x1573e2,[]),_0x38f4f9['get'](_0x1573e2)['push'](_0x58a7e8));}for(const [_0x21b9fd,_0x24faf8]of _0x38f4f9)_0x21b9fd['model']['change'](()=>{_0x24faf8['forEach'](_0x89037e=>{_0x21b9fd['editing']['reconvertMarker'](_0x89037e);});});}_getTrailingSoftBreaks(_0x39a5e9){const _0x13bb08=Array['from'](_0x39a5e9['getChildren']());let _0x4e99c5=_0x13bb08['length'];const _0x23c103=_0x13bb08[_0x4e99c5-0x1];_0x23c103&&_0x23c103['is']('$text')&&''===_0x23c103['data']['trim']()&&_0x4e99c5--;let _0x31063e=_0x4e99c5;for(;_0x31063e>0x0&&_0x13bb08[_0x31063e-0x1]['is']('element','softBreak');)_0x31063e--;return _0x13bb08['slice'](_0x31063e,_0x4e99c5);}_getPositionLimitingRange(_0x225106,_0x125013,_0x560eb8='outside'){if(!_0x225106)return null;let _0x52eae2=_0x225106['parent'];for(;_0x52eae2&&_0x52eae2['parent']&&!_0x52eae2['parent']['is']('rootElement')&&!_0x125013['model']['schema']['isLimit'](_0x52eae2)&&!_0x125013['model']['schema']['isBlock'](_0x52eae2);)_0x52eae2=_0x52eae2['parent'];if(!_0x52eae2||!_0x52eae2['name']||_0x52eae2['is']('rootElement'))return null;let _0x57c1d3=null;return _0x125013['model']['change'](_0x1e7f6d=>{_0x57c1d3='inside'===_0x560eb8?_0x1e7f6d['createRangeIn'](_0x52eae2):_0x1e7f6d['createRangeOn'](_0x52eae2);}),_0x57c1d3;}_validateMarkers(_0x205cb0,_0x3a7fd7){const _0xd3ff6d=Array['from'](this['_markers']['keys']()),_0x1c2190=new Map();for(const _0x5afaf3 of _0xd3ff6d){const _0x50e4e8=_0x205cb0['model']['markers']['get'](_0x5afaf3);if(!_0x50e4e8)continue;const _0x37374a=_0x50e4e8['getStart']()['root']['rootName']+':'+_0x50e4e8['getStart']()['path'][0x0];_0x1c2190['has'](_0x37374a)||_0x1c2190['set'](_0x37374a,[]),_0x1c2190['get'](_0x37374a)['push'](_0x50e4e8);}const _0x37bce3=new Set();for(const _0x593471 of _0x205cb0['model']['document']['differ']['getChanges']()){let _0x2bfa6c,_0x29b4e5;if('insert'===_0x593471['type'])_0x29b4e5=new _0x3aaa22(_0x593471['position'],_0x593471['position']['getShiftedBy'](_0x593471['length'])),_0x2bfa6c=_0x593471['position']['root']['rootName']+':'+_0x593471['position']['path'][0x0];else{if('remove'!==_0x593471['type'])continue;_0x29b4e5=new _0x3aaa22(_0x593471['position']),_0x2bfa6c=_0x593471['position']['root']['rootName']+':'+_0x593471['position']['path'][0x0];}const _0x207deb=_0x1c2190['get'](_0x2bfa6c)||[];if(_0x207deb['length']){for(const _0x13907b of _0x207deb)if(_0x29b4e5['root']['rootName']===_0x13907b['getRange']()['root']['rootName']&&('insert'!==_0x593471['type']||!_0x29b4e5['containsRange'](_0x13907b['getRange']()))&&(_0x29b4e5['isIntersecting'](_0x13907b['getRange']())||_0x29b4e5['start']['isTouching'](_0x13907b['getRange']()['end'])||_0x29b4e5['end']['isTouching'](_0x13907b['getRange']()['start']))){const _0x4b20a9=this['_parseMarkerName'](_0x13907b['name']);Array['from'](this['_markers']['values']())['filter'](_0x168622=>_0x168622['groupId']===_0x4b20a9['groupId'])['forEach'](_0x2c2387=>_0x37bce3['add'](_0x2c2387['id']));}}}if(_0x37bce3['size']){for(const _0x18892c of _0x37bce3)_0x3a7fd7['removeMarker'](_0x18892c);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0xec9c02){for(const {name:_0x5c14be,data:_0x520feb}of _0xec9c02['model']['document']['differ']['getChangedMarkers']()){if(!_0x5c14be['startsWith'](Wc))continue;const _0x14a4cd=_0x520feb['oldRange'],_0x347fdc=_0x520feb['newRange'],_0x230303=_0x14a4cd&&'$graveyard'===_0x14a4cd['root']['rootName'],_0x2498ec=_0x347fdc&&'$graveyard'===_0x347fdc['root']['rootName'];if(_0x230303&&_0x2498ec)continue;const _0x1ad1a6=this['_parseMarkerName'](_0x5c14be);this['_markers']['get'](_0x5c14be)&&(_0x2498ec||!_0x347fdc?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x5c14be,'changeId':_0x1ad1a6['groupId']}):_0x230303&&_0x347fdc&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x5c14be,'changeId':_0x1ad1a6['groupId']}));}}['_parseMarkerName'](_0x481585){const _0x4759a1=_0x481585['split'](':'),_0xf508ed=(_0x4759a1[0x1]||'')['split']('_');return{'prefix':_0x4759a1[0x0],'groupId':_0xf508ed[0x0],'suffix':_0xf508ed[0x1]};}_translateOperationToEditorContent(_0x39ef54,_0x1a5880,_0x37ff16){if('insert'===_0x39ef54['type']){const _0x47842d=_0x39ef54;return new _0x38210e(this['_changePosition'](_0x1a5880['concat'](_0x47842d['position']['offset']),_0x37ff16),_0x47842d['nodes'],_0x47842d['baseVersion']);}if('marker'===_0x39ef54['type']&&_0x39ef54['name']['startsWith']('$markedRemove')){const _0x4a3d85=_0x39ef54;return new _0x2070bd(_0x4a3d85['name'],_0x4a3d85['oldRange'],this['_changeRange'](_0x4a3d85['newRange'],_0x1a5880['concat'](_0x4a3d85['newRange']['start']['offset']),_0x1a5880['concat'](_0x4a3d85['newRange']['end']['offset']),_0x37ff16),_0x4a3d85['_markers'],_0x4a3d85['affectsData'],_0x4a3d85['baseVersion']);}return _0x39ef54;}_groupAdjacentOperations(_0x41cb5f){if(!_0x41cb5f['length'])return[];const _0x56af39=[];let _0x2b3ba1=0x0,_0x550aee=0x0,_0x2f5ca1=[];for(let _0x384b47=0x0;_0x384b47<=_0x41cb5f['length'];_0x384b47++){const _0x540c7c=_0x41cb5f[_0x384b47],_0x19be80=_0x41cb5f[_0x384b47-0x1];!_0x540c7c||_0x19be80&&!this['_getOperationEnd'](_0x19be80)['isTouching'](this['_getOperationStart'](_0x540c7c))?(_0x56af39['push']({'operations':_0x2f5ca1,'operationsIsolated':_0x2f5ca1['map'](_0x1dc46b=>this['_shiftOperation'](_0x1dc46b['clone'](),-_0x550aee)),'groupOffset':_0x2b3ba1}),_0x2f5ca1=_0x540c7c?[_0x540c7c]:[],_0x550aee+=_0x2b3ba1,_0x2b3ba1=0x0):_0x2f5ca1['push'](_0x540c7c),_0x540c7c&&'insert'===_0x540c7c['type']&&(_0x2b3ba1+=_0x540c7c['howMany']);}return _0x56af39;}_findAdjacentContextDistance(_0x3e7143,_0x5c7872,_0x1ad375,_0x30af8e=0x1){const _0x8a2ef3=new _0x3d1b58({'startPosition':_0x3e7143,'direction':_0x5c7872});let _0x2e7b30=0x0;for(let _0x2ce3ce=0x0;_0x2ce3ce<_0x30af8e;_0x2ce3ce++){let _0x269685=0x0,_0x1ea706=!0x1,_0x54a3c2='forward'===_0x5c7872?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x11f6ee}of _0x8a2ef3)if(_0x11f6ee['is']('$textProxy')){const _0x579482=_0x54a3c2['exec'](_0x11f6ee['data']);if(_0x579482&&_0x579482['length']){if(_0x269685+='forward'===_0x5c7872?_0x579482['index']+_0x579482[0x0]['length']:_0x11f6ee['data']['length']-_0x579482['index'],_0x579482[0x0]['length']!==_0x11f6ee['data']['length'])break;_0x1ea706=!0x0,_0x54a3c2='forward'===_0x5c7872?/^\w+/:/\w+$/;}else{if(_0x1ea706)break;_0x269685+=_0x11f6ee['offsetSize'];}}else{if(_0x11f6ee['is']('element')){_0x1ad375['isInline'](_0x11f6ee)&&!_0x1ea706&&(_0x269685+=0x1);break;}}_0x2e7b30+=_0x269685,_0x8a2ef3['jumpTo'](_0x3e7143['getShiftedBy']('forward'===_0x5c7872?_0x2e7b30:-_0x2e7b30));}return _0x2e7b30;}_getChangeContext(_0x535fab,_0x5ea329,_0x4141e8){const _0x35fa38=_0x4141e8['model']['schema'],_0x5b5ade=this['_findAdjacentContextDistance'](_0x535fab,'backward',_0x35fa38,0x6),_0x34ba0f=this['_findAdjacentContextDistance'](_0x5ea329,'forward',_0x35fa38,0x6),_0x5ce7b3=_0x535fab['getShiftedBy'](-_0x5b5ade),_0x4d6490=_0x5ea329['getShiftedBy'](_0x34ba0f);return{'start':_0x5ce7b3,'end':_0x4d6490,'hasContentBefore':!_0x5ce7b3['isAtStart'],'hasContentAfter':!_0x4d6490['isAtEnd']};}_insertMarkers(_0x1737c8,_0x3c51f6){const _0x5d1a54=this['context']['plugins']['get']('AIEditing'),_0x2a347b=new Set();_0x3c51f6['model']['change'](_0xc93e80=>{for(const _0x2bc5e9 of _0x1737c8){const _0x3d043d=''+Wc+_0x2bc5e9['type']+':'+_0x2bc5e9['groupId']+'_'+_0x5d1a54['_nextDataId'](_0x2a347b);this['_markers']['set'](_0x3d043d,{'id':_0x3d043d,'groupId':_0x2bc5e9['groupId'],'type':_0x2bc5e9['type'],'content':_0x2bc5e9['content'],'editor':_0x3c51f6}),_0xc93e80['addMarker'](_0x3d043d,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xc93e80['createRange'](_0x2bc5e9['start'],_0x2bc5e9['end'])});}});}_createGetContextFn(_0x54201f,_0x2c3f15,_0x88352a){let _0x281171='';return()=>{if(!_0x281171){const _0x2ef02a=_0x2c3f15['toView'](_0x54201f,{'showSuggestionHighlights':!0x0});let _0x35f074=_0x2ef02a['getChild'](0x0);if(_0x35f074['is']('containerElement')||(_0x35f074=_0x2ef02a),!_0x35f074)return'';let _0x139b34=!0x1;const _0x3b1df7=[];for(const _0x38e569 of _0x35f074['getChildren']())_0x38e569['is']('element','span')&&_0x38e569['hasClass']('ck-ai_review-marker_context-end')&&(_0x139b34=!0x1),_0x139b34&&_0x3b1df7['push'](_0x38e569),_0x38e569['is']('element','span')&&_0x38e569['hasClass']('ck-ai_review-marker_context-start')&&(_0x139b34=!0x0);_0x35f074['_removeChildren'](0x0,_0x35f074['childCount']),_0x88352a?.['ellipsisBefore']&&_0x35f074['_appendChild']('…'),_0x35f074['_appendChild'](_0x3b1df7),_0x88352a?.['ellipsisAfter']&&_0x35f074['_appendChild']('…');const _0x34e5dc=_0x2c3f15['htmlProcessor']['domConverter']['viewToDom'](_0x2ef02a),_0x491754=_0x2c3f15['htmlProcessor']['htmlWriter']['getHtml'](_0x34e5dc);_0x281171=this['_removeUnsupportedElements'](_0x491754);}return _0x281171;};}_createGetContentFn(_0x31f291,_0x2b9a18){let _0x2fd361='';return()=>(_0x2fd361||(_0x2fd361=this['_removeUnsupportedElements'](_0x2b9a18['stringify'](_0x31f291,{'showSuggestionHighlights':!0x0}))),_0x2fd361);}_createGetContentUsingDataIdFn(_0xdb51b4,_0x4deed8,_0xcff7a6){let _0x4c476a='';return()=>{if(!_0x4c476a){const _0x4cc3b4=_0xcff7a6['toView'](new _0x1f9306(_0xdb51b4));_0x4c476a=_0xcff7a6['htmlProcessor']['domConverter']['viewToDom'](_0x4cc3b4)['querySelector']('[data-id=\x22'+_0x4deed8+'\x22]')?.['outerHTML']||'';}return _0x4c476a;};}_removeUnsupportedElements(_0x4909b1){if(!_0x4909b1)return'';const _0x3bb142=en(_0x4909b1,{'decodeEntities':!0x1}),_0x387375=on(_0x3bb142);if(!_0x387375['length'])return _0x4909b1;for(const _0xf4395d of _0x387375)_0x15340f(_0xf4395d);return sn(_0x3bb142,{'encodeEntities':!0x1});}_neutralizeChangesOnUnsupportedElements(_0x560cf6,_0x268389){const _0x53ca26=en(_0x560cf6,{'decodeEntities':!0x1}),_0x560880=en(_0x268389,{'decodeEntities':!0x1}),_0x4058d9=on(_0x53ca26),_0x1ab9b0=on(_0x560880);if(!_0x4058d9['length']&&!_0x1ab9b0['length'])return{'contentInitial':_0x560cf6,'contentNew':_0x268389};const _0x8621dd=new Map(),_0x57d125=new Map();for(const _0x31ce42 of _0x4058d9){const _0xd5e76f=ln(_0x31ce42,'data-id');if(_0xd5e76f)_0x8621dd['set'](_0xd5e76f,_0x31ce42);else{const _0x468c41=sn(_0x31ce42,{'encodeEntities':!0x1}),_0x2fc1b4=_0x57d125['get'](_0x468c41);_0x2fc1b4?_0x2fc1b4['push'](_0x31ce42):_0x57d125['set'](_0x468c41,[_0x31ce42]);}}for(const _0x284b96 of _0x1ab9b0){const _0x2b2cf7=ln(_0x284b96,'data-id');let _0x547960;if(_0x2b2cf7)_0x547960=_0x8621dd['get'](_0x2b2cf7);else{const _0x9c364b=_0x57d125['get'](sn(_0x284b96,{'encodeEntities':!0x1}));_0x547960=_0x9c364b&&_0x9c364b['length']?_0x9c364b['shift']():void 0x0;}_0x547960?_0x418ed2(_0x284b96,_0x950ff(_0x547960,!0x0)):_0x15340f(_0x284b96);}return{'contentInitial':sn(_0x53ca26,{'encodeEntities':!0x1}),'contentNew':sn(_0x560880,{'encodeEntities':!0x1})};}_findMarkerElement(_0x1508e1,_0x5baa9c=0x5){let _0x2c5bbb=_0x1508e1,_0x5ccddc=null;for(let _0x361cf9=0x0;_0x361cf9<_0x5baa9c&&_0x2c5bbb;_0x361cf9++)if(_0x2c5bbb instanceof HTMLElement&&_0x2c5bbb['className']){if((''+_0x2c5bbb['className'])['includes']('ck-ai_review-marker_')){if(!_0x2c5bbb['getAttribute']('data-marker-id'))break;_0x5ccddc=_0x2c5bbb;break;}_0x2c5bbb=Lt(_0x2c5bbb);}else _0x2c5bbb=Lt(_0x2c5bbb);return _0x5ccddc;}_findMarkerElementById(_0x499253){const _0x275dc6=this['_markers']['get'](_0x499253);if(!_0x275dc6)return null;const _0x5af4a9=_0x275dc6['editor']['model']['markers']['get'](_0x499253);return _0x5af4a9?_0x4e2022(_0x275dc6['editor']['editing'],_0x5af4a9):null;}_getMarkersDataForGroup(_0x52d4ad){return Array['from'](this['_markers']['values']())['filter'](_0x1f1164=>_0x1f1164['groupId']===_0x52d4ad);}_getOperationStart(_0x10298b){return'insert'===_0x10298b['type']?_0x10298b['position']:_0x10298b['newRange']['start'];}_getOperationEnd(_0x1f056e,_0x37ce70=!0x1){return'insert'===_0x1f056e['type']?_0x37ce70?_0x1f056e['position']:_0x1f056e['position']['getShiftedBy'](_0x1f056e['howMany']):_0x1f056e['newRange']['end'];}_shiftOperation(_0x272695,_0x3207d5){return'insert'===_0x272695['type']?_0x272695['position']=_0x272695['position']['getShiftedBy'](_0x3207d5):'marker'===_0x272695['type']&&_0x272695['newRange']&&(_0x272695['newRange']=new _0x3aaa22(_0x272695['newRange']['start']['getShiftedBy'](_0x3207d5),_0x272695['newRange']['end']['getShiftedBy'](_0x3207d5))),_0x272695;}_changeOperationOwnerDocument(_0x737861,_0x4251da){'insert'===_0x737861['type']?_0x737861['position']=this['_changePositionOwnerDocument'](_0x737861['position'],_0x4251da):'marker'===_0x737861['type']&&_0x737861['newRange']&&(_0x737861['newRange']=this['_changeRangeOwnerDocument'](_0x737861['newRange'],_0x4251da));}_changePositionOwnerDocument(_0x11debe,_0x2256bb){return new _0x265910(_0x2256bb,_0x11debe['path']);}_changeRangeOwnerDocument(_0x3e71af,_0x52eda6){return new _0x3aaa22(this['_changePositionOwnerDocument'](_0x3e71af['start'],_0x52eda6),this['_changePositionOwnerDocument'](_0x3e71af['end'],_0x52eda6));}_changePosition(_0x2a28c2,_0x470d9f){return new _0x265910(_0x470d9f,[..._0x2a28c2]);}_clampPositionToParent(_0x272c8a){const _0x537792=_0x272c8a['parent'];return!_0x537792['is']('element')||_0x272c8a['offset']<=_0x537792['maxOffset']?_0x272c8a:_0x265910['_createAt'](_0x537792,_0x537792['maxOffset']);}['_changeRange'](_0x1c7fa1,_0xf520d1,_0x7b31c4,_0xaef808){return new _0x3aaa22(this['_changePosition'](_0xf520d1,_0xaef808),this['_changePosition'](_0x7b31c4,_0xaef808));}_sortMarkers(_0x31945c){const _0x399207=_0x1f05e3=>{switch(_0x1f05e3){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x31945c['sort']((_0x369e67,_0x4daf18)=>_0x399207(_0x369e67['type'])-_0x399207(_0x4daf18['type']));}_hasSameTopLevelElement(_0x1f7598,_0x32514f){const _0x42dbbc=_0x1f7598['getChild'](0x0),_0x1dcba1=_0x32514f['getChild'](0x0);return!(!_0x42dbbc||!_0x1dcba1)&&((!_0x42dbbc['is']('element')||!_0x1dcba1['is']('element')||_0x42dbbc['name']===_0x1dcba1['name'])&&!(_0x42dbbc['is']('element')&&!_0x1dcba1['is']('element')||!_0x42dbbc['is']('element')&&_0x1dcba1['is']('element')));}_haveSingleTopLevelElement(_0x2ea7e0){return 0x1===_0x2ea7e0['childCount'];}_haveOnlyInlineContent(_0x457aea,_0x1f235d){for(const _0x59cf0e of _0x457aea['getChildren']())if(_0x59cf0e['is']('element')&&!_0x1f235d['isInline'](_0x59cf0e))return!0x1;return!0x0;}_upsertDataId(_0x67b0e4,_0x53235a){let _0xb1ab58=_0x67b0e4['getAttribute'](Vn);return _0xb1ab58||(_0xb1ab58=_0x53235a(),_0x67b0e4['_setAttribute'](Vn,_0xb1ab58)),_0xb1ab58;}};const Yc=/* #__PURE__ -- @preserve */
38
+ It();var qc=class extends Yc{['id'];contentNew;contentInitial;documentVersion;constructor({id:_0x1f02c9,contentNew:_0x27ad1f,contentInitial:_0x4ef39a,documentVersion:_0x472be2}){super(),this['id']=_0x1f02c9,this['contentNew']=_0x27ad1f,this['contentInitial']=_0x4ef39a,this['documentVersion']=_0x472be2;}};const Qc=/* #__PURE__ -- @preserve */
39
+ mt();var Xc=class extends Qc{['id'];parent;editor;_data;_editorOperations=[];constructor(_0x20cc3f,_0x2ab10d,_0x1978e7,_0x33755b){super(),this['id']=_0x20cc3f,this['parent']=_0x1978e7,this['editor']=_0x33755b,this['_data']=_0x2ab10d,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']['wrapperTag']?function(_0x249d2a){const _0x34caad=en(_0x249d2a)['children']['filter'](_0x58049c);return 0x1!==_0x34caad['length']?_0x249d2a:_0x34caad[0x0]['children']['map'](_0x199c30=>sn(_0x199c30))['join']('');}(this['_data']['context']()):this['_data']['context']();}get['wrapperTag'](){return this['_data']['wrapperTag'];}get operations(){return this['_data']['operations']['slice']();}get operationsIsolated(){return this['_data']['operationsIsolated']['slice']();}};const zc=/* #__PURE__ -- @preserve */
40
+ mt();var jc=class extends zc{get['isUnresolved'](){return'initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['pendingChangesCount']>0x0;}['id']=Xt();['callId'];_results=new Map();['_changes']=[];_hasUnsupportedInlineChange=!0x1;['_sourceCheck'];_documentData;_aiConnector;['_reviewParams'];['_reviewArgs'];_context;_activeRequest=null;_currentError;_wasAborted=!0x1;constructor(_0x1cc65b,_0x31feb8,_0x455d49,_0xd8d54f,_0x41d36f,_0x5161e3=new nr()){super(),this['_sourceCheck']=_0x31feb8,this['_documentData']=_0x1cc65b,this['_aiConnector']=_0x455d49,this['_reviewParams']=_0xd8d54f,this['_reviewArgs']=_0x41d36f,this['_context']=_0x5161e3,this['on']('change:status',(_0x3be6bb,_0x24190f,_0x59d6ec)=>{'aborted'==_0x59d6ec&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x59d6ec,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get documentData(){return this['_documentData'];}get['sourceCheck'](){return this['_sourceCheck'];}get processedResultsCount(){return this['_results']['size'];}get hasUnsupportedInlineChange(){return this['_hasUnsupportedInlineChange'];}get title(){return this['_sourceCheck']['title'];}get subTitle(){return'';}get['reviewName'](){return this['_sourceCheck']['id'];}get hasModifications(){return!this['_changes']['every'](_0x147f1c=>'pending'===_0x147f1c['status']);}get currentError(){return this['_currentError'];}get results(){return Array['from'](this['_results']['values']());}updateDocumentData(_0x40eeca){this['_documentData']=_0x40eeca;}async start(){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x291936=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x1419b9 of _0x291936)'unmodified'!==_0x1419b9['data']['operation']&&('error'!==_0x1419b9['data']['operation']?'review-metadata'!==_0x1419b9['event']?this['_addReviewCheckResult'](_0x1419b9['data']['dataId'],_0x1419b9['data']['textDelta']):this['callId']=_0x1419b9['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(_0x20a767){this['_currentError']=_0x20a767,lr(_0x20a767)?this['status']='aborted':this['status']='error-general';}finally{this['_activeRequest']=null;}}async restart(){this['_results']['clear'](),this['_changes']['length']=0x0,this['_currentError']=void 0x0,this['_hasUnsupportedInlineChange']=!0x1,await this['start']();}addResultChanges(_0x24d1ba,_0x24ae70){const _0x1288c7=this['_results']['get'](_0x24d1ba);if(!_0x1288c7)return;if(0x0===_0x24ae70['length'])return;const _0x144b42=this['_documentData']['elements']['get'](_0x24d1ba);if(!_0x144b42)return;const _0x3babe7=[];_0x24ae70['forEach']((_0x37c2d0,_0x1582a6)=>{const _0x2e1de7=new Xc(_0x1288c7['id']+'-'+_0x1582a6,_0x37c2d0,_0x1288c7,_0x144b42['editor']);_0x2e1de7['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x2e1de7,'status':_0x2e1de7['status']});}),_0x2e1de7['on']('change:isActivated',()=>{_0x2e1de7['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x2e1de7}):this['fire']('reviewCheckResultDeactivated',{'change':_0x2e1de7});}),this['_changes']['push'](_0x2e1de7),_0x3babe7['push'](_0x2e1de7);}),this['fire']('reviewCheckResultReady',{'changes':_0x3babe7,'result':_0x1288c7,'source':this});}abort(){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}isChangeActive(_0x4f5f5c){const _0x37e7ea=this['_changes']['find'](_0x4285ef=>_0x4285ef['id']===_0x4f5f5c);return!(!_0x37e7ea||'pending'!==_0x37e7ea['status']);}isAnyChangeActivated(){return this['_changes']['some'](_0x33439b=>!0x0===_0x33439b['isActivated']);}getActiveChanges(){return this['_changes']['filter'](_0x2c1ed4=>'pending'===_0x2c1ed4['status']);}getChangeById(_0x1c1934){return this['_changes']['find'](_0x46263f=>_0x46263f['id']===_0x1c1934);}getChangePosition(_0x47b4b9){return this['_changes']['findIndex'](_0x27b769=>_0x27b769['id']===_0x47b4b9)+0x1;}get totalChangesCount(){return this['_changes']['length'];}get pendingChangesCount(){return this['getActiveChanges']()['length'];}get reviewedChangesCount(){return this['totalChangesCount']-this['pendingChangesCount'];}markAllChangesAsAccepted(){for(const _0x5bf48f of this['_changes'])'pending'===_0x5bf48f['status']&&(_0x5bf48f['status']='accepted');this['_checkIfFinished']();}markAllChangesAsRejected(){for(const _0x511235 of this['_changes'])'pending'===_0x511235['status']&&(_0x511235['status']='rejected');this['_checkIfFinished']();}markChangeAsAccepted(_0x56c763){const _0x5d1028=this['_changes']['find'](_0x5c47d1=>_0x5c47d1['id']===_0x56c763);_0x5d1028&&'pending'===_0x5d1028['status']&&(_0x5d1028['status']='accepted'),this['_checkIfFinished']();}markChangeAsRejected(_0x39418d){const _0x47f295=this['_changes']['find'](_0x2eec64=>_0x2eec64['id']===_0x39418d);_0x47f295&&'pending'===_0x47f295['status']&&(_0x47f295['status']='rejected'),this['_checkIfFinished']();}markChangeAsOutdated(_0x1f099d){const _0x1c58cc=this['_changes']['find'](_0x418207=>_0x418207['id']===_0x1f099d);_0x1c58cc&&'pending'===_0x1c58cc['status']&&(_0x1c58cc['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x1b1439){const _0x2dedd2=this['_changes']['find'](_0x5519dc=>_0x5519dc['id']===_0x1b1439);_0x2dedd2&&'outdated'===_0x2dedd2['status']&&(_0x2dedd2['status']='pending'),this['_checkIfFinished']();}activateChange(_0x20785c){this['_changes']['filter'](_0x3a4ab1=>_0x3a4ab1['isActivated']&&_0x3a4ab1['id']!==_0x20785c)['forEach'](_0x3a296c=>{_0x3a296c['isActivated']=!0x1;});const _0x44846a=this['_changes']['find'](_0x27e903=>_0x27e903['id']===_0x20785c);_0x44846a&&'pending'===_0x44846a['status']&&(_0x44846a['isActivated']=!0x0);}deactivateChange(){this['_changes']['filter'](_0xadaf5f=>_0xadaf5f['isActivated'])['forEach'](_0x4017c7=>{_0x4017c7['isActivated']=!0x1;});}forceReadyState(){this['status']='ready';}async sendRating(_0x513ea8){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x1ad2b6;if(_0x513ea8){const _0x5e113e=this['_changes']['find'](_0x2d5f22=>_0x2d5f22['id']===_0x513ea8);if(_0x5e113e&&_0x5e113e['isRated'])return;_0x5e113e&&(_0x1ad2b6=_0x5e113e['parent']['id'],_0x5e113e['isRated']=!0x0);}const _0x52c7f2={'positiveCount':this['_changes']['filter'](_0x436a3e=>'accepted'===_0x436a3e['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x52c7f2,this['callId'],_0x1ad2b6);}_addReviewCheckResult(_0x1ef781,_0x35c687){const _0x4555c2=this['_documentData']['elements']['get'](_0x1ef781);if(!_0x4555c2)return;if(En(_0x4555c2['editor'],_0x4555c2['rootName'])&&!wn(_0x4555c2['editor'],en(_0x35c687)))return void(this['_hasUnsupportedInlineChange']=!0x0);const _0x1313dc=_0x4555c2['getContent']();if(_0x1313dc===_0x35c687)return;const _0x5e2da8=new qc({'id':_0x1ef781,'contentInitial':_0x1313dc,'contentNew':_0x35c687,'documentVersion':_0x4555c2['documentVersion']});this['_results']['set'](_0x5e2da8['id'],_0x5e2da8),this['fire']('reviewCheckResultAdded',{'result':_0x5e2da8,'source':this,'editor':_0x4555c2['editor'],'rootName':_0x4555c2['rootName']});}['_checkIfFinished'](){'finished'===this['status']&&this['_changes']['filter'](_0xca358b=>'pending'===_0xca358b['status'])['length']>0x0&&(this['status']='ready'),'ready'===this['status']&&0x0===this['_changes']['filter'](_0x3b0c65=>'pending'===_0x3b0c65['status'])['length']&&(this['status']='finished');}},Jc=class extends jc{get subTitle(){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x2a4373=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x25d500=0x0;_0x25d500<this['_reviewParams']['length'];_0x25d500++){if(!this['_reviewParams'][_0x25d500]||!this['_sourceCheck']['options'][_0x25d500])continue;const _0x3a5220=this['_sourceCheck']['options'][_0x25d500]['data']?.['find'](_0x882d8c=>_0x882d8c['id']===this['_reviewParams'][_0x25d500]);_0x3a5220&&_0x2a4373['push'](_0x3a5220['label']);}return _0x2a4373['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}_createApiRequest(){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs'],'contexts':this['_context']['toRequestContexts']()});}_sendRatingRequest(_0xbd1376,_0x54b8e9,_0x8b37c1){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x54b8e9,_0xbd1376,_0x8b37c1);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}},Zc=class extends _0x4cd5fc{_aiConnector;['_aiTabs'];['_aiReviewCoreUi'];_aiReviewCoreEditing;['_availableReviewChecks'];_reporter;_currentReviewCheckRun;_changeActivationSource=null;_shouldAcceptAsSuggestion(){return!0x1;}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_initRequiredPlugins'](),this['_initAvailableReviewChecks'](),this['_initUIListeners']();}async _initAvailableReviewChecks(){try{this['_availableReviewChecks']=await this['_getReviewChecks'](),this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}finally{this['_aiReviewCoreUi']['toggleLoadingSkeleton'](!0x1);}}_initUIListeners(){this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_availableReviewChecks']&&this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',(_0x547339,_0x3dcf00)=>this['runCheck'](_0x3dcf00)),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_currentReviewCheckRun']?.['isUnresolved']?this['_aiReviewCoreUi']['showLeaveConfirmationDialog'](this['_leaveConfirmationDialogOptions'],()=>{this['_onReviewRunLeave'](!0x0);}):this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>this['abort']()),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x3eec84=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x3eec84['length'])return;this['_shouldAcceptAsSuggestion']()?this['_aiReviewCoreEditing']['applyChangesAsSuggestions'](_0x3eec84['map'](_0x48bb11=>_0x48bb11['id']),this['_aiSource']):this['_aiReviewCoreEditing']['applyChange'](_0x3eec84['map'](_0x37191b=>_0x37191b['id']),this['_aiSource']);const _0x38c9fa=this['_currentReviewCheckRun'];_0x38c9fa['markAllChangesAsAccepted'](),_0x38c9fa['sendRating'](),this['_leaveReviewAfterBulkAction']();}),this['listenTo'](this['_aiReviewCoreUi'],'rejectAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x3646a5=this['_currentReviewCheckRun'],_0x2040cc=_0x3646a5['getActiveChanges']();_0x2040cc['length']&&(this['_aiReviewCoreEditing']['rejectAllChanges'](_0x2040cc['map'](({id:_0x1b77c4})=>_0x1b77c4)),_0x3646a5['markAllChangesAsRejected'](),_0x3646a5['sendRating'](),this['_leaveReviewAfterBulkAction']());}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x5a8132,_0x1d98e0)=>{if(!this['_currentReviewCheckRun']||!this['_currentReviewCheckRun']['isChangeActive'](_0x1d98e0['id']))return;const _0x54a033=this['_getPendingChangeIndex'](_0x1d98e0['id']);this['_aiReviewCoreEditing']['applyChange']([_0x1d98e0['id']],this['_aiSource']),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x1d98e0['id']),this['_onChangeResolved'](_0x54a033),this['_currentReviewCheckRun']['sendRating'](_0x1d98e0['id']);}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x311351,_0x32529a)=>{if(!this['_currentReviewCheckRun']||!this['_currentReviewCheckRun']['isChangeActive'](_0x32529a['id']))return;const _0x10f0d2=this['_getPendingChangeIndex'](_0x32529a['id']);this['_aiReviewCoreEditing']['rejectChange'](_0x32529a['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x32529a['id']),this['_onChangeResolved'](_0x10f0d2),this['_currentReviewCheckRun']['sendRating'](_0x32529a['id']);}),this['listenTo'](this['_aiReviewCoreUi'],'suggestChange',(_0x3eaef0,_0x5791b7)=>{if(!this['_currentReviewCheckRun']||!this['_currentReviewCheckRun']['isChangeActive'](_0x5791b7['changeId']))return;const _0x2c060d=this['_getPendingChangeIndex'](_0x5791b7['changeId']);this['_aiReviewCoreEditing']['applyChangesAsSuggestions']([_0x5791b7['changeId']],this['_aiSource']),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x5791b7['changeId']),this['_onChangeResolved'](_0x2c060d),this['_currentReviewCheckRun']['sendRating'](_0x5791b7['changeId']);}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreUi']['hideNavigationPanel'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreUi']['setHasPendingChanges'](!0x1),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x25981f,_0x1a5cad)=>{this['_onActivateChange'](_0x1a5cad);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x18b298,_0x124e19)=>{this['_onDeactivateChange'](_0x124e19);}),this['listenTo'](this['_aiReviewCoreUi'],'navigateChange',(_0x270eca,_0x320d1a)=>{this['_onNavigateChange'](_0x320d1a['direction']);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x491e6d,_0x5f20d5)=>{this['_onChangeMarkerClicked'](_0x491e6d,_0x5f20d5);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x258c5d,_0x62e90e)=>{this['_onChangeMarkerHovered'](_0x258c5d,_0x62e90e);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x20bac2,_0x126095)=>{this['_onChangeMarkerRemoved'](_0x20bac2,_0x126095);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x1d5d2b,_0x4e6d68)=>{this['_onChangeMarkerRestored'](_0x1d5d2b,_0x4e6d68);}),this['listenTo'](this['_aiTabs']['view'],'beforeActivateTab',(_0x248cee,{newTab:_0x475c14,oldTab:_0x53f0cc,resolveActivation:_0x3cb032})=>{_0x475c14!==_0x53f0cc&&_0x53f0cc===this['_aiTabId']&&this['_currentReviewCheckRun']?.['isUnresolved']&&(_0x248cee['stop'](),this['_aiReviewCoreUi']['showLeaveConfirmationDialog'](this['_leaveConfirmationDialogOptions'],()=>{_0x3cb032?_0x3cb032(!0x0):this['_aiTabs']['view']['forceActivateTab'](_0x475c14);},()=>{_0x3cb032?.(!0x1);}));});}async['runCheck'](_0x487090){if(this['_hideOpenDialog'](),!this['_availableReviewChecks'])return;const _0x58fcf0=this['_availableReviewChecks']['find'](_0xf863dd=>_0xf863dd['id']===_0x487090['id']);if(!_0x58fcf0)return void this['_logError'](new dt('ai-review-mode-source-check-not-found',this,{'checkId':_0x487090['id']}));this['_onReviewCheckRun'](_0x487090),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_aiReviewCoreUi']['setHasPendingChanges'](!0x1);const _0x453094=this['context']['plugins']['get'](Js)['contextLibrary']['resolveContext']({'feature':this['_defaultContextFeature'],'ids':[_0x487090['id']],'context':new nr()});this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x487090,_0x58fcf0,_0x453094);const _0x149dac=this['_currentReviewCheckRun'];_0x149dac['on']('reviewCheckResultChangeStatusUpdated',(_0x3a9a21,_0x244a15)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x244a15['change']['id'],_0x244a15['status']),this['_aiReviewCoreUi']['updateProgress'](_0x149dac['reviewedChangesCount'],_0x149dac['totalChangesCount']),this['_refreshNavigationPanelPosition'](),this['_pushHasPendingChanges'](_0x149dac);}),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x4987c6,_0x958d91)=>{switch(_0x958d91['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x958d91);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_currentReviewCheckRun']?.['hasUnsupportedInlineChange']?this['_aiReviewCoreUi']['showUnsupportedInlineChangeView']():(this['_aiReviewCoreUi']['updateProgress'](this['_currentReviewCheckRun']['reviewedChangesCount'],this['_currentReviewCheckRun']['totalChangesCount']),this['_aiReviewCoreUi']['showActionsWhenResultIsReady']());break;case'unmodified':this['_currentReviewCheckRun']?.['hasUnsupportedInlineChange']?this['_aiReviewCoreUi']['showUnsupportedInlineChangeView']():this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new dt('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new dt('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'!==_0x958d91['status']&&'error-chunk'!==_0x958d91['status']&&'error-general'!==_0x958d91['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x2689ed,_0x3b1d2e)=>{if(!this['_currentReviewCheckRun'])throw new dt('ai-review-mode-no-current-check-run',this);const _0x112aab=En(_0x3b1d2e['editor'],_0x3b1d2e['rootName']);let _0x9a1e91=_0x3b1d2e['result']['contentInitial'],_0x6c97ac=_0x3b1d2e['result']['contentNew'];_0x112aab&&(_0x9a1e91=Tn(_0x9a1e91),_0x6c97ac=Tn(_0x6c97ac));const _0x31eb01=this['_diffContent'](_0x3b1d2e['editor'],_0x9a1e91,_0x6c97ac);if(_0x112aab){const _0x34d133=_0x3b1d2e['editor']['ui']['getEditableElement'](_0x3b1d2e['rootName'])?.['tagName']['toLowerCase']();for(const _0x2e9c81 of _0x31eb01)_0x2e9c81['wrapperTag']=_0x34d133;}_0x3b1d2e['source']['addResultChanges'](_0x3b1d2e['result']['id'],_0x31eb01);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0xc7729b,_0x4e162d)=>{for(const _0x32a4fc of _0x4e162d['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x32a4fc);this['_pushHasPendingChanges'](_0x4e162d['source']),this['_markChangePositionInEditorContent'](_0x4e162d['changes'],_0x4e162d['source']['documentData']),this['_onReviewCheckResultsRendered'](),this['_refreshNavigationPanelPosition']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x1e30b6,_0x41619c)=>{this['_onReviewCheckResultActivated'](_0x41619c);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x1c72bf){if(lr(_0x1c72bf))return;_0x1c72bf instanceof dt?this['_logError'](_0x1c72bf):this['_logError'](new dt('ai-review-mode-check-run-failed',this,void 0x0,_0x1c72bf));}}abort(){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}getAvailableChecks(){return(this['_availableReviewChecks']??[])['slice']();}getCurrentCheckRun(){return this['_currentReviewCheckRun'];}['_pushHasPendingChanges'](_0xaa0813){this['_aiReviewCoreUi']['setHasPendingChanges'](_0xaa0813['getActiveChanges']()['length']>0x0);}['_hideOpenDialog'](){this['_aiReviewCoreEditing']['getEditors']()['find'](_0x269b15=>_0x269b15['plugins']['has']('AIEditorIntegration'))?.['plugins']['get']('AIEditorIntegration')['dialog']['hide']();}_createReviewCheckRun(_0x29ed2a,_0x498826,_0x45dee4=new nr()){return new Jc(this['_aiReviewCoreEditing']['getDocumentData'](),_0x498826,this['_aiConnector'],_0x29ed2a['params'],_0x29ed2a['args'],_0x45dee4);}_getNavigationPosition(_0x14433b){const _0xed0a1b=this['_currentReviewCheckRun'];return{'index':_0xed0a1b?.['getChangePosition'](_0x14433b)??0x0,'total':_0xed0a1b?.['totalChangesCount']??0x0,'pendingCount':_0xed0a1b?.['pendingChangesCount']??0x0};}_getPendingChangeIndex(_0x554427){return(this['_currentReviewCheckRun']?.['getActiveChanges']()??[])['findIndex'](_0x4bbc3a=>_0x4bbc3a['id']===_0x554427);}_refreshNavigationPanelPosition(){const _0xc1f6b7=(this['_currentReviewCheckRun']?.['getActiveChanges']()['find'](_0x2f6775=>_0x2f6775['isActivated']))?.['id']??this['_aiReviewCoreUi']['getNavigationPanelChangeId']();_0xc1f6b7&&this['_aiReviewCoreUi']['updateNavigationPanelPosition'](this['_getNavigationPosition'](_0xc1f6b7));}_onNavigateChange(_0x4d2400){const _0xa70682=this['_currentReviewCheckRun']?.['getActiveChanges']()??[],_0x2da472=_0xa70682['findIndex'](_0x558b96=>_0x558b96['isActivated']);if(_0xa70682['length']<(-0x1===_0x2da472?0x1:0x2))return;const _0x57d56a=-0x1===_0x2da472?0x0:(_0x2da472+('next'===_0x4d2400?0x1:-0x1)+_0xa70682['length'])%_0xa70682['length'];this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0xa70682[_0x57d56a]['id']);}['_onChangeResolved'](_0x459ed8){const _0x32a4a6=this['_currentReviewCheckRun'];if(!_0x32a4a6?.['pendingChangesCount'])return void this['_aiReviewCoreUi']['hideNavigationPanel']();const _0x3447a0=_0x32a4a6['getActiveChanges'](),_0x2bc49e=Math['max'](_0x459ed8,0x0),_0x193e9d=_0x2bc49e<_0x3447a0['length']?_0x2bc49e:0x0;this['_changeActivationSource']='panel',_0x32a4a6['activateChange'](_0x3447a0[_0x193e9d]['id']);}_onReviewCheckResultsRendered(){}['_onChangeMarkerRemoved'](_0x18aa73,_0x4aae45){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x4aae45['changeId']);}_onChangeMarkerRestored(_0x1c30f8,_0x2cae81){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x2cae81['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['hideNavigationPanel'](),this['_aiReviewCoreUi']['showReviewCompletedView']();}_leaveReviewAfterBulkAction(){this['_currentReviewCheckRun']&&this['_onReviewRunLeave'](!0x0);}_initRequiredPlugins(){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_reporter']=this['context']['plugins']['get'](dr)['createReporter']('aireview'),this['_aiTabs']=this['context']['plugins']['get'](Ks);}['_onReviewRunLeave'](_0x1f4715=!0x1){this['_aiReviewCoreUi']['hideNavigationPanel'](),this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x1f4715&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x3adcba of this['_aiReviewCoreEditing']['getEditors']())_0x3adcba['editing']['view']['change'](_0x56bbf3=>{for(const _0x2e7890 of _0x3adcba['editing']['view']['document']['getRoots']())_0x56bbf3['removeClass']('ck-ai_review-diff',_0x2e7890),_0x56bbf3['removeClass']('ck-ai_review-highlights',_0x2e7890),_0x56bbf3['removeClass']('ck-ai-translate-mode-content',_0x2e7890);});}['_logError'](_0x31f33a){this['_reporter']['logError'](_0x31f33a),'ai-review-mode-models-unable-to-retrieve'===function(_0x16644e){return _0x16644e instanceof ur?_0x16644e['code']:_0x16644e instanceof Error?_0x16644e['message']['match'](/^\S+/)?.[0x0]:void 0x0;}(_0x31f33a)?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']();}['_scrollToChange'](_0x168a03){if(!this['_changeActivationSource'])return;if(this['_aiReviewCoreUi']['scrollResultsToChange'](_0x168a03),'content'===this['_changeActivationSource'])return;const _0x3c6a25=this['_getChangeContentElement'](_0x168a03);_0x3c6a25&&Yt({'target':_0x3c6a25,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}},tl=class extends jc{_prompt;['_model'];constructor(_0x20e1a2,_0x4b08ba,_0x2f15a9,_0x261aac,_0x34d528,_0x3fcc3b){super(_0x2f15a9,_0x261aac,_0x34d528,void 0x0,void 0x0,_0x3fcc3b),this['_prompt']=_0x20e1a2,this['_model']=_0x4b08ba;}get subTitle(){return this['_prompt']??'';}_createApiRequest(){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],...void 0x0!==this['_prompt']&&{'prompt':this['_prompt']},'model':this['_model'],'contexts':this['_context']['toRequestContexts']()});}_sendRatingRequest(_0x1069c0,_0x21b4b5,_0x117bc7){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x21b4b5,_0x1069c0,_0x117bc7);}},el=class{['id'];['commandId'];title;description;isParameterized;['useArgs'];options;['args'];get['apiId'](){return this['commandId'];}constructor(_0x574e7f){this['id']=_0x574e7f['id'],this['commandId']=_0x574e7f['commandId'],this['title']=_0x574e7f['title'],this['description']=_0x574e7f['description'],this['isParameterized']=_0x574e7f['isParameterized'],this['useArgs']=_0x574e7f['useArgs'],this['options']=_0x574e7f['options'],this['args']=_0x574e7f['args'];}},il=class extends el{isExtra=!0x0;prompt;context;['model'];_defaultModel=null;constructor(_0x46aa79,_0x50b061,_0x28da48){super(_0x46aa79),this['prompt']=_0x46aa79['prompt'],this['context']=_0x46aa79['context'],this['model']=_0x46aa79['model'],this['model']?this['_defaultModel']=_0x50b061['find'](_0x51c6d0=>_0x51c6d0['id']===this['model'])||null:this['_defaultModel']=_0x28da48;}get defaultModel(){return this['_defaultModel'];}},sl=class extends tl{get subTitle(){return'';}set prompt(_0x2cc71a){this['_prompt']=_0x2cc71a;}set['model'](_0x322c15){this['_model']=_0x322c15;}},nl=class extends _0x4cd5fc{static get requires(){return[$s,dr];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_cache'];_reporter;init(){this['_reporter']=this['context']['plugins']['get'](dr)['createReporter']('aireview');}getChecksList(){return this['_cache']||(this['_cache']=this['_loadChecksList']()),this['_cache'];}};const rl=[{'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'}]}]}],ol=/* #__PURE__ -- @preserve */
41
+ mt();var al=class extends ol{['_checks']=[];setupChecks(_0x3af79d){this['_checks']=_0x3af79d['map'](_0x9e4982=>new el(_0x9e4982));}get['checks'](){return this['_checks']['slice']();}getCheckById(_0x1e2c55){return this['checks']['find'](_0x17bfaa=>_0x17bfaa['id']===_0x1e2c55);}['removeCheckById'](_0x28153b){this['_checks']=this['_checks']['filter'](_0x56363f=>_0x56363f['id']!==_0x28153b);}},hl=class extends el{['_models']=[];_defaultModel=null;constructor(_0x8bb64e,_0x3515c8,_0x371b46){super(_0x8bb64e),this['_models']=_0x3515c8,this['_defaultModel']=_0x371b46;}get['models'](){return this['_models']['slice']();}get defaultModel(){return this['_defaultModel'];}},cl=class extends al{['_allModels']=[];['_recommendedModels']=[];_defaultModel=null;constructor(_0xff286b,_0x3570b1,_0x589ba2){super(),this['_allModels']=_0xff286b,this['_recommendedModels']=_0x3570b1,this['_defaultModel']=_0x589ba2;}get['allModels'](){return this['_allModels']['slice']();}setupChecks(_0x5cdf8d){this['_checks']=_0x5cdf8d['map'](_0x172d57=>!0x0===_0x172d57['isExtra']?new il(_0x172d57,this['_allModels'],this['_defaultModel']):'custom'===_0x172d57['id']?new hl(_0x172d57,this['_recommendedModels'],this['_defaultModel']):new el(_0x172d57));}},ll=class extends nl{static get['pluginName'](){return'AIReviewModeCheckRegistry';}static get requires(){return[$s,dr,Js];}['_modelsLoadError']=null;constructor(_0x3a1514){super(_0x3a1514),this['context']['config']['define']('ai.review.extraCommands',[]);}get['modelsLoadError'](){return this['_modelsLoadError'];}getExtraChecks(){return this['context']['config']['get']('ai.review.extraCommands')['map'](_0x5114b9=>({'id':_0x5114b9['id'],'commandId':_0x5114b9['id'],'title':_0x5114b9['label'],'description':_0x5114b9['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x5114b9['prompt'],'context':_0x5114b9['context'],'model':_0x5114b9['model']}));}async _loadChecksList(){const _0xe000d9=[...rl,...this['getExtraChecks']()]['map'](_0x160cf6=>_0x160cf6['isExtra']?_0x160cf6:this['_translateReviewCheck'](_0x160cf6)),_0x3c1e2d=this['context']['plugins']['get'](Js);let _0x3cba10;try{_0x3cba10=new cl(await _0x3c1e2d['models']['getAllModels'](),await _0x3c1e2d['models']['getAvailableModels'](),await _0x3c1e2d['models']['getDefault']()),this['_modelsLoadError']=null;}catch(_0x52df96){this['_modelsLoadError']=new dt('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x52df96),this['_reporter']['logError'](this['_modelsLoadError'],{'context':{'operation':'load-review-models'}}),_0x3cba10=new cl([],[],null);}return _0x3cba10['setupChecks'](_0xe000d9),_0x3cba10;}_translateReviewCheck(_0x9b1c39){const _0x45f733='AI_REVIEW_CHECK_'+_0x9b1c39['commandId']['toUpperCase']()['replaceAll']('-','_'),_0x394e37={..._0x9b1c39,'title':this['_translate'](_0x45f733+'_TITLE',_0x9b1c39['title']),'description':this['_translate'](_0x45f733+'_DESCRIPTION',_0x9b1c39['description'])};return _0x9b1c39['options']&&(_0x394e37['options']=_0x9b1c39['options']['map'](_0x231fdd=>({..._0x231fdd,'label':this['_translate'](_0x45f733+'_OPTIONS_LABEL',_0x231fdd['label']||''),'data':_0x231fdd['data']?_0x231fdd['data']['map'](_0x1436bc=>({..._0x1436bc,'label':this['_translate'](_0x45f733+'_OPTIONS_DATA_'+_0x1436bc['id']['toUpperCase'](),_0x1436bc['label'])})):void 0x0}))),_0x394e37;}_translate(_0x3c392f,_0x497363){const _0x13b982=qs(this['context']['locale'],_0x3c392f);return _0x13b982===_0x3c392f?_0x497363:_0x13b982;}},ul=class extends Zc{static get['pluginName'](){return'AIReviewModeController';}static get requires(){return[dr,ll,Js];}get['_aiSource'](){return'review';}_shouldAcceptAsSuggestion(){return Hc(this['context'])&&Uc(this['context']);}get _defaultContextFeature(){return'review';}get['_aiTabId'](){return Sh;}get _leaveConfirmationDialogOptions(){const {context:{locale:_0xc3d834}}=this;return{'dialogId':'aiReviewModeLeaveConfirmation','title':qs(_0xc3d834,'AI_REVIEW_MODE_LEAVE_CONFIRMATION_TITLE'),'content':qs(_0xc3d834,'AI_REVIEW_MODE_LEAVE_CONFIRMATION_CONTENT'),'stayButton':qs(_0xc3d834,'AI_REVIEW_MODE_LEAVE_CONFIRMATION_STAY_BUTTON'),'exitButton':qs(_0xc3d834,'AI_REVIEW_MODE_LEAVE_CONFIRMATION_EXIT_BUTTON')};}['_isDiffOn']=!0x1;['_usesAvailableCommandsConfig'];constructor(_0x434541){super(_0x434541),this['_usesAvailableCommandsConfig']=Boolean(this['context']['config']['get']('ai.review.availableCommands')),this['context']['config']['define']('ai.review.availableCommands',rl['map'](_0x7a9406=>_0x7a9406['id']));}init(){super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x1b7fa5,_0x1f837e)=>{this['_isDiffOn']=_0x1f837e['on'],this['_onDiffChange'](this['_isDiffOn']);});}_initRequiredPlugins(){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}_createReviewCheckRun(_0x545302,_0x4db7f2,_0xf718b5=new nr()){if(_0x545302['isCustom'])return new tl(_0x545302['args']['prompt'],_0x545302['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x4db7f2,this['_aiConnector'],_0xf718b5);if(_0x4db7f2['isExtra']){const _0x7f5d20=_0x4db7f2,_0xfe8222=_0x7f5d20['context']?_0xf718b5['cloneWith'](_0x7f5d20['context']):_0xf718b5;return new sl(_0x545302['args']?.['prompt']??_0x7f5d20['prompt'],_0x545302['args']?.['model']??_0x7f5d20['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x4db7f2,this['_aiConnector'],_0xfe8222);}return new Jc(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4db7f2,this['_aiConnector'],_0x545302['params'],_0x545302['args'],_0xf718b5);}_onReviewCheckResultActivated(_0x1952b8){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x1952b8['change']['id']);const {markerData:_0x2dadeb,editorInstance:_0x186da7}=this['_activateChangeMarkersAndReveal'](_0x1952b8['change']['id']);'content'!==this['_changeActivationSource']&&this['_aiReviewCoreUi']['showNavigationPanel']({'change':_0x1952b8['change'],'position':this['_getNavigationPosition'](_0x1952b8['change']['id']),'getTarget':()=>_0x2dadeb?.['getElement']()??null,'limiter':this['_getBalloonDomRoot'](_0x186da7,_0x2dadeb?.['modelRange']['root']['rootName']),'viewportOffset':_0x186da7?.['ui']?.['viewportOffset']});}_activateChangeMarkersAndReveal(_0x18d91c){return this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x18d91c),this['_scrollToChange'](_0x18d91c),{'markerData':this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x18d91c),'editorInstance':this['_aiReviewCoreEditing']['getEditorForChange'](_0x18d91c)??this['_aiReviewCoreEditing']['getEditor']()};}_onReviewCheckResultsRendered(){if(!this['_currentReviewCheckRun']||this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const [_0x5df475]=this['_currentReviewCheckRun']['getActiveChanges']();_0x5df475&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x5df475['id']));}_revealActivatedChange(_0x5532f5){this['_aiReviewCoreUi']['isNavigationPanelInViewport']()||(this['_changeActivationSource']='panel',this['_onReviewCheckResultActivated']({'change':_0x5532f5}));}_onDeactivateChange(){}['_onChangeMarkerHovered'](){}['_onChangeMarkerBlurred'](){}_onReviewCheckResultDeactivated(){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}_onActivateChange(_0xfcbe2c){if(!this['_currentReviewCheckRun']||'click'!==_0xfcbe2c['uiInteraction'])return;const _0x13ad4b=this['_currentReviewCheckRun']['getChangeById'](_0xfcbe2c['id']);_0x13ad4b?.['isActivated']?this['_revealActivatedChange'](_0x13ad4b):(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0xfcbe2c['id']));}['_onChangeMarkerClicked'](_0x379494,_0x5c0251){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5c0251['changeId']);const _0x47bb6f=this['_currentReviewCheckRun']['getChangeById'](_0x5c0251['changeId']);if(!_0x47bb6f)return;const _0x255758=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x5c0251['changeId']),_0x35034c=this['_aiReviewCoreEditing']['getEditorForChange'](_0x5c0251['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showNavigationPanel']({'change':_0x47bb6f,'position':this['_getNavigationPosition'](_0x5c0251['changeId']),'getTarget':_0x5c0251['markerElement'],'domEvent':_0x5c0251['domEvent'],'limiter':this['_getBalloonDomRoot'](_0x35034c,_0x255758?.['modelRange']['root']['rootName']),'viewportOffset':_0x35034c?.['ui']?.['viewportOffset']});}_getChangeContentElement(_0x15c80b){const _0x540245=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x15c80b);return _0x540245?_0x540245['getElement']():null;}_markChangePositionInEditorContent(_0x55c718,_0x4fb9fa){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x55c718,_0x4fb9fa);}_diffContent(_0x3b295e,_0x366549,_0x31f974){return this['_aiReviewCoreEditing']['diffContent'](_0x3b295e,_0x366549,_0x31f974,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x53c506){for(const _0x215690 of this['_aiReviewCoreEditing']['getEditors']())_0x215690['editing']['view']['change'](_0x223862=>{for(const _0x80d486 of _0x215690['editing']['view']['document']['getRoots']()){for(const _0x23333f of _0x80d486['getClassNames']())_0x23333f['startsWith']('ck-ai_review-')&&_0x223862['removeClass'](_0x23333f,_0x80d486);_0x223862['addClass'](_0x53c506?'ck-ai_review-diff':'ck-ai_review-highlights',_0x80d486);}});}_getBalloonDomRoot(_0x38cb40,_0x52845a){const _0x4f4221=_0x38cb40['editing']['view'];if(_0x52845a){const _0x1287ed=_0x4f4221['getDomRoot'](_0x52845a);if(_0x1287ed)return _0x1287ed;}return _0x4f4221['getDomRoot']()??void 0x0;}async _getReviewChecks(){const _0x33bacf=this['context']['plugins']['get']('AIReviewModeCheckRegistry'),_0x3c4fe2=await _0x33bacf['getChecksList']();_0x33bacf['modelsLoadError']&&this['_logError'](_0x33bacf['modelsLoadError']);let _0x2aba11=_0x3c4fe2['checks'];const _0x1522ac=this['context']['config']['get']('ai.review.availableCommands');return this['_logWarningForNonExistentChecks'](_0x1522ac,_0x2aba11),this['_usesAvailableCommandsConfig']&&(_0x2aba11=_0x1522ac['map'](_0x20103e=>_0x2aba11['find'](_0x537df0=>_0x537df0['id']===_0x20103e))['filter'](_0x55bd9f=>!!_0x55bd9f)),this['_filterChecksWithMissingModel'](_0x2aba11);}_logWarningForNonExistentChecks(_0x539d96,_0x35da26){const _0x245904=_0x539d96['filter'](_0x2bcc21=>!_0x35da26['some'](_0x177af7=>_0x177af7['id']===_0x2bcc21));_0x245904['length']&&this['_reporter']['logError'](new ur({'code':'ai-review-mode-non-existent-commands-used','severity':'warning','context':{'commandIds':_0x245904['join'](',\x20')}}));}_filterChecksWithMissingModel(_0x4e368b){const _0x324a70=[];return _0x4e368b['forEach'](_0x555e81=>{(_0x555e81 instanceof il&&!_0x555e81['defaultModel']||_0x555e81 instanceof hl&&!_0x555e81['models']['length'])&&_0x324a70['push'](_0x555e81['id']);}),_0x324a70['length']&&_0x324a70['forEach'](_0x4dccab=>{_0x4e368b=_0x4e368b['filter'](_0x45b553=>_0x45b553['id']!==_0x4dccab),this['_reporter']['logError'](new ur({'code':'ai-review-mode-command-unavailable-due-to-missing-model','context':{'commandId':_0x4dccab}}));}),_0x4e368b;}},dl=class extends _0x4cd5fc{static get['pluginName'](){return'AIReviewGateway';}static get requires(){return[$c,ll,$s,Pn,Jn,Js];}get['models'](){return this['context']['plugins']['get'](Js)['models'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async getAllCommands(){return(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['map'](_0x22a894=>{const _0x1b0bc9={'id':_0x22a894['id'],'title':_0x22a894['title'],'description':_0x22a894['description']};return'custom'!==_0x22a894['id']&&_0x22a894['options']?.['length']&&(_0x1b0bc9['parameters']=_0x22a894['options'][0x0]['data']['map'](_0x3d7073=>({..._0x3d7073}))),_0x1b0bc9;});}async['runReview'](_0x499779,_0x5eff7b){const _0x52064c=await this['_resolveReviewCheck'](_0x499779),_0xa1d518=this['context']['plugins']['get']('AIReviewCoreEditing'),_0x328d1e=this['context']['plugins']['get']('AIConnector'),_0x58f009=_0xa1d518['getDocumentData']({'roots':_0x5eff7b?.['roots']}),_0x5bb39a=this['_createReviewCheckRun'](_0x52064c,_0x58f009,_0x328d1e,_0x5eff7b?.['parameterId'],new nr(_0x5eff7b?.['contexts']));return _0xa1d518['runCheck'](_0x5bb39a,{'signal':_0x5eff7b?.['signal']});}async runCustomReview(_0x5f315f,_0x335657){const {reviewCheck:_0x8298eb,resolvedModel:_0x335d47}=await this['_resolveCustomReviewCheck'](_0x5f315f,_0x335657?.['model']),_0x4964d6=this['context']['plugins']['get']('AIReviewCoreEditing'),_0x443f89=this['context']['plugins']['get']('AIConnector'),_0x4c5687=_0x4964d6['getDocumentData']({'roots':_0x335657?.['roots']}),_0x2b61ea=new tl(_0x5f315f,_0x335d47,_0x4c5687,_0x8298eb,_0x443f89,new nr(_0x335657?.['contexts']));return _0x4964d6['runCheck'](_0x2b61ea,{'signal':_0x335657?.['signal']});}['applyReview'](_0x5021da,_0x55be2a){this['context']['plugins']['get']('AIGateway')['apply'](_0x5021da,{'aiSource':'review',..._0x55be2a});}async['_resolveReviewCheck'](_0x2ccd8c){const _0x550f83=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x1acd54=>_0x1acd54['id']===_0x2ccd8c);if(!_0x550f83)throw new dt('ai-reviewgateway-unknown-command',this,{'checkId':_0x2ccd8c});if(_0x550f83 instanceof hl)throw new dt('ai-reviewgateway-not-a-system-command',this,{'checkId':_0x2ccd8c});if(_0x550f83 instanceof il&&!_0x550f83['defaultModel']?.['id'])throw new dt('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x2ccd8c});return _0x550f83;}async _resolveCustomReviewCheck(_0x4df0f9,_0x24e92b){const _0x5c3304='custom',_0x5a7fa1=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x324ea4=>_0x324ea4['id']===_0x5c3304);if(!_0x5a7fa1)throw new dt('ai-reviewgateway-unknown-command',this,{'checkId':_0x5c3304});if(!(_0x5a7fa1 instanceof hl))throw new dt('ai-reviewgateway-not-a-custom-command',this,{'checkId':_0x5c3304});if(!_0x4df0f9)throw new dt('ai-reviewgateway-missing-custom-command-prompt',this,{'checkId':_0x5c3304});const _0x4e548a=_0x24e92b??_0x5a7fa1['defaultModel']?.['id'];if(!_0x4e548a)throw new dt('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x5c3304});return{'reviewCheck':_0x5a7fa1,'resolvedModel':_0x4e548a};}_createReviewCheckRun(_0x841fb3,_0x85acac,_0x39093e,_0x10265a,_0x370f5f=new nr()){if(_0x841fb3 instanceof il){const _0x20e963=_0x841fb3['context']?_0x370f5f['cloneWith'](_0x841fb3['context']):_0x370f5f;return new sl(_0x841fb3['prompt'],_0x841fb3['defaultModel']['id'],_0x85acac,_0x841fb3,_0x39093e,_0x20e963);}return new Jc(_0x85acac,_0x841fb3,_0x39093e,_0x10265a?[_0x10265a]:void 0x0,void 0x0,_0x370f5f);}},_l=class extends _0x4cd5fc{static get requires(){return[ul,Bc,$c,dl];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async startReview(_0x5e7221,_0x239489){await this['assertStartReviewPreconditions'](_0x5e7221,_0x3c6869=>{if(_0x3c6869 instanceof hl)throw new dt('ai-reviewmode-not-a-system-command',this,{'commandId':_0x5e7221});}),await this['context']['plugins']['get']('AIReviewModeController')['runCheck']({'id':_0x5e7221,'params':_0x239489?.['parameterId']?[_0x239489['parameterId']]:void 0x0});}async startCustomReview(_0xb5ec43,_0x23f08f){if(!_0xb5ec43)throw new dt('ai-reviewmode-missing-custom-command-prompt',this);const _0x3c52d8=rl['find'](_0x2522aa=>'custom'===_0x2522aa['commandId'])['id'],_0x5ea8a1=await this['assertStartReviewPreconditions'](_0x3c52d8,_0x5d8231=>{if(!this['resolveCustomReviewModel'](_0x5d8231,_0x23f08f))throw new dt('ai-reviewmode-missing-custom-command-model',this);}),_0x1beb2a=this['resolveCustomReviewModel'](_0x5ea8a1,_0x23f08f);await this['context']['plugins']['get']('AIReviewModeController')['runCheck']({'id':_0x3c52d8,'isCustom':!0x0,'args':{'prompt':_0xb5ec43,'model':_0x1beb2a}});}getAvailableCommands(){return this['context']['plugins']['get']('AIReviewModeController')['getAvailableChecks']()['map'](_0x3d059a=>{const _0x4a9806={'id':_0x3d059a['id'],'title':_0x3d059a['title'],'description':_0x3d059a['description']};return'custom'!==_0x3d059a['id']&&_0x3d059a['options']?.['length']&&(_0x4a9806['parameters']=_0x3d059a['options'][0x0]['data']['map'](_0x29dbd9=>({..._0x29dbd9}))),_0x4a9806;});}async assertStartReviewPreconditions(_0x4aad26,_0x3bf576){const _0x20d996=this['context']['plugins']['get']('AIReviewModeController');if(_0x20d996['getCurrentCheckRun']())throw new dt('ai-reviewmode-review-already-running',this);const _0x39348a=_0x20d996['getAvailableChecks']()['find'](_0x5348a7=>_0x5348a7['id']===_0x4aad26);if(!_0x39348a)throw new dt('ai-reviewmode-unknown-command',this,{'commandId':_0x4aad26});if(_0x3bf576(_0x39348a),!await cc(this['context'],Sh))throw new dt('ai-reviewmode-review-vetoed',this);return _0x39348a;}resolveCustomReviewModel(_0x5b6dc2,_0x13cd13){return _0x13cd13?.['model']??_0x5b6dc2['defaultModel']?.['id'];}},gl=class extends Jc{_title;constructor(_0x4ff110,_0x40053a,_0x1fb8a1,_0x3f5586,_0x4e7138,_0x435d90,_0x5c8211){super(_0x4ff110,_0x40053a,_0x1fb8a1,_0x4e7138,_0x435d90,_0x5c8211),this['_title']=_0x3f5586;}get title(){return this['_title'];}get subTitle(){return this['_sourceCheck']['title'];}},Il=class extends el{get['apiId'](){return'translate';}},Al=class extends al{setupChecks(_0x336d2a){this['_checks']=_0x336d2a['map'](_0x6da231=>new Il(_0x6da231));}};const El=[{'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'}];var pl=class extends nl{static get['pluginName'](){return'AITranslateCheckRegistry';}constructor(_0x18d102){super(_0x18d102),this['context']['config']['define']('ai.translate.languages',El);}async _loadChecksList(){const _0x234b9c=[],_0x3bbc03=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x5d2ee7 of _0x3bbc03)_0x234b9c['push']({'title':_0x5d2ee7['label'],'id':_0x5d2ee7['id'],'commandId':_0x5d2ee7['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x5d2ee7['id']}});const _0x3b372d=new Al();return _0x3b372d['setupChecks'](this['_translateChecks'](_0x234b9c)),_0x3b372d;}_translateChecks(_0x4a9765){const _0x2c87d4=this['context']['locale'];return _0x4a9765['map'](_0x431ab0=>{const _0x800520='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x431ab0['title']['toUpperCase']()['replaceAll']('-','_'),_0x17a889=qs(_0x2c87d4,_0x800520);return{..._0x431ab0,'title':_0x17a889===_0x800520?_0x431ab0['title']:_0x17a889};});}},ml=class extends Zc{static get['pluginName'](){return'AITranslateController';}static get requires(){return[dr,pl,Js];}get['_aiSource'](){return'translate';}get _defaultContextFeature(){return'translate';}get['_aiTabId'](){return Oh;}get _leaveConfirmationDialogOptions(){const {context:{locale:_0x37bb68}}=this;return{'dialogId':'aiTranslateLeaveConfirmation','title':qs(_0x37bb68,'AI_TRANSLATE_LEAVE_CONFIRMATION_TITLE'),'content':qs(_0x37bb68,'AI_TRANSLATE_LEAVE_CONFIRMATION_CONTENT'),'stayButton':qs(_0x37bb68,'AI_TRANSLATE_LEAVE_CONFIRMATION_STAY_BUTTON'),'exitButton':qs(_0x37bb68,'AI_TRANSLATE_LEAVE_CONFIRMATION_EXIT_BUTTON')};}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}_initRequiredPlugins(){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}_createReviewCheckRun(_0x4530dc,_0x354595,_0x49f45f){return new gl(this['_aiReviewCoreEditing']['getDocumentData'](),_0x354595,this['_aiConnector'],qs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x4530dc['params'],_0x4530dc['args'],_0x49f45f);}_onReviewCheckResultActivated(_0x39aa02){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x39aa02['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x39aa02['change']['id']);}_onReviewCheckResultDeactivated(){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}_onActivateChange(_0x2ac3f1){this['_currentReviewCheckRun']&&('hover'===_0x2ac3f1['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x2ac3f1['id'])),'click'===_0x2ac3f1['uiInteraction']&&this['_scrollToChange'](_0x2ac3f1['id']));}_onDeactivateChange(_0x3c0d56){this['_currentReviewCheckRun']&&'panel'===_0x3c0d56['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x45ef37,_0x2f5560){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x2f5560['changeId']),this['_scrollToChange'](_0x2f5560['changeId']));}['_onChangeMarkerHovered'](_0x3bc790,_0x3f4a08){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3f4a08['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x3f4a08['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}_getChangeContentElement(_0x53fa77){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x53fa77);}_markChangePositionInEditorContent(_0x269208,_0x190780){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x269208,_0x190780);}_diffContent(_0x4e6ac1,_0x1f99b6,_0x18e112){return this['_aiReviewCoreEditing']['diffContent'](_0x4e6ac1,_0x1f99b6,_0x18e112,!0x0);}['_onReviewCheckRun'](){for(const _0x24abee of this['_aiReviewCoreEditing']['getEditors']())_0x24abee['editing']['view']['change'](_0x7aa301=>{for(const _0x524165 of _0x24abee['editing']['view']['document']['getRoots']())_0x7aa301['addClass']('ck-ai-translate-mode-content',_0x524165);});}async _getReviewChecks(){return(await this['context']['plugins']['get']('AITranslateCheckRegistry')['getChecksList']())['checks'];}},Tl=class extends vc{constructor(_0x45af9a,_0x2ee1f5){super(_0x45af9a,_0x2ee1f5),this['on']('set:isLoading',(_0x441037,_0x2da7fd,_0x2253e3)=>{_0x2253e3&&(this['headerTitle']=qs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x1eb356,_0x282e26,_0x57fc80)=>{_0x57fc80&&(this['headerTitle']=qs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}_createAcceptAllButtonView(){const _0x2fd03f=new _0x1a9216(this['locale']);return _0x2fd03f['set']({'label':qs(this['locale'],'AI_TRANSLATE_ACCEPT_ALL'),'withText':!0x0}),_0x2fd03f['bind']('isEnabled')['to'](this,'hasPendingChanges',this,'isError',(_0x562c79,_0x23cdd3)=>_0x562c79&&!_0x23cdd3),_0x2fd03f['extendTemplate']({'attributes':{'class':[gr,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x1482cc=>!_0x1482cc),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2dad1a=>_0x2dad1a)]}}),_0x2fd03f['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x2fd03f;}_createExitButtonView(){const _0x939eb=new _0x1a9216(this['locale']);return _0x939eb['set']({'label':qs(this['locale'],'AI_CHAT_HISTORY_CANCEL'),'withText':!0x0}),_0x939eb['extendTemplate']({'attributes':{'class':[Ar,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4ad33b=>!_0x4ad33b),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4fc6b5=>_0x4fc6b5)]}}),_0x939eb['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x939eb;}_createHeaderControlViews(){return this['_acceptAllButtonView']??=this['_createAcceptAllButtonView'](),this['_exitButtonView']??=this['_createExitButtonView'](),[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitButtonView'],this['_finishReviewButtonView']];}_createProgressBarViewList(){return[];}_getSkeletonDefinition(){return uo['aiTranslateChecks'];}},wl=class extends Mc{constructor(_0x4b9b7f){super(_0x4b9b7f),this['_setupTemplate']();}['_clearCheckViews'](){this['items']['clear']();}['_addCheckView'](_0x45143b){this['items']['add'](_0x45143b);}getCheckViews(){return[...this['items']]['filter'](_0x1acc3d=>_0x1acc3d instanceof Pc);}_setupTemplate(){const _0x3578c5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x3578c5['if']('isVisible','ck-hidden',_0x1d89a6=>!_0x1d89a6)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':qs(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':qs(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'ul','attributes':{'class':['ck-ai_review__check-list',_0x3578c5['if']('isVisible','ck-hidden',_0x35fdb1=>!_0x35fdb1)]},'children':this['items']}]});}},Cl=class extends Cc{static get['pluginName'](){return'AITranslateUI';}createMainView(){const _0x4f5cc0=this['context']['plugins']['get']('AITabs'),_0x210ce7=this['context']['locale'],_0x14be93=new sh(_0x210ce7,{'label':qs(_0x210ce7,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x46b415,'class':'ck-ai-header_review-translate','showResizeButton':_0x4f5cc0['showResizeButton']});_0x14be93['delegate']('resizeTabs')['to'](_0x4f5cc0),_0x14be93['bind']('isMaximized')['to'](_0x4f5cc0['view'],'isMaximized',_0x73ef5d=>_0x73ef5d);const _0x56b648=new Rc(_0x210ce7,{'header':_0x14be93,'list':new wl(_0x210ce7),'results':new Tl(_0x210ce7,{'generalErrorText':qs(_0x210ce7,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new Nc(_0x210ce7,{'headerText':qs(_0x210ce7,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':qs(_0x210ce7,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':qs(_0x210ce7,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x56b648['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x56b648;}registerTab(){const _0x49f3db=this['context']['plugins']['get']('AITabs');_0x49f3db['view']['on']('activateTab',(_0x37a678,{newTab:_0x24c94a,oldTab:_0x47263e})=>{_0x24c94a===Oh?this['fire']('getReviewCheckList'):_0x47263e===Oh&&this['fire']('leaveReview');}),_0x49f3db['view']['addTab']({'id':Oh,'buttonLabel':qs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x46b415,'order':0x0,'content':this['_mainView']});}},fl=class extends _0x4cd5fc{static get['pluginName'](){return'AITranslateGateway';}static get requires(){return[$c,$s,Pn,Jn];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async runTranslate(_0x293024,_0x55b6c3){const _0x50e96a=this['context']['plugins']['get']('AIReviewCoreEditing'),_0x804843=this['context']['plugins']['get']('AIConnector'),_0x532bd9=new Il({'id':_0x293024,'commandId':_0x293024,'title':_0x293024,'description':'','isParameterized':!0x1}),_0x44ad86=_0x50e96a['getDocumentData']({'roots':_0x55b6c3?.['roots']}),_0x277180=new Jc(_0x44ad86,_0x532bd9,_0x804843,void 0x0,{'language':_0x293024},new nr(_0x55b6c3?.['contexts']));return _0x50e96a['runCheck'](_0x277180,{'signal':_0x55b6c3?.['signal']});}applyTranslate(_0x3d4a4b,_0x2a5b66){this['context']['plugins']['get']('AIGateway')['apply'](_0x3d4a4b,_0x2a5b66);}},Rl=class extends _0x4cd5fc{static get requires(){return[ml,Cl,$c,fl];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async startTranslate(_0x4d773b){const _0x3e8f50=await this['assertStartTranslatePreconditions'](_0x4d773b);await this['context']['plugins']['get']('AITranslateController')['runCheck']({'id':_0x3e8f50['id'],'args':_0x3e8f50['useArgs']?_0x3e8f50['args']:void 0x0});}getAvailableLanguages(){return this['context']['plugins']['get']('AITranslateController')['getAvailableChecks']()['map'](_0x3faff8=>({'id':_0x3faff8['id'],'label':_0x3faff8['title']}));}async assertStartTranslatePreconditions(_0x385df8){const _0x3e3ca3=this['context']['plugins']['get']('AITranslateController');if(_0x3e3ca3['getCurrentCheckRun']())throw new dt('ai-translate-translation-already-running',this);const _0x37445b=_0x3e3ca3['getAvailableChecks']()['find'](_0x532415=>_0x532415['id']===_0x385df8);if(!_0x37445b)throw new dt('ai-translate-unknown-language',this,{'languageId':_0x385df8});if(!await cc(this['context'],Oh))throw new dt('ai-translate-translation-vetoed',this);return _0x37445b;}},bl=class extends _0x158c3f{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'DocumentCompareUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x157d1c=[this['editor']];for(const _0x376c16 of _0x157d1c){let _0x1f1217;for(const _0xe3d53d in _0x376c16){const _0x14f3bc=_0xe3d53d,_0x138a74=_0x376c16[_0x14f3bc];if('documentCompareLicenseKeyValid'==_0x138a74||'documentCompareLicenseKeyInvalid'==_0x138a74||'documentCompareLicenseKeyExpired'==_0x138a74||'documentCompareLicenseKeyDomainLimit'==_0x138a74||'documentCompareLicenseKeyNotAllowed'==_0x138a74||'documentCompareLicenseKeyEvaluationLimit'==_0x138a74||'documentCompareLicenseKeyUsageLimit'==_0x138a74){delete _0x376c16[_0x14f3bc],_0x1f1217=_0x138a74,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'documentCompareLicenseKeyInvalid'==_0x1f1217&&_0x376c16['_showLicenseError']('invalid'),'documentCompareLicenseKeyExpired'==_0x1f1217&&_0x376c16['_showLicenseError']('expired'),'documentCompareLicenseKeyDomainLimit'==_0x1f1217&&_0x376c16['_showLicenseError']('domainLimit'),'documentCompareLicenseKeyNotAllowed'==_0x1f1217&&_0x376c16['_showLicenseError']('featureNotAllowed','DocumentCompare'),'documentCompareLicenseKeyEvaluationLimit'==_0x1f1217&&_0x376c16['_showLicenseError']('evaluationLimit'),'documentCompareLicenseKeyUsageLimit'==_0x1f1217&&_0x376c16['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}};const Sl=new Set(['br']);var Ol=class{['_usedIds']=new Set();_writer;constructor(_0x35d7f7){this['_writer']=new _0x1cc48b(_0x35d7f7['editing']['view']['document']);}['assign'](_0x870d3f){this['_assignToChildren'](_0x870d3f);}['_assignToChildren'](_0x2ad7e6){let _0x883d96=!0x1;for(const _0x1228c7 of _0x2ad7e6['getChildren']()){if(!_0x1228c7['is']('view:element')||Sl['has'](_0x1228c7['name']))continue;const _0x5b9a67=_0x1228c7['is']('view:containerElement'),_0x2a81c9=_0x1228c7['is']('view:emptyElement'),_0x3b8831=_0x1228c7['is']('view:rawElement'),_0x21c63a=this['_assignToChildren'](_0x1228c7);_0x1228c7['hasAttribute']('data-id')?(this['_usedIds']['add'](_0x1228c7['getAttribute'](Hn)),_0x883d96=!0x0):(_0x5b9a67||_0x2a81c9||_0x3b8831||_0x21c63a)&&(this['_writer']['setAttribute'](Hn,this['_nextId'](),_0x1228c7),_0x883d96=!0x0);}return _0x883d96;}_nextId(){let _0x1e43ae;do{_0x1e43ae='';for(let _0x469366=0x0;_0x469366<0x4;_0x469366++)_0x1e43ae+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(this['_usedIds']['has'](_0x1e43ae));return this['_usedIds']['add'](_0x1e43ae),_0x1e43ae;}};function vl(_0x40f659){return new _0x1f9306(Array['from'](_0x40f659['getChildren'](),_0x14d186=>_0x14d186['_clone'](!0x0)));}const yl='documentcompare-selection',Nl='documentcompare-selection-start',kl='documentcompare-selection-end';function xl(_0x501f0e){const _0x3ce353='<'+Nl+'></'+Nl+'>',_0x52c9d1='<'+kl+'></'+kl+'>';let _0x152e2c=_0x501f0e;const _0x424ea9=[];let _0x4a6837=_0x152e2c['indexOf'](_0x3ce353);for(;-0x1!==_0x4a6837;){_0x152e2c=_0x152e2c['slice'](0x0,_0x4a6837)+_0x152e2c['slice'](_0x4a6837+_0x3ce353['length']);const _0x516b0f=_0x152e2c['indexOf'](_0x3ce353);let _0x432e5f=_0x152e2c['indexOf'](_0x52c9d1);-0x1===_0x432e5f||-0x1!==_0x516b0f&&_0x516b0f<_0x432e5f?_0x432e5f=_0x4a6837:_0x152e2c=_0x152e2c['slice'](0x0,_0x432e5f)+_0x152e2c['slice'](_0x432e5f+_0x52c9d1['length']),_0x424ea9['push']({'start':_0x4a6837,'end':_0x432e5f}),_0x4a6837=_0x152e2c['indexOf'](_0x3ce353);}return{'content':_0x152e2c,'selection':_0x424ea9};}var Ll=class extends _0x158c3f{['_sessionId'];static get['pluginName'](){return'DocumentCompare';}static get requires(){return[Un,bl];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['editor']['conversion']['for']('dataDowncast')['markerToElement']({'model':yl,'view':(_0x562882,{writer:_0x12b802,options:_0x794779})=>_0x794779['includeDocumentCompareSelection']?_0x12b802['createUIElement'](_0x562882['isOpening']?Nl:kl):null});}afterInit(){!async function(_0x3f4bc5){const _0x71c00a='KpOBJGNSEgqCyfVF1kZ8lbnRjM7eIzAsDQHw9aThu6rcYi05UmPL4d3X2Wotvx',_0x3b7e9a=0x79710,_0xb6660c={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x3b4897(_0x4d74b1){const _0x311628=new window['Promise'](_0xbb2545=>{_0x4d74b1['once']('ready',_0xbb2545);}),_0x6633d7=window['Date']['now'](),_0x2eec08=_0x4d74b1['config']['get']('licenseKey');async function _0x5d1ee1(){let _0x5e8f56,_0x51b029=null,_0xf5d7c7=null;try{return'GPL'==_0x2eec08?'NotAllowed':(_0x5e8f56=_0x48f245(),_0x5e8f56?(_0x5e8f56['usageEndpoint']&&(_0xf5d7c7=_0x14e6d1(_0x5e8f56['usageEndpoint'],_0x5e8f56['jti'])),await _0x2b1fdb()?_0x338522()?_0x3ae98c()?'Expired':_0x1eb252()?('evaluation'==_0x5e8f56['licenseType']&&(_0x51b029=_0x254680('EvaluationLimit')),await _0x399d46()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3ae98c(){const _0x533a03=['evaluation','trial']['includes'](_0x5e8f56['licenseType'])?_0x6633d7/0x3e8:0xe10*_0x3b7e9a;return _0x5e8f56['exp']<_0x533a03;}function _0x338522(){const _0x5125eb=_0x5e8f56['features'];return!!_0x5125eb&&(!!_0x5125eb['includes']('*')||(!!_0x5125eb['includes']('DC')||!!_0x5125eb['includes']('ET')));}function _0x1eb252(){const _0x4e8512=_0x5e8f56['licensedHosts'];if(!_0x4e8512||0x0==_0x4e8512['length'])return!0x0;const {hostname:_0x35979c}=new URL(window['location']['href']);if(_0x4e8512['includes'](_0x35979c))return!0x0;const _0x274601=_0x35979c['split']('.');return _0x4e8512['filter'](_0x364f3e=>_0x364f3e['includes']('*'))['map'](_0x14f805=>_0x14f805['split']('.'))['filter'](_0x5dc1b8=>_0x5dc1b8['length']<=_0x274601['length'])['map'](_0x40111e=>Array(_0x274601['length']-_0x40111e['length'])['fill']('*'===_0x40111e[0x0]?'*':'')['concat'](_0x40111e))['some'](_0x4224b9=>_0x274601['every']((_0x4c3e96,_0x5c45f6)=>_0x4224b9[_0x5c45f6]===_0x4c3e96||'*'===_0x4224b9[_0x5c45f6]));}function _0x399d46(){return _0x51b029&&_0xf5d7c7?new window['Promise']((_0x39310d,_0x2db89d)=>{_0x51b029['then'](_0x39310d,_0x2db89d),_0xf5d7c7['then'](_0x4a3a0c=>{'Valid'!=_0x4a3a0c&&_0x39310d(_0x4a3a0c);},_0x2db89d);}):_0x51b029||_0xf5d7c7||'Valid';}}function _0x14e6d1(_0x3fa267,_0x19a42b){return new window['Promise'](_0x2a0c44=>{if(_0x453c63())return _0x2a0c44('Valid');_0x322b7f(),_0x4d74b1['decorate']('_sendUsageRequest');let _0xb35d84=!0x1;const _0x25d1f2=Xt();function _0x5375be(_0x582876){return!!_0x582876&&('object'==typeof _0x582876||'function'==typeof _0x582876)&&'function'==typeof _0x582876['then']&&'function'==typeof _0x582876['catch'];}function _0x12df0f(_0x59ce4e){_0x64da05(_0x59ce4e)['then'](_0x515dcd=>_0x515dcd&&'ok'==_0x515dcd['status']?_0x43590e(_0x4e3210(_0x25d1f2+_0x19a42b))!=_0x515dcd['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x3a075=>(_0x3e4e4e(),_0x3a075),()=>{const _0xa2e339=_0x540a9d();return null==_0xa2e339?(_0x3e4e4e(),'Valid'):_0x6633d7-_0xa2e339>0x240c8400?'UsageLimit':'Valid';})['then'](_0x2a0c44)['catch'](()=>{_0x2a0c44('UsageLimit');});const _0x292a81=0x36ee80;function _0x3e4e4e(){const _0x431c38='llct-'+_0x43590e(_0x4e3210(_0x3fa267)),_0x395bab=_0x2be04e(_0x43590e(window['Math']['ceil'](_0x6633d7/_0x292a81)));window['localStorage']['setItem'](_0x431c38,_0x395bab);}function _0x540a9d(){const _0x7e4ac8='llct-'+_0x43590e(_0x4e3210(_0x3fa267)),_0x43a9f3=window['localStorage']['getItem'](_0x7e4ac8);return _0x43a9f3?window['parseInt'](_0x2be04e(_0x43a9f3),0x10)*_0x292a81:null;}function _0x64da05(_0x4ad672){return new window['Promise']((_0x3a9a86,_0x55d277)=>{_0x4ad672['then'](_0x3a9a86,_0x55d277),window['setTimeout'](_0x55d277,0x1d4c0);});}}_0x4d74b1['on']('_sendUsageRequest',(_0xbe783d,_0x1167a9)=>{if(_0x1167a9[0x0]!=_0x3fa267)return _0x2a0c44('UsageLimit');_0x1167a9[0x1]={..._0x1167a9[0x1],'requestId':_0x25d1f2};},{'priority':'high'}),_0x4d74b1['on']('_sendUsageRequest',_0xb09f17=>{_0x5375be(_0xb09f17['return'])&&(_0xb35d84=!0x0,_0x12df0f(_0xb09f17['return']));},{'priority':'low'}),_0x311628['then'](()=>{_0xb35d84||_0x2a0c44('UsageLimit');});});function _0x453c63(){return'auto'==_0x4d74b1['editing']['view']['_overlayModeHint'];}function _0x322b7f(){_0x4d74b1['editing']['view']['_overlayModeHint']='auto';}}function _0x254680(_0x10e1f4){const _0x10b0e2=[new window['Promise'](_0x2248ff=>setTimeout(_0x2248ff,0x93ecc)),_0x311628['then'](()=>new window['Promise'](_0xa41b6d=>{let _0x314ec7=0x0;_0x4d74b1['model']['on']('applyOperation',(_0x5cdf02,_0x556c6e)=>{_0x556c6e[0x0]['isDocumentOperation']&&_0x314ec7++,0x5e8==_0x314ec7&&(_0xa41b6d(),_0x5cdf02['off']());});}))];return window['Promise']['race'](_0x10b0e2)['then'](()=>_0x10e1f4);}async function _0xa151c7(){await _0x311628,_0x3f4bc5['makeSnapshot']=_0x43a9d1,_0x3f4bc5['diffSnapshot']=_0x43a9d1,_0x3f4bc5['applyPatch']=_0x43a9d1,_0x4d74b1['model']['change']=_0x43a9d1,_0x4d74b1['model']['enqueueChange']=_0x43a9d1,_0x4d74b1['enableReadOnlyMode']('model');}function _0x414ef7(_0x4fdcef){const _0x536f35=_0x346cb0();_0x4d74b1[_0x536f35]='documentCompareLicenseKey'+_0x4fdcef,'Valid'!=_0x4fdcef&&_0xa151c7();}function _0x346cb0(){const _0x4e9621=window['String'](window['performance']['now']())['replace']('.','');let _0x3a285f='K';for(let _0x206a87=0x0;_0x206a87<_0x4e9621['length'];_0x206a87+=0x2){let _0x1f6573=window['parseInt'](_0x4e9621['substring'](_0x206a87,_0x206a87+0x2));_0x1f6573>=0x3e&&(_0x1f6573-=0x3e),_0x3a285f+=_0x71c00a[_0x1f6573];}return _0x3a285f;}function _0x48f245(){const _0x42d545=_0x2eec08['split']('.');if(0x3!=_0x42d545['length'])return null;return _0x4d349d(_0x42d545[0x1]);function _0x4d349d(_0x4048d0){const _0x35e85f=_0x2cc47c(_0x4048d0);return _0x35e85f&&_0x58c412()?_0x35e85f:null;function _0x58c412(){const _0x195228=_0x35e85f['jti'],_0x582f74=window['parseInt'](_0x195228['substring'](_0x195228['length']-0x8),0x10),_0x3cd63b={..._0x35e85f,'jti':_0x195228['substring'](0x0,_0x195228['length']-0x8)};return delete _0x3cd63b['vc'],_0x4e3210(_0x3cd63b)==_0x582f74;}}}async function _0x2b1fdb(){let _0x523551=!0x0;try{const [_0x5a14cb,_0x86db6b,_0x405d7e]=_0x2eec08['split']('.');return _0x13eede(_0x5a14cb),await _0x4f12af(_0x5a14cb,_0x86db6b,_0x405d7e),_0x523551;}catch{return!0x1;}function _0x13eede(_0x4e5497){const _0x372a03=_0x2cc47c(_0x4e5497);_0x372a03&&'ES256'==_0x372a03['alg']||(_0x523551=!0x1);}async function _0x4f12af(_0x4613e3,_0x100e32,_0x38c533){const _0xf09497=window['Uint8Array']['from'](_0x468928(_0x38c533),_0x579e91=>_0x579e91['charCodeAt'](0x0)),_0x21a583=new window['TextEncoder']()['encode'](_0x4613e3+'.'+_0x100e32),_0x32cb09=window['crypto']['subtle'];if(!_0x32cb09)return;const _0x23a1e4=await _0x32cb09['importKey']('jwk',_0xb6660c,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x32cb09['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x23a1e4,_0xf09497,_0x21a583)||(_0x523551=!0x1);}}function _0x2cc47c(_0x5d1226){return _0x5d1226['startsWith']('ey')?JSON['parse'](_0x468928(_0x5d1226)):null;}function _0x468928(_0x2dc1c9){return window['atob'](_0x2dc1c9['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x4e3210(_0x2136ed){let _0x3076be=0x1505;function _0x240a41(_0x5a8435){for(let _0x40506b=0x0;_0x40506b<_0x5a8435['length'];_0x40506b++){const _0x117859=_0x5a8435['charCodeAt'](_0x40506b);_0x3076be=(_0x3076be<<0x5)+_0x3076be+_0x117859,_0x3076be&=_0x3076be;}}function _0x28ce12(_0xe825aa){Array['isArray'](_0xe825aa)?_0xe825aa['forEach'](_0x28ce12):_0xe825aa&&'object'==typeof _0xe825aa?Object['entries'](_0xe825aa)['sort']()['forEach'](([_0x17d5ae,_0x520faa])=>{_0x240a41(_0x17d5ae),_0x28ce12(_0x520faa);}):_0x240a41(window['String'](_0xe825aa));}return _0x28ce12(_0x2136ed),_0x3076be>>>0x0;}function _0x43590e(_0x549e07){return _0x549e07['toString'](0x10)['padStart'](0x8,'0');}function _0x2be04e(_0x4cd043){return _0x4cd043['split']('')['reverse']()['join']('');}function _0x43a9d1(){}_0x414ef7(await _0x5d1ee1());}_0x3b4897(_0x3f4bc5['editor']);}(this);}makeSnapshot(_0x461479=[]){const _0x468b1b=this['editor'],_0xadc2af=Array['from'](_0x461479),_0x401ed6={},_0x381155={},_0x27dbe0=new Ol(_0x468b1b);for(const _0x2719d5 of _0x468b1b['model']['document']['getRoots']()){const _0x349adf=Array['from'](_0x2719d5['getChildren']())['map'](_0x778e79=>_0x778e79['_clone'](!0x0)),_0x28deba=new _0x1f9306(_0x349adf);for(const _0x5e715a of _0x468b1b['model']['markers']){const _0x612930=_0x5e715a['getRange']();_0x5e715a['affectsData']&&_0x612930['root']===_0x2719d5&&_0x28deba['markers']['set'](_0x5e715a['name'],_0x468b1b['model']['createRange'](_0x468b1b['model']['createPositionFromPath'](_0x28deba,_0x612930['start']['path']),_0x468b1b['model']['createPositionFromPath'](_0x28deba,_0x612930['end']['path'])));}let _0x4ffa5a=0x0;for(const _0x4a075e of _0xadc2af)_0x4a075e['root']===_0x2719d5&&_0x28deba['markers']['set'](yl+':'+_0x4ffa5a++,_0x468b1b['model']['createRange'](_0x468b1b['model']['createPositionFromPath'](_0x28deba,_0x4a075e['start']['path']),_0x468b1b['model']['createPositionFromPath'](_0x28deba,_0x4a075e['end']['path'])));const _0x11154d=_0x468b1b['data']['toView'](_0x28deba,{'includeDocumentCompareSelection':!0x0});_0x27dbe0['assign'](_0x11154d);const {content:_0x13d5d7,selection:_0x1bc413}=xl(_0x468b1b['data']['processor']['toData'](_0x11154d));_0x401ed6[_0x2719d5['rootName']]=_0x13d5d7,_0x1bc413['length']&&(_0x381155[_0x2719d5['rootName']]=_0x1bc413);}return{'channelId':this['_getChannelId'](),'sessionId':this['_getSessionId'](),'version':_0x468b1b['model']['document']['version'],'content':_0x401ed6,'selection':_0x381155,'editorConfig':xn(_0x468b1b)};}diffSnapshot(_0x2b9eb2,_0x30f7c9,_0xad6296={}){const _0x4028ca=this['editor']['plugins']['get'](Un),_0x3e62b4='string'==typeof _0x30f7c9?{'main':_0x30f7c9}:_0x30f7c9,_0x20b785={};for(const _0x296990 of Object['keys'](_0x2b9eb2['content'])){const _0x22434e=_0x3e62b4[_0x296990];void 0x0!==_0x22434e&&(_0x20b785[_0x296990]=_0x4028ca['getDiff'](_0x2b9eb2['content'][_0x296990],_0x22434e,{'targetEditor':this['editor'],'anchor':_0x296990,'markDeletions':_0xad6296['asSuggestions']||!0x1}));}return{'channelId':_0x2b9eb2['channelId'],'sessionId':_0x2b9eb2['sessionId'],'version':_0x2b9eb2['version'],'options':_0xad6296,'operations':_0x20b785};}applyPatch(_0x2d16eb){const _0x106240=this['editor'];if(_0x2d16eb['channelId']!==this['_getChannelId']()||_0x2d16eb['sessionId']!==this['_getSessionId']())throw new dt('documentcompare-apply-session-mismatch',_0x106240);const _0x36fdc9=_0x2d16eb['options']['asSuggestions']||!0x1,_0x3f415b=Object['values'](_0x2d16eb['operations'])['filter'](_0x26dba2=>_0x26dba2['length']);if(!_0x3f415b['length'])return;if(_0x36fdc9&&!_0x106240['plugins']['has']('TrackChangesEditing'))throw new dt('documentcompare-no-track-changes',_0x106240);const _0x1f20ca=_0x106240['model']['document']['history']['getOperations'](_0x2d16eb['version']),_0xc71d17=[];for(const _0x509b77 of _0x3f415b)_0xc71d17['push'](..._0x3e782f(_0x509b77,_0x1f20ca,{'document':_0x106240['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1})['operationsA']);const _0x2493a5=function(_0x24939b,_0x13e4e5){const _0xe77529=_0x24939b['model']['document'],_0x4be0ae=new Map();for(const _0x406f38 of _0xe77529['roots'])_0x4be0ae['set'](_0x406f38['rootName'],vl(_0x406f38));for(const _0x2177d7 of _0x13e4e5)if('marker'!==_0x2177d7['type']){if(_0x2177d7 instanceof _0x285c43||_0x2177d7 instanceof ti)return{'reason':'unsupported','operation':_0x2177d7};try{const _0x13d190=_0x2177d7['clone']();if(_0x13d190['baseVersion']=null,_0x13d190['isDocumentOperation']=!0x1,ts(_0x13d190,_0x4be0ae),_0x3463ba(_0x13d190))continue;_0x13d190['_validate'](),_0x13d190['_execute']();}catch(_0x4bbc58){return{'reason':'invalid','operation':_0x2177d7,'cause':_0x4bbc58};}}return null;}(_0x106240,_0xc71d17);if(_0x2493a5){if('unsupported'===_0x2493a5['reason'])throw new dt('documentcompare-applypatch-unsupported-operation',_0x106240,{'history':_0x1f20ca,'patch':_0x2d16eb,'operation':_0x2493a5['operation']});throw new dt('documentcompare-applypatch-invalid-patch',_0x106240,{'history':_0x1f20ca,'patch':_0x2d16eb,'operation':_0x2493a5['operation']},_0x2493a5['cause']);}try{_0x106240['model']['change'](_0x5188a8=>{_0x36fdc9?_0x106240['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0xc71d17):_0x106240['plugins']['get'](Un)['applyOperations'](_0x5188a8,_0xc71d17);});}catch(_0x5591f5){throw new dt('documentcompare-apply-failed',_0x106240,{'history':_0x1f20ca,'patch':_0x2d16eb},_0x5591f5);}}async['process'](_0x1ebeb1,_0x34d948={}){const _0xc8d53a=this['makeSnapshot'](),_0x4a7c93=await _0x1ebeb1(_0xc8d53a);try{return this['applyPatch'](this['diffSnapshot'](_0xc8d53a,_0x4a7c93,_0x34d948)),!0x0;}catch(_0x3f3f89){if(!_0x34d948['overwriteOnError'])throw _0x3f3f89;return this['editor']['data']['set'](_0x4a7c93,{'suppressErrorInCollaboration':!0x0}),!0x1;}}_getSessionId(){const _0x28f540=this['editor'];return _0x28f540['plugins']['has']('RealTimeCollaborationClient')?_0x28f540['plugins']['get']('RealTimeCollaborationClient')['sessionId']:(this['_sessionId']||(this['_sessionId']=Xt()),this['_sessionId']);}_getChannelId(){return this['editor']['config']['get']('collaboration.channelId')||'';}};export{Ac as AIActions,us as AIAdapter,Ps as AIAssistant,xs as AIAssistantUI,Gh as AIBalloon,fh as AIChat,Kr as AIChatController,ta as AIChatFeedCustomElementView,Ch as AIChatHistory,wh as AIChatHistoryController,Ah as AIChatHistoryUI,Hr as AIChatInteraction,yh as AIChatShortcuts,ch as AIChatUI,Gc as AICheckRunSingleRootResult,$s as AIConnector,nr as AIContext,js as AIContextLibrary,Js as AICore,ur as AICoreError,cr as AIDocumentProcessingGateway,ar as AIDocumentProcessingRunResult,Pn as AIEditing,Qh as AIEditorIntegration,_r as AIErrorReporter,dr as AIErrorSink,Jn as AIGateway,Lr as AIInteraction,Xs as AIModels,Ec as AIQuickActions,ac as AIQuickActionsUI,Nr as AIReply,ds as AIRequestError,el as AIReviewCheck,qc as AIReviewCheckResult,Xc as AIReviewCheckResultChange,jc as AIReviewCheckRun,dl as AIReviewGateway,_l as AIReviewMode,Zc as AIReviewModeController,$c as AIReviewModeEditing,Bc as AIReviewModeUI,hr as AIRunResult,or as AIRunSingleRootResult,Ks as AITabs,Fs as AITabsMainView,Bs as AITabsView,Vs as AITextAdapter,kh as AIToggleButtonUI,Rl as AITranslate,ml as AITranslateController,fl as AITranslateGateway,Cl as AITranslateUI,Us as AWSTextAdapter,Ll as DocumentCompare,Hs as OpenAITextAdapter,gs as ShowAIAssistantCommand,Nh as ToggleAICommand,Tr as createResizeButton,Ms as getDefaultAICommands,jn as markOperationsAsAI};