@ckeditor/ckeditor5-ai 48.3.1-alpha.1 → 48.4.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 (246) hide show
  1. package/dist/aiactions/aiactions.d.ts +36 -1
  2. package/dist/aiactions/model/aiactionsinteraction.d.ts +7 -1
  3. package/dist/aiassistant/aiassistantui.d.ts +0 -3
  4. package/dist/aiballoon/aiballoon.d.ts +0 -1
  5. package/dist/aichat/aichatballoon.d.ts +7 -2
  6. package/dist/aichat/aichatcontroller.d.ts +12 -2
  7. package/dist/aichat/aichatui.d.ts +20 -6
  8. package/dist/aichat/model/aichatcontext.d.ts +29 -10
  9. package/dist/aichat/model/aichatconversation.d.ts +10 -1
  10. package/dist/aichat/model/aichatinteraction.d.ts +6 -1
  11. package/dist/aichat/ui/aichatballoonview.d.ts +14 -19
  12. package/dist/aichat/ui/aichatcontrolsview.d.ts +0 -9
  13. package/dist/aichat/ui/aichatfeedview.d.ts +5 -11
  14. package/dist/aichat/ui/aichatview.d.ts +0 -4
  15. package/dist/aichat/ui/controls/aichatdropzoneview.d.ts +4 -0
  16. package/dist/aichat/ui/controls/aichatpromptcapabilitiesview.d.ts +14 -29
  17. package/dist/aichat/ui/feed/aichatfeedsuggestionitemview.d.ts +7 -2
  18. package/dist/aichathistory/aichathistoryui.d.ts +0 -1
  19. package/dist/aichatshortcuts/aichatshortcuts.d.ts +2 -2
  20. package/dist/aiconfig.d.ts +109 -0
  21. package/dist/aicore/aiconnector.d.ts +78 -11
  22. package/dist/aicore/aicore.d.ts +53 -0
  23. package/dist/aicore/aiediting.d.ts +8 -2
  24. package/dist/aicore/aigateway.d.ts +43 -11
  25. package/dist/aicore/errors/normalizeerror.d.ts +4 -0
  26. package/dist/aicore/model/aicapabilities.d.ts +20 -5
  27. package/dist/aicore/model/aicontext.d.ts +57 -2
  28. package/dist/aicore/model/aicontextlibrary.d.ts +70 -0
  29. package/dist/aicore/model/aicontextref.d.ts +39 -0
  30. package/dist/aicore/model/aidefaultcontext.d.ts +95 -0
  31. package/dist/aicore/model/aieditorroot.d.ts +26 -0
  32. package/dist/aicore/model/aimodels.d.ts +11 -4
  33. package/dist/aicore/model/aireply.d.ts +12 -1
  34. package/dist/aicore/model/airunresult.d.ts +18 -73
  35. package/dist/aicore/model/airunsinglerootresult.d.ts +101 -0
  36. package/dist/aicore/ui/aidisclaimerview.d.ts +0 -1
  37. package/dist/aicore/ui/aiheaderview.d.ts +0 -1
  38. package/dist/aicore/ui/aimodelselectorview.d.ts +151 -0
  39. package/dist/aicore/ui/aiskeleton.d.ts +0 -1
  40. package/dist/aicore/ui/aispinner.d.ts +0 -1
  41. package/dist/aicore/ui/suggestioncontainer/aiminitoolbarview.d.ts +0 -1
  42. package/dist/aicore/ui/suggestioncontainer/aisuggestionbodyview.d.ts +20 -5
  43. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontainerview.d.ts +0 -1
  44. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartheaderview.d.ts +12 -1
  45. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.d.ts +4 -12
  46. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.d.ts +6 -1
  47. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.d.ts +11 -1
  48. package/dist/aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.d.ts +0 -1
  49. package/dist/aicore/utils/createandattachaibodycollection.d.ts +0 -1
  50. package/dist/aicore/utils/createresizebutton.d.ts +0 -1
  51. package/dist/aicore/utils/createstartconversationbutton.d.ts +0 -1
  52. package/dist/aicore/utils/geteditorconfig.d.ts +88 -0
  53. package/dist/aicore/utils/getmodeldisplaymode.d.ts +21 -0
  54. package/dist/aicore/utils/getsuggestionpartsfromreply.d.ts +4 -1
  55. package/dist/aicore/utils/htmlparser.d.ts +1 -0
  56. package/dist/aicore/utils/inlineroot.d.ts +1 -0
  57. package/dist/aicore/utils/tocontextrefrequestdata.d.ts +1 -0
  58. package/dist/aidocumentprocessing/aidocumentprocessinggateway.d.ts +48 -25
  59. package/dist/aidocumentprocessing/model/aidocumentprocessingrunresult.d.ts +2 -2
  60. package/dist/aieditorintegration/aitogglebutton/aitogglebuttonui.d.ts +0 -1
  61. package/dist/aiquickactions/aiquickactions.d.ts +60 -9
  62. package/dist/aiquickactions/aiquickactionsui.d.ts +10 -4
  63. package/dist/aiquickactions/ui/balloon/aiactionsballoonview.d.ts +6 -1
  64. package/dist/aireviewcore/aireviewcorecheckregistry.d.ts +2 -4
  65. package/dist/aireviewcore/aireviewcoreediting.d.ts +43 -6
  66. package/dist/aireviewcore/aireviewcoreui.d.ts +3 -10
  67. package/dist/aireviewcore/model/aichecksinglerootresult.d.ts +22 -0
  68. package/dist/aireviewcore/model/aireviewcheckresultchange.d.ts +12 -1
  69. package/dist/aireviewcore/model/aireviewcheckrun.d.ts +11 -1
  70. package/dist/aireviewcore/types.d.ts +7 -1
  71. package/dist/aireviewcore/ui/aireviewcoreballoonsuggestionview.d.ts +0 -2
  72. package/dist/aireviewcore/ui/aireviewcorechecklistitemresultview.d.ts +7 -0
  73. package/dist/aireviewcore/ui/aireviewcorecustomcheckview.d.ts +1 -19
  74. package/dist/aireviewcore/ui/aireviewcorefinishreviewbuttonview.d.ts +0 -1
  75. package/dist/aireviewcore/ui/aireviewcorereviewchecklistview.d.ts +0 -1
  76. package/dist/aireviewcore/ui/aireviewcorereviewcompletedview.d.ts +0 -1
  77. package/dist/aireviewcore/ui/aireviewcoreuicheckresultsview.d.ts +10 -8
  78. package/dist/aireviewcore/ui/aireviewcoreview.d.ts +3 -4
  79. package/dist/aireviewmode/aireviewgateway.d.ts +63 -44
  80. package/dist/aireviewmode/aireviewmode.d.ts +73 -5
  81. package/dist/aireviewmode/aireviewmodecheckregistry.d.ts +8 -1
  82. package/dist/aireviewmode/aireviewmodecontroller.d.ts +2 -1
  83. package/dist/aireviewmode/model/aireviewcheckextra.d.ts +7 -2
  84. package/dist/aireviewmode/model/aireviewcustomcheckrun.d.ts +2 -1
  85. package/dist/aitabs/aitabsmainview.d.ts +0 -1
  86. package/dist/aitabs/tabs/aitabsview.d.ts +0 -1
  87. package/dist/aitabs/tabs/tabbuttonview.d.ts +0 -1
  88. package/dist/aitranslate/aitranslatecontroller.d.ts +2 -1
  89. package/dist/aitranslate/aitranslategateway.d.ts +33 -21
  90. package/dist/aitranslate/aitranslateui.d.ts +0 -1
  91. package/dist/aitranslate/model/aitranslatecheckrun.d.ts +2 -1
  92. package/dist/augmentation.d.ts +2 -0
  93. package/dist/index-content.css +0 -97
  94. package/dist/index-editor.css +2640 -2631
  95. package/dist/index.css +36 -32
  96. package/dist/index.d.ts +17 -8
  97. package/dist/index.js +19 -19
  98. package/dist/translations/af.js +1 -1
  99. package/dist/translations/af.umd.js +1 -1
  100. package/dist/translations/ar.js +1 -1
  101. package/dist/translations/ar.umd.js +1 -1
  102. package/dist/translations/ast.js +1 -1
  103. package/dist/translations/ast.umd.js +1 -1
  104. package/dist/translations/az.js +1 -1
  105. package/dist/translations/az.umd.js +1 -1
  106. package/dist/translations/be.js +1 -1
  107. package/dist/translations/be.umd.js +1 -1
  108. package/dist/translations/bg.js +1 -1
  109. package/dist/translations/bg.umd.js +1 -1
  110. package/dist/translations/bn.js +1 -1
  111. package/dist/translations/bn.umd.js +1 -1
  112. package/dist/translations/bs.js +1 -1
  113. package/dist/translations/bs.umd.js +1 -1
  114. package/dist/translations/ca.js +1 -1
  115. package/dist/translations/ca.umd.js +1 -1
  116. package/dist/translations/cs.js +1 -1
  117. package/dist/translations/cs.umd.js +1 -1
  118. package/dist/translations/da.js +1 -1
  119. package/dist/translations/da.umd.js +1 -1
  120. package/dist/translations/de-ch.js +1 -1
  121. package/dist/translations/de-ch.umd.js +1 -1
  122. package/dist/translations/de.js +1 -1
  123. package/dist/translations/de.umd.js +1 -1
  124. package/dist/translations/el.js +1 -1
  125. package/dist/translations/el.umd.js +1 -1
  126. package/dist/translations/en-au.js +1 -1
  127. package/dist/translations/en-au.umd.js +1 -1
  128. package/dist/translations/en-gb.js +1 -1
  129. package/dist/translations/en-gb.umd.js +1 -1
  130. package/dist/translations/en.js +1 -1
  131. package/dist/translations/en.umd.js +1 -1
  132. package/dist/translations/eo.js +1 -1
  133. package/dist/translations/eo.umd.js +1 -1
  134. package/dist/translations/es-co.js +1 -1
  135. package/dist/translations/es-co.umd.js +1 -1
  136. package/dist/translations/es.js +1 -1
  137. package/dist/translations/es.umd.js +1 -1
  138. package/dist/translations/et.js +1 -1
  139. package/dist/translations/et.umd.js +1 -1
  140. package/dist/translations/eu.js +1 -1
  141. package/dist/translations/eu.umd.js +1 -1
  142. package/dist/translations/fa.js +1 -1
  143. package/dist/translations/fa.umd.js +1 -1
  144. package/dist/translations/fi.js +1 -1
  145. package/dist/translations/fi.umd.js +1 -1
  146. package/dist/translations/fr.js +1 -1
  147. package/dist/translations/fr.umd.js +1 -1
  148. package/dist/translations/gl.js +1 -1
  149. package/dist/translations/gl.umd.js +1 -1
  150. package/dist/translations/gu.js +1 -1
  151. package/dist/translations/gu.umd.js +1 -1
  152. package/dist/translations/he.js +1 -1
  153. package/dist/translations/he.umd.js +1 -1
  154. package/dist/translations/hi.js +1 -1
  155. package/dist/translations/hi.umd.js +1 -1
  156. package/dist/translations/hr.js +1 -1
  157. package/dist/translations/hr.umd.js +1 -1
  158. package/dist/translations/hu.js +1 -1
  159. package/dist/translations/hu.umd.js +1 -1
  160. package/dist/translations/hy.js +1 -1
  161. package/dist/translations/hy.umd.js +1 -1
  162. package/dist/translations/id.js +1 -1
  163. package/dist/translations/id.umd.js +1 -1
  164. package/dist/translations/it.js +1 -1
  165. package/dist/translations/it.umd.js +1 -1
  166. package/dist/translations/ja.js +1 -1
  167. package/dist/translations/ja.umd.js +1 -1
  168. package/dist/translations/jv.js +1 -1
  169. package/dist/translations/jv.umd.js +1 -1
  170. package/dist/translations/kk.js +1 -1
  171. package/dist/translations/kk.umd.js +1 -1
  172. package/dist/translations/km.js +1 -1
  173. package/dist/translations/km.umd.js +1 -1
  174. package/dist/translations/kn.js +1 -1
  175. package/dist/translations/kn.umd.js +1 -1
  176. package/dist/translations/ko.js +1 -1
  177. package/dist/translations/ko.umd.js +1 -1
  178. package/dist/translations/ku.js +1 -1
  179. package/dist/translations/ku.umd.js +1 -1
  180. package/dist/translations/lt.js +1 -1
  181. package/dist/translations/lt.umd.js +1 -1
  182. package/dist/translations/lv.js +1 -1
  183. package/dist/translations/lv.umd.js +1 -1
  184. package/dist/translations/ms.js +1 -1
  185. package/dist/translations/ms.umd.js +1 -1
  186. package/dist/translations/nb.js +1 -1
  187. package/dist/translations/nb.umd.js +1 -1
  188. package/dist/translations/ne.js +1 -1
  189. package/dist/translations/ne.umd.js +1 -1
  190. package/dist/translations/nl.js +1 -1
  191. package/dist/translations/nl.umd.js +1 -1
  192. package/dist/translations/no.js +1 -1
  193. package/dist/translations/no.umd.js +1 -1
  194. package/dist/translations/oc.js +1 -1
  195. package/dist/translations/oc.umd.js +1 -1
  196. package/dist/translations/pl.js +1 -1
  197. package/dist/translations/pl.umd.js +1 -1
  198. package/dist/translations/pt-br.js +1 -1
  199. package/dist/translations/pt-br.umd.js +1 -1
  200. package/dist/translations/pt.js +1 -1
  201. package/dist/translations/pt.umd.js +1 -1
  202. package/dist/translations/ro.js +1 -1
  203. package/dist/translations/ro.umd.js +1 -1
  204. package/dist/translations/ru.js +1 -1
  205. package/dist/translations/ru.umd.js +1 -1
  206. package/dist/translations/si.js +1 -1
  207. package/dist/translations/si.umd.js +1 -1
  208. package/dist/translations/sk.js +1 -1
  209. package/dist/translations/sk.umd.js +1 -1
  210. package/dist/translations/sl.js +1 -1
  211. package/dist/translations/sl.umd.js +1 -1
  212. package/dist/translations/sq.js +1 -1
  213. package/dist/translations/sq.umd.js +1 -1
  214. package/dist/translations/sr-latn.js +1 -1
  215. package/dist/translations/sr-latn.umd.js +1 -1
  216. package/dist/translations/sr.js +1 -1
  217. package/dist/translations/sr.umd.js +1 -1
  218. package/dist/translations/sv.js +1 -1
  219. package/dist/translations/sv.umd.js +1 -1
  220. package/dist/translations/th.js +1 -1
  221. package/dist/translations/th.umd.js +1 -1
  222. package/dist/translations/ti.js +1 -1
  223. package/dist/translations/ti.umd.js +1 -1
  224. package/dist/translations/tk.js +1 -1
  225. package/dist/translations/tk.umd.js +1 -1
  226. package/dist/translations/tr.js +1 -1
  227. package/dist/translations/tr.umd.js +1 -1
  228. package/dist/translations/tt.js +1 -1
  229. package/dist/translations/tt.umd.js +1 -1
  230. package/dist/translations/ug.js +1 -1
  231. package/dist/translations/ug.umd.js +1 -1
  232. package/dist/translations/uk.js +1 -1
  233. package/dist/translations/uk.umd.js +1 -1
  234. package/dist/translations/ur.js +1 -1
  235. package/dist/translations/ur.umd.js +1 -1
  236. package/dist/translations/uz.js +1 -1
  237. package/dist/translations/uz.umd.js +1 -1
  238. package/dist/translations/vi.js +1 -1
  239. package/dist/translations/vi.umd.js +1 -1
  240. package/dist/translations/zh-cn.js +1 -1
  241. package/dist/translations/zh-cn.umd.js +1 -1
  242. package/dist/translations/zh.js +1 -1
  243. package/dist/translations/zh.umd.js +1 -1
  244. package/package.json +30 -12
  245. package/dist/aireviewmode/model/aireviewrunresult.d.ts +0 -20
  246. package/dist/aitranslate/model/aitranslaterunresult.d.ts +0 -20
package/dist/index.js CHANGED
@@ -20,22 +20,22 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Command as _0x24f2c3,ContextPlugin as _0x5d28a2,Editor as _0x1f7986,Plugin as _0x3688ab,rootAcceptsBlocks as _0x30f76f}from'@ckeditor/ckeditor5-core';import{IconAI as _0x170240,IconAIAdjustLength as _0x4bdbb4,IconAIAskAI as _0x3adddc,IconAIChangeTone as _0xc3c3ab,IconAIChat as _0x4282d3,IconAIChatCommands as _0x573020,IconAIContinueWriting as _0x33e37e,IconAIGrammarCheck as _0xc4a56a,IconAIHistory as _0x5c358f,IconAIImproveWriting as _0x1382e4,IconAIOther as _0x1c72b8,IconAIQuickActions as _0x27a3d4,IconAIReview as _0x5bd10a,IconAITranslate as _0x4dd947,IconBoxWithCheck as _0x3cdc95,IconBoxWithCross as _0x2cae61,IconBoxWithMarker as _0x41c137,IconBrowseFiles as _0x50cb94,IconBulb as _0x1c8883,IconCancel as _0x27af74,IconCheck as _0x27c014,IconChevronDown as _0x13018d,IconChevronRight as _0x1d567d,IconChevronUp as _0x53c774,IconCopy as _0x26f268,IconDocument as _0x97af05,IconDocumentOutline as _0x31a9ab,IconDropdownArrow as _0x20cf00,IconError as _0x340eb9,IconEye as _0x236ceb,IconEyeCrossedOut as _0x2ee912,IconFileUpload as _0x43190a,IconImage as _0xfe36cf,IconInfo as _0x4d8e0c,IconLink as _0x2906fb,IconLoupe as _0x11ac1a,IconMagicWand as _0x3775e2,IconMaximize as _0x14d558,IconMinimize as _0x4df119,IconNextArrow as _0x1a35f7,IconOutdated as _0x4f2173,IconPaperClip as _0x14f9ee,IconPin as _0x1f7bdc,IconPlus as _0x3927b2,IconPreviousArrow as _0x1901d7,IconRefresh as _0xd0bd37,IconRobotPencil as _0x595fc7,IconSelection as _0xc348c2,IconShowChangesOff as tt,IconShowChangesOn as et,IconStop as it,IconSubmit as st,IconThreeHorizontalDots as nt,IconThumbDown as rt,IconThumbUp as ot,IconWeb as at}from'@ckeditor/ckeditor5-icons';import{CKEditorError as ht,Collection as ct,DomEmitterMixin as lt,EmitterMixin as ut,FocusTracker as dt,KeystrokeHandler as _t,ObservableMixin as gt,Rect as At,ResizeObserver as It,_isMotionReduced as pt,first as mt,getConstrainedViewportRect as Et,global as Tt,insertToPriorityArray as wt,isVisible as Ct,logError as ft,logWarning as bt,scrollAncestorsToShowTarget as St,scrollViewportToShowTarget as Rt,toArray as Ot,uid as vt,version as kt}from'@ckeditor/ckeditor5-utils';import{AutocompleteView as Nt,BalloonPanelView as yt,BalloonToolbar as xt,BodyCollection as Lt,ButtonLabelView as Dt,ButtonLabelWithHighlightView as Pt,ButtonView as Ht,Dialog as Mt,DialogViewPosition as Vt,DropdownMenuPanelPositioningFunctions as Ut,FileDialogButtonView as Bt,FocusCycler as Gt,FormHeaderView as Ft,FormRowView as Kt,HighlightedTextView as Wt,IconView as Yt,InputTextView as $t,LabeledFieldView as qt,ListItemButtonView as Qt,ListItemGroupView as Xt,ListItemView as zt,ListView as jt,MenuBarMenuListItemButtonView as Jt,MenuBarMenuListItemView as Zt,MenuBarMenuListView as te,MenuBarMenuView as _0x42746f,SearchTextView as _0x27b4c4,SpinnerView as _0x3a0dfe,TextareaView as _0x5455d5,ToolbarView as _0x116a57,UIModel as _0x24dcce,View as _0x215f6f,ViewCollection as _0x498844,addListToDropdown as _0x1d523e,addMenuToDropdown as _0x24db68,clickOutsideHandler as _0x191c5a,createDropdown as _0x32dc43,createLabeledInputText as _0x4fc470,createLabeledTextarea as _0x30e284,submitHandler as _0x1dbba7}from'@ckeditor/ckeditor5-ui';import{ClipboardMarkersUtils as _0x3cc194,ClipboardPipeline as _0x4c1dbc}from'@ckeditor/ckeditor5-clipboard';import{InsertOperation as _0x416680,MarkerOperation as _0x11ea10,Matcher as _0x935ec5,ModelDocumentFragment as _0x2868da,ModelPosition as _0x5d12c5,ModelRange as _0x4e8468,ModelTreeWalker as _0x143bbc,ViewDataTransfer as _0x46cc83,ViewDocumentDomEventData as _0x5dfed6,ViewDowncastWriter as _0x17a1b2,ViewUpcastWriter as _0x361177,_DetachOperation as _0x50ba30,_insertIntoModelNodeList as _0x4ec8f8,_removeFromModelNodeList as _0x3c01a8,transformOperationSets as _0x29e916}from'@ckeditor/ckeditor5-engine';import{cloneDeep as _0x21b61f,debounce as _0x5d2c2e,escape as _0x33f243,escapeRegExp as _0x49ade4,throttle as _0x2150f4,unescape as _0x57857d}from'es-toolkit/compat';import{createParser as _0x239286}from'eventsource-parser';import{CloudServices as _0x545796}from'@ckeditor/ckeditor5-cloud-services';import{ConfirmMixin as _0x3688b4,DATA_ID_MODEL_ATTRIBUTE as _0x5e92a3,DATA_ID_VIEW_ATTRIBUTE as _0x2d4fde,DocumentCompare as _0x1cf5c4,SuggestionsConversion as _0x611eb6,fixElementSuggestionRange as _0x38a66a,getAllMarkersDomElementsSorted as _0x456453,getMarkerDomElement as _0x5e0b30}from'@ckeditor/ckeditor5-collaboration-core';import{parseDocument as _0x1023a2}from'htmlparser2';import{append as _0x218be5,appendChild as _0x1cca13,find as _0x3ced30,findAll as _0x5380b2,findOne as ti,getChildren as _0x5b482f,getParent as _0x38b6f8,isComment as _0xc2cc58,isTag as _0x489441,prepend as _0x201d1c,prependChild as _0x2dfbea,removeElement as _0x2a7599,replaceElement as _0x43a070,textContent as _0x1d60b7}from'domutils';import _0x1dbe92 from'dom-serializer';import{Document as _0x3df49e,Element as _0x1a4ef3,NodeWithChildren as _0x9749e,Text as _0xecc90d,cloneNode as _0x373861,isDocument as _0x1f806c,isText as _0x506b37}from'domhandler';import{MarkdownGfmMdToHtml as _0x3e333d,MarkdownGfmMdToHtmlDefaultPlugins as _0x387a1c}from'@ckeditor/ckeditor5-markdown-gfm';import _0x20d56a from'rehype-sanitize';import _0x312697 from'morphdom';import{diffArrays as _0x118114}from'diff';const fi='_ungrouppedCommands';function bi(_0x3b315e,_0x292931){const _0x2428af=(0x0,_0x292931['t'])('Other');return _0x3b315e['length']?'groupId'in _0x3b315e[0x0]?_0x3b315e:[{'groupId':fi,'groupLabel':_0x2428af,'order':0x1/0x0,'commands':_0x3b315e}]:[{'groupId':fi,'groupLabel':_0x2428af,'order':0x1/0x0,'commands':[]}];}const Si=globalThis['DataTransfer'],Ri='ai-ui';var Oi=class extends _0x3688ab{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x489399}=this,_0x1c602c=['ck-fake-ai-selection'];_0x489399['config']['get']('ai.assistant.useTheme')&&_0x1c602c['push']('ck-ai-assistant-ui_theme'),_0x489399['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ri,'view':{'classes':_0x1c602c,'priority':0xc}}),_0x489399['conversion']['for']('editingDowncast')['markerToElement']({'model':Ri,'view':(_0x358685,{writer:_0x280018})=>{if(!_0x358685['markerRange']['isCollapsed'])return null;const _0x5459bb=_0x280018['createUIElement']('span');return _0x280018['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x5459bb),_0x5459bb;}});}['afterInit'](){!async function(_0x329860){const _0x1630b9='nA7yurgOHbZvDplRkJscdICm86oPWx92f1qF0LaSX3NGwTMK4jVtYUBQi5zheE',_0x1b28b1=0x78fc0,_0x597aab=window['Date']['now'](),_0x10bcf3=_0x329860['editor'],_0x5afeaa=new window['Promise'](_0x2b68d0=>{_0x10bcf3['once']('ready',_0x2b68d0);}),_0x482d73={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x8b32cf=_0x10bcf3['config']['get']('licenseKey');async function _0x54c08a(){let _0x302725,_0x5623d3=null,_0x35e609=null;try{return'GPL'==_0x8b32cf?'NotAllowed':(_0x302725=_0x1361d6(),_0x302725?(_0x302725['usageEndpoint']&&(_0x35e609=_0x269d18(_0x302725['usageEndpoint'],_0x302725['jti'])),await _0x28b671()?_0x21623d()?_0x1ea366()?'Expired':_0x4c3e04()?('evaluation'==_0x302725['licenseType']&&(_0x5623d3=_0x5b05cd('EvaluationLimit')),await _0x11f220()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x1ea366(){const _0x4c2ae8=['evaluation','trial']['includes'](_0x302725['licenseType'])?_0x597aab/0x3e8:0xe10*_0x1b28b1;return _0x302725['exp']<_0x4c2ae8;}function _0x21623d(){const _0x33bdae=_0x302725['features'];return!!_0x33bdae&&(!!_0x33bdae['includes']('*')||!!_0x33bdae['includes']('AI'));}function _0x4c3e04(){const _0x546bf5=_0x302725['licensedHosts'];if(!_0x546bf5||0x0==_0x546bf5['length'])return!0x0;const {hostname:_0x379ea5}=new URL(window['location']['href']);if(_0x546bf5['includes'](_0x379ea5))return!0x0;const _0x181d0b=_0x379ea5['split']('.');return _0x546bf5['filter'](_0x12ce47=>_0x12ce47['includes']('*'))['map'](_0x453c33=>_0x453c33['split']('.'))['filter'](_0x10e763=>_0x10e763['length']<=_0x181d0b['length'])['map'](_0x48ff43=>Array(_0x181d0b['length']-_0x48ff43['length'])['fill']('*'===_0x48ff43[0x0]?'*':'')['concat'](_0x48ff43))['some'](_0x2c6668=>_0x181d0b['every']((_0x2578d4,_0x1c4955)=>_0x2c6668[_0x1c4955]===_0x2578d4||'*'===_0x2c6668[_0x1c4955]));}function _0x11f220(){return _0x5623d3&&_0x35e609?new window['Promise']((_0x57d237,_0x363f36)=>{_0x5623d3['then'](_0x57d237,_0x363f36),_0x35e609['then'](_0x3ef96e=>{'Valid'!=_0x3ef96e&&_0x57d237(_0x3ef96e);},_0x363f36);}):_0x5623d3||_0x35e609||'Valid';}}function _0x269d18(_0x1384ee,_0x1a9a7d){return new window['Promise'](_0x43ff7f=>{if(_0x51b778())return _0x43ff7f('Valid');_0x282df5(),_0x10bcf3['decorate']('_sendUsageRequest');let _0x17f4c6=!0x1;const _0x59863e=vt();function _0x328df6(_0x3ce702){return!!_0x3ce702&&('object'==typeof _0x3ce702||'function'==typeof _0x3ce702)&&'function'==typeof _0x3ce702['then']&&'function'==typeof _0x3ce702['catch'];}function _0x1732ac(_0x3a2fcd){_0xcf2d37(_0x3a2fcd)['then'](_0x2fb95a=>_0x2fb95a&&'ok'==_0x2fb95a['status']?_0x31d5c8(_0x753373(_0x59863e+_0x1a9a7d))!=_0x2fb95a['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x12eb05=>(_0x472263(),_0x12eb05),()=>{const _0x35abd6=_0x268452();return null==_0x35abd6?(_0x472263(),'Valid'):_0x597aab-_0x35abd6>0x240c8400?'UsageLimit':'Valid';})['then'](_0x43ff7f)['catch'](()=>{_0x43ff7f('UsageLimit');});const _0x23d003=0x36ee80;function _0x472263(){const _0x11487a='llct-'+_0x31d5c8(_0x753373(_0x1384ee)),_0x1358dc=_0x1caf3a(_0x31d5c8(window['Math']['ceil'](_0x597aab/_0x23d003)));window['localStorage']['setItem'](_0x11487a,_0x1358dc);}function _0x268452(){const _0x492a13='llct-'+_0x31d5c8(_0x753373(_0x1384ee)),_0x36cd85=window['localStorage']['getItem'](_0x492a13);return _0x36cd85?window['parseInt'](_0x1caf3a(_0x36cd85),0x10)*_0x23d003:null;}function _0xcf2d37(_0x131da6){return new window['Promise']((_0xc923ef,_0x392866)=>{_0x131da6['then'](_0xc923ef,_0x392866),window['setTimeout'](_0x392866,0x1d4c0);});}}_0x10bcf3['on']('_sendUsageRequest',(_0x2b50b9,_0x1fd30f)=>{if(_0x1fd30f[0x0]!=_0x1384ee)return _0x43ff7f('UsageLimit');_0x1fd30f[0x1]={..._0x1fd30f[0x1],'requestId':_0x59863e};},{'priority':'high'}),_0x10bcf3['on']('_sendUsageRequest',_0x229c46=>{_0x328df6(_0x229c46['return'])&&(_0x17f4c6=!0x0,_0x1732ac(_0x229c46['return']));},{'priority':'low'}),_0x5afeaa['then'](()=>{_0x17f4c6||_0x43ff7f('UsageLimit');});});function _0x51b778(){return'auto'==_0x10bcf3['editing']['view']['_overlayModeHint'];}function _0x282df5(){_0x10bcf3['editing']['view']['_overlayModeHint']='auto';}}function _0x5b05cd(_0x4220e5){const _0x57593d=[new window['Promise'](_0x241055=>setTimeout(_0x241055,0x93ecc)),_0x5afeaa['then'](()=>new window['Promise'](_0x2cb754=>{let _0x510b34=0x0;_0x10bcf3['model']['on']('applyOperation',(_0x312a58,_0x5662ba)=>{_0x5662ba[0x0]['isDocumentOperation']&&_0x510b34++,0x5e8==_0x510b34&&(_0x2cb754(),_0x312a58['off']());});}))];return window['Promise']['race'](_0x57593d)['then'](()=>_0x4220e5);}async function _0x1a25ac(){await _0x5afeaa,_0x10bcf3['model']['change']=_0x258a67,_0x10bcf3['model']['enqueueChange']=_0x258a67,_0x10bcf3['enableReadOnlyMode']('model');}function _0x53bc2d(_0x865c6f){const _0x424d00=_0xd714ec();_0x10bcf3[_0x424d00]='aiLicenseKey'+_0x865c6f,'Valid'!=_0x865c6f&&_0x1a25ac();}function _0xd714ec(){const _0x59f86b=window['String'](window['performance']['now']())['replace']('.','');let _0x10faf7='n';for(let _0x3acc99=0x0;_0x3acc99<_0x59f86b['length'];_0x3acc99+=0x2){let _0x15009a=window['parseInt'](_0x59f86b['substring'](_0x3acc99,_0x3acc99+0x2));_0x15009a>=0x3e&&(_0x15009a-=0x3e),_0x10faf7+=_0x1630b9[_0x15009a];}return _0x10faf7;}function _0x1361d6(){const _0x550f29=_0x8b32cf['split']('.');if(0x3!=_0x550f29['length'])return null;return _0x350e65(_0x550f29[0x1]);function _0x350e65(_0x2168fb){const _0x317c80=_0x10947e(_0x2168fb);return _0x317c80&&_0x53adbf()?_0x317c80:null;function _0x53adbf(){const _0x3c8854=_0x317c80['jti'],_0x435730=window['parseInt'](_0x3c8854['substring'](_0x3c8854['length']-0x8),0x10),_0x41b4b6={..._0x317c80,'jti':_0x3c8854['substring'](0x0,_0x3c8854['length']-0x8)};return delete _0x41b4b6['vc'],_0x753373(_0x41b4b6)==_0x435730;}}}async function _0x28b671(){let _0x20009a=!0x0;try{const [_0x17ba1b,_0x3c047d,_0x345480]=_0x8b32cf['split']('.');return _0x5edafa(_0x17ba1b),await _0x18834b(_0x17ba1b,_0x3c047d,_0x345480),_0x20009a;}catch{return!0x1;}function _0x5edafa(_0x5758e9){const _0x3ae87b=_0x10947e(_0x5758e9);_0x3ae87b&&'ES256'==_0x3ae87b['alg']||(_0x20009a=!0x1);}async function _0x18834b(_0x477dde,_0x1379d3,_0x3522ea){const _0x436cd9=window['Uint8Array']['from'](_0x3246f1(_0x3522ea),_0x25c96a=>_0x25c96a['charCodeAt'](0x0)),_0x1d5615=new window['TextEncoder']()['encode'](_0x477dde+'.'+_0x1379d3),_0x51cb81=window['crypto']['subtle'];if(!_0x51cb81)return;const _0x35d4c5=await _0x51cb81['importKey']('jwk',_0x482d73,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x51cb81['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x35d4c5,_0x436cd9,_0x1d5615)||(_0x20009a=!0x1);}}function _0x10947e(_0x3db679){return _0x3db679['startsWith']('ey')?JSON['parse'](_0x3246f1(_0x3db679)):null;}function _0x3246f1(_0x77b29a){return window['atob'](_0x77b29a['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x753373(_0x40f9eb){let _0xad9c54=0x1505;function _0x18abd7(_0x3d2287){for(let _0x106255=0x0;_0x106255<_0x3d2287['length'];_0x106255++){const _0x3a9d92=_0x3d2287['charCodeAt'](_0x106255);_0xad9c54=(_0xad9c54<<0x5)+_0xad9c54+_0x3a9d92,_0xad9c54&=_0xad9c54;}}function _0x20a3ae(_0x42be40){Array['isArray'](_0x42be40)?_0x42be40['forEach'](_0x20a3ae):_0x42be40&&'object'==typeof _0x42be40?Object['entries'](_0x42be40)['sort']()['forEach'](([_0x5cb533,_0x57864a])=>{_0x18abd7(_0x5cb533),_0x20a3ae(_0x57864a);}):_0x18abd7(window['String'](_0x42be40));}return _0x20a3ae(_0x40f9eb),_0xad9c54>>>0x0;}function _0x31d5c8(_0x475d35){return _0x475d35['toString'](0x10)['padStart'](0x8,'0');}function _0x1caf3a(_0x1c8d98){return _0x1c8d98['split']('')['reverse']()['join']('');}function _0x258a67(){}_0x53bc2d(await _0x54c08a());}(this);}['showFakeVisualSelection'](){const _0x45d90e=this['editor']['model'];_0x45d90e['change'](_0x3a08f9=>{const _0x476f93=_0x45d90e['document']['selection']['getRanges']();let _0x4a353f=0x0;for(const _0x117083 of _0x476f93){const _0x3b0afa=Ri+':'+_0x4a353f;if(_0x45d90e['markers']['has'](_0x3b0afa))_0x3a08f9['updateMarker'](_0x3b0afa,{'range':_0x117083});else{if(_0x117083['start']['isAtEnd']){const _0x31b147=_0x117083['start']['getLastMatchingPosition'](({item:_0x308d91})=>!_0x45d90e['schema']['isContent'](_0x308d91),{'boundaries':_0x117083});_0x3a08f9['addMarker'](_0x3b0afa,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3a08f9['createRange'](_0x31b147,_0x117083['end'])});}else _0x3a08f9['addMarker'](_0x3b0afa,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x117083});}_0x4a353f++;}});}['hideFakeVisualSelection'](){const _0x346971=this['editor']['model'],_0x50617a=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](Ri));_0x50617a['length']&&_0x346971['change'](_0xa9874b=>{_0x50617a['forEach'](_0x2b3255=>{_0xa9874b['removeMarker'](_0x2b3255);});});}['insertContent'](_0x39be8a,_0x56da82){const _0x4a0dfc=this['_getAISelection'](),_0x27bafe=_0x56da82||_0x4a0dfc['getFirstRange']();this['editor']['model']['canEditAt'](_0x27bafe)&&this['editor']['model']['change'](_0x5f1250=>{this['hideFakeVisualSelection'](),_0x56da82||this['_resetContentOfSelectedTableCells'](_0x5f1250,_0x4a0dfc),this['_pasteHTMLUsingClipboard']({'insertAt':_0x27bafe,'writer':_0x5f1250,'html':_0x39be8a});});}['insertContentBelow'](_0x1ca16f){const {model:_0x58e0e1}=this['editor'],_0x5e4d12=this['_getAISelection']();_0x58e0e1['change'](()=>{const _0x4a502a=this['_prepareTableInsertBelowPosition'](_0x1ca16f,_0x5e4d12)||this['_getDefaultInsertBelowPosition'](_0x5e4d12);this['insertContent'](_0x1ca16f,_0x4a502a);});}['_getAISelection'](){const _0x4630d3=this['editor']['model'],_0x1157c4=Array['from'](_0x4630d3['markers']['getMarkersGroup'](Ri))['map'](_0x260c75=>_0x260c75['getRange']());return _0x4630d3['createSelection'](_0x1157c4);}['_pasteHTMLUsingClipboard']({writer:_0x5edd6b,html:_0x3f4673,insertAt:_0x4a4709}){const {view:_0x45efc6}=this['editor']['editing'],_0x324af6=this['editor']['plugins']['get'](_0x4c1dbc),_0x495d3e=new Si();_0x495d3e['setData']('text/html',_0x3f4673);const _0x4f6cad=new _0x5dfed6(_0x45efc6,new ClipboardEvent('paste',{'clipboardData':_0x495d3e}),{'dataTransfer':new _0x46cc83(_0x495d3e)});_0x5edd6b['setSelection'](_0x4a4709);const _0x1e49bb=(_0x1b0b69,_0x2aa89e)=>{_0x2aa89e['resultRange']&&_0x5edd6b['setSelection'](_0x2aa89e['resultRange']);};_0x324af6['once']('contentInsertion',_0x1e49bb,{'priority':'lowest'}),_0x45efc6['document']['fire']('paste',_0x4f6cad),_0x324af6['off']('contentInsertion',_0x1e49bb);}['_getDefaultInsertBelowPosition'](_0x22cb28){const {model:_0x48f6e4}=this['editor'],_0x248d77=Array['from'](_0x22cb28['getSelectedBlocks']());return _0x248d77['length']?_0x48f6e4['createPositionAfter'](_0x248d77['pop']()):_0x22cb28['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x17d36b,_0x335cd2){const {model:_0x11ae76,plugins:_0x4fdce4}=this['editor'];if(_0x4fdce4['has']('TableUtils')){const _0x30d028=_0x4fdce4['get']('TableUtils')['getSelectedTableCells'](_0x335cd2);if(_0x30d028['length']){const _0x542f64=this['_getTableRowCountFromContent'](_0x17d36b),_0x4b6901=this['_createEmptyTableRows'](_0x30d028,_0x542f64);return _0x11ae76['createPositionAt'](_0x4b6901,0x0);}}return null;}['_getTableRowCountFromContent'](_0x197f5f){const _0x517854=this['editor']['plugins']['get']('TableUtils'),_0x3d7181=this['editor']['data']['parse'](_0x197f5f,'$documentFragment'),_0x355724=Array['from'](_0x3d7181['getChildren']())['filter'](_0x1d69c5=>_0x1d69c5['is']('element','table'));let _0x541843=0x0;return _0x355724['forEach'](_0x27d91c=>{_0x541843+=_0x517854['getRows'](_0x27d91c);}),_0x541843;}['_createEmptyTableRows'](_0x2ffc36,_0x4a54d4){const _0x1f9e69=this['editor']['plugins']['get']('TableUtils'),_0xc380e=_0x1f9e69['getRowIndexes'](_0x2ffc36),_0x558fdf=_0x1f9e69['getColumnIndexes'](_0x2ffc36),_0x15e6d6=_0xc380e['last']+0x1,_0x2ef366=_0x558fdf['first'],_0x29170d=_0x2ffc36[0x0]['findAncestor']('table');for(let _0x4a00f7=0x0;_0x4a00f7<_0x4a54d4;_0x4a00f7++)_0x1f9e69['insertRows'](_0x29170d,{'at':_0x15e6d6});return _0x29170d['getChild'](_0x15e6d6)['getChild'](_0x2ef366);}['_resetContentOfSelectedTableCells'](_0x74054,_0x275a9f){const {plugins:_0x5d53f5}=this['editor'],{model:_0x267637}=_0x74054;_0x5d53f5['has']('TableUtils')&&_0x5d53f5['get']('TableUtils')['getSelectedTableCells'](_0x275a9f)['length']&&_0x267637['deleteContent'](_0x275a9f);}},vi=class extends _0x3688ab{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new ht('aiadapter-text-adapter-not-set',null);}},ki=class extends Error{constructor(_0x34608e){super(_0x34608e),this['name']='AIRequestError';}};function Ni(_0x69e469,_0x1d72c5,_0x5c795b){const t=_0x69e469['t'];switch(_0x1d72c5){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',_0x5c795b);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5c795b);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'},_0x5c795b);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 _0x1d72c5;}}var yi=class extends _0x24f2c3{['_commandDefinitions'];constructor(_0x3b740b,_0x1f8d94){super(_0x3b740b),this['_commandDefinitions']=_0x1f8d94,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3cc37a,_0x1c8ea1,_0x4c8ecd)=>{this['isEnabled']&&(this['enabledCommandsIds']=xi(this['_commandDefinitions'],_0x4c8ecd));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xa14906,_0x4ffe92,_0x1aaa83)=>{this['enabledCommandsIds']=_0x1aaa83?xi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2d7279=this['editor']['model'];this['_hasContext']=function(_0x449ec7){const _0x5b8270=_0x449ec7['document']['selection'];return _0x5b8270['isCollapsed']?0x0!==[..._0x5b8270['getSelectedBlocks']()]['length']&&![..._0x5b8270['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x449ec7['hasContent'](_0x5b8270['getFirstRange']());}(_0x2d7279);const _0x432081=_0x2d7279['document']['selection'],_0x54799b=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x2d6a35 of _0x432081['getRanges']())for(const _0x34bdd7 of _0x2d6a35['getItems']())if(_0x34bdd7['is']('element')&&_0x54799b['includes'](_0x34bdd7['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x996623='',_0x2853fa='',_0x4a77a2='custom'){this['editor']['plugins']['get'](Xi)['showUI'](_0x996623,_0x2853fa,_0x4a77a2);}};function xi(_0x50c602,_0x204f63){const _0x416b9d=new Set();for(const _0x3546ef of _0x50c602['values']())(_0x204f63||!0x1===_0x3546ef['requiresContent'])&&_0x416b9d['add'](_0x3546ef['id']);return Array['from'](_0x416b9d);}const Li=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is'),Di=/* #__PURE__ -- @preserve */
24
- gt();var Pi=class extends Di{['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x2de2e9,_0x5c7dcd,_0x209394){super(),this['editor']=_0x2de2e9,this['textAdapter']=_0x5c7dcd,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x209394,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x23bbf9,_0x32584f,_0x4e39f8)=>{this['view']['value']=this['_sanitizeHTML'](_0x4e39f8);}),this['listenTo'](this['view'],'submitPrompt',(_0x149a54,_0x2170bc)=>{const _0x4ed6c8=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x2170bc,_0x4ed6c8,'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:_0x35e050,query:_0x65db97,htmlContent:_0x564524,label:_0x4c07ef,mainActionLabel:_0x9b9139}){this['view']['prompt']=_0x4c07ef,this['view']['mainAction']=_0x9b9139,this['initialContext']=_0x564524,_0x65db97&&(this['view']['isRendered']?this['_handleQuery'](_0x65db97,_0x564524,_0x35e050,_0x4c07ef):this['view']['once']('render',()=>{this['_handleQuery'](_0x65db97,_0x564524,_0x35e050,_0x4c07ef);}));}['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'](_0x21c08c,_0x175fbf,_0x2162ed,_0x18b060){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x175fbf,this['previousQuery']=_0x21c08c,this['previousLabel']=_0x18b060||_0x21c08c,this['previousActionId']=_0x2162ed,new Promise(_0x113ec2=>{this['textAdapter']['makeRequest']({'query':_0x21c08c,'context':_0x175fbf,'onData':_0x2a7e80=>{this['currentResponse']=_0x2a7e80,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x2162ed})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x959eee=>{_0x959eee instanceof ki?this['view']['handleError'](_0x959eee['message']):this['view']['handleError'](),_0x113ec2();})['finally'](()=>{this['stopProcessing'](),_0x113ec2();});});}['_parseAndNormalizeContent'](_0x3b2761,_0x2bdbdf=!0x1){const _0x4cc63f=Li['exec'](_0x3b2761);_0x3b2761=_0x4cc63f?_0x3b2761['substring'](_0x4cc63f[0x1]['length']):_0x3b2761['length']<0x64&&!_0x2bdbdf?'':this['_stripMarkdownSyntax'](_0x3b2761);const _0xc9094=this['_domParser']['parseFromString'](_0x3b2761,'text/html');if(_0x4cc63f){const _0xc2b6dd=Array['from'](_0xc9094['body']['childNodes']);_0xc2b6dd['reverse']();for(const _0x40856a of _0xc2b6dd){if(_0x40856a['nodeType']==Node['ELEMENT_NODE'])break;_0x40856a['remove']();}}const _0x2d1150=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xc9094['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x2d1150);const _0x53c97d=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x3161fa=this['editor']['data']['toModel'](_0x2d1150);return _0x53c97d||_0x3161fa['markers']['clear'](),this['editor']['data']['stringify'](_0x3161fa);}['_normalizeResponseHeadings'](_0x204925){const _0x2fed78=new _0x361177(this['editor']['editing']['view']['document']),_0x12e344=new _0x935ec5({'name':/^h[1-5]$/}),_0x326a17=[];let _0x3e1a09=!0x1;for(const _0x2fff68 of _0x204925)_0x2fff68['is']('element')&&_0x12e344['match'](_0x2fff68)&&(_0x326a17['push'](_0x2fff68),'h1'==_0x2fff68['name']&&(_0x3e1a09=!0x0));if(_0x3e1a09){for(const _0xb505a of _0x326a17)_0x2fed78['rename']('h'+(parseInt(_0xb505a['name'][0x1])+0x1),_0xb505a);}}['_isH1TagSupportEnabled'](){const {data:_0x20c595,editing:_0x5df508}=this['editor'],_0x1d9327=_0x20c595['htmlProcessor']['toView']('<h1></h1>'),_0x3cd87f=_0x20c595['toView'](_0x20c595['toModel'](_0x1d9327));return!!_0x5df508['view']['domConverter']['viewToDom'](_0x3cd87f)['querySelector']('h1');}['_sanitizeHTML'](_0x52996c){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x52996c),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x59533c){const _0xb3326a=_0x59533c['trim']();return _0xb3326a['startsWith']('```html')?_0xb3326a['endsWith']('```')?_0xb3326a['substring'](0x7,_0xb3326a['length']-0x3):_0xb3326a['substring'](0x7):_0x59533c;}};const Hi={'REPLACE':'replace','INSERT':'insert'};var Mi=class extends _0x116a57{constructor(_0xb52c51){super(_0xb52c51),this['set']('isVisible',!0x1),this['set']('mainAction',Hi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x558d90=>Ni(_0xb52c51,'AI_'+_0x558d90['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Ni(_0xb52c51,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Ni(_0xb52c51,'Try\x20again')),this['stopButton']=this['_createButton'](Ni(_0xb52c51,'Stop'));const _0x39649e=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x39649e['if']('isVisible','ck-hidden',_0x506ccc=>!_0x506ccc)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x5d2679,_0x339ec4){const _0x1f60c8=new Ht(this['locale']);return _0x1f60c8['set']({'label':_0x5d2679,'class':_0x339ec4||'','isVisible':!0x0,'withText':!0x0}),_0x1f60c8;}},Vi=class extends _0x215f6f{['contentFieldView'];['copyButtonView'];constructor(_0x445cb1,_0x3cea2f=''){super(_0x445cb1),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1bca16=this['bindTemplate'];this['contentFieldView']=new Ui(_0x445cb1,_0x3cea2f),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1bca16['if']('isVisible','ck-hidden',_0x209f25=>!_0x209f25)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1bca16['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 _0x5c4c5e=!0x1;this['on']('change:value',(_0x3e94a7,_0x4aa542,_0x43af10)=>{const _0x17550f=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x43af10),this['isProcessing']&&_0x17550f&&!_0x5c4c5e&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x5b658d,_0x3e79ec,_0x1d186c)=>{_0x5c4c5e=!0x1,_0x1d186c?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x5c4c5e=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x5c4c5e=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0xd99891=this['locale'],_0x150b15=new Ht(this['locale']),_0x40c463='ck-ai-form__copy-button';return _0x150b15['set']({'label':Ni(_0xd99891,'Copy'),'icon':_0x26f268,'class':_0x40c463,'tooltip':!0x0}),_0x150b15['bind']('isVisible')['to'](this,'value',_0x345550=>!!_0x345550),_0x150b15['bind']('isEnabled')['to'](this,'isProcessing',_0x576705=>!_0x576705),_0x150b15['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x150b15['icon']=_0x27c014,_0x150b15['class']=_0x40c463+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x150b15['icon']=_0x26f268,_0x150b15['class']=_0x40c463;},0x3e8);}),_0x150b15;}['_copyHTMLToClipboard'](_0x3b3e81){const {window:_0x110ae5,document:_0x173d5b}=Tt;if(_0x110ae5['ClipboardItem']){const {Blob:_0x304bc9,ClipboardItem:_0x45eaef}=_0x110ae5,_0x21fdef=[new _0x45eaef({'text/html':new _0x304bc9([_0x3b3e81['innerHTML']],{'type':'text/html'}),'text/plain':new _0x304bc9([_0x3b3e81['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x21fdef);}else{const _0x294fab=_0x173d5b['createElement']('div');_0x294fab['style']['position']='absolute',_0x294fab['style']['left']='-9999px',_0x294fab['innerHTML']='<span>[</span>'+_0x3b3e81['innerHTML']+'<span>]</span>',_0x173d5b['body']['appendChild'](_0x294fab);const _0x4036b4=_0x173d5b['createRange']();_0x4036b4['setStartAfter'](_0x294fab['firstElementChild']),_0x4036b4['setEndBefore'](_0x294fab['lastElementChild']);const _0x4ebdfc=_0x110ae5['getSelection']();_0x4ebdfc['removeAllRanges'](),_0x4ebdfc['addRange'](_0x4036b4),_0x173d5b['execCommand']('copy'),_0x294fab['remove']();}}},Ui=class extends _0x215f6f{constructor(_0x23b1a4,_0x5ad59e=''){super(_0x23b1a4),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x5ad59e,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x53f1c3){this['element']['innerHTML']=_0x53f1c3;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x28065d=new _0x215f6f(),_0x5db2c0=this['locale'],_0x46e94b=new _0x3a0dfe();return _0x46e94b['isVisible']=!0x0,_0x28065d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x46e94b,{'text':Ni(_0x5db2c0,'AI\x20is\x20writing...')}]}),_0x28065d['render'](),_0x28065d;}},Bi=class extends _0x215f6f{constructor(_0x4ea770,_0x22e236=''){super(_0x4ea770);const _0x4e59dc=new Yt(),_0x1f4a73=this['bindTemplate'];this['set']('text',_0x22e236),_0x4e59dc['content']=_0x340eb9,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4e59dc,{'text':_0x1f4a73['to']('text')}]});}},Gi=class extends Nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x6c3d8f,_0x3a3209){super(_0x6c3d8f,_0x3a3209),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',(_0x4faaf4,_0x3d8783)=>{_0x4faaf4['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3d8783());});}['_createSubmitButton'](){const _0x4a50e3=new Ht(this['locale']),_0x3f4b3e=this['locale'];return _0x4a50e3['set']({'icon':st,'label':Ni(_0x3f4b3e,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x4a50e3['on']('execute',()=>{this['submit']();}),_0x4a50e3['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x5ad8c0,_0x4effa1)=>!_0x5ad8c0&&_0x4effa1),_0x4a50e3;}['_createShowHistoryButton'](){const _0x2e9248=new Ht(this['locale']),_0x2f6046=this['resultsView'],_0x176505=this['locale'];_0x2e9248['set']({'label':Ni(_0x176505,'History'),'withText':!0x1,'icon':_0x5c358f,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x2e9248['bind']('isOn')['to'](_0x2f6046,'isVisible'),_0x2e9248['bind']('isEnabled')['to'](this,'isEnabled'),_0x2e9248['on']('execute',()=>{_0x2f6046['isVisible']=!_0x2f6046['isVisible'],_0x2f6046['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x3f3638=()=>{Tt['window']['requestAnimationFrame'](()=>{if(Ct(this['element'])){const _0x1d4c53=new At(this['queryView']['fieldView']['element']),_0x5b9095=_0x1d4c53['width'],_0x1e281c='rtl'===_0x176505['uiLanguageDirection']?'left':'right';_0x1d4c53['excludeScrollbarsAndBorders'](),_0x2e9248['element']['style'][_0x1e281c]=_0x5b9095-_0x1d4c53['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x3f3638),this['on']('render',_0x3f3638),_0x2e9248;}['submit'](){const _0x5764f7=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x5764f7);}['focus'](_0x160f0d){-0x1===_0x160f0d?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}},Fi=class extends jt{['historyGroupView'];['clearHistoryButton'];constructor(_0x2bf9ee){super(_0x2bf9ee),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Xt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Ni(_0x2bf9ee,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4b9f6e=0x0;for(const _0x3d0756 of this['items'])_0x4b9f6e+=_0x3d0756['items']['length'];return{'resultsCount':_0x4b9f6e,'totalItemsCount':_0x4b9f6e};}['_createClearHistoryButton'](){const _0x65da43=this['locale'],_0x152297=new Ht(this['locale']);return _0x152297['set']({'label':'('+Ni(_0x65da43,'Clear')+')','withText':!0x0}),_0x152297['on']('execute',()=>this['fire']('clearHistory')),_0x152297;}},Ki=class extends zt{constructor(_0x33a261){super();const _0x538aac=new Dt(),_0x26c2e3=new Ht(this['locale'],_0x538aac);this['children']['add'](_0x26c2e3),_0x26c2e3['set']({'label':_0x33a261['prompt'],'withText':!0x0}),_0x26c2e3['on']('execute',()=>{this['fire']('execute',{'value':_0x57857d(_0x33a261['prompt'])});});}};const Wi='CKEditor/AIFormView/PromptHistory';var Yi=class extends ct{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x47c1dc,_0x5536af)=>{const _0x4bf6d0=$i(_0x5536af['prompt']);for(const _0x33c067 of this)if(_0x33c067!=_0x5536af&&$i(_0x33c067['prompt'])===_0x4bf6d0){this['remove'](_0x33c067);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x19e371=sessionStorage['getItem'](Wi)||'[]';this['addMany'](JSON['parse'](_0x19e371));}['_saveToSessionStorage'](){sessionStorage['setItem'](Wi,JSON['stringify'](this['map'](_0x5cb5d6=>_0x5cb5d6)));}};function $i(_0x4967d5){return _0x4967d5['toLowerCase']()['trim']();}var qi=class extends _0x215f6f{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2dfc99,_0x186992,_0x33281d=''){super(_0x2dfc99),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',Hi['REPLACE']),this['_promptHistory']=new Yi(),this['errorView']=new Bi(_0x2dfc99),this['contentArea']=new Vi(_0x2dfc99,_0x33281d),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 dt(),this['keystrokes']=new _t(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Gt({'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 _0x530394=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x186992],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x530394['if']('isError','ck-hidden',_0x2f5223=>!_0x2f5223)]},'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'](_0x11b0dc=0x1){-0x1===_0x11b0dc?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 _0x534af2=this['locale'],_0x59d432=new Gi(_0x534af2,{'queryView':{'label':Ni(_0x534af2,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x30e284,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Ni(_0x534af2,'Empty\x20history'),'secondary':Ni(_0x534af2,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x59d432['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x74c521,_0x11582a)=>_0x74c521&&!_0x11582a),this['listenTo'](_0x59d432,'submit',(_0x442115,_0x4754e8)=>{this['prompt']=_0x4754e8;const _0x2b24fa=_0x33f243(_0x4754e8);this['fire']('submitPrompt',_0x2b24fa),_0x4754e8['trim']()&&this['_promptHistory']['add']({'prompt':_0x2b24fa},0x0);},{'priority':'high'}),_0x59d432;}['_createHistoryView'](){const _0xb5c691=new Fi(this['locale']);return _0xb5c691['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ki),_0xb5c691['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0xb5c691;}['_createToolbar'](){const _0x5ed465=new Mi(this['locale']);return _0x5ed465['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x289ed1,_0x51b7b4,_0x52b98a)=>_0x289ed1&&!_0x51b7b4&&!!_0x52b98a),_0x5ed465['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x5ed465['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2d56b5,_0x3a056f,_0x4fa0a6)=>_0x2d56b5&&!_0x3a056f&&!!_0x4fa0a6),_0x5ed465['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x5ed465['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x47de1e,_0x506b4f)=>_0x47de1e&&!_0x506b4f),_0x5ed465['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x5ed465['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x5ed465['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x5ed465;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x35022a=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Ni(_0x35022a,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x3f0c77){const _0x473b39=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x3f0c77||Ni(_0x473b39,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}};const Qi=globalThis['DataTransfer'];var Xi=class extends _0x3688ab{['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[_0x3cc194,Oi,vi,Mt];}constructor(_0x459326){super(_0x459326),_0x459326['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x459326['config']['define']('ai.assistant.contentAreaCssClass',''),_0x459326['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x459326['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x3be6fd}=this;this['_aiAdapter']=_0x3be6fd['plugins']['get'](vi),this['_dialog']=_0x3be6fd['plugins']['get'](Mt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x187080=new yi(_0x3be6fd,Array['from'](this['_commandDefinitions']['values']()));_0x3be6fd['commands']['add']('showAIAssistant',_0x187080),_0x3be6fd['ui']['componentFactory']['add']('aiCommands',_0xe0e1f6=>{const _0x50bcb2=_0x32dc43(_0xe0e1f6);return _0x50bcb2['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x50bcb2['buttonView']['set']({'label':Ni(_0xe0e1f6,'AI\x20Commands'),'icon':_0x3775e2,'tooltip':!0x0}),_0x50bcb2['on']('execute',_0x13aec7=>this['_onExecute'](_0x13aec7['source']['id'])),_0x24db68(_0x50bcb2,_0x3be6fd['ui']['view']['body'],function(_0x3e368f){const _0x310444=ji(_0x3e368f,bi(_0x3e368f['config']['get']('ai.assistant.commands'),_0x3e368f['locale']))['filter'](_0xb6caab=>_0xb6caab['commands']['length']);return 0x1===_0x310444['length']?ji(_0x3e368f,_0x310444[0x0]['commands'])['map'](_0x14e91b=>({'id':_0x14e91b['id'],'label':_0x14e91b['label']})):_0x310444['map'](_0x1ac8ef=>{const {groupId:_0x285228,groupLabel:_0x1a4f3e,commands:_0x453963}=_0x1ac8ef,_0x2986c2=ji(_0x3e368f,_0x453963)['map'](_0x68d111=>({'id':_0x68d111['id'],'label':_0x68d111['label']}));return{'id':_0x285228,'menu':_0x1a4f3e||_0x285228,'children':_0x2986c2};});}(_0x3be6fd),{'ariaLabel':Ni(_0xe0e1f6,'AI\x20Commands')}),_0x50bcb2['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x187080['on']('change:enabledCommandsIds',_0x42d502),_0x50bcb2['menuView']['once']('render',_0x42d502),_0x50bcb2;function _0x42d502(){_0x50bcb2['isEnabled']=_0x187080['enabledCommandsIds']['length']>0x0;for(const _0x3ace52 of _0x50bcb2['menuView']['buttons'])_0x3ace52['isEnabled']=_0x187080['enabledCommandsIds']['includes'](_0x3ace52['id']);}}),_0x3be6fd['ui']['componentFactory']['add']('menuBar:aiCommands',_0x7f7b4d=>{const _0x96cb03=new _0x42746f(_0x7f7b4d);_0x96cb03['buttonView']['set']({'label':Ni(_0x7f7b4d,'AI\x20Commands'),'icon':_0x3775e2}),_0x96cb03['bind']('isEnabled')['to'](_0x187080,'enabledCommandsIds',_0x5b382f=>_0x5b382f['length']>0x0);const _0x3d01f1=bi(_0x3be6fd['config']['get']('ai.assistant.commands'),_0x7f7b4d);return this['_populateMenuBarMenu'](_0x187080,_0x96cb03,_0x3d01f1,_0xa5a32f=>this['_onExecute'](_0xa5a32f)),_0x96cb03;}),_0x3be6fd['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x30384f=this['_createAIAssistantUIButton'](Ht);return _0x30384f['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x30384f;}),_0x3be6fd['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x257220=this['_createAIAssistantUIButton'](Jt);return _0x257220['set']({'role':'menuitemcheckbox'}),_0x257220;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2317c4=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x199f99;for(const _0x5e55e0 in _0x2317c4){const _0x4a88fd=_0x5e55e0,_0x1b61fe=_0x2317c4[_0x4a88fd];if('aiLicenseKeyValid'==_0x1b61fe||'aiLicenseKeyInvalid'==_0x1b61fe||'aiLicenseKeyExpired'==_0x1b61fe||'aiLicenseKeyDomainLimit'==_0x1b61fe||'aiLicenseKeyNotAllowed'==_0x1b61fe||'aiLicenseKeyEvaluationLimit'==_0x1b61fe||'aiLicenseKeyUsageLimit'==_0x1b61fe){delete _0x2317c4[_0x4a88fd],_0x199f99=_0x1b61fe,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x199f99&&_0x2317c4['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x199f99&&_0x2317c4['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x199f99&&_0x2317c4['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x199f99&&_0x2317c4['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x199f99&&_0x2317c4['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x199f99&&_0x2317c4['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x2283a4='',_0x462bd7='',_0x58297e='custom'){const _0x1865e5=this['editor'],_0x4a7695=_0x1865e5['editing']['view'],_0x416261=_0x1865e5['plugins']['get'](Oi),_0x45b99b=_0x1865e5['plugins']['get'](_0x3cc194);_0x416261['showFakeVisualSelection']();const _0x46d4b3=new Qi(),_0x3c7cde=new ClipboardEvent('copy',{'clipboardData':_0x46d4b3}),_0x2a37bd=new _0x46cc83(_0x46d4b3),_0x76c7e0=new _0x5dfed6(_0x4a7695,_0x3c7cde,{'dataTransfer':_0x2a37bd});_0x45b99b['_forceMarkersCopy']('comment',()=>{_0x4a7695['document']['fire']('copy',_0x76c7e0);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new Pi(_0x1865e5,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x3b2c80=_0x2a37bd['getData']('text/html');const _0x342272=_0x1865e5['model']['document']['selection'],_0x24fdbd=Array['from'](_0x342272['getRanges']());0x1===_0x24fdbd['length']&&_0x24fdbd[0x0]['isFlat']&&!_0x342272['getSelectedElement']()&&''!==_0x3b2c80['replace'](/&nbsp;/g,'')['trim']()&&(_0x3b2c80='<p>'+_0x3b2c80+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x58297e,'query':_0x2283a4,'htmlContent':_0x3b2c80,'label':_0x462bd7,'mainActionLabel':Hi[_0x1865e5['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x595fc7,'title':Ni(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Vt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x416261['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x11292e=new Map(),_0x51f8a8=bi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x5dc91d of _0x51f8a8)for(const _0x5960be of _0x5dc91d['commands'])_0x11292e['set'](_0x5960be['id'],{..._0x5960be,'groupId':_0x5dc91d['groupId'],'groupLabel':_0x5dc91d['groupLabel']||_0x5dc91d['groupId']});return _0x11292e;}['_createAIAssistantUIButton'](_0x46ce4e){const _0x4e33f0=this['editor'],_0x369658=_0x4e33f0['commands']['get']('showAIAssistant'),_0x472628=new _0x46ce4e(_0x4e33f0['locale']);return _0x472628['set']({'label':Ni(_0x4e33f0['locale'],'AI\x20Assistant'),'icon':_0x595fc7,'isToggleable':!0x0}),_0x472628['bind']('isEnabled')['to'](_0x369658),_0x472628['bind']('isOn')['to'](this['_dialog'],'id',_0x3590d8=>'aiAssistant'===_0x3590d8),this['listenTo'](_0x472628,'execute',()=>{_0x472628['isOn']?this['hideUI']():_0x369658['execute']();}),_0x472628;}['_initView'](){const _0x4be033=this['editor']['plugins']['get'](Oi);this['_formView']=new qi(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',()=>{_0x4be033['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x4be033['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x273eaa,ui:{ariaLiveAnnouncer:_0x595e49}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1e8d3f,_0x3ef78c,_0x4f37b2)=>{const _0x220f50=this['_aiAssistantController']['currentContext'];_0x4f37b2?_0x595e49['announce'](Ni(_0x273eaa,'AI\x20is\x20writing')):_0x220f50&&_0x595e49['announce'](Ni(_0x273eaa,'Generated\x20content:\x20%0',_0x220f50),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x53050b,_0x57e30e,_0x23dc82)=>{if(_0x23dc82){const _0x32728e=this['_formView']['errorView']['text'];_0x595e49['announce'](Ni(_0x273eaa,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x32728e));}});}['_onExecute'](_0xa7fd5f){const _0x4daeba=this['_commandDefinitions']['get'](_0xa7fd5f),_0xf9112=this['editor'],_0x47ae49=_0xf9112['model']['document']['selection'],_0x2dbdba=_0xf9112['commands']['get']('showAIAssistant'),_0x426fbf=_0xf9112['plugins']['get'](Oi),_0x294781=''+('_ungrouppedCommands'!==_0x4daeba['groupId']?_0x4daeba['groupLabel']+':\x20':'')+_0x4daeba['label'];if(!0x1!==_0x4daeba['requiresContent']&&_0x47ae49['isCollapsed']){const _0x24c4cb=mt(_0x47ae49['getSelectedBlocks']())||_0xf9112['model']['schema']['getLimitElement'](_0x47ae49);_0xf9112['model']['change'](_0x50e368=>{_0x50e368['setSelection'](_0x24c4cb,'in');});}_0x426fbf['showFakeVisualSelection'](),_0x2dbdba['execute'](_0x4daeba['prompt'],_0x294781,'command:'+_0xa7fd5f);}['_populateMenuBarMenu'](_0x4d4595,_0x4f4296,_0xd7fa3d,_0x5baa6b){const _0x73ff1d=this['editor'],_0x438ea4=_0x73ff1d['locale'],_0x311777=new te(_0x438ea4),_0xbdf268=ji(_0x73ff1d,_0xd7fa3d)['filter'](_0x54b605=>_0x54b605['commands']['length']);0x1===_0xbdf268['length']?this['_getMenuBarGroupButtons']({'command':_0x4d4595,'commands':_0xbdf268[0x0]['commands'],'parentMenuView':_0x4f4296,'onExecute':_0x5baa6b})['forEach'](_0x4d1209=>_0x311777['items']['add'](_0x4d1209)):_0xbdf268['forEach'](({groupId:_0x420012,groupLabel:_0x51d028,commands:_0x45d2f4})=>{const _0x45aa50=new Zt(_0x438ea4,_0x4f4296),_0x27f27f=new _0x42746f(_0x438ea4),_0x24d376=new te(_0x438ea4),_0x775bc2=this['_getMenuBarGroupButtons']({'command':_0x4d4595,'commands':_0x45d2f4,'parentMenuView':_0x27f27f,'onExecute':_0x5baa6b});_0x27f27f['buttonView']['set']({'label':_0x51d028||_0x420012}),_0x27f27f['delegate']('execute')['to'](_0x4f4296),_0x24d376['items']['addMany'](_0x775bc2),_0x27f27f['panelView']['children']['add'](_0x24d376),_0x45aa50['children']['add'](_0x27f27f),_0x311777['items']['add'](_0x45aa50);}),_0x4f4296['panelView']['children']['add'](_0x311777);}['_getMenuBarGroupButtons']({command:_0x54548c,commands:_0x204385,parentMenuView:_0x52a180,onExecute:_0x3e9a73}){const _0x285e33=this['editor'],_0x3f5869=_0x285e33['locale'];return ji(_0x285e33,_0x204385)['map'](_0x39acb6=>{const _0x3516eb=new Zt(_0x3f5869,_0x52a180),_0x42615b=new Jt(_0x3f5869);return _0x42615b['set']({'label':_0x39acb6['label']}),_0x42615b['delegate']('execute')['to'](_0x52a180),_0x42615b['on']('execute',()=>_0x3e9a73(_0x39acb6['id'])),_0x42615b['bind']('isEnabled')['to'](_0x54548c,'enabledCommandsIds',_0x3d5aaa=>_0x3d5aaa['includes'](_0x39acb6['id'])),_0x3516eb['children']['add'](_0x42615b),_0x3516eb;});}};function zi(_0x4297f8,_0x15f3bb){return void 0x0!==_0x4297f8['order']&&void 0x0===_0x15f3bb['order']?0x1:void 0x0===_0x4297f8['order']&&void 0x0!==_0x15f3bb['order']?-0x1:void 0x0!==_0x4297f8['order']&&void 0x0!==_0x15f3bb['order']?_0x4297f8['order']-_0x15f3bb['order']:0x0;}function ji(_0x1d3a54,_0x1c5f01){_0x1c5f01['sort'](zi);const _0x2c0ba5={},_0x4e21ea=[];for(const _0x2eba57 of _0x1c5f01)if(void 0x0!==_0x2eba57['order']){if(_0x2eba57['order']in _0x2c0ba5)throw new ht('ai-commands-config-order-collision',_0x1d3a54,{'conflictingDefinitions':[_0x2eba57,_0x2c0ba5[_0x2eba57['order']]]});_0x2c0ba5[_0x2eba57['order']]=_0x2eba57,_0x4e21ea['splice'](_0x2eba57['order'],0x0,_0x2eba57);}else _0x4e21ea['push'](_0x2eba57);return _0x4e21ea;}var Ji=class extends _0x3688ab{static get['requires'](){return[Xi,Oi];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x14f94d){super(_0x14f94d);const _0x18d4dd=_0x14f94d['config'],_0x2452ba=_0x14f94d['locale'];_0x18d4dd['define']('ai.assistant.preserveComments',!0x0),_0x18d4dd['define']('ai.assistant.commands',Zi(_0x2452ba)),_0x18d4dd['define']('ai.assistant.extraCommandGroups',[]),_0x18d4dd['define']('ai.assistant.removeCommands',[]);let _0x4fb70d=bi(_0x18d4dd['get']('ai.assistant.commands'),_0x2452ba);const _0x253b9c=_0x18d4dd['get']('ai.assistant.extraCommandGroups'),_0x4ea9d5=_0x18d4dd['get']('ai.assistant.removeCommands');_0x253b9c['forEach'](_0x5e4283=>{const _0x405d34=_0x4fb70d['find'](_0x4d2041=>_0x4d2041['groupId']===_0x5e4283['groupId']);_0x405d34?_0x405d34['commands']=_0x405d34['commands']['concat'](_0x5e4283['commands']):_0x4fb70d['push'](_0x5e4283);}),_0x4fb70d=_0x4fb70d['filter'](_0x4008cd=>!_0x4ea9d5['includes'](_0x4008cd['groupId'])),_0x4fb70d['forEach'](_0x1a78c3=>{_0x1a78c3['commands']=_0x1a78c3['commands']['filter'](_0x5f3eff=>!_0x4ea9d5['includes'](_0x5f3eff['id']));}),_0x18d4dd['set']('ai.assistant.commands',_0x4fb70d);}};function Zi(_0x119265){return[{'groupId':'editOrReview','groupLabel':Ni(_0x119265,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Ni(_0x119265,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Ni(_0x119265,'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':Ni(_0x119265,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Ni(_0x119265,'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':Ni(_0x119265,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Ni(_0x119265,'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':Ni(_0x119265,'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':Ni(_0x119265,'Change\x20tone'),'commands':[{'id':'professional','label':Ni(_0x119265,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Ni(_0x119265,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Ni(_0x119265,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Ni(_0x119265,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Ni(_0x119265,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Ni(_0x119265,'Change\x20style'),'commands':[{'id':'business','label':Ni(_0x119265,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Ni(_0x119265,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Ni(_0x119265,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Ni(_0x119265,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Ni(_0x119265,'Translate'),'commands':[{'id':'translateEnglish','label':Ni(_0x119265,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Ni(_0x119265,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Ni(_0x119265,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Ni(_0x119265,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Ni(_0x119265,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Ni(_0x119265,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Ni(_0x119265,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Ni(_0x119265,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}var ts=class extends _0x3688ab{['abortController'];static get['requires'](){return[vi];}constructor(_0x35a2cb){super(_0x35a2cb),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](vi)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x2b4b82){return this['sendRequest'](_0x2b4b82)['catch'](_0x393f86=>{if(_0x393f86 instanceof ki)return Promise['reject'](_0x393f86);if('AbortError'==_0x393f86['name'])return Promise['resolve']();throw console['error'](_0x393f86),new ht('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x50d458,_0x1eef3b){const _0x59c001=this['editor']['locale'],_0xd44f34={'Content-Type':'application/json'};if('object'==typeof _0x50d458)Object['assign'](_0xd44f34,_0x50d458);else{if(_0x50d458)try{const _0x229367=await _0x50d458(_0x1eef3b);Object['assign'](_0xd44f34,_0x229367);}catch{return Promise['reject'](new ki(Ni(_0x59c001,'AI_ERROR_GET_HEADERS')));}}return _0xd44f34;}async['_prepareRequestParameters'](_0x56ee1f,_0x24bc29){const _0x378815=this['editor']['locale'];if('object'==typeof _0x56ee1f)return _0x56ee1f;try{return await _0x56ee1f(_0x24bc29);}catch{return Promise['reject'](new ki(Ni(_0x378815,'AI_ERROR_GET_PARAMETERS')));}}},es=class extends ts{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x5c2ca2){super(_0x5c2ca2),_0x5c2ca2['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x5c2ca2['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x5c2ca2['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x5c2ca2['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x5c2ca2['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x5c2ca2['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x28ea2a,context:_0x103d7b,onData:_0x39b2b8,actionId:_0x48768d}){const _0x53f7b1=this['editor']['locale'],_0x275125=await this['prepareMessages'](_0x28ea2a,_0x103d7b,_0x48768d),_0x2b5490=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x48768d),_0x1ab818=await this['_prepareRequestParameters'](this['_requestParameters'],_0x48768d),_0x4d15e1={'messages':_0x275125,..._0x1ab818},_0xcd1337={'method':'POST','headers':_0x2b5490,'body':JSON['stringify'](_0x4d15e1),'signal':this['abortController']['signal']},_0x3142c8=await fetch(this['_apiUrl'],_0xcd1337);if(_0x3142c8['ok'])return _0x1ab818['stream']?await this['_readStreamableResponse'](_0x3142c8,_0x39b2b8):await this['_readStaticResponse'](_0x3142c8,_0x39b2b8),Promise['resolve']();{const _0x42208e=await _0x3142c8['text']();return _0x42208e['includes']('context_length_exceeded')?Promise['reject'](new ki(Ni(_0x53f7b1,'AI_ERROR_CONTEXT_LENGTH'))):_0x42208e['includes']('Moderation')?Promise['reject'](new ki(Ni(_0x53f7b1,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x42208e));}}async['prepareMessages'](_0x28f8fa,_0x2b71f2,_0x183809){let _0x40185f,_0x4c2b32;return _0x2b71f2?(_0x40185f='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.',_0x4c2b32='Instruction:\x0a'+_0x28f8fa+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2b71f2):(_0x40185f='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.',_0x4c2b32=_0x28f8fa),[{'role':'system','content':_0x40185f},{'role':'user','content':_0x4c2b32}];}async['_readStreamableResponse'](_0x36a376,_0x64feb1){const _0x3b2cc4=_0x36a376['body']['getReader'](),_0x55f087=new TextDecoder();let _0x2847ea='',_0x385000='',_0x2349ec='',_0x15e947=!0x1;for(;!_0x15e947;){const {done:_0x544831,value:_0x18dada}=await _0x3b2cc4['read'](),_0x155d60=_0x2847ea+_0x55f087['decode'](_0x18dada);let _0x4a6c2c='';_0x15e947=_0x544831;try{_0x4a6c2c=this['_cleanUpData'](_0x155d60),_0x2847ea='';}catch{_0x2847ea=_0x155d60;continue;}_0x385000+=_0x4a6c2c,!_0x15e947&&this['_isBufferIncomplete'](_0x385000)||_0x385000&&(_0x2349ec+=_0x385000,_0x385000='',_0x64feb1(_0x2349ec));}return Promise['resolve']();}async['_readStaticResponse'](_0x71d0a6,_0x606348){return _0x606348((await _0x71d0a6['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x11ff92){const _0x4a8cf2=_0x11ff92['split']('<')['length']!==_0x11ff92['split']('>')['length'],_0x519008=_0x11ff92['length']<0x1e;return _0x4a8cf2&&_0x519008;}['_cleanUpData'](_0x1d80d2){return _0x1d80d2['split'](/\n(?![^{]*\})/g)['map'](_0x1cb672=>_0x1cb672['replace']('data:\x20',''))['filter'](_0x2d02f7=>_0x2d02f7&&_0x2d02f7['length']>0x0&&'[DONE]'!==_0x2d02f7)['map'](_0x1e9503=>{const {choices:_0x425d2a}=JSON['parse'](_0x1e9503);if(_0x425d2a[0x0]?.['delta']?.['content'])return _0x425d2a[0x0]['delta']['content'];})['filter'](_0x4535bc=>_0x4535bc)['join']('');}},is=class extends ts{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),bt('ai-aws-adapter-not-supported');}async['sendRequest'](_0x1936b7){throw ft('ai-aws-adapter-not-supported'),new ki(Ni(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}},ss=class extends Ht{constructor(_0x114ecf,_0x3170a9={}){super(_0x114ecf),this['isToggleable']=!0x0,this['set']('side',_0x3170a9['side']||'top');const _0x2e5206=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...Ot(_0x3170a9['class']||[]),_0x2e5206['to']('side',_0x2a83c0=>'ck-tab-button_'+_0x2a83c0),_0x2e5206['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}},ns=class extends _0x215f6f{['children'];constructor(_0x5a2c9e,_0x1a2665={}){super(_0x5a2c9e);const _0x45d434=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...Ot(_0x1a2665['class']||[]),_0x45d434['to']('class'),_0x45d434['if']('isVisible','ck-hidden',_0x4a2253=>!_0x4a2253)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}},rs=class extends _0x215f6f{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x1b99ed,_0x37bb05={}){super(_0x1b99ed),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x37bb05['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0x37bb05['collapsible']||!0x1),this['set']('isCollapsed',!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'isCollapsed',(_0x1a972e,_0x8b261b)=>_0x1a972e&&!_0x8b261b);const _0x5c6b7e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...Ot(_0x37bb05['class']||[]),_0x5c6b7e['to']('side',_0x138bb5=>'ck-tabs_'+_0x138bb5),_0x5c6b7e['to']('class'),_0x5c6b7e['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x5c6b7e['if']('isCollapsed','ck-ai-tabs_collapsed')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x5c6b7e['to']('side',_0x5eb353=>'ck-tabs__buttons-container_'+_0x5eb353)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x5c6b7e['to']('side',_0x2ed95e=>'ck-tabs__panels-container_'+_0x2ed95e)]},'children':this['panelViews']},...Ot(_0x37bb05['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0xce696b){const _0x44d24e=this['_tabs']['get'](_0xce696b);return _0x44d24e||null;}['addTab'](_0x3fcbae){const _0x551ad2=this['_setupButton']({'id':_0x3fcbae['id'],'label':_0x3fcbae['buttonLabel'],'icon':_0x3fcbae['buttonIcon'],'order':_0x3fcbae['order']}),_0x2294aa=new ns(this['locale']);return _0x2294aa['render'](),_0x3fcbae['content']&&_0x2294aa['children']['add'](_0x3fcbae['content']),this['panelViews']['add'](_0x2294aa),this['_tabs']['set'](_0x3fcbae['id'],{'button':_0x551ad2,'panel':_0x2294aa,'order':void 0x0!==_0x3fcbae['order']?_0x3fcbae['order']:null}),this['fire']('addTab:'+_0x3fcbae['id'],{'id':_0x3fcbae['id'],'button':_0x551ad2,'panel':_0x2294aa}),null===this['activeTab']?this['activateTab'](_0x3fcbae['id']):this['_hidePanel'](_0x3fcbae['id']),{'button':_0x551ad2,'panel':_0x2294aa};}['activateTab'](_0x169a1b){if(null!==_0x169a1b&&!this['getTab'](_0x169a1b))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x169a1b});if(this['isCollapsed']=!0x1,this['activeTab']===_0x169a1b)return;const _0x444131=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x169a1b,_0x169a1b&&this['_showPanel'](_0x169a1b),this['fire']('activateTab:'+_0x169a1b,{'newTab':_0x169a1b,'oldTab':_0x444131});}['toggleTabPanel'](_0x2a4be9){this['activeTab']===_0x2a4be9?this['collapsible']&&(this['isCollapsed']=!this['isCollapsed']):this['activateTab'](_0x2a4be9);}['showTab'](_0x30008d){if(!this['getTab'](_0x30008d))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x30008d});this['_showPanel'](_0x30008d),this['_showButton'](_0x30008d),this['fire']('show:'+_0x30008d,_0x30008d);}['hideTab'](_0x4efcda){if(!this['getTab'](_0x4efcda))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4efcda});const _0x53c818=this['activeTab'];this['_hidePanel'](_0x4efcda),this['_hideButton'](_0x4efcda);const _0xcb615a=this['getTabIds']();_0x53c818===_0x4efcda&&_0xcb615a['length']>0x1&&this['activateTab'](_0xcb615a['find'](_0x4fa9ea=>_0x4fa9ea!==_0x4efcda)),this['fire']('hide:'+_0x4efcda,_0x4efcda);}['_getPanel'](_0x1033f5){const _0x5a2d4c=this['_tabs']['get'](_0x1033f5);return _0x5a2d4c?_0x5a2d4c['panel']:null;}['_showPanel'](_0x4e1229){null!==this['activeTab']&&this['activeTab']!==_0x4e1229||this['_getPanel'](_0x4e1229)['show']();}['_hidePanel'](_0x1eaee2){const _0x110b7c=this['_getPanel'](_0x1eaee2);_0x110b7c['isVisible']&&(this['activeTab']===_0x1eaee2&&(this['activeTab']=null),_0x110b7c['hide']());}['_getButton'](_0x33690c){const _0x40dc8f=this['_tabs']['get'](_0x33690c);return _0x40dc8f?_0x40dc8f['button']:null;}['_showButton'](_0x5e2ce2){this['_getButton'](_0x5e2ce2)['show']();}['_hideButton'](_0x484bce){this['_getButton'](_0x484bce)['hide']();}['_setupButton'](_0x5bcfd1){const _0x1d7f41=new ss(this['locale'],{'side':this['side']}),_0x71b222=this['buttonViews'];if(_0x1d7f41['set']({'label':_0x5bcfd1['label'],'icon':_0x5bcfd1['icon'],'tooltip':!0x0,'withText':!0x0}),_0x1d7f41['bind']('isOn')['to'](this,'activeTab',this,'isCollapsed',(_0x37fb8d,_0x2733d5)=>_0x37fb8d===_0x5bcfd1['id']&&!_0x2733d5),_0x1d7f41['bind']('side')['to'](this,'side'),_0x5bcfd1['order']){const _0x5e9dd8=[...this['_tabs']]['reduce']((_0x3241e6,_0x249fc1)=>{const _0x6eeb69=_0x249fc1[0x0],{order:_0x166b9a}=_0x249fc1[0x1];return!_0x166b9a||_0x166b9a>_0x5bcfd1['order']?_0x3241e6:_0x166b9a>=_0x3241e6['order']?{'id':_0x6eeb69,'order':_0x166b9a}:_0x3241e6;},{'id':'','order':0x0}),_0x5478a4=_0x71b222['getIndex'](this['_getButton'](_0x5e9dd8['id']));_0x71b222['add'](_0x1d7f41,_0x5478a4+0x1);}else _0x71b222['add'](_0x1d7f41);return _0x1d7f41['on']('execute',()=>{this['toggleTabPanel'](_0x5bcfd1['id']);}),_0x1d7f41;}};const os=['overlay','sidebar','custom'],as=['left','right'];var hs=class extends rs{constructor(_0x319353,_0x1cb62e={}){super(_0x319353,_0x1cb62e),this['set']('type',_0x1cb62e['type']||'sidebar'),this['set']('side',_0x1cb62e['side']||'right'),this['set']('isVisible',_0x1cb62e['visibleByDefault']??!0x0);const _0x17a10d=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x17a10d['if']('type','ck-ai-tabs__overlay',_0x5d9ec4=>'overlay'===_0x5d9ec4),_0x17a10d['if']('type','ck-ai-tabs__sidebar',_0x3ce0db=>'sidebar'===_0x3ce0db),_0x17a10d['if']('isVisible','ck-hidden',_0x1d30d2=>!_0x1d30d2)]}}),this['buttonViews']['on']('add',(_0x385e9a,_0x16ef40)=>{_0x16ef40['set']('withText',!0x1);});}},cs=class extends _0x5d28a2{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x19d6b7){if(super(_0x19d6b7),!this['context']['config']['get']('ai.container'))throw new ht('ai-tabs-configuration-not-found');this['context']['config']['define']('ai.container.visibleByDefault',!0x0),this['context']['config']['define']('ai.container.collapsible',!0x1);const _0x1d4692=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x1d4692['showResizeButton']&&(this['showResizeButton']=_0x1d4692['showResizeButton']),'sidebar'!==_0x1d4692['type']&&'overlay'!==_0x1d4692['type']||_0x1d4692['side']&&(this['side']=_0x1d4692['side']),'sidebar'===_0x1d4692['type']){if(this['container']=_0x1d4692['element'],this['set']('type','sidebar'),!this['container'])throw new ht('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x1d4692['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new hs(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':_0x1d4692['visibleByDefault'],'collapsible':_0x1d4692['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 _0x1f7986&&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'](_0x26a136){if(_0x26a136&&this['type']!==_0x26a136){if(!os['includes'](_0x26a136))throw new ht('ai-tabs-unsupported-ui-type');this['type']=_0x26a136;}}['switchSide'](_0x5d1ce7){if(_0x5d1ce7&&this['side']!==_0x5d1ce7){if(!as['includes'](_0x5d1ce7))throw new ht('ai-tabs-unsupported-ui-side');this['side']=_0x5d1ce7;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}},ls=class extends _0x5d28a2{['_apiUrl'];get['_apiUrlV11'](){return this['_apiUrl']['replace'](/\/v1$/,'/v1.1');}['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x545796];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x42be62){if(super(_0x42be62),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 ht('ai-service-url-invalid-version',this,{'serviceUrl':this['_apiUrl']});this['_token']=null,this['_decoder']=new TextDecoder(),this['_responseCache']=new Map();}['init'](){const _0x2f0248=this['context']['plugins']['get'](_0x545796);if(!_0x2f0248['token'])throw new ht('ai-missing-token',this);this['_token']=_0x2f0248['token'];}['startConversation'](_0x28e2c4,_0x17e221){const _0x4567ad=this['_sendApiRequest']('/conversations','POST',{'id':_0x28e2c4,'group':_0x17e221});return{'getConversation':async()=>(await _0x4567ad['request'])['json'](),'abortController':_0x4567ad['abortController']};}['queryAssistant']({message:_0x3607d8,conversationId:_0xa3daa4,parts:_0x5ad693,capabilities:_0x434a47,model:_0x5b93f,attributes:_0x275944}){const _0x50b7fd={'prompt':_0x3607d8,'content':_0x5ad693,'model':_0x5b93f,..._0x434a47&&{'capabilities':_0x434a47},..._0x275944&&{'attributes':_0x275944}},_0x2f1a7a=this['_sendApiRequest']('/conversations/'+_0xa3daa4+'/messages','POST',_0x50b7fd,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x30cad8=(await _0x2f1a7a['request'])['body'];return this['_getStreamReader'](_0x30cad8);},'abortController':_0x2f1a7a['abortController']};}['executeCustomAction']({content:_0x28e1f1,message:_0x380637,model:_0x42f123,outputFormat:_0xcdd14a}){const _0x4cb797={'content':[{'type':'text','content':_0x28e1f1}],'prompt':_0x380637,'model':_0x42f123,'outputFormat':_0xcdd14a},_0x3bb4fe=this['_sendApiRequest']('/actions/custom/calls','POST',_0x4cb797);return{'getStream':async()=>{const _0x41aa12=(await _0x3bb4fe['request'])['body'];return this['_getStreamReader'](_0x41aa12);},'abortController':_0x3bb4fe['abortController']};}['executeAction']({actionName:_0x50d4e9,content:_0x355935,args:_0x238c28}){const _0x27eea5={'content':[{'type':'text','content':_0x355935}],'args':_0x238c28},_0x587318=this['_sendApiRequest']('/actions/system/'+_0x50d4e9+'/calls','POST',_0x27eea5);return{'getStream':async()=>{const _0x3c3c39=(await _0x587318['request'])['body'];return this['_getStreamReader'](_0x3c3c39);},'abortController':_0x587318['abortController']};}['uploadFile'](_0x2ffbc4,_0xa776d7,_0xfafdcd){const _0x4b5f45=new FormData();_0x4b5f45['append']('file',_0xa776d7,_0xa776d7['name']),_0xfafdcd&&_0x4b5f45['append']('attributes',JSON['stringify'](_0xfafdcd));const _0x27da1f=this['_sendApiRequest']('/conversations/'+_0x2ffbc4+'/files','POST',_0x4b5f45);return{'getId':async()=>(await _0x27da1f['request'])['json'](),'abortController':_0x27da1f['abortController']};}['uploadDocuments'](_0x541453,_0xeba703){const _0x371a86={'documents':_0xeba703['map'](_0x5006e3=>({'content':_0x5006e3['content'],'attributes':{'version':_0x5006e3['version'],'sessionId':_0x5006e3['sessionId'],'channelId':_0x5006e3['channelId'],'rootName':_0x5006e3['rootName'],'selections':_0x5006e3['selections']},...void 0x0!==_0x5006e3['name']?{'name':_0x5006e3['name']}:{},...void 0x0!==_0x5006e3['description']?{'description':_0x5006e3['description']}:{}}))},_0x2c8642=this['_sendApiRequest']('/conversations/'+_0x541453+'/documents/batch','POST',_0x371a86);return{'getIds':async()=>(await _0x2c8642['request'])['json'](),'abortController':_0x2c8642['abortController']};}['fetchDocuments'](_0x23cf1a,_0x4cc811){const _0x37e747=new URLSearchParams();_0x37e747['append']('documentIds',_0x4cc811['join'](','));const _0x52ffed=this['_sendApiRequest']('/conversations/'+_0x23cf1a+'/documents/batch?'+_0x37e747['toString'](),'GET');return{'getDocuments':async()=>(await _0x52ffed['request'])['json'](),'abortController':_0x52ffed['abortController']};}['fetchConversations'](_0x59341d,_0x4e94f8={}){const _0x5ea1d5=new URLSearchParams();_0x5ea1d5['append']('group',_0x59341d),_0x5ea1d5['append']('excludeEmpty',!0x1!==_0x4e94f8['excludeEmpty']?'true':'false'),_0x5ea1d5['append']('limit',_0x4e94f8['limit']?_0x4e94f8['limit']['toString']():'100'),_0x5ea1d5['append']('sortBy',_0x4e94f8['sortBy']?_0x4e94f8['sortBy']:'createdAt'),_0x5ea1d5['append']('order',_0x4e94f8['order']?_0x4e94f8['order']:'desc');const _0x115a8f=this['_sendApiRequest']('/conversations?'+_0x5ea1d5['toString'](),'GET');return{'getConversations':async()=>(await(await _0x115a8f['request'])['json']())['items'],'abortController':_0x115a8f['abortController']};}['deleteConversation'](_0x4ff7be){const _0x22562c=this['_sendApiRequest']('/conversations/'+_0x4ff7be,'DELETE');return{'execute':async()=>{await _0x22562c['request'];},'abortController':_0x22562c['abortController']};}['updateConversation'](_0x4029e3,_0x3a7cb4){const _0x51a799=this['_sendApiRequest']('/conversations/'+_0x4029e3,'PATCH',_0x3a7cb4);return{'getResult':async()=>(await _0x51a799['request'],_0x3a7cb4),'abortController':_0x51a799['abortController']};}['fetchConversation'](_0x1fb4ec){const _0x2b3b98=this['_sendApiRequest']('/conversations/'+_0x1fb4ec,'GET');return{'getConversation':async()=>(await _0x2b3b98['request'])['json'](),'abortController':_0x2b3b98['abortController']};}['fetchConversationMessages'](_0x5553b1){const _0x16e65b=this['_sendApiRequest']('/conversations/'+_0x5553b1+'/messages','GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getMessages':async()=>(await(await _0x16e65b['request'])['json']())['items'],'abortController':_0x16e65b['abortController']};}['uploadUrl'](_0x5c7f4,_0x5d30c8,_0x1b18df){const _0x509880=this['_sendApiRequest']('/conversations/'+_0x5c7f4+'/web-resources','POST',{'url':_0x5d30c8,'attributes':_0x1b18df});return{'getId':async()=>(await _0x509880['request'])['json'](),'abortController':_0x509880['abortController']};}['getModels'](_0x1ba488='en'){const _0x51e98b=new URLSearchParams();_0x51e98b['append']('language',_0x1ba488);const _0x365a70='/models/1?'+_0x51e98b['toString'](),_0x49c99d=this['_sendApiRequest'](_0x365a70,'GET',void 0x0,{'useCache':!0x0});return{'list':async()=>await(await _0x49c99d['request'])['json'](),'abortController':_0x49c99d['abortController']};}['deleteFile'](_0xb5c4,_0x1967c2){const _0x5dfa82=this['_sendApiRequest']('/conversations/'+_0xb5c4+'/files/'+_0x1967c2,'DELETE');return{'execute':async()=>{await _0x5dfa82['request'];},'abortController':_0x5dfa82['abortController']};}['deleteDocument'](_0xf959ac,_0x186575){const _0x30128a=this['_sendApiRequest']('/conversations/'+_0xf959ac+'/documents/'+_0x186575,'DELETE');return{'execute':async()=>{await _0x30128a['request'];},'abortController':_0x30128a['abortController']};}['deleteWebResource'](_0x529bc8,_0x2dc30f){const _0x2cd402=this['_sendApiRequest']('/conversations/'+_0x529bc8+'/web-resources/'+_0x2dc30f,'DELETE');return{'execute':async()=>{await _0x2cd402['request'];},'abortController':_0x2cd402['abortController']};}['cancelStream'](_0x199375,_0xb0a05c){const _0x252c7b=this['_sendApiRequest']('/conversations/'+_0x199375+'/messages/'+_0xb0a05c+'/stream','DELETE',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'execute':async()=>{await _0x252c7b['request'];},'abortController':_0x252c7b['abortController']};}['resumeStream'](_0x4fa1c8,_0x1684d1,_0x10a0aa='0-0'){const _0x56242d=new URLSearchParams({'lastEventId':_0x10a0aa}),_0x1d4ca9=this['_sendApiRequest']('/conversations/'+_0x4fa1c8+'/messages/'+_0x1684d1+'/stream?'+_0x56242d['toString'](),'GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x465ee3=await _0x1d4ca9['request'];return this['_getStreamReader'](_0x465ee3['body']);},'abortController':_0x1d4ca9['abortController']};}['callSystemReview']({reviewName:_0x33840e,content:_0x11d635,args:_0x481bfc}){const _0x174ef0=this['_sendApiRequest']('/reviews/system/'+_0x33840e+'/calls','POST',{'content':[{'type':'text','content':_0x11d635}],'args':_0x481bfc});return{'getStream':async()=>{const _0xe1dadf=(await _0x174ef0['request'])['body'];return this['_getStreamReader'](_0xe1dadf);},'abortController':_0x174ef0['abortController']};}['processDocument']({document:_0xf33ebc,prompt:_0x58d5e9,model:_0x24c374}){const _0x58fcdb=this['_sendApiRequest']('/documents/process','POST',{'document':_0xf33ebc,'prompt':_0x58d5e9,'model':_0x24c374});return{'getResult':async()=>(await _0x58fcdb['request'])['json'](),'abortController':_0x58fcdb['abortController']};}['callCustomReview']({content:_0x45f59e,prompt:_0x2aa807,model:_0x126ae4}){const _0x1689c9=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x45f59e}],'prompt':_0x2aa807,'model':_0x126ae4});return{'getStream':async()=>{const _0x54584d=(await _0x1689c9['request'])['body'];return this['_getStreamReader'](_0x54584d);},'abortController':_0x1689c9['abortController']};}['upsertAIChatRating'](_0x24d4af,_0x429e1a,_0x3f3d76){const _0x44cd4a=this['_sendApiRequest']('/conversations/'+_0x24d4af+'/messages/'+_0x429e1a+'/ratings','PUT',{'positiveCount':_0x3f3d76['positiveCount'],'totalCount':_0x3f3d76['totalCount'],'modificationId':_0x3f3d76['modificationId']});return{'execute':async()=>{await _0x44cd4a['request'];},'abortController':_0x44cd4a['abortController']};}['upsertAIActionRating'](_0xbe37c7,_0x3c109a,_0x1217aa){const _0x257a7f=this['_sendApiRequest']('/actions/system/'+_0xbe37c7+'/calls/'+_0x3c109a+'/ratings','PUT',{'positiveCount':_0x1217aa['positiveCount'],'totalCount':_0x1217aa['totalCount']});return{'execute':async()=>{await _0x257a7f['request'];},'abortController':_0x257a7f['abortController']};}['upsertCustomAIActionRating'](_0x4d154a,_0x343773){const _0x456550=this['_sendApiRequest']('/actions/custom/calls/'+_0x4d154a+'/ratings','PUT',{'positiveCount':_0x343773['positiveCount'],'totalCount':_0x343773['totalCount']});return{'execute':async()=>{await _0x456550['request'];},'abortController':_0x456550['abortController']};}['upsertAIReviewRating'](_0xd9dfff,_0x3c1e27,_0x52331e,_0x297bd8){const _0x5da121=this['_sendApiRequest']('/reviews/system/'+_0xd9dfff+'/calls/'+_0x3c1e27+'/ratings','PUT',{'positiveCount':_0x52331e['positiveCount'],'totalCount':_0x52331e['totalCount'],'dataId':_0x297bd8});return{'execute':async()=>{await _0x5da121['request'];},'abortController':_0x5da121['abortController']};}['upsertCustomAIReviewRating'](_0x548579,_0x176f50,_0x8e257f){const _0x2a61aa=this['_sendApiRequest']('/reviews/custom/calls/'+_0x548579+'/ratings','PUT',{'positiveCount':_0x176f50['positiveCount'],'totalCount':_0x176f50['totalCount'],'dataId':_0x8e257f});return{'execute':async()=>{await _0x2a61aa['request'];},'abortController':_0x2a61aa['abortController']};}['_sendApiRequest'](_0x1a82de,_0x23b48d,_0x4239bd,_0x372a9a={}){const {useCache:_0x9ba803=!0x1,apiUrl:_0x3064c0=this['_apiUrl']}=_0x372a9a,_0x449cd1=new AbortController(),_0x4578ed=_0x9ba803?_0x23b48d+':'+_0x1a82de:null;if(_0x4578ed){const _0x2dbb1e=this['_responseCache']['get'](_0x4578ed);if(_0x2dbb1e)return{'request':_0x2dbb1e['then'](_0x451b0a=>_0x451b0a['clone']()),'abortController':_0x449cd1};}const _0x237f52=_0x4239bd instanceof FormData,_0x16834f={'Authorization':'Bearer\x20'+this['_token']?.['value'],'X-Editor-Version':kt};_0x4239bd&&!_0x237f52&&(_0x16834f['Content-Type']='application/json');const _0x5368bf={'method':_0x23b48d,'headers':_0x16834f,'signal':_0x449cd1['signal']};_0x4239bd&&(_0x5368bf['body']=_0x237f52?_0x4239bd:JSON['stringify'](_0x4239bd));const _0x1db712=fetch(''+_0x3064c0+_0x1a82de,_0x5368bf)['catch'](_0x3c41cd=>{_0x4578ed&&this['_responseCache']['delete'](_0x4578ed),this['_handleError'](_0x3c41cd);})['then'](_0x259aff=>_0x259aff['ok']?_0x259aff:_0x259aff['json']()['then'](_0xce94e1=>{throw _0x4578ed&&this['_responseCache']['delete'](_0x4578ed),{'url':_0x3064c0,'path':_0x1a82de,'method':_0x23b48d,'body':_0x4239bd,'status':(_0x259aff||{})['status'],'statusText':(_0x259aff||{})['statusText'],'code':_0xce94e1['code'],'message':_0xce94e1['message'],'traceId':_0xce94e1['traceId']};}));return _0x4578ed&&this['_responseCache']['set'](_0x4578ed,_0x1db712['then'](_0x2f1798=>_0x2f1798['clone']())),{'request':_0x1db712,'abortController':_0x449cd1};}async*['_getStreamReader'](_0x23cf33){const _0x58ba27=[],_0x148767=_0x23cf33['getReader'](),_0x1734ee=_0x239286({'onError':_0x191c89=>{this['_handleError'](_0x191c89);},'onEvent':_0x5bc01d=>{_0x5bc01d['data']=JSON['parse'](_0x5bc01d['data']),_0x58ba27['push'](_0x5bc01d);}});try{let _0x3644ab=!0x1;for(;!_0x3644ab;){const {done:_0x26a6fa,value:_0x445920}=await _0x148767['read']();_0x26a6fa&&(_0x3644ab=!0x0),_0x1734ee['feed'](this['_decoder']['decode'](_0x445920,{'stream':!0x0})),yield*_0x58ba27,_0x58ba27['length']=0x0;}}catch(_0x363fe3){this['_handleError'](_0x363fe3);}finally{_0x148767['releaseLock'](),_0x1734ee['reset']();}}['_handleError'](_0x56d96c){if(_0x56d96c instanceof ht)throw _0x56d96c;if(_0x56d96c instanceof Error&&'AbortError'===_0x56d96c['name'])throw new ht('ai-request-aborted',this,{'originalError':_0x56d96c});throw new ht('ai-request-failed',this,{'originalError':_0x56d96c});}};function us(_0x2b2472,_0x5dfed2,_0x29e6a1){const t=_0x2b2472['t'];switch(_0x5dfed2){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'},_0x29e6a1);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.'},_0x29e6a1);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.'},_0x29e6a1);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_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.'},_0x29e6a1);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'},_0x29e6a1);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x29e6a1);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'},_0x29e6a1);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.'},_0x29e6a1);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.'},_0x29e6a1);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.'},_0x29e6a1);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.'},_0x29e6a1);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'},_0x29e6a1);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.'},_0x29e6a1);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 _0x5dfed2;}}function ds(_0x852c78){return _0x852c78?_0x852c78 instanceof _0x1f7986?[_0x852c78]:_0x852c78['editors']&&0x0!==_0x852c78['editors']['length']?Array['from'](_0x852c78['editors']):[]:[];}function _s(_0x1ac7ef){const _0x51fc97=ds(_0x1ac7ef);if(!_0x51fc97['length'])throw new ht('ai-get-editor-from-context-no-editor');if(0x1===_0x51fc97['length'])return _0x51fc97[0x0];const _0x3b6552=_0x51fc97['find'](_0x5d40e4=>_0x5d40e4['ui']?.['focusTracker']?.['isFocused']);if(_0x3b6552)return _0x3b6552;const _0x3d3a58=function(_0x19dd7f){if(_0x19dd7f instanceof _0x1f7986)return;const _0x48b6ac=_0x19dd7f;if(!_0x48b6ac['plugins']||!_0x48b6ac['plugins']['has']('AIEditing'))return;return _0x48b6ac['plugins']['get']('AIEditing')['getLastContentFocusedEditor']?.();}(_0x1ac7ef);return _0x3d3a58&&_0x51fc97['includes'](_0x3d3a58)?_0x3d3a58:_0x51fc97[0x0];}const gs='ai-selection',As=['br'];var Is=class extends _0x5d28a2{constructor(_0x53249d){super(_0x53249d),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'](_0x1e1a0a){let _0x9dcaaf=this['_sessionIdByEditor']['get'](_0x1e1a0a);return _0x9dcaaf||(_0x9dcaaf=_0x1e1a0a['plugins']['has']('RealTimeCollaborationClient')&&_0x1e1a0a['plugins']['get']('RealTimeCollaborationClient')['sessionId']||vt(),this['_sessionIdByEditor']['set'](_0x1e1a0a,_0x9dcaaf)),_0x9dcaaf;}async['getDocumentData'](){const _0x4cb17f=ds(this['context']);if(!_0x4cb17f['length'])throw new ht('ai-get-editor-from-context-no-editor');const _0x4b33a4=[],_0x8944f=new Set();for(const _0x48c164 of _0x4cb17f){const _0x36dc45=_0x48c164['config']['get']('roots')||{};for(const _0x258668 of _0x48c164['model']['document']['getRoots']()){if('$graveyard'===_0x258668['rootName'])continue;const _0x1cd549=await this['_getDocumentDataForEditorRoot'](_0x48c164,_0x258668,_0x8944f),_0x87ea60=_0x36dc45[_0x258668['rootName']],_0x4b97b2=_0x258668['getAttribute']('$description')??_0x87ea60?.['description'];let _0x297a2d=_0x258668['getAttribute']('$title')??_0x87ea60?.['title'];_0x297a2d||(_0x297a2d=_0x258668['getAttribute']('$rootEditableOptions')?.['label']??_0x87ea60?.['label']),_0x297a2d||(bt('ai-document-root-missing-title',{'editor':_0x48c164,'rootName':_0x258668['rootName']}),_0x297a2d=_0x258668['rootName']),_0x4b33a4['push']({'editor':_0x48c164,'rootName':_0x258668['rootName'],'content':_0x1cd549['content'],'version':_0x1cd549['version'],'sessionId':this['getSessionId'](_0x48c164),'channelId':_0x48c164['config']['get']('collaboration.channelId'),'selections':_0x1cd549['selections'],'name':_0x297a2d,'description':_0x4b97b2});}}return _0x4b33a4;}async['_getDocumentDataForEditorRoot'](_0x1e7126,_0x1681cb,_0x174796){const _0x3bdbb8=_0x1e7126['data']['toView'](_0x1681cb,{'convertAiChatSelectionMarker':!0x0}),_0x35b9f7=new _0x17a1b2(_0x1e7126['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x3bdbb8,_0x35b9f7,_0x174796);let _0x3e187b=await this['_getDocumentDataStringFromView'](_0x3bdbb8,_0x1e7126);const _0x1ae75f=this['_getMarkersInDocumentOrder'](_0x1e7126,_0x1681cb),_0x1f91fd=[];for(const _0x13b5b3 of _0x1ae75f){const _0x4cb827='<'+_0x13b5b3['name']+':start></'+_0x13b5b3['name']+':start>',_0x5d39c0=_0x3e187b['indexOf'](_0x4cb827);_0x3e187b=_0x3e187b['substring'](0x0,_0x5d39c0)+_0x3e187b['substring'](_0x5d39c0+_0x4cb827['length']);const _0x2420d5='<'+_0x13b5b3['name']+':end></'+_0x13b5b3['name']+':end>',_0xd25ac5=_0x3e187b['indexOf'](_0x2420d5);_0x3e187b=_0x3e187b['substring'](0x0,_0xd25ac5)+_0x3e187b['substring'](_0xd25ac5+_0x2420d5['length']),_0x1f91fd['push']({'markerName':_0x13b5b3['name'],'start':_0x5d39c0,'end':_0xd25ac5,'htmlFragment':_0x3e187b['substring'](_0x5d39c0,_0xd25ac5)});}return{'content':_0x3e187b,'version':_0x1e7126['model']['document']['version'],'selections':_0x1f91fd};}['afterInit'](){this['context']instanceof _0x1f7986?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x5106bf,_0xdb2daa)=>{_0xdb2daa['on']('ready',()=>{this['_integrateEditor'](_0xdb2daa);});});}['_setOutputDataProcessor'](_0x5c4ac9){this['_outputDataProcessor']=_0x5c4ac9;}async['_getDocumentDataStringFromView'](_0x1a713e,_0x573886){let _0x472a9b;if(this['_outputDataProcessor']){const _0x422530=_0x573886['data']['processor']['domConverter']['viewToDom'](_0x1a713e),_0x29ff44=await this['_outputDataProcessor'](_0x422530);_0x472a9b=_0x573886['data']['processor']['htmlWriter']['getHtml'](_0x29ff44);}else _0x472a9b=_0x573886['data']['processor']['toData'](_0x1a713e);return _0x472a9b;}['_integrateEditor'](_0xa3009a){if(!_0xa3009a['config']['get']('collaboration.channelId'))throw new ht('ai-missing-channel-id',_0xa3009a);_0xa3009a['ui']['focusTracker']['on']('change:isFocused',(_0x295efb,_0xe32f7e,_0x399e4f)=>{_0x399e4f&&(this['_lastContentFocusedEditor']=_0xa3009a);}),_0xa3009a['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0xa3009a&&(this['_lastContentFocusedEditor']=void 0x0);}),_0xa3009a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':gs,'view':({markerName:_0x4d85ab})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x4d85ab['split'](':')[0x1]],'priority':0xc})}),_0xa3009a['conversion']['for']('dataDowncast')['markerToElement']({'model':gs+':context','view':(_0x1f6819,{writer:_0x37e6cc,options:_0x10635a})=>_0x10635a['convertAiChatSelectionMarker']?_0x37e6cc['createUIElement'](_0x1f6819['markerName']+':'+(_0x1f6819['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x16072f){const _0x3ddaa2=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x16072f);const _0x2963bd=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x3ddaa2,_0x2963bd);}['hideFakeVisualSelection'](_0x3e4228){const _0x32275f=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x3e4228);const _0x16c904=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x32275f,_0x16c904);}async['modelToDataWithIds'](_0x257cc4,_0x1eb814){const _0x3c2ebf=_0x1eb814['data']['toView'](_0x257cc4),_0x4cdca5=new _0x17a1b2(_0x1eb814['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x3c2ebf,_0x4cdca5),this['_getDocumentDataStringFromView'](_0x3c2ebf,_0x1eb814);}['_setDataIdsOnChildren'](_0x55cfb7,_0x51a601,_0x192eb=new Set()){let _0x3c9055=!0x1;for(const _0x13d6d9 of _0x55cfb7['getChildren']()){if(!_0x13d6d9['is']('view:element')||As['includes'](_0x13d6d9['name']))continue;const _0x38c306=_0x13d6d9['is']('view:containerElement'),_0x197da5=_0x13d6d9['is']('view:emptyElement'),_0x8fe909=_0x13d6d9['is']('view:rawElement'),_0x4c171e=this['_setDataIdsOnChildren'](_0x13d6d9,_0x51a601,_0x192eb);_0x13d6d9['hasAttribute']('data-id')?(_0x3c9055=!0x0,_0x192eb['add'](_0x13d6d9['getAttribute']('data-id'))):(_0x38c306||_0x197da5||_0x8fe909||_0x4c171e)&&(_0x51a601['setAttribute']('data-id',this['_nextDataId'](_0x192eb),_0x13d6d9),_0x3c9055=!0x0);}return _0x3c9055;}['_nextDataId'](_0x3d781f){let _0x4250c4;do{_0x4250c4='';for(let _0x51f297=0x0;_0x51f297<0x4;_0x51f297++)_0x4250c4+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x3d781f['has'](_0x4250c4));return _0x3d781f['add'](_0x4250c4),_0x4250c4;}['getSelectionText'](_0x23219c){const _0x2e6266=(_0x23219c?_0x23219c['model']:_s(this['context'])['model'])['document']['selection'],_0x105701=[],_0xd10d74=Array['from'](_0x2e6266['getRanges']());_0xd10d74['sort']((_0x5bdbf7,_0x3d3673)=>_0x5bdbf7['start']['isBefore'](_0x3d3673['start'])?-0x1:0x1);for(const _0x4ae082 of _0xd10d74)for(const _0x8699b3 of _0x4ae082['getItems']())_0x8699b3['is']('$textProxy')?_0x105701['push'](_0x8699b3['data']):_0x8699b3['is']('element')&&_0x105701['length']>0x0&&'\x20'!==_0x105701[_0x105701['length']-0x1]&&_0x105701['push']('\x20');return _0x105701['length']?'\x22'+_0x105701['join']('')['trim']()+'\x22':us(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x2e0b9f){for(let _0x178721=0x0;_0x178721<this['_fakeSelections']['length'];_0x178721++)if(this['_fakeSelections'][_0x178721]['id']==_0x2e0b9f)return void this['_fakeSelections']['splice'](_0x178721,0x1);}['_addFakeSelection'](_0xa23c56){this['_removeFakeSelectionById'](_0xa23c56['id']),wt(this['_fakeSelections'],_0xa23c56);}['_refreshFakeSelection'](_0x5d011d,_0x5ef1a7){if(_0x5d011d==_0x5ef1a7)return;const _0x449a08=_0x5d011d?_0x5d011d['editor']:null,_0x4181fe=_0x5ef1a7?_0x5ef1a7['editor']:null,_0x5b3495=(_0x5f3d45,_0x28a137)=>{const _0x5165bd=_0x28a137['model']['markers']['getMarkersGroup'](gs);for(const _0x353314 of _0x5165bd)_0x5f3d45['removeMarker'](_0x353314);},_0x1bb8aa=(_0x4747e9,_0x22a32a,_0xbf6276)=>{const _0x278614=_0x22a32a['model'];for(let _0x5a76ad=0x0;_0x5a76ad<_0xbf6276['ranges']['length'];_0x5a76ad++){let _0x4fed90=_0xbf6276['ranges'][_0x5a76ad];const _0x3f3ebf=gs+':'+_0xbf6276['id']+':'+_0x5a76ad;if(_0x4fed90['start']['isAtEnd']){const _0x3422ae=_0x4fed90['start']['getLastMatchingPosition'](({item:_0x373e20})=>!_0x278614['schema']['isContent'](_0x373e20),{'boundaries':_0x4fed90});_0x4fed90=_0x4747e9['createRange'](_0x3422ae,_0x4fed90['end']);}_0x4747e9['addMarker'](_0x3f3ebf,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4fed90});}};_0x449a08&&_0x4181fe&&_0x449a08===_0x4181fe&&_0x5ef1a7?_0x449a08['model']['change'](_0x501cc9=>{_0x5b3495(_0x501cc9,_0x449a08),_0x1bb8aa(_0x501cc9,_0x4181fe,_0x5ef1a7);}):(_0x449a08&&_0x449a08['model']['change'](_0x307336=>_0x5b3495(_0x307336,_0x449a08)),_0x4181fe&&_0x5ef1a7&&_0x4181fe['model']['change'](_0x17516d=>_0x1bb8aa(_0x17516d,_0x4181fe,_0x5ef1a7)));}['_getMarkersInDocumentOrder'](_0x533eee,_0x3bc108){const _0x4ebbe2=Array['from'](_0x533eee['model']['markers']['getMarkersGroup'](gs+':context'));return(_0x3bc108?_0x4ebbe2['filter'](_0x2c32bc=>{const _0x45b5ab=_0x2c32bc['getRange']();return _0x45b5ab&&_0x45b5ab['root']['rootName']===_0x3bc108['rootName'];}):_0x4ebbe2)['sort']((_0x468335,_0x28356b)=>_0x468335['getStart']()['isBefore'](_0x28356b['getStart']())?-0x1:_0x468335['getStart']()['isAfter'](_0x28356b['getStart']())?0x1:0x0);}};function ps(_0xce7bc8,_0x25a33f){return _0x1023a2(_0xce7bc8,_0x25a33f);}function ms(_0x523007,_0x48d5a5){return _0x1dbe92(_0x523007,_0x48d5a5);}function Es(_0x1acc4a,_0x1550e9,_0x4fde0a){const _0x34ac3e=null!==_0x1550e9?_0x505b97=>_0x505b97['attribs'][_0x1acc4a]===_0x1550e9:_0x224522=>Boolean(_0x224522['attribs'][_0x1acc4a]);return ti(_0x3f80fc=>_0x489441(_0x3f80fc)&&_0x34ac3e(_0x3f80fc),_0x4fde0a);}function Ts(_0x996ba3,_0x2c2b23,_0x32afec){const _0x440166=null!==_0x2c2b23?_0x575e74=>_0x575e74['attribs'][_0x996ba3]===_0x2c2b23:_0x3df786=>Boolean(_0x3df786['attribs'][_0x996ba3]);return _0x5380b2(_0x4e83ad=>_0x489441(_0x4e83ad)&&_0x440166(_0x4e83ad),_0x32afec);}function ws(_0x19dc87){return _0x5380b2(_0x4b0b3=>_0x489441(_0x4b0b3)&&function(_0xad93bc){const _0x46eb6c=_0xad93bc['toLowerCase']();return'script'===_0x46eb6c||'style'===_0x46eb6c||_0x46eb6c['includes']('-');}(_0x4b0b3['name']),_0x19dc87);}function Cs(_0x2f3240){return _0x3ced30(_0x4a0068=>_0xc2cc58(_0x4a0068),_0x2f3240,!0x0,0x1/0x0);}function fs(_0x630422,_0x48e3a5){return _0x630422&&_0x489441(_0x630422)?_0x630422['attribs'][_0x48e3a5]:null;}function bs(_0x3b840c,_0x57fe55,_0x775cbd){_0x489441(_0x3b840c)&&(null===_0x775cbd?delete _0x3b840c['attribs'][_0x57fe55]:_0x3b840c['attribs'][_0x57fe55]=_0x775cbd);}function Ss(_0x4afb5d,_0x127bbb,_0x35ebe2){const _0x435f0d=_0x127bbb['cloneNode'](!0x0);'beforebegin'===_0x35ebe2?_0x201d1c(_0x4afb5d,_0x435f0d):'afterbegin'===_0x35ebe2?_0x2dfbea(_0x4afb5d,_0x435f0d):'beforeend'===_0x35ebe2?_0x1cca13(_0x4afb5d,_0x435f0d):'afterend'===_0x35ebe2&&_0x218be5(_0x4afb5d,_0x435f0d);}function Rs(_0x53eae5){const _0x352c9e=[];let _0x203175=_0x53eae5;for(;_0x203175;)_0x203175=_0x38b6f8(_0x203175),_0x203175&&_0x352c9e['push'](_0x203175);return _0x352c9e;}function Os(_0xf62bee){return _0xf62bee['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function vs(_0x3c666a){let _0x5a7a5e=0x0;for(;_0x3c666a['parentNode'];)_0x3c666a=_0x3c666a['parentNode'],_0x5a7a5e++;return _0x5a7a5e;}function ks(_0x5357b1){const _0x559cdb=[];let _0x5b142c=_0x5357b1['nextSibling'];for(;_0x5b142c;)_0x559cdb['push'](_0x5b142c),_0x5b142c=_0x5b142c['nextSibling'];_0x559cdb['forEach'](_0x337091=>{_0x2a7599(_0x337091);});}const Ns=/* #__PURE__ -- @preserve */
25
- gt();var ys=class extends Ns{['_generateUid'];['_uidCounter']=0x0;['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null,'rescuedNewIds':new Set()};['_existingDataIds']=new Set();['_referencedExistingIds']=new Set();constructor(_0x34c4b1){super(),this['_generateUid']=_0x34c4b1||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x288a4c,_0x19960b,_0x4758bd){this['_uidCounter']=0x0;const _0x5dec6a=_0x288a4c['cloneNode'](!0x0);Ds(_0x19960b,_0x5dec6a);const _0x64937d=_0x5dec6a['childNodes'],_0x54b64f=Array['from'](_0x64937d)['filter'](_0x32a8f7=>!(0x3===_0x32a8f7['nodeType']&&''===ms(_0x32a8f7)['trim']())),_0x1a961b=_0x54b64f['length'];this['_existingDataIds']=new Set(Ts('data-id',null,_0x19960b)['map'](_0xc2c589=>fs(_0xc2c589,'data-id'))['filter'](_0x515a2c=>!!_0x515a2c));for(const _0x33961c of _0x54b64f)_0x33961c&&_0x489441(_0x33961c)&&void 0x0===_0x33961c['attribs']['data-id']&&bs(_0x33961c,'data-id','new-element');if(Ts('data-id',null,_0x5dec6a)['forEach'](_0x1f64e2=>{const _0x1d018d=fs(_0x1f64e2,'data-id');'new-element'===_0x1d018d||this['_existingDataIds']['has'](_0x1d018d)||bs(_0x1f64e2,'data-id','new-element');}),0x0===_0x19960b['childNodes']['length']){const _0x4359c5=[];return Ts('data-id','new-element',_0x5dec6a)['forEach'](_0x3aa07f=>{const _0x52cf73=this['_generateUid']();bs(_0x3aa07f,'data-id',_0x52cf73),_0x4359c5['push'](_0x52cf73);}),this['_removeSpecialComments'](_0x5dec6a),{'parsedContent':_0x5dec6a,'newNodeIds':_0x4359c5,'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 _0x3ea70d=-0x1,_0x46a40c=!0x1;for(let _0x2292bc=0x0;_0x2292bc<_0x1a961b;_0x2292bc++){const _0x56fe18=_0x54b64f[_0x2292bc],_0x294f30=_0x54b64f[_0x2292bc+0x1];if(this['_isNewNode'](_0x56fe18)){if(-0x1===_0x3ea70d&&(_0x3ea70d=_0x2292bc),this['_markWrappedElements'](_0x56fe18),!this['_isNewNode'](_0x294f30)){const [_0x58054a,_0x335ce9]=this['_findReferenceNode'](_0x56fe18,_0x46a40c,_0x19960b);if(_0x58054a){const _0x2ee891=Array['from'](_0x54b64f)['slice'](_0x3ea70d,_0x2292bc+0x1);this['_insertNodes'](_0x58054a,_0x2ee891,_0x335ce9),_0x3ea70d=-0x1;}}}else{if(this['_isExistingContentComment'](_0x56fe18))_0x46a40c=!0x0;else{if(this['_isExistingNode'](_0x56fe18)){const _0x5e5145=fs(_0x56fe18,'data-id');if(_0x5e5145&&this['_existingDataIds']['has'](_0x5e5145)){this['_referencedExistingIds']['add'](_0x5e5145);const _0xb65813=Es('data-id',_0x5e5145,_0x19960b);this['_replaceNode'](_0xb65813,_0x56fe18);}}else{if(xs(_0x56fe18)){const _0x4ce02e=Ls(_0x56fe18);Es('data-id',_0x4ce02e,_0x5dec6a)||this['_touchedNodesState']['removedIds']['push'](_0x4ce02e);}}}}}for(const _0x1dfe0e of this['_touchedNodesState']['removedIds']){const _0x1eb568=Es('data-id',_0x1dfe0e,_0x19960b);_0x1eb568&&(this['_rescueUnwrappedElements'](_0x1eb568),this['_removeNode'](_0x1eb568,_0x1dfe0e,_0x4758bd));}if(Ts('data-id','new-element',_0x19960b)['forEach'](_0x183778=>{const _0xad0aba=this['_getUid'](_0x183778);bs(_0x183778,'data-id',_0xad0aba),this['_touchedNodesState']['newIds']['push'](_0xad0aba);}),this['_removeSpecialComments'](_0x19960b),_0x4758bd&&_0x4758bd['cutAfterUnstable']){const _0x40cba1=this['_findLastConfirmationPoint'](_0x54b64f),_0x56ec23=this['_getLastStableElement'](_0x19960b,_0x40cba1);this['_markUnstableElements'](_0x19960b,_0x56ec23);}if(this['_processWrappedElements'](_0x19960b,_0x4758bd),_0x4758bd&&_0x4758bd['cutAfterUnstable']&&this['_touchedNodesState']['lastTouchedId']){const _0x3e6cc8=Ts('data-id',this['_touchedNodesState']['lastTouchedId'],_0x19960b);let _0x4d8624=_0x3e6cc8[_0x3e6cc8['length']-0x1];for(;_0x4d8624;)ks(_0x4d8624),_0x4d8624=_0x4d8624['parentNode'];}return{'parsedContent':_0x19960b,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x461f5b,_0x16ffa5,_0x18879b){for(const _0x5d5670 of _0x16ffa5){const _0x48959c=this['_getUid'](_0x5d5670);bs(_0x5d5670,'data-id',_0x48959c),this['_touchedNodesState']['newIds']['push'](_0x48959c),this['_touchedNodesState']['lastTouchedId']=_0x48959c;}const _0x2ed1dd='afterbegin'===_0x18879b||'afterend'===_0x18879b?_0x16ffa5['reverse']():_0x16ffa5;for(const _0x29d1bb of _0x2ed1dd)Ss(_0x461f5b,_0x29d1bb,_0x18879b);}['_replaceNode'](_0x30e4c4,_0xe695e1){if(!_0x30e4c4)return;if(_0x405579=_0xe695e1,Os(ms(_0x30e4c4))===Os(ms(_0x405579)))return;var _0x405579;const _0xef4bbe=fs(_0x30e4c4,'data-id');this['_touchedNodesState']['modifiedIds']['push'](_0xef4bbe),this['_touchedNodesState']['lastTouchedId']=_0xef4bbe,_0x43a070(_0x30e4c4,_0xe695e1['cloneNode'](!0x0));}['_removeNode'](_0x462006,_0x3aaa32,_0x3e982b){if(_0x3e982b&&_0x3e982b['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x3aaa32;const _0x3cde96=_0x3e982b['replaceRemovedWith']['cloneNode'](!0x0);bs(_0x3cde96,'data-id',_0x3aaa32),bs(_0x3cde96,'data-removed','true'),_0x43a070(_0x462006,_0x3cde96);}else _0x2a7599(_0x462006);}['_findReferenceNode'](_0x1d52c6,_0x347e6f,_0x5a0fda){const _0x348296=this['_findPrevElementWithDataId'](_0x1d52c6,!0x1);if(_0x348296){const _0x5645ac=Ls(_0x348296),_0x55c0e5=Es('data-id',_0x5645ac,_0x5a0fda);if(_0x55c0e5)return[_0x55c0e5,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x5645ac);}const _0x2df460=this['_findNextElementWithDataId'](_0x1d52c6,!0x1);if(_0x2df460){const _0x21a9a8=Ls(_0x2df460),_0x3e1fa7=Es('data-id',_0x21a9a8,_0x5a0fda);if(_0x3e1fa7)return[_0x3e1fa7,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x21a9a8);}return _0x347e6f?_0x1d52c6['nextSibling']?this['_findFallbackReferenceNode'](_0x1d52c6,_0x5a0fda):[_0x5a0fda['childNodes'][_0x5a0fda['childNodes']['length']-0x1],'afterend']:[_0x5a0fda['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x19f8f0,_0x52c18e){const _0x44a81f=[],_0x4c0f5d=this['_findPrevElementWithDataId'](_0x19f8f0,!0x0);if(_0x4c0f5d){const _0x3d638e=Es('data-id',Ls(_0x4c0f5d),_0x52c18e);_0x3d638e&&_0x44a81f['push']([_0x3d638e,'afterend']);}const _0x3cc0dc=this['_findNextElementWithDataId'](_0x19f8f0,!0x0);if(_0x3cc0dc){const _0x4c6aa6=Es('data-id',Ls(_0x3cc0dc),_0x52c18e);_0x4c6aa6&&_0x44a81f['push']([_0x4c6aa6,'beforebegin']);}return _0x44a81f['length']>0x1?vs(_0x44a81f[0x0][0x0])<=vs(_0x44a81f[0x1][0x0])?_0x44a81f[0x0]:_0x44a81f[0x1]:0x1===_0x44a81f['length']?_0x44a81f[0x0]:[_0x52c18e['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x4addfa,_0x3b58e8){let _0x4f50b1=_0x4addfa['nextSibling'],_0x47f29c=null,_0x33c836=!0x1;for(;_0x4f50b1;){if(_0xc2cc58(_0x4f50b1)){if(xs(_0x4f50b1)&&(_0x47f29c=_0x4f50b1),this['_isExistingContentComment'](_0x4f50b1)&&_0x3b58e8&&!_0x33c836){_0x33c836=!0x0,_0x4f50b1=_0x4f50b1['nextSibling'];continue;}break;}const _0x2fb9e2=fs(_0x4f50b1,'data-id');if(_0x2fb9e2&&'new-element'!==_0x2fb9e2&&this['_existingDataIds']['has'](_0x2fb9e2)){_0x47f29c=_0x4f50b1;break;}_0x4f50b1=_0x4f50b1['nextSibling'];}return _0x47f29c;}['_findPrevElementWithDataId'](_0x202be2,_0x290c23){let _0x4a0ef2=_0x202be2['previousSibling'],_0x5d7b12=null,_0x3844d9=!0x1;for(;_0x4a0ef2;){if(_0xc2cc58(_0x4a0ef2)){if(xs(_0x4a0ef2)&&(_0x5d7b12=_0x4a0ef2),this['_isExistingContentComment'](_0x4a0ef2)&&_0x290c23&&!_0x3844d9){_0x3844d9=!0x0,_0x4a0ef2=_0x4a0ef2['previousSibling'];continue;}break;}const _0x4fd174=fs(_0x4a0ef2,'data-id');if(_0x4fd174&&'new-element'!==_0x4fd174&&this['_existingDataIds']['has'](_0x4fd174)){_0x5d7b12=_0x4a0ef2;break;}_0x4a0ef2=_0x4a0ef2['previousSibling'];}return _0x5d7b12;}['_markWrappedElements'](_0x485080){_0x489441(_0x485080)&&Ts('data-id',null,_0x485080)['forEach'](_0x922ee9=>{this['_isExistingNode'](_0x922ee9)&&(bs(_0x922ee9,'data-wrapped-id',fs(_0x922ee9,'data-id')),bs(_0x922ee9,'data-id',null));});}['_processWrappedElements'](_0x5b8e35,_0x42f45b){Ts('data-wrapped-id',null,_0x5b8e35)['forEach'](_0x5f2801=>{const _0x1d8d85=fs(_0x5f2801,'data-wrapped-id');if(this['_hasUnstableParent'](_0x5f2801))return;const _0x4ab3b9=Es('data-id',_0x1d8d85,_0x5b8e35);bs(_0x5f2801,'data-id',_0x1d8d85),_0x4ab3b9&&(this['_removeNode'](_0x4ab3b9,_0x1d8d85,_0x42f45b),this['_touchedNodesState']['removedIds']['push'](_0x1d8d85),this['_touchedNodesState']['lastTouchedId']=_0x1d8d85);});}['_hasUnstableParent'](_0xebcfe5){let _0x593d4e=_0xebcfe5['parentNode'];for(;_0x593d4e;){if(fs(_0x593d4e,'data-unstable'))return!0x0;_0x593d4e=_0x593d4e['parentNode'];}return!0x1;}['_rescueUnwrappedElements'](_0x5b16e3){const _0x135b1c=new Set(this['_touchedNodesState']['removedIds']),_0x1eee4b=new Set(this['_touchedNodesState']['newIds']);Ts('data-id',null,_0x5b16e3)['forEach'](_0x2a359c=>{const _0x3b11c8=fs(_0x2a359c,'data-id'),_0x31c35f=!!_0x3b11c8&&this['_referencedExistingIds']['has'](_0x3b11c8),_0x3a16b3=!!_0x3b11c8&&_0x1eee4b['has'](_0x3b11c8);if(!_0x3b11c8||!_0x31c35f&&!_0x3a16b3)return;if(_0x135b1c['has'](_0x3b11c8))return;let _0x66c4a1=_0x2a359c['parentNode'],_0x480fb9=!0x1;for(;_0x66c4a1;){if(_0x66c4a1===_0x5b16e3){_0x480fb9=!0x0;break;}const _0x48e47f=fs(_0x66c4a1,'data-id');if(_0x48e47f&&(this['_referencedExistingIds']['has'](_0x48e47f)||_0x1eee4b['has'](_0x48e47f)))return;_0x66c4a1=_0x66c4a1['parentNode'];}if(_0x480fb9){if(_0x201d1c(_0x5b16e3,_0x2a359c),_0x31c35f){const _0x306d3a=this['_generateUid'](),_0x58f2ed=this['_touchedNodesState']['modifiedIds']['indexOf'](_0x3b11c8);-0x1!==_0x58f2ed&&this['_touchedNodesState']['modifiedIds']['splice'](_0x58f2ed,0x1),bs(_0x2a359c,'data-unwrapped-id',_0x3b11c8),bs(_0x2a359c,'data-id',_0x306d3a),this['_touchedNodesState']['newIds']['push'](_0x306d3a),this['_touchedNodesState']['rescuedNewIds']['add'](_0x306d3a),this['_touchedNodesState']['lastTouchedId']=_0x306d3a;}else this['_touchedNodesState']['rescuedNewIds']['add'](_0x3b11c8),this['_touchedNodesState']['lastTouchedId']=_0x3b11c8;}});}['_getUid'](_0x1d5783){return this['_isExistingNode'](_0x1d5783)?fs(_0x1d5783,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x597305){Cs(_0x597305)['filter'](_0x38120f=>xs(_0x38120f)||this['_isExistingContentComment'](_0x38120f))['forEach'](_0x52afc3=>{_0x2a7599(_0x52afc3);});}['_findLastConfirmationPoint'](_0x2fb43b){let _0x2b5970=null,_0x95eb2c=null,_0x2ef9a3=null,_0x18fdb5=null;const _0x32b85e=_0x4e8787=>{_0x4e8787&&(_0x2b5970=_0x4e8787),_0x2ef9a3=null,_0x18fdb5=null;};for(let _0xf0934a=0x0;_0xf0934a<_0x2fb43b['length'];_0xf0934a++){const _0x2506a5=_0x2fb43b[_0xf0934a];if(this['_isExistingContentComment'](_0x2506a5)){_0x32b85e(_0x95eb2c);continue;}if(_0x489441(_0x2506a5)){const _0x1b1844=fs(_0x2506a5,'data-id'),_0x4ecfc0=_0xf0934a===_0x2fb43b['length']-0x1;if(_0x1b1844&&'new-element'!==_0x1b1844&&this['_touchedNodesState']['modifiedIds']['includes'](_0x1b1844)&&!_0x4ecfc0){_0x32b85e(_0x1b1844),_0x95eb2c=_0x1b1844;continue;}}let _0x13da3f=null;const _0x3ca8e2=Ls(_0x2506a5);if(_0x3ca8e2&&this['_touchedNodesState']['rescuedNewIds']['has'](_0x3ca8e2))_0x95eb2c=_0x3ca8e2;else{if(_0x3ca8e2&&this['_touchedNodesState']['newIds']['includes'](_0x3ca8e2))_0x13da3f='N';else{if(!xs(_0x2506a5))continue;_0x13da3f='R';}_0x13da3f===_0x18fdb5||null===_0x18fdb5?_0x18fdb5=_0x13da3f:null!==_0x2ef9a3?(_0x32b85e(_0x95eb2c),_0x18fdb5=_0x13da3f):(_0x2ef9a3=_0x18fdb5,_0x18fdb5=_0x13da3f),_0x95eb2c=_0x3ca8e2;}}const _0x35143c=_0x2fb43b[_0x2fb43b['length']-0x1];return _0x35143c&&!_0x489441(_0x35143c)&&!xs(_0x35143c)&&_0x95eb2c&&_0x32b85e(_0x95eb2c),_0x2b5970;}['_getLastStableElement'](_0x4c3087,_0x3bfc36){if(!_0x3bfc36)return null;const _0x302db2=Es('data-id',_0x3bfc36,_0x4c3087);if(!_0x302db2)return null;const _0x566f8c=[_0x302db2,...Rs(_0x302db2)]['at'](-0x2);if(_0x566f8c===_0x302db2)return _0x302db2;let _0x3bb0ed=_0x566f8c['previousSibling'];for(;_0x3bb0ed&&!_0x489441(_0x3bb0ed);)_0x3bb0ed=_0x3bb0ed['previousSibling'];return _0x3bb0ed;}['_markUnstableElements'](_0x2385fb,_0x5791de){const _0x556327=new Set([...this['_touchedNodesState']['newIds'],...this['_touchedNodesState']['modifiedIds'],...this['_touchedNodesState']['removedIds']]);let _0x5f072c=_0x5791de?_0x5791de['nextSibling']:_0x2385fb['firstChild'];for(;_0x5f072c;)_0x489441(_0x5f072c)&&(_0x556327['has'](fs(_0x5f072c,'data-id'))||Ts('data-id',null,_0x5f072c)['some'](_0x4ea8e7=>_0x556327['has'](fs(_0x4ea8e7,'data-id'))))&&bs(_0x5f072c,'data-unstable','true'),_0x5f072c=_0x5f072c['nextSibling'];}['_isNewNode'](_0x304ec1){return Boolean('new-element'===fs(_0x304ec1,'data-id'));}['_isExistingNode'](_0x308205){return Boolean((fs(_0x308205,'data-id')||'')['length']>0x0&&'new-element'!==fs(_0x308205,'data-id'));}['_isExistingContentComment'](_0x2f17bf){return Boolean(_0xc2cc58(_0x2f17bf)&&ms(_0x2f17bf)['match'](/\s*existing[\s*-](content|document)\s*/g));}};function xs(_0x4338bf){return!!_0x4338bf&&Boolean(_0xc2cc58(_0x4338bf)&&ms(_0x4338bf)['match'](/removed[\s*-]data-id="[^"]+"/));}function Ls(_0x1c818e){if(!_0x1c818e)return null;if(_0x489441(_0x1c818e))return fs(_0x1c818e,'data-id')??null;if(_0xc2cc58(_0x1c818e)){const _0x453ff6=ms(_0x1c818e)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x453ff6&&_0x453ff6[0x1])return _0x453ff6[0x1];}return null;}function Ds(_0x3c6db9,_0x3fa5be){const _0x230de9=new Map();for(const _0x504b0f of ws(_0x3c6db9))_0x230de9['set'](fs(_0x504b0f,'data-id'),_0x504b0f);const _0x261edd=new Set();for(const _0x385f4d of ws(_0x3fa5be)){const _0x4d6b8a=fs(_0x385f4d,'data-id'),_0x2d1d54=_0x4d6b8a?_0x230de9['get'](_0x4d6b8a):void 0x0;_0x2d1d54?(_0x43a070(_0x385f4d,_0x373861(_0x2d1d54,!0x0)),_0x261edd['add'](_0x4d6b8a)):_0x2a7599(_0x385f4d);}for(const _0x3bc007 of Cs(_0x3fa5be))xs(_0x3bc007)&&_0x230de9['has'](Ls(_0x3bc007))&&_0x2a7599(_0x3bc007);const _0x484aae=new Set(Ts('data-id',null,_0x3fa5be)['map'](_0x23ce58=>fs(_0x23ce58,'data-id')));for(const [_0x3117b3,_0x4a0442]of _0x230de9){if(_0x261edd['has'](_0x3117b3))continue;let _0x2403a4=_0x4a0442['parent'],_0x2a8751=null;for(;_0x2403a4&&_0x489441(_0x2403a4);){const _0x10a03f=fs(_0x2403a4,'data-id');if(_0x10a03f&&_0x484aae['has'](_0x10a03f)){_0x2a8751=_0x10a03f;break;}_0x2403a4=_0x2403a4['parent'];}if(!_0x2a8751)continue;const _0x4551f5=Es('data-id',_0x2a8751,_0x3fa5be);_0x4551f5&&_0x1cca13(_0x4551f5,_0x373861(_0x4a0442,!0x0));}}const Ps=/* #__PURE__ -- @preserve */
26
- gt();var Hs=class extends Ps{['_m2html'];constructor(){super();const _0x94d6de=Object['entries'](_0x387a1c),_0x1b0b51=_0x94d6de['findIndex'](([_0x217c9e])=>'rehypeDomRaw'===_0x217c9e);if(-0x1===_0x1b0b51)throw new ht('ai-response-parser-unable-to-set-up-parser');_0x94d6de['splice'](_0x1b0b51+0x1,0x0,['rehypeSanitize',_0x20d56a]),this['_m2html']=new _0x3e333d({'plugins':Object['fromEntries'](_0x94d6de)});}['convertMarkdownToHTML'](_0x4e31f5){const _0x101648=this['_m2html']['parse'](_0x4e31f5);return this['parseAndNormalizeHTML'](_0x101648);}['parseAndNormalizeHTML'](_0x1b3efc){return this['_parseHTML'](_0x1b3efc);}['_parseHTML'](_0x3d2294){const _0x1c7ecb=ps('<dummy>'+_0x3d2294['replace'](/<[^>]*?$/g,'')+'</dummy>');return Ms(_0x1c7ecb),_0x1c7ecb['children']=_0x1c7ecb['children'][0x0]['children'],_0x1c7ecb;}};function Ms(_0xd93574){for(const _0x259b3e of _0xd93574['children'])_0x489441(_0x259b3e)?'pre'!==_0x259b3e['name']&&Ms(_0x259b3e):_0x506b37(_0x259b3e)&&(_0x259b3e['data']=_0x259b3e['data']['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/[ \t\r\f\v]+/g,'\x20'));}function Vs({changeGroups:_0x46dfd0,documentContextContent:_0x1ebb87,showDiff:_0x4684c7,trimUnchanged:_0x1ce0e1=!0x0}){return _0x46dfd0['map'](_0x15db2c=>{if(!_0x15db2c['editor']||'destroyed'===_0x15db2c['editor']['state'])return null;if(!_0x30f76f(_0x15db2c['editor'],_0x15db2c['rootName']))return{'type':_0x15db2c['changes'][0x0]['type'],'index':_0x15db2c['index'],'content':new _0x3df49e([]),'hasChanges':!0x1};const _0x5c3780=new _0x3df49e([]),_0x2b5dda=new _0x3df49e([]),_0x463dbe=new Set();for(const _0x2496cb of _0x15db2c['changes'])'new'==_0x2496cb['type']&&Ts('data-id',null,_0x2496cb['node'])['forEach'](_0x4ba396=>{_0x463dbe['add'](fs(_0x4ba396,'data-id'));});for(const _0x364671 of _0x15db2c['changes'])if('removed'!=_0x364671['type']?_0x2b5dda['children']['push'](_0x364671['node']['cloneNode'](!0x0)):_0x4684c7||_0x463dbe['has'](_0x364671['id'])||_0x2b5dda['children']['push'](_0x364671['node']['cloneNode'](!0x0)),'new'!=_0x364671['type']&&(_0x4684c7||'removed'!=_0x364671['type'])){const _0x1544dd=ti(_0x4011cf=>fs(_0x4011cf,'data-id')==_0x364671['id'],_0x1ebb87['get'](_0x15db2c['documentId']),!0x0);_0x1544dd&&_0x5c3780['children']['push'](_0x1544dd['cloneNode'](!0x0));}let _0x3eb654,_0xd8b082;try{({content:_0x3eb654,hasChanges:_0xd8b082}=Us(_0x15db2c['editor'],_0x5c3780,_0x2b5dda,_0x4684c7,_0x1ce0e1));}catch{return{'type':_0x15db2c['changes'][0x0]['type'],'index':_0x15db2c['index'],'content':new _0x3df49e([]),'hasChanges':!0x1};}return{'type':_0x15db2c['changes'][0x0]['type'],'index':_0x15db2c['index'],'content':_0x3eb654,'hasChanges':_0xd8b082};})['filter'](_0x3c8550=>null!==_0x3c8550);}function Us(_0x12e59a,_0x58666c,_0x23b852,_0x110c53,_0x359b3f=!0x0){const _0x4c72ad=_0x12e59a['plugins']['get']('DocumentCompare'),_0x16a872=ms(_0x58666c),_0xa9753f=ms(_0x23b852),_0x47da27=_0x12e59a['data']['parse'](_0x16a872,'$root'),_0x5b97e5=_0x12e59a['model']['createPositionAt'](_0x47da27,0x0),_0x14bcdf=_0x4c72ad['getDiff'](_0x16a872,_0xa9753f,{'anchor':_0x5b97e5,'markDeletions':_0x110c53,'targetEditor':_0x12e59a})['getOperations']();if(0x0==_0x14bcdf['length'])return{'content':_0x58666c['cloneNode'](!0x0),'hasChanges':!0x1};if(_0x110c53?function(_0xfb943,_0xc68e33,_0x31bbb3){if(0x0==_0xfb943['length'])return;const _0x41fe24=_0x31bbb3['plugins']['get']('DocumentCompare'),_0xebf2f8=_0x31bbb3['plugins']['get']('SuggestionsConversion');_0x31bbb3['model']['change'](_0x292ac5=>{const _0x470127=new Set();for(let _0x37a246=0x0;_0x37a246<_0xfb943['length'];_0x37a246++){const _0xfb9111=_0xfb943[_0x37a246];if(_0xfb9111['baseVersion']=null,_0xfb9111['isDocumentOperation']=!0x1,_0x41fe24['isMarkedRemoveOperation'](_0xfb9111)){const _0x1108b1=_0x38a66a(_0xfb9111['newRange'],_0x31bbb3['model']),_0x16bd66='suggestion:deletion:'+vt()+':$aiSuggestion';_0xc68e33['markers']['set'](_0x16bd66,_0x1108b1);}else switch(_0xfb9111['type']){case'rename':{if(_0xfb9111['oldName']==_0xfb9111['newName'])break;_0x292ac5['batch']['addOperation'](_0xfb9111),_0x31bbb3['model']['applyOperation'](_0xfb9111);const _0x39a161='$elementName',_0x3dcdcf=_0xfb9111['position'],_0xd7b133=_0x31bbb3['model']['createRange'](_0x3dcdcf,_0x31bbb3['model']['createPositionAt'](_0x3dcdcf['nodeAfter'],'end')),_0x48ca49='suggestion:attribute:'+_0x39a161+':'+vt()+':$aiSuggestion';_0xc68e33['markers']['set'](_0x48ca49,_0xd7b133);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0xfb9111['oldValue']==_0xfb9111['newValue'])break;_0x292ac5['batch']['addOperation'](_0xfb9111),_0x31bbb3['model']['applyOperation'](_0xfb9111);const _0x162175=_0xfb9111['key'];if(!_0xebf2f8['isRegisteredAttribute'](_0x162175))break;const _0x264f81=_0x38a66a(_0xfb9111['range'],_0x31bbb3['model']),_0x4e51e9='suggestion:attribute:'+_0x162175+':'+vt()+':$aiSuggestion';_0xc68e33['markers']['set'](_0x4e51e9,_0x264f81);break;}case'insert':{if(_0x292ac5['batch']['addOperation'](_0xfb9111),_0x31bbb3['model']['applyOperation'](_0xfb9111),Bs(_0xc68e33,_0xfb9111),_0xfb943[_0x37a246+0x1]&&'move'==_0xfb943[_0x37a246+0x1]['type'])break;const _0x37ba09=_0xfb9111['position'],_0x5ad68f=_0xfb9111['howMany'],_0x3531d4=_0x38a66a(_0x31bbb3['model']['createRange'](_0x37ba09,_0x37ba09['getShiftedBy'](_0x5ad68f)),_0x31bbb3['model']),_0x354073='suggestion:insertion:'+vt()+':$aiSuggestion';_0xc68e33['markers']['set'](_0x354073,_0x3531d4);break;}case'split':{_0x292ac5['batch']['addOperation'](_0xfb9111),_0x31bbb3['model']['applyOperation'](_0xfb9111),Bs(_0xc68e33,_0xfb9111);const _0x346c1e=_0xfb9111['splitPosition'],_0x3671e5=_0xfb9111['moveTargetPosition'],_0x1b4669=_0x31bbb3['model']['createRange'](_0x346c1e,_0x3671e5),_0xeb5a95='suggestion:insertion:'+vt()+':$aiSuggestion';_0xc68e33['markers']['set'](_0xeb5a95,_0x1b4669);break;}case'move':{_0x292ac5['batch']['addOperation'](_0xfb9111),_0x31bbb3['model']['applyOperation'](_0xfb9111),Bs(_0xc68e33,_0xfb9111);const _0x5225f4=_0xfb9111['getMovedRangeStart'](),_0x443592=_0xfb9111['howMany'];for(let _0x5bace6=0x0;_0x5bace6<_0x443592;_0x5bace6++){const _0xf3bd35=_0x5225f4['getShiftedBy'](_0x5bace6)['nodeAfter'];_0x470127['add'](_0xf3bd35);}break;}case'remove':{const _0x2e8e7b=_0xfb9111['sourcePosition'],_0x360d66=_0xfb9111['howMany'],_0x14d313=new _0x50ba30(_0x2e8e7b,_0x360d66);_0x292ac5['batch']['addOperation'](_0x14d313),_0x31bbb3['model']['applyOperation'](_0x14d313),Bs(_0xc68e33,_0xfb9111);break;}}}for(const _0x55942e of _0x470127){const _0x28e377=_0x31bbb3['model']['createRangeOn'](_0x55942e),_0x35393b='suggestion:formatBlock:$fakeWrap:'+vt()+':$aiSuggestion';_0xc68e33['markers']['set'](_0x35393b,_0x38a66a(_0x28e377,_0x31bbb3['model']));}});}(_0x14bcdf,_0x47da27,_0x12e59a):_0x12e59a['model']['change'](_0x225907=>{for(const _0x5d9069 of _0x14bcdf)if('remove'==_0x5d9069['type']){const _0x3ce39d=_0x5d9069['sourcePosition'],_0x1d6db6=_0x5d9069['howMany'],_0x2ab71b=new _0x50ba30(_0x3ce39d,_0x1d6db6);_0x225907['batch']['addOperation'](_0x2ab71b),_0x12e59a['model']['applyOperation'](_0x2ab71b),Bs(_0x47da27,_0x5d9069);}else{if('marker'==_0x5d9069['type']){const _0x91b379=_0x5d9069['name'],_0x38c248=_0x5d9069['newRange'];null!==_0x38c248?_0x47da27['markers']['set'](_0x91b379,_0x38c248):_0x47da27['markers']['delete'](_0x91b379);}else _0x5d9069['baseVersion']=null,_0x5d9069['isDocumentOperation']=!0x1,_0x225907['batch']['addOperation'](_0x5d9069),_0x12e59a['model']['applyOperation'](_0x5d9069),Bs(_0x47da27,_0x5d9069);}}),_0x359b3f){const _0x1d163a=Gs(_0x12e59a,_0x14bcdf,_0x47da27);Ks(_0x12e59a['model'],_0x1d163a),function(_0x570b1f,_0x37553e){const _0x3d9f29=_0x37553e['getFirstRange']()['start'];let _0x22345c=_0x37553e['getFirstRange']()['end'];const _0x3f0831=_0x3d9f29['root'];(_0x22345c['textNode']||_0x22345c['nodeAfter']&&_0x22345c['nodeAfter']['is']('$text'))&&(_0x4ec8f8(_0x22345c,'...'),$s(_0x3f0831,_0x22345c,0x3),_0x22345c=_0x22345c['getShiftedBy'](0x3)),(_0x3d9f29['textNode']||_0x3d9f29['nodeBefore']&&_0x3d9f29['nodeBefore']['is']('$text'))&&(_0x4ec8f8(_0x3d9f29,'...'),$s(_0x3f0831,_0x3d9f29,0x3),_0x3d9f29['parent']==_0x22345c['parent']&&(_0x22345c=_0x22345c['getShiftedBy'](0x3)));const _0x3bcc30=_0x570b1f['createRange'](_0x570b1f['createPositionAt'](_0x3f0831,0x0),_0x3d9f29),_0x46fbc5=_0x570b1f['createRange'](_0x22345c,_0x570b1f['createPositionAt'](_0x3f0831,'end')),_0x5a55b3=[..._0x3bcc30['getMinimalFlatRanges'](),..._0x46fbc5['getMinimalFlatRanges']()];_0x5a55b3['reverse']();for(const _0x444cd9 of _0x5a55b3)_0x3c01a8(_0x444cd9),Ys(_0x3f0831,_0x444cd9);}(_0x12e59a['model'],_0x1d163a);}return{'content':ps(_0x12e59a['data']['stringify'](_0x47da27,{'showSuggestionHighlights':!0x0})),'hasChanges':!0x0};}function Bs(_0x3dd41c,_0x2c36d7){for(const [_0x4fe438,_0x3e9c1d]of _0x3dd41c['markers']){const _0x424b3f=_0x4e8468['_createFromRanges'](_0x3e9c1d['getTransformedByOperation'](_0x2c36d7));_0x424b3f['root']==_0x3dd41c?_0x3dd41c['markers']['set'](_0x4fe438,_0x424b3f):_0x3dd41c['markers']['delete'](_0x4fe438);}}function Gs(_0x210aaa,_0x60f65f,_0x5e7c3b){const _0x2a3c1a=_0x210aaa['plugins']['get']('DocumentCompare');let _0x254106=_0x210aaa['model']['createPositionAt'](_0x5e7c3b,Number['POSITIVE_INFINITY']),_0x2d9443=_0x210aaa['model']['createPositionAt'](_0x5e7c3b,0x0);for(const _0x17cbb6 of _0x60f65f){let _0x5e37c8,_0x369177;if(_0x2a3c1a['isMarkedRemoveOperation'](_0x17cbb6))_0x5e37c8=_0x17cbb6['newRange']['start'],_0x369177=_0x17cbb6['newRange']['end'];else switch(_0x254106=Fs(_0x254106,_0x17cbb6),_0x2d9443=Fs(_0x2d9443,_0x17cbb6),_0x17cbb6['type']){case'rename':_0x5e37c8=_0x17cbb6['position'],_0x369177=_0x5e37c8['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x5e37c8=_0x17cbb6['range']['start'],_0x369177=_0x17cbb6['range']['end'];break;case'insert':_0x5e37c8=_0x17cbb6['position'],_0x369177=_0x5e37c8['getShiftedBy'](_0x17cbb6['howMany']);break;case'split':_0x5e37c8=_0x17cbb6['splitPosition'],_0x369177=_0x17cbb6['moveTargetPosition'];break;case'merge':{const _0x497549=_0x17cbb6['targetPosition']['path']['slice'](0x0,-0x1);_0x5e37c8=_0x210aaa['model']['createPositionFromPath'](_0x5e7c3b,_0x497549),_0x369177=_0x5e37c8['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x5e3113=_0x17cbb6['howMany'],_0x9e4620=_0x17cbb6['sourcePosition']['_getTransformedByInsertion'](_0x17cbb6['targetPosition'],_0x5e3113),_0x935012=_0x17cbb6['getMovedRangeStart']();'remove'==_0x17cbb6['type']?(_0x5e37c8=_0x9e4620,_0x369177=_0x9e4620):(_0x5e37c8=_0x935012,_0x369177=_0x935012['getShiftedBy'](_0x5e3113));break;}}_0x5e37c8&&_0x5e37c8['isBefore'](_0x254106)&&(_0x254106=_0x5e37c8['clone'](),_0x254106['stickiness']='toNone'),_0x369177&&_0x369177['isAfter'](_0x2d9443)&&(_0x2d9443=_0x369177['clone'](),_0x2d9443['stickiness']='toNone');}return _0x210aaa['model']['createSelection'](_0x210aaa['model']['createRange'](_0x254106,_0x2d9443));}function Fs(_0x13a639,_0x104fbc){return'move'!=_0x104fbc['type']&&'remove'!=_0x104fbc['type']||_0x104fbc['sourceRange']['containsPosition'](_0x13a639)&&((_0x13a639=_0x104fbc['sourcePosition']['clone']())['stickiness']='toNone'),_0x13a639['getTransformedByOperation'](_0x104fbc);}function Ks(_0x531098,_0x1734bc){Ws(_0x531098,_0x1734bc,'forward');const _0x3dcdaf=_0x1734bc['getFirstRange']();_0x1734bc['setTo']([]),_0x1734bc['setTo'](_0x3dcdaf,{'backward':!0x0}),Ws(_0x531098,_0x1734bc,'backward');}function Ws(_0x407861,_0x501f70,_0x5ab3b9){let _0x3ed86e=0x14;for(;_0x3ed86e;){_0x407861['modifySelection'](_0x501f70,{'unit':'word','direction':_0x5ab3b9}),_0x3ed86e--;const _0x2c0d0d=_0x501f70['focus']['forward'==_0x5ab3b9?'nodeBefore':'nodeAfter'];if(_0x2c0d0d&&_0x2c0d0d['is']('element')&&_0x407861['schema']['isBlock'](_0x2c0d0d)&&_0x407861['schema']['isObject'](_0x2c0d0d))break;}}function Ys(_0x31bb16,_0x1381be){for(const [_0x14239c,_0x15a305]of _0x31bb16['markers']){const _0x4275ca=_0x15a305['_getTransformedByDeletion'](_0x1381be['start'],_0x1381be['end']['offset']-_0x1381be['start']['offset']);null!=_0x4275ca?_0x31bb16['markers']['set'](_0x14239c,_0x4275ca):_0x31bb16['markers']['delete'](_0x14239c);}}function $s(_0x46865f,_0x84e0f,_0x269c61){for(let [_0x5bdbad,_0x5f4bf2]of _0x46865f['markers'])_0x5f4bf2=_0x5f4bf2['_getTransformedByInsertion'](_0x84e0f,_0x269c61,!0x1)[0x0],_0x46865f['markers']['set'](_0x5bdbad,_0x5f4bf2);}const qs=/* #__PURE__ -- @preserve */
27
- ut();var Qs=class extends qs{['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x429d70,config:_0x29b55b,locale:_0xa7eae7}){super(),this['_connector']=_0x429d70,this['_config']=_0x29b55b,this['_locale']=_0xa7eae7;}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 _0xdb5d85=await this['getAll']();let _0x29f7a5;return _0x29f7a5=this['_availableModels']?this['_filterModels'](_0xdb5d85,this['_availableModels']):_0xdb5d85['filter'](_0x5580b8=>_0x5580b8['recommended']),_0x29f7a5;}async['getModel'](_0x56b7a1){const _0x38da6f=await this['getAll']();if(!_0x38da6f['length'])return null;if(_0x56b7a1){const _0x2ba722=this['_getModelById'](_0x38da6f,_0x56b7a1);if(_0x2ba722)return _0x2ba722;bt('ai-chat-model-id-unrecognized',{'modelId':_0x56b7a1,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x5a3d85=await this['getAvailableModels']();if(!_0x5a3d85['length'])return null;if(this['_defaultModelId']){const _0x248bdd=this['_getModelById'](_0x5a3d85,this['_defaultModelId']);if(_0x248bdd)return _0x248bdd;bt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x5a3d85[0x0]['id']});}return _0x5a3d85[0x0];}async['isAvailable'](_0xce2bff){return(await this['getAvailableModels']())['some'](_0x63ff0f=>_0x63ff0f['name']===_0xce2bff['name']&&_0x63ff0f['provider']===_0xce2bff['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length']){const _0x476203=this['_locale']['uiLanguage']||'en',_0x402a01=await this['_connector']['getModels'](_0x476203)['list']();this['_modelList']=_0x402a01['items']['map'](_0x2c5a6d=>Xs(_0x2c5a6d)?{..._0x2c5a6d,'name':us(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x2c5a6d);}return[...this['_modelList']];}['_filterModels'](_0x58a65c,_0x1ccfe4){let _0x19a43a;if(_0x1ccfe4){_0x19a43a=[];const _0x596ee9=new Set(),_0x12f58d='string'==typeof _0x1ccfe4?[_0x1ccfe4['toLocaleLowerCase']()]:_0x1ccfe4['map'](_0x3211e6=>_0x3211e6['toLocaleLowerCase']());for(const _0x14b3c1 of _0x12f58d)for(const _0x2c6776 of _0x58a65c)!_0x596ee9['has'](_0x2c6776['id'])&&this['_isMatchingFilter'](_0x2c6776,_0x14b3c1)&&(_0x19a43a['push'](_0x2c6776),_0x596ee9['add'](_0x2c6776['id']));}else _0x19a43a=_0x58a65c;return _0x19a43a;}['_isMatchingFilter'](_0x53f4c0,_0x4b61ba){const _0x57e9ca=_0x53f4c0['id']['toLocaleLowerCase'](),_0x404806=_0x53f4c0['name']['toLocaleLowerCase'](),_0x3c3e74=_0x53f4c0['provider']['toLocaleLowerCase']();return _0x57e9ca===_0x4b61ba||_0x404806===_0x4b61ba||Xs(_0x53f4c0)&&'auto'===_0x4b61ba||_0x3c3e74===_0x4b61ba||_0x57e9ca['startsWith'](_0x4b61ba);}['_getModelById'](_0x2995f7,_0x54da9e){return _0x2995f7['find'](_0x45ffda=>Xs(_0x45ffda)&&'auto'===_0x54da9e?_0x45ffda:_0x45ffda['id']===_0x54da9e)||null;}};function Xs(_0x392847){return _0x392847['id']['startsWith']('agent');}function zs(_0x45b37a,_0x299ec3){for(const _0x16da91 of _0x45b37a)'noop'!==_0x16da91['type']&&(_0x16da91['_aiSource']=_0x299ec3);}var js=class extends _0x5d28a2{static get['pluginName'](){return'AIGateway';}static get['requires'](){return[_0x1cf5c4];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['getAvailableModels'](){return new Qs({'connector':this['context']['plugins']['get']('AIConnector'),'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']})['getAll']();}['apply'](_0x3e4859,_0x5c6f7a){if('completed'!==_0x3e4859['status'])throw new ht('ai-gateway-apply-invalid-status',this,{'status':_0x3e4859['status']});const _0x3a1fb8=_0x3e4859['editor'],{applyMethod:_0x2edad3}=_0x5c6f7a;if('suggest'===_0x2edad3&&!_0x3a1fb8['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',this);const _0x1d8527='suggest'===_0x2edad3,_0x549eff=this['context']['plugins']['get'](_0x1cf5c4),_0x4a49dc=_0x3a1fb8['model']['createPositionAt'](_0x3a1fb8['model']['document']['getRoot'](),0x0),_0x2e4ed3=_0x549eff['getDiff'](_0x3e4859['contentRawOld'],_0x3e4859['contentRawNew'],{'anchor':_0x4a49dc,'markDeletions':_0x1d8527,'targetEditor':_0x3a1fb8}),_0x2e0ac0=_0x3a1fb8['model']['document']['history']['getOperations'](_0x3e4859['documentVersion']),_0x4ff93b={'document':_0x3a1fb8['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4e2410=_0x29e916(_0x2e4ed3['getOperations'](),_0x2e0ac0,_0x4ff93b)['operationsA'];zs(_0x4e2410,_0x5c6f7a['aiSource']??'api'),_0x3a1fb8['model']['change'](_0x29666e=>{_0x1d8527?_0x3a1fb8['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4e2410):_0x549eff['applyOperations'](_0x29666e,_0x4e2410);});}['mergeChangesIntoContent'](_0x2e2c34,_0xc6f4b9,_0x460e05){const _0xe45099=new Hs(),_0x39c13a=new ys();let _0xbc3b9f=_0xe45099['parseAndNormalizeHTML'](_0xc6f4b9);for(const _0x5bfca6 of _0x2e2c34)try{const _0x2a29fb=_0xe45099['parseAndNormalizeHTML'](_0x5bfca6['content']);_0xbc3b9f=_0x39c13a['merge'](_0x2a29fb,_0xbc3b9f,{'cutAfterUnstable':!0x1,'replaceRemovedWith':void 0x0})['parsedContent'];}catch(_0x5508c6){throw new ht('ai-gateway-merge-failed',this,{..._0x5bfca6},_0x5508c6);}return Us(_0x460e05,_0xe45099['parseAndNormalizeHTML'](_0xc6f4b9),_0xbc3b9f,!0x1,!0x1)['content'];}},Js=class{['_editor'];['_rootName'];['_channelId'];['_sessionId'];['_documentVersion'];['_contentRawOld'];['_contentRawNew'];['_error'];['_isAborted']=!0x1;constructor(_0x2abfc2){this['_editor']=_0x2abfc2['editor'],this['_rootName']=_0x2abfc2['rootName'],this['_channelId']=_0x2abfc2['channelId'],this['_sessionId']=_0x2abfc2['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'](_0x5e9433){this['_documentVersion']=_0x5e9433;}get['contentRawOld'](){return this['_contentRawOld'];}set['contentRawOld'](_0x27d301){this['_contentRawOld']=_0x27d301;}get['contentRawNew'](){return this['_contentRawNew'];}set['contentRawNew'](_0x978b11){this['_contentRawNew']=_0x978b11;}get['contentOld'](){return this['_dropDataIds'](this['_contentRawOld']||'');}get['contentNew'](){return this['_dropDataIds'](this['_contentRawNew']||'');}get['error'](){return this['_error'];}set['error'](_0x359ce7){this['_error']=_0x359ce7;}['abort'](){this['_isAborted']=!0x0;}['_dropDataIds'](_0x16428e){return _0x16428e['replace'](/ data-id="[a-z0-9]+"/g,'');}},Zs=class extends Js{['_summary']='';get['summary'](){return this['_summary'];}set['summary'](_0x551e79){this['_summary']=_0x551e79;}},tn=class extends _0x5d28a2{static get['pluginName'](){return'AIDocumentProcessingGateway';}static get['requires'](){return[ls,Is,js];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['getAvailableModels'](){return this['context']['plugins']['get']('AIGateway')['getAvailableModels']();}async['processDocument'](_0x2c564e,_0x153dec){if(!_0x2c564e)throw new ht('ai-documentprocessinggateway-missing-prompt',this);const _0x5ccce1=await this['context']['plugins']['get'](Is)['getDocumentData']();if(!_0x5ccce1[0x0])throw new ht('ai-documentprocessinggateway-missing-document',this);const _0x19344a=new Zs({'editor':_0x5ccce1[0x0]['editor'],'rootName':_0x5ccce1[0x0]['rootName'],'channelId':this['context']['config']['get']('collaboration.channelId'),'sessionId':_0x5ccce1[0x0]['sessionId']});if(_0x19344a['contentRawOld']=_0x5ccce1[0x0]['content'],_0x19344a['documentVersion']=_0x5ccce1[0x0]['version'],_0x153dec?.['signal']?.['aborted'])return _0x19344a['abort'](),_0x19344a;const _0x5c1cb2=this['context']['plugins']['get']('AIConnector')['processDocument']({'document':_0x19344a['contentRawOld'],'prompt':_0x2c564e,'model':_0x153dec['model']});let _0x25160c;if(_0x153dec?.['signal']){if(_0x153dec['signal']['aborted'])return _0x5c1cb2['abortController']['abort'](),_0x19344a['abort'](),_0x19344a;const _0x525a9f=_0x153dec['signal'],_0xe02a92=()=>_0x5c1cb2['abortController']['abort']();_0x525a9f['addEventListener']('abort',_0xe02a92),_0x25160c=()=>_0x525a9f['removeEventListener']('abort',_0xe02a92);}try{const _0x296cb3=await _0x5c1cb2['getResult']();if(!(_0x296cb3&&_0x296cb3['document']&&_0x296cb3['document']['length']>0x0))throw new ht('ai-documentprocessinggateway-empty-reply',this);_0x19344a['contentRawNew']=_0x296cb3['document'],_0x19344a['summary']=_0x296cb3['summary']||'';}catch(_0x393edf){_0x393edf instanceof Error&&_0x393edf['message']['includes']('ai-request-aborted')?_0x19344a['abort']():_0x19344a['error']=_0x393edf instanceof ht?_0x393edf:new ht('ai-documentprocessinggateway-run-failed',this,{},_0x393edf);}finally{_0x25160c&&_0x25160c();}return _0x19344a;}['applyResult'](_0x4f7e8e,_0x3b7b32){this['context']['plugins']['get']('AIGateway')['apply'](_0x4f7e8e,_0x3b7b32);}};function en(_0x2a51cb){return _0x2a51cb instanceof Error&&('AbortError'===_0x2a51cb['name']||('AICoreError'===_0x2a51cb['name']?!0x0===_0x2a51cb['isAbort']:_0x2a51cb['message']['startsWith']('ai-request-aborted')));}var sn=class extends Error{['code'];['severity'];['type'];['context'];['isAbort'];constructor(_0x3ab87c){super(_0x3ab87c['code'],_0x3ab87c['cause']instanceof Error?{'cause':_0x3ab87c['cause']}:void 0x0),this['name']='AICoreError',this['code']=_0x3ab87c['code'],this['severity']=_0x3ab87c['severity']??'error',this['type']=_0x3ab87c['type']??'system',this['context']=_0x3ab87c['context'],this['isAbort']=_0x3ab87c['isAbort']??en(_0x3ab87c['cause']);}},nn=class extends _0x5d28a2{static get['pluginName'](){return'AIErrorSink';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['createReporter'](_0x1aae3c){return new rn(this,_0x1aae3c);}},rn=class{['_sink'];['_component'];constructor(_0x4ecee9,_0x10c734){this['_sink']=_0x4ecee9,this['_component']=_0x10c734;}['logError'](_0x20a843,_0x2611bb={}){this['_emit'](_0x20a843,_0x2611bb),this['_defaultLog'](_0x20a843);}['reportError'](_0x3d6606,_0x1c92e1={}){this['_emit'](_0x3d6606,_0x1c92e1);}['_emit'](_0xeb45b3,_0x41679c){en(_0xeb45b3)||this['_sink']['fire']('error',{'error':_0xeb45b3,'component':this['_component'],'context':_0x41679c['context']});}['_defaultLog'](_0x335262){if(!en(_0x335262)){if(_0x335262 instanceof sn){if('user'===_0x335262['type']||'network'===_0x335262['type'])return;if('warning'===_0x335262['severity'])return void console['warn'](this['_component'],_0x335262);}console['error'](this['_component'],_0x335262);}}};const on='ck-ai-button-primary',an='ck-ai-button-secondary',hn='ck-ai-button-tertiary';function cn(_0x5461e1,_0x2e769e){const _0xe5bb1e=new Ht(_0x5461e1),_0x2a3915=us(_0x5461e1,'AI_TABS_LABEL_MINIMIZE'),_0x25f4ee=us(_0x5461e1,'AI_TABS_LABEL_MAXIMIZE');return _0xe5bb1e['set']({'withText':!0x1,'icon':_0x14d558,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+hn}),_0xe5bb1e['bind']('label')['to'](_0x2e769e,'isMaximized',_0x10f29d=>_0x10f29d?_0x2a3915:_0x25f4ee),_0xe5bb1e['bind']('icon')['to'](_0x2e769e,'isMaximized',_0x19b9fc=>_0x19b9fc?_0x4df119:_0x14d558),_0xe5bb1e['bind']('isOn')['to'](_0x2e769e,'isMaximized'),_0xe5bb1e['on']('execute',()=>{_0x2e769e['fire']('resizeTabs');}),_0xe5bb1e;}function ln(_0x32ae18){const _0x99c722=new Lt(_0x32ae18);return _0x99c722['attachToDom'](),_0x99c722['bodyCollectionContainer']['classList']['add']('ck-ai-body'),_0x99c722;}const un=/* #__PURE__ -- @preserve */
28
- gt();var dn=class extends un{['id'];['interactionId'];['type'];['content']=new Map();['sources']=[];['parsedContent']=new Map();['parsedMergedContent']=new Map();['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['_documentIdToSource']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x1737ca,isDone:_0x447031=!0x1,isComplete:_0x3ffa2d,interactionId:_0x277315,areActionsDisabled:_0xa05282,isFromHistory:_0x6cc929=!0x1,documentContextContent:_0x554399,locale:_0x2077d7,id:_0x1aa88c,channelsToEditors:_0x1814f4}){super(),this['id']=_0x1aa88c||vt(),this['interactionId']=_0x277315,this['type']=_0x1737ca,this['areActionsDisabled']=!!_0xa05282,this['isFromHistory']=_0x6cc929,this['locale']=_0x2077d7,this['aiResponseParser']=new Hs(),this['aiResponseApplier']=new ys(),this['documentContextContent']=new Map(_0x554399?.['map'](_0x5cb955=>[_0x5cb955['id'],ps(_0x5cb955['content'])])||[]),this['_documentIdToSource']=new Map(_0x554399?.['map'](_0x1f590d=>[_0x1f590d['id'],{'editor':_0x1814f4['get'](_0x1f590d['channelId']),'rootName':_0x1f590d['rootName']}])||[]),this['set']('isDone',_0x447031),this['set']('isComplete',_0x3ffa2d??_0x447031),'text'===this['type']&&this['content']['set']('text','');}['appendContent'](_0x3ed08b,_0x3f5da3){const _0x300490='text'===this['type']?'text':_0x3f5da3;this['content']['has'](_0x300490)||this['content']['set'](_0x300490,''),this['content']['set'](_0x300490,this['content']['get'](_0x300490)+_0x3ed08b),this['onContentChange'](_0x300490);}['done'](_0x5d083c=!0x0){this['isComplete']=_0x5d083c,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x591845,_0x5ebd67){this['changeGroups'][_0x591845]['state']=_0x5ebd67,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x591845,'state':_0x5ebd67});}['getContentParts']({showDiff:_0x4d7b62,groupIndex:_0x1aeaba}){const _0x1267a2=this['_getCachedContentParts'](_0x4d7b62,_0x1aeaba);if(_0x1267a2)return _0x1267a2;let _0x5d5d9b=[];if(void 0x0===_0x1aeaba)_0x5d5d9b=this['changeGroups'];else{const _0xb2a688=this['changeGroups']['find'](({index:_0x335761})=>_0x335761===_0x1aeaba);if(!_0xb2a688)throw new ht('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x1aeaba});_0x5d5d9b=[_0xb2a688];}const _0x2e1bc4=Vs({'showDiff':_0x4d7b62,'changeGroups':_0x5d5d9b,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x4d7b62,_0x2e1bc4),_0x2e1bc4;}['_getCachedContentParts'](_0x3ac7fa,_0x22d0f8){const _0x2bc394=_0x3ac7fa?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x2bc394]['length'])return null;const _0x37ac78=this['cachedSuggestionContentParts'][_0x2bc394];if(void 0x0===_0x22d0f8)return _0x37ac78['length']>0x0&&_0x37ac78['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x3ac7fa,null),null):_0x21b61f(_0x37ac78);{const _0x3e915f=_0x37ac78['find'](({index:_0x3a812a})=>_0x3a812a===_0x22d0f8);if(_0x3e915f)return[_0x21b61f(_0x3e915f)];}return null;}['_setCachedContentParts'](_0x280c1c,_0x3471c7){const _0x1dcea6=_0x280c1c?'withDiff':'withoutDiff';_0x3471c7?_0x3471c7['forEach'](_0x4745dd=>{const _0x4d959d=this['cachedSuggestionContentParts'][_0x1dcea6],_0x32be68=_0x4d959d['find'](({index:_0x2828d3})=>_0x2828d3===_0x4745dd['index']);if(_0x32be68){const _0xa5643e=_0x4d959d['indexOf'](_0x32be68);_0x4d959d['splice'](_0xa5643e,0x1,_0x4745dd);}else _0x4d959d['push'](_0x4745dd);}):this['cachedSuggestionContentParts'][_0x1dcea6]['length']=0x0;}['onContentChange'](_0x127073){if('modification'===this['type']){if(_0x127073)this['parsedContent']['set'](_0x127073,this['aiResponseParser']['parseAndNormalizeHTML'](this['content']['get'](_0x127073)));else{for(const [_0x43fac4,_0x1c125a]of this['content'])this['parsedContent']['set'](_0x43fac4,this['aiResponseParser']['parseAndNormalizeHTML'](_0x1c125a));}const _0x1a2756=this['changeGroups'];for(const _0x418ad1 of this['content']['keys']())this['updateChangeGroups'](_0x418ad1);const _0x3ac1f2=this['_getDifferentChangeGroups'](_0x1a2756,this['changeGroups']);(_0x3ac1f2['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x3ac1f2),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']['set']('text',this['aiResponseParser']['convertMarkdownToHTML'](this['content']['get']('text'))),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x1ae85c,_0x4226cf){const _0x87cc2=[];for(const _0x3e9be5 of _0x4226cf){const _0x1f6f7f=_0x1ae85c[_0x3e9be5['index']];_0x1f6f7f?_0x1f6f7f['changes']['length']!==_0x3e9be5['changes']['length']?_0x87cc2['push'](_0x3e9be5):_0x1f6f7f['changes']['forEach']((_0x46af3e,_0x3d413c)=>{const _0x211390=_0x3e9be5['changes'][_0x3d413c];_0x46af3e['id']!==_0x211390['id']&&_0x87cc2['push'](_0x3e9be5);}):_0x87cc2['push'](_0x3e9be5);}return _0x87cc2;}['updateChangeGroups'](_0x3ea8bc){const _0xe6a14a=this['documentContextContent']['get'](_0x3ea8bc),_0x48fee6=this['parsedContent']['get'](_0x3ea8bc);if(!_0xe6a14a||!_0x48fee6)return;const _0x245472=new _0x1a4ef3('p',{},[new _0x1a4ef3('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0xecc90d(us(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x2d5ace=this['aiResponseApplier']['merge'](_0x48fee6,_0xe6a14a['cloneNode'](!0x0),{'cutAfterUnstable':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x245472});this['parsedMergedContent']['set'](_0x3ea8bc,_0x2d5ace['parsedContent']);let _0x4d3763=[];if(_0x5380b2(_0x43b4af=>{const _0x5ed04e=fs(_0x43b4af,'data-id');if(!_0x5ed04e||!_0xf94a6f(_0x5ed04e))return!0x1;const _0x13c079=[_0x43b4af,...Rs(_0x43b4af)]['at'](-0x2);if(_0x43b4af!=_0x13c079){const _0x5cf09b=fs(_0x13c079,'data-id');_0xf94a6f(_0x5cf09b)||(_0x4d3763['push']({'node':_0x13c079,'id':_0x5cf09b,'type':'modified'}),_0x2d5ace['modifiedNodeIds']['push'](_0x5cf09b));}else _0x2d5ace['modifiedNodeIds']['includes'](_0x5ed04e)?_0x4d3763['push']({'node':_0x43b4af,'type':'modified','id':_0x5ed04e}):_0x2d5ace['newNodeIds']['includes'](_0x5ed04e)?_0x4d3763['push']({'node':_0x43b4af,'type':'new','id':_0x5ed04e,'anchorId':fs(_0x43b4af['previousSibling'],'data-id')}):_0x4d3763['push']({'node':_0x43b4af,'type':'removed','id':_0x5ed04e});return!0x0;},this['parsedMergedContent']['get'](_0x3ea8bc)),_0x4d3763=_0x4d3763['filter'](({node:_0x4b15f3})=>[...Rs(_0x4b15f3),_0x4b15f3]['every'](_0x350412=>!fs(_0x350412,'data-unstable'))),this['changeGroups']=this['changeGroups']['filter'](_0x5e826c=>_0x5e826c['documentId']!==_0x3ea8bc),0x0==_0x4d3763['length'])return;const _0x42bf4b=[[_0x4d3763[0x0]]];for(let _0x5dce1e=0x1;_0x5dce1e<_0x4d3763['length'];_0x5dce1e++){const _0xf20a9f=_0x42bf4b[_0x42bf4b['length']-0x1],_0x4b798a=_0xf20a9f[_0xf20a9f['length']-0x1];_0x4d3763[_0x5dce1e]['node']['previousSibling']==_0x4b798a['node']&&'modified'!=_0x4d3763[_0x5dce1e]['type']&&'modified'!=_0x4b798a['type']?_0xf20a9f['push'](_0x4d3763[_0x5dce1e]):_0x42bf4b['push']([_0x4d3763[_0x5dce1e]]);}for(const _0x4a371d of _0x42bf4b){const _0x45556e=_0x4a371d[0x0],_0x40f281=_0x4a371d[_0x4a371d['length']-0x1],_0xfdde55=_0x6ffec(_0x45556e['node']['previousSibling']);_0xfdde55&&_0x4a371d['unshift'](_0xfdde55);const _0x23721b=_0x6ffec(_0x40f281['node']['nextSibling']);_0x23721b&&_0x4a371d['push'](_0x23721b);}Ts('data-wrapped-id',null,this['parsedMergedContent']['get'](_0x3ea8bc))['forEach'](_0x3144c3=>{bs(_0x3144c3,'data-wrapped-id',null);});const _0x582ca6=new Map();Ts('data-unwrapped-id',null,this['parsedMergedContent']['get'](_0x3ea8bc))['forEach'](_0x1800d4=>{const _0x376726=fs(_0x1800d4,'data-unwrapped-id'),_0xfca508=fs(_0x1800d4,'data-id');_0x582ca6['set'](_0xfca508,_0x376726),bs(_0x1800d4,'data-id',_0x376726),bs(_0x1800d4,'data-unwrapped-id',null);});for(const _0x332cba of _0x4d3763){const _0x5eb6e6=_0x582ca6['get'](_0x332cba['id']);_0x5eb6e6&&(_0x332cba['id']=_0x5eb6e6);}this['changeGroups']['push'](..._0x42bf4b['map']((_0xda7ef2,_0x5c9afd)=>({'changes':_0xda7ef2,'state':'pending','index':_0x5c9afd,'editor':this['_documentIdToSource']['get'](_0x3ea8bc)['editor'],'rootName':this['_documentIdToSource']['get'](_0x3ea8bc)['rootName'],'documentId':_0x3ea8bc})));const _0x3bacab=Array['from'](this['documentContextContent']['keys']());function _0xf94a6f(_0x4e506c){return _0x2d5ace['modifiedNodeIds']['includes'](_0x4e506c)||_0x2d5ace['newNodeIds']['includes'](_0x4e506c)||_0x2d5ace['removedNodeIds']['includes'](_0x4e506c);}function _0x6ffec(_0x8cf620){if(_0x8cf620&&fs(_0x8cf620,'data-id')&&!fs(_0x8cf620,'data-unstable')){const _0xa041c4=fs(_0x8cf620,'data-id');if(!_0xf94a6f(_0xa041c4))return{'node':_0x8cf620,'type':'context','id':_0xa041c4};}return null;}this['changeGroups']['sort']((_0x1e17fc,_0x5490c9)=>_0x3bacab['indexOf'](_0x1e17fc['documentId'])-_0x3bacab['indexOf'](_0x5490c9['documentId'])),this['changeGroups']['forEach']((_0x181a53,_0x5f1750)=>{_0x181a53['index']=_0x5f1750;});}};const _n=/* #__PURE__ -- @preserve */
29
- ut(),gn=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];var An=class extends _n{['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['locale'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;['_channelsToEditors'];constructor({connector:_0x46f787,locale:_0x2e05d9,channelsToEditors:_0x3507e9}){super(),this['id']=vt(),this['connector']=_0x46f787,this['isStopped']=!0x0,this['locale']=_0x2e05d9,this['_channelsToEditors']=_0x3507e9||new Map();}async['start'](){await this['_run']();}async['resume'](_0x2afb63){await this['_run'](_0x2afb63);}async['_run'](_0x5e10f1){const _0x1aa5fd=[];let _0x2c036b,_0x15e225,_0x469afd,_0x351a4b=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=_0x5e10f1||await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x4810b7=await this['currentRequest']['getStream']();for await(const _0x4755c0 of _0x4810b7){if(this['isStopped'])return;if('error'==_0x4755c0['event'])return void this['fire']('error',{'error':new ht('ai-chat-interaction-error',this)});switch(_0x4755c0['event']){case'message-metadata':this['messageId']=_0x4755c0['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x4755c0['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x4755c0['data']['conversationTitle'],!0x0);break;case'source':_0x1aa5fd['push'](_0x4755c0['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'](),_0x2c036b='modification-delta'==_0x4755c0['event']?'modification':'text',_0x15e225='modification-delta'==_0x4755c0['event']?_0x4755c0['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x2c036b&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x2c036b,'interactionId':this['id'],'id':_0x15e225,'channelsToEditors':this['_channelsToEditors'],...'modification-delta'==_0x4755c0['event']&&{'documentId':_0x4755c0['data']['documentId']}}),'modification'==_0x2c036b&&(this['currentReply']['sources']=_0x1aa5fd['splice'](0x0))),this['currentReply']['appendContent'](_0x4755c0['data']['textDelta'],_0x4755c0['data']['documentId']);break;case'mcp-tool-result':_0x469afd=JSON['parse'](_0x4755c0['data']['result']),this['_handleToolResultData']({'toolName':_0x4755c0['data']['toolName'],'data':_0x469afd['data'],'attributes':_0x469afd['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x4755c0['data']['toolName'],'data':_0x4755c0['data']['data']});}}_0x351a4b=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x1aa5fd['length']>0x0&&(this['currentReply']['sources']=_0x1aa5fd['splice'](0x0)),this['_finalizeInteraction'](_0x351a4b),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x13cdfb){return this['replies']['find'](_0x55218f=>_0x55218f['id']===_0x13cdfb);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x1c4776=>_0x1c4776['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x1462d5){const _0x5a0f32=this['getDocumentContext'](),_0x23afda=new dn({'locale':this['locale'],'documentContextContent':_0x5a0f32?.['documents'],..._0x1462d5});return this['replies']['push'](_0x23afda),_0x23afda['delegate'](...gn)['to'](this),this['fire']('replyCreated',_0x23afda),_0x23afda;}['setConversationTitle'](_0x88b819,_0x2a7125=!0x1){this['fire']('setConversationTitle',_0x88b819,_0x2a7125);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x2deae4){this['fire']('toolDataReceived',{'type':'result','toolName':_0x2deae4['toolName'],'data':structuredClone(_0x2deae4['data']||{}),'attributes':structuredClone(_0x2deae4['attributes']||{})},this);}['_handleToolNotificationData'](_0x48694c){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x48694c['toolName'],'data':structuredClone(_0x48694c['data'])},this);}['_finalizeInteraction'](_0x17188c=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x17188c),this['currentRequest']=this['currentReply']=void 0x0;}};const In=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']]),pn=/* #__PURE__ -- @preserve */
30
- gt(),mn=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];var En=class AIChatContext extends pn{['_connector'];['_config'];['_ownerId'];constructor({connector:_0x320143,config:_0x5a3feb,ownerId:_0x3ef225}){super(),this['_connector']=_0x320143,this['_config']=_0x5a3feb,this['_ownerId']=_0x3ef225;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}['getPendingContextItems'](){return new Map(this['_pendingContextItems']);}async['populateFromMessage'](_0x333da7,_0x109d16){const _0x1f5bea=new Map(),{contextItem:_0x8895b2,hasUnmatched:_0x1c7212}=await this['_populateDocumentContextItem'](_0x333da7,_0x109d16);_0x8895b2&&_0x1f5bea['set'](_0x8895b2['id'],_0x8895b2);for(const _0x57c0e5 of _0x333da7){if('document'===_0x57c0e5['type'])continue;const _0xb65412=await this['_createContextItemFromContent'](_0x57c0e5);this['_addToConversationContextItem'](_0xb65412),_0x1f5bea['set'](_0xb65412['id'],_0xb65412);}return{'contextItems':_0x1f5bea,'hasUnmatched':_0x1c7212};}async['_populateDocumentContextItem'](_0x166e0f,_0x1996e1){const _0xa64785=_0x166e0f['filter'](_0x450666=>'document'===_0x450666['type']);if(0x0===_0xa64785['length'])return{'hasUnmatched':!0x1};const _0x13a381=_0xa64785['map'](_0x45eab7=>_0x45eab7['id']),_0x34a85e=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x13a381)['getDocuments'](),_0x5a2ce9=new Map(_0x34a85e['map'](_0x4a9c8d=>[_0x4a9c8d['id'],_0x4a9c8d])),_0x541f81=[];let _0x3fc271=!0x1;for(const _0x8d3ddd of _0xa64785){const _0x34981b=_0x5a2ce9['get'](_0x8d3ddd['id']);_0x34981b&&(this['_matchDocumentToRoot'](_0x34981b,_0x1996e1)||(_0x3fc271=!0x0),_0x541f81['push']({'id':_0x34981b['id'],'content':_0x34981b['content'],'version':_0x34981b['attributes']?.['version']??0x0,'sessionId':_0x34981b['attributes']?.['sessionId']??null,'selection':[],'channelId':_0x34981b['attributes']?.['channelId']??_0x1996e1[0x0]?.['config']['get']('collaboration.channelId')??'','rootName':_0x34981b['attributes']?.['rootName']??_0x1996e1[0x0]?.['model']['document']['getRoots']()[0x0]['rootName']??''}));}const _0x2f3c72={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x541f81};return this['_addToConversationContextItem'](_0x2f3c72),this['toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x2f3c72,'hasUnmatched':_0x3fc271};}['_matchDocumentToRoot'](_0x4d8fe5,_0x57b883){const _0x24b7d1=_0x4d8fe5['attributes']?.['channelId'],_0x1e384a=_0x4d8fe5['attributes']?.['rootName'];if(_0x24b7d1&&_0x1e384a){for(const _0x2f585c of _0x57b883)if(_0x2f585c['config']['get']('collaboration.channelId')===_0x24b7d1){for(const _0x4f8ee9 of _0x2f585c['model']['document']['getRoots']())if('$graveyard'!==_0x4f8ee9['rootName']&&_0x4f8ee9['rootName']===_0x1e384a)return{'editor':_0x2f585c,'rootName':_0x4f8ee9['rootName']};}}}async['_createContextItemFromContent'](_0x437f24){return'mcp-tool-context'===_0x437f24['type']?{'id':_0x437f24['id'],'uiId':_0x437f24['id'],'label':_0x437f24['data']?.['label']||_0x437f24['id'],'type':'mcp-tool-context','mcpServerName':_0x437f24['mcpServerName'],'toolName':_0x437f24['toolName'],'data':_0x437f24['data']||{}}:{'id':_0x437f24['id'],'uiId':_0x437f24['id'],'label':_0x437f24['attributes']?.['label']||_0x437f24['name']||_0x437f24['url']||_0x437f24['id'],'type':_0x437f24['type'],..._0x437f24?.['attributes']?.['resourceId']?{'resourceId':_0x437f24['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x5bb709){this['_pendingContextItems']['get'](_0x5bb709)?.['isReadOnly']||this['_removeContextItem'](_0x5bb709);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0xf5cd29 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0xf5cd29['uiId']);const _0x203450=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x203450&&this['_addContextItem']({..._0x203450,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x39199f){for(const _0x4014f6 of _0x39199f['values']())this['_addToConversationContextItem'](_0x4014f6);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'](_0x37c20b){return Array['from'](_0x37c20b['values']())['flatMap'](_0x17f942=>this['_mapContextItemToRequestData'](_0x17f942));}async['addFilesToContext'](_0x8aac21,_0x3b11d7,_0x1213a3='file'){const _0xfd611c='files-'+vt();this['_startUploadOperation'](_0xfd611c);try{await Promise['all'](_0x8aac21['map'](async _0x2c3670=>{const _0x331dc0='file-'+vt(),_0x14e8e1=_0x33f243(_0x2c3670['name']),_0x28d51d='file'===_0x1213a3&&_0x2c3670['type']['startsWith']('image/')?'image':_0x1213a3;try{this['_addContextItem']({'type':_0x28d51d,'label':_0x3b11d7?.['label']||_0x14e8e1,'uiId':_0x331dc0,'resourceId':_0x3b11d7?.['resourceId']},!0x0);const _0x195b68=this['_connector']['uploadFile'](this['_ownerId'],_0x2c3670,_0x3b11d7);this['_ongoingUploads']['set'](_0x331dc0,_0x195b68['abortController']);const {id:_0x3311a1}=await _0x195b68['getId']();this['_ongoingUploads']['delete'](_0x331dc0),this['_finishContextItemLoading']({'type':_0x28d51d,'id':_0x3311a1,'label':_0x3b11d7?.['label']||_0x14e8e1,'uiId':_0x331dc0,'resourceId':_0x3b11d7?.['resourceId']},!0x1);}catch(_0x4e1768){if(this['_ongoingUploads']['delete'](_0x331dc0),!en(_0x4e1768)){const _0x50c90f=new sn({'code':In['get'](_0x4e1768['code'])||'ai-chat-file-upload-failed','cause':_0x4e1768,'context':{'fileName':_0x14e8e1}});this['fire']('error',{'error':_0x50c90f});}this['_removeContextItem'](_0x331dc0);}}));}finally{this['_finishUploadOperation'](_0xfd611c);}}['addCurrentDocumentToContext'](_0x3bd0ad){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x3639f4={'type':'document','uiId':'current-document','label':_0x3bd0ad,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x3639f4);}async['updateCurrentDocuments'](_0xd1d92b){const _0xcc66b0=this['_pendingContextItems']['get']('current-document');if(!_0xcc66b0||!_0xd1d92b['length']||_0xd1d92b['every'](_0x465494=>!_0x465494['content']))return;_0xd1d92b['length']>0x1&&_0xd1d92b['some'](_0x4cd813=>!_0x4cd813['description'])&&bt('ai-chat-documents-missing-description');try{const _0x30b45c=await this['_connector']['uploadDocuments'](this['_ownerId'],_0xd1d92b)['getIds']();if(_0x30b45c['length']!==_0xd1d92b['length']||_0x30b45c['some'](_0x1d2ecc=>!_0x1d2ecc?.['id'])){const _0x20fef7=new ht('ai-chat-document-upload-reply-mismatch',null);return void this['fire']('error',{'error':_0x20fef7});}_0xcc66b0['documents']=_0xd1d92b['map']((_0x297b4,_0x49291f)=>{return{'id':_0x30b45c[_0x49291f]['id'],'content':_0x297b4['content'],'version':_0x297b4['version'],'sessionId':_0x297b4['sessionId'],'selection':(_0xe614a1=_0x297b4['selections'],_0xe614a1?_0xe614a1['map'](_0x36c476=>({'start':_0x36c476['start'],'end':_0x36c476['end']})):[]),'channelId':_0x297b4['channelId'],'rootName':_0x297b4['rootName']};var _0xe614a1;});}catch(_0x37ac83){const _0x2f54e8=new sn({'code':'ai-chat-document-upload-failed','type':'network','cause':_0x37ac83});this['fire']('error',{'error':_0x2f54e8});}}['addSelectionToContext'](_0x293d9a){this['_addContextItem']({'type':'selection','label':_0x293d9a,'uiId':'selection','content':_0x293d9a});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x575ee8,_0x262713){const _0x130700='url-'+vt();this['_startUploadOperation'](_0x130700);const _0x325795='url-'+vt();try{this['_addContextItem']({'type':'web-resource','label':_0x262713?.['label']||_0x575ee8,'uiId':_0x325795,'resourceId':_0x262713?.['resourceId']},!0x0);const _0x19a602=this['_connector']['uploadUrl'](this['_ownerId'],_0x575ee8,_0x262713);this['_ongoingUploads']['set'](_0x325795,_0x19a602['abortController']);const {id:_0x5aa9bb}=await _0x19a602['getId']();this['_ongoingUploads']['delete'](_0x325795),this['_finishContextItemLoading']({'type':'web-resource','id':_0x5aa9bb,'label':_0x262713?.['label']||_0x575ee8,'uiId':_0x325795,'resourceId':_0x262713?.['resourceId']},!0x1);}catch(_0x4b92a8){this['_ongoingUploads']['delete'](_0x325795),en(_0x4b92a8)||this['fire']('error',{'error':new ht('ai-chat-url-upload-failed',this,{'url':_0x575ee8,'originalError':_0x4b92a8}),'url':_0x575ee8}),this['_removeContextItem'](_0x325795);}finally{this['_finishUploadOperation'](_0x130700);}}['addToolItemToContext'](_0x5c8724){_0x5c8724['id']=_0x5c8724['id']??vt()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x5c8724['uiId'],_0x5c8724),this['fire']('contextItemAdded',{'contextItem':_0x5c8724,'isLoading':!0x1});}async['loadSourceResources'](_0x46fbfe,_0x1f899a,_0x2009c2){const _0xd3dbd1=this['_addContextOptionsState']['sources']['find'](_0x40ff15=>_0x40ff15['id']===_0x46fbfe);if(!_0xd3dbd1)return this['fire']('error',{'error':new ht('ai-chat-source-not-found',this,{'sourceId':_0x46fbfe}),'sourceId':_0x46fbfe}),[];try{const _0x5ce0ef=(await _0xd3dbd1['getResources'](_0x1f899a))['map'](_0x5b3a98=>{const _0x2501a3=this['_isResourceInContext'](_0x5b3a98['id']);return{..._0x5b3a98,'isInContext':_0x2501a3};});return _0xd3dbd1['resources']=_0x5ce0ef,this['fire']('sourceResourcesLoaded',{'sourceId':_0x46fbfe,'source':_0xd3dbd1,'resources':_0x5ce0ef,'uid':_0x2009c2}),_0x5ce0ef;}catch(_0x56d2d3){return this['fire']('error',{'error':new ht('ai-chat-source-resources-load-failed',this,{'sourceId':_0x46fbfe,'originalError':_0x56d2d3}),'sourceId':_0x46fbfe,'sourceLabel':_0xd3dbd1['label']}),[];}}async['addResourceToContext'](_0x1ad5f1,_0x502189){if(this['_isResourceInContext'](_0x502189['id']))return;let _0x263e50=_0x502189['data'];if(!_0x263e50&&_0x1ad5f1['getData'])try{_0x263e50=await _0x1ad5f1['getData'](_0x502189['id']);}catch(_0x535455){return void this['fire']('error',{'error':new ht('ai-chat-resource-load-failed',this,{'resourceId':_0x502189['id'],'sourceId':_0x1ad5f1['id'],'originalError':_0x535455}),'resourceId':_0x502189['id'],'sourceId':_0x1ad5f1['id']});}if(_0x263e50)switch(_0x502189['type']){case'web-resource':if('string'!=typeof _0x263e50)return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x502189['id'],'sourceId':_0x1ad5f1['id'],'expectedType':'string','actualType':typeof _0x263e50}),'resourceId':_0x502189['id'],'sourceId':_0x1ad5f1['id']});await this['addUrlToContext'](_0x263e50,{'label':_0x502189['label'],'resourceId':_0x502189['id']});break;case'file':if(!(_0x263e50 instanceof File))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x502189['id'],'sourceId':_0x1ad5f1['id'],'expectedType':'File','actualType':typeof _0x263e50}),'resourceId':_0x502189['id'],'sourceId':_0x1ad5f1['id']});await this['addFilesToContext']([_0x263e50],{'label':_0x502189['label'],'resourceId':_0x502189['id']});break;case'text':if('object'!=typeof _0x263e50||!('content'in _0x263e50)||!('type'in _0x263e50))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x502189['id'],'sourceId':_0x1ad5f1['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x263e50}),'resourceId':_0x502189['id'],'sourceId':_0x1ad5f1['id']});_0x263e50=AIChatContext['_convertTextResourceToFile'](_0x263e50,_0x502189['label']),await this['addFilesToContext']([_0x263e50],{'label':_0x502189['label'],'resourceId':_0x502189['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new ht('ai-chat-context-unsupported-type',this,{'resourceId':_0x502189['id'],'sourceId':_0x1ad5f1['id'],'resourceType':_0x502189['type']}),'resourceId':_0x502189['id'],'sourceId':_0x1ad5f1['id']});}else this['fire']('error',{'error':new ht('ai-chat-resource-no-data',this,{'resourceId':_0x502189['id'],'sourceId':_0x1ad5f1['id']}),'resourceId':_0x502189['id'],'sourceId':_0x1ad5f1['id']});}['toggleAddCurrentDocumentOptionVisibility'](_0x4e9c0a){if(void 0x0!==_0x4e9c0a)this['_addContextOptionsState']['document']['isHidden']=!_0x4e9c0a;else{const _0x3f9385=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x3f9385;}this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}static['_convertTextResourceToFile'](_0x2ee21a,_0x5b0439){switch(_0x2ee21a['type']){case'markdown':return new File([_0x2ee21a['content']],_0x5b0439,{'type':'text/markdown'});case'html':return new File([_0x2ee21a['content']],_0x5b0439,{'type':'text/html'});default:return new File([_0x2ee21a['content']],_0x5b0439,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x116217){switch(_0x116217['type']){case'file':case'image':case'text':return[{'type':'file','id':_0x116217['id']}];case'web-resource':return[{'type':'web-resource','id':_0x116217['id']}];case'document':return _0x116217['documents']?.['length']?_0x116217['documents']['map'](_0x3035c9=>({'type':'document','id':_0x3035c9['id'],..._0x3035c9['selection']?.['length']&&{'selection':_0x3035c9['selection']}})):[];case'mcp-tool-context':{const _0x3b0258=_0x116217;return[{'type':'mcp-tool-context','mcpServerName':_0x3b0258['mcpServerName'],'toolName':_0x3b0258['toolName'],'data':{..._0x3b0258['data'],'label':_0x3b0258['label']||_0x3b0258['data']?.['label']||_0x3b0258['id']},'id':_0x3b0258['id']}];}default:return[];}}['_addContextItem'](_0x329b61,_0x4433f4=!0x1){if(this['_pendingContextItems']['set'](_0x329b61['uiId'],_0x329b61),_0x329b61['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x329b61,'isLoading':_0x4433f4}),'current-document'===_0x329b61['uiId']&&this['toggleAddCurrentDocumentOptionVisibility'](),_0x329b61['resourceId']){const _0x3298a0=this['_findSourceIdsByResourceId'](_0x329b61['resourceId']);_0x3298a0&&_0x3298a0['forEach'](_0x2523fe=>{this['_updateResourceInContextState'](_0x2523fe,_0x329b61['resourceId'],!0x0);});}}['_removeContextItem'](_0x1087b4){const _0x2a30fe=this['_pendingContextItems']['get'](_0x1087b4),_0x309f24=this['_ongoingUploads']['get'](_0x1087b4);if(_0x309f24&&(_0x309f24['abort'](),this['_ongoingUploads']['delete'](_0x1087b4)),_0x2a30fe?.['resourceId']){const _0x24b884=this['_findSourceIdsByResourceId'](_0x2a30fe['resourceId']);_0x24b884&&_0x24b884['forEach'](_0x31584b=>{this['_updateResourceInContextState'](_0x31584b,_0x2a30fe['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x1087b4),this['fire']('contextItemRemoved',{'uiId':_0x1087b4,'type':_0x2a30fe?.['type']}),'current-document'===_0x1087b4&&this['toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x297c0e,_0x214873){if(this['_pendingContextItems']['has'](_0x297c0e['uiId'])&&(this['_pendingContextItems']['set'](_0x297c0e['uiId'],_0x297c0e),this['fire']('contextItemLoadingEnded',{'contextItem':_0x297c0e,'isLoading':_0x214873}),_0x297c0e['resourceId'])){const _0x28afc9=this['_findSourceIdsByResourceId'](_0x297c0e['resourceId']);_0x28afc9&&_0x28afc9['forEach'](_0x1997ea=>{this['_updateResourceInContextState'](_0x1997ea,_0x297c0e['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0xbe0124){this['_conversationContextItems']['set'](_0xbe0124['uiId'],_0xbe0124);}['_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'](_0x124795=>({..._0x124795,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x3fb03b=>({..._0x3fb03b,'resources':[]}))??[];}['_isResourceInContext'](_0x1a45d5){for(const _0xca05d5 of this['_pendingContextItems']['values']())if(_0xca05d5['resourceId']===_0x1a45d5)return!0x0;for(const _0x5e9ba8 of this['_conversationContextItems']['values']())if(_0x5e9ba8['resourceId']===_0x1a45d5)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x3fb20b){const _0x2ad1df=[];for(const _0x36705a of this['_addContextOptionsState']['sources'])_0x36705a['resources']['find'](_0x2dc7a7=>_0x2dc7a7['id']===_0x3fb20b)&&_0x2ad1df['push'](_0x36705a['id']);return 0x0===_0x2ad1df['length']?null:_0x2ad1df;}['_updateResourceInContextState'](_0x236d4b,_0x2cf503,_0x9ca95){const _0x126a58=this['_addContextOptionsState']['sources']['find'](_0x14e98d=>_0x14e98d['id']===_0x236d4b);if(!_0x126a58)return;const _0x14da57=_0x126a58['resources']['find'](_0x439d22=>_0x439d22['id']===_0x2cf503);_0x14da57&&(_0x14da57['isInContext']=_0x9ca95,this['fire']('resourceStateChanged',{'sourceId':_0x236d4b,'resourceId':_0x2cf503,'isInContext':_0x9ca95}));}['_startUploadOperation'](_0x7ef63f){this['_ongoingUploadOperations']['set'](_0x7ef63f,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x3087ed){this['_ongoingUploadOperations']['delete'](_0x3087ed),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}};const Tn=/* #__PURE__ -- @preserve */
31
- ut(),wn=['capabilitiesUpdated'];var Cn=class extends Tn{['_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'](_0x2d6014){const _0x43410d={};return _0x2d6014&&_0x2d6014['isWebSearchEnabled']&&(_0x43410d['webSearch']={}),_0x2d6014&&_0x2d6014['isReasoningEnabled']&&(_0x43410d['reasoning']={}),_0x43410d;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0xb038b7){_0xb038b7!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0xb038b7,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0xbc8cca){_0xbc8cca!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0xbc8cca,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}},fn=class extends An{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x277cfd){super(_0x277cfd),this['conversationId']=_0x277cfd['conversationId'],this['contextItems']=_0x277cfd['contextItems'],this['capabilities']=_0x277cfd['capabilities'],this['userMessage']=_0x277cfd['userMessage'],this['model']=_0x277cfd['model'],this['attributes']=_0x277cfd['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':En['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Cn['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}};const bn=/* #__PURE__ -- @preserve */
32
- ut();var Sn=class extends bn{['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];['_channelsToEditors'];['_getSessionId'];constructor(_0xb41bc5){super(),this['options']=_0xb41bc5,this['connector']=_0xb41bc5['connector'],this['chatModels']=_0xb41bc5['chatModels'],this['id']=_0xb41bc5['conversationId'],this['isFromHistory']=_0xb41bc5['isFromHistory'],this['_channelsToEditors']=_0xb41bc5['channelsToEditors'],this['_getSessionId']=_0xb41bc5['getSessionId'];}async['init'](_0x228cd2){try{this['chatContext']=new En({'connector':this['connector'],'config':_0x228cd2,'ownerId':this['id']}),this['chatContext']['delegate'](...mn)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Cn(),this['chatCapabilities']['delegate'](...wn)['to'](this),this['chatCapabilities']['init']();const _0xa907f8=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0xa907f8});const _0x48c70c=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x48c70c&&await this['setModel'](_0x48c70c);}catch(_0x52d55c){const _0x5108d5=new sn({'code':'ai-chat-conversation-init-failed','cause':_0x52d55c,'type':'network'});this['fire']('error',{'error':_0x5108d5});}}async['start'](){if(this['isStarted'])throw new ht('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new ht('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x2e5fc3}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x2e5fc3,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x3bbc61){const _0x586311=new sn({'code':'ai-chat-conversation-start-failed','cause':_0x3bbc61,'type':'network','context':{'conversationId':this['id']}});throw this['fire']('error',{'error':_0x586311}),_0x586311;}}async['load'](_0x4a754a){try{const _0x4e29a4=await this['connector']['fetchConversation'](_0x4a754a)['getConversation'](),_0x290363=await this['connector']['fetchConversationMessages'](_0x4a754a)['getMessages'](),_0x53a235=_0x290363[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x4e29a4['id'],'title'in _0x4e29a4?this['fire']('setConversationTitle',_0x4e29a4['title'],!this['isFromHistory']):this['fire']('setConversationTitle','',!this['isFromHistory']);const _0x12b95a=(await this['chatModels']['getAll']())['find'](_0x231635=>_0x231635['id']['toLowerCase']()===_0x53a235['toLowerCase']());this['selectedModel']=_0x12b95a,this['fire']('modelSelected',{'selectedModel':_0x12b95a,'isDisabled':!0x0});const {streamingMessageId:_0x3e67d1}=await this['_processMessagesToInteractions'](_0x290363,_0x53a235);return _0x3e67d1&&this['currentInteraction']?this['_resumeStream'](_0x3e67d1):this['currentInteraction']=void 0x0,this;}catch(_0x8aedd7){const _0x511381=new sn({'code':'ai-chat-conversation-init-from-id-failed','cause':_0x8aedd7,'type':'network','context':{'conversationId':_0x4a754a}});throw this['fire']('error',{'error':_0x511381}),_0x511381;}}async['_processMessagesToInteractions'](_0x44e42d,_0x491df8){let _0x4ff528,_0x5d4b31,_0x15b474=!0x1;for(const _0x43ee02 of _0x44e42d)if('user'===_0x43ee02['role']){const {contextItems:_0xe493ac,hasUnmatched:_0x4440db}=await this['_extractContextItems'](_0x43ee02);_0x15b474=_0x4440db;const _0x1aa0ec={'isReasoningEnabled':Object['hasOwn'](_0x43ee02['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x43ee02['capabilities'],'webSearch')};_0x4ff528=this['createInteraction']({'userMessage':_0x43ee02['prompt'],'contextItems':_0xe493ac,'capabilities':_0x1aa0ec,'modelId':_0x491df8,'attributes':_0x43ee02['attributes'],'channelsToEditors':this['_channelsToEditors']}),this['currentInteraction']=_0x4ff528,_0x5d4b31=void 0x0,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x43ee02['role']&&_0x4ff528){if('streaming'===_0x43ee02['status']){_0x5d4b31=_0x43ee02['id'];continue;}if('error'===_0x43ee02['status'])continue;const _0xf8cdbe=[];for(const _0x374318 of _0x43ee02['content'])switch(_0x374318['type']){case'text':case'modification':{const _0x348dc1=_0x4ff528['getDocumentContext'](),_0xdc46f9=this['_hasSessionMismatch'](_0x348dc1)||_0x15b474;_0x4ff528['currentReply']?.['type']!==_0x374318['type']&&(_0x4ff528['currentReply']=_0x4ff528['createReply']({'type':_0x374318['type'],'isDone':!0x0,'interactionId':_0x4ff528['id'],'areActionsDisabled':_0xdc46f9,'isFromHistory':!0x0,'channelsToEditors':this['_channelsToEditors']}),_0xf8cdbe['length']>0x0&&(_0x4ff528['currentReply']['sources']=_0xf8cdbe['splice'](0x0))),_0x4ff528['currentReply']['appendContent'](_0x374318['content'],_0x374318['documentId']);break;}case'url':_0xf8cdbe['push'](_0x374318);break;case'mcp-tool-result':{const {data:_0x295712,attributes:_0x4c9172}=JSON['parse'](_0x374318['content']);_0x4ff528['_handleToolResultData']({'toolName':_0x374318['toolName'],'data':_0x295712,'attributes':_0x4c9172});break;}}'cancelled'===_0x43ee02['status']&&this['fire']('error',{'interactionId':_0x4ff528['id'],'error':new ht('ai-request-aborted',this)});}}return{'streamingMessageId':_0x5d4b31};}async['_resumeStream'](_0x220499){if(this['currentInteraction'])try{const _0x156c2c=this['connector']['resumeStream'](this['id'],_0x220499);await this['currentInteraction']['resume'](_0x156c2c);}catch(_0x36c583){_0x36c583 instanceof ht&&this['fire']('error',{'interactionId':this['currentInteraction']?.['id'],'error':_0x36c583});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}async['_extractContextItems'](_0x51736a){return _0x51736a['content']?this['chatContext']['populateFromMessage'](_0x51736a['content'],Array['from'](this['_channelsToEditors']['values']())):{'contextItems':new Map(),'hasUnmatched':!0x1};}async['handleUserInteraction']({userMessage:_0x5bb580,attributes:_0x3c8dd2}){if(!this['isStarted'])throw new ht('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new ht('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x5c1e32=new Map(this['getPendingContextItems']()),_0x251e18=this['chatCapabilities']['getCapabilitiesConfig'](),_0x19af05=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x5bb580,'contextItems':_0x5c1e32,'capabilities':_0x251e18,'modelId':_0x19af05,'attributes':_0x3c8dd2,'channelsToEditors':this['_channelsToEditors']}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x1c928a){if(_0x1c928a instanceof ht)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x1c928a});else{const _0x81ba81=In['get'](_0x1c928a['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ht(_0x81ba81,null,{'error':_0x1c928a})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x4f88f0,contextItems:_0x41c5c6,capabilities:_0x5e7989,modelId:_0x497f48,attributes:_0x5e075,channelsToEditors:_0x3e1cd5}){const _0x168f5a=new fn({'userMessage':_0x4f88f0,'contextItems':_0x41c5c6,'capabilities':_0x5e7989,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x497f48,'attributes':_0x5e075,'channelsToEditors':_0x3e1cd5});return _0x168f5a['delegate'](...gn)['to'](this),this['interactions']['push'](_0x168f5a),this['fire']('interactionCreated',_0x168f5a),_0x168f5a;}['getInteraction'](_0x5a8ce0){return this['interactions']['find'](_0x188bcc=>_0x188bcc['id']===_0x5a8ce0);}['removeInteraction'](_0x1c69e1){const _0x375d24=this['getInteraction'](_0x1c69e1);_0x375d24&&(_0x375d24['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x375d24),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['cancelLastInteractionStream'](){const _0x1b4dca=this['lastInteraction'];_0x1b4dca?.['conversationId']&&_0x1b4dca['messageId']&&this['connector']['cancelStream'](_0x1b4dca['conversationId'],_0x1b4dca['messageId'])['execute']()['catch'](()=>{});}['addCurrentDocumentToContext'](_0x24f911){this['chatContext']['addCurrentDocumentToContext'](_0x24f911);}async['updateCurrentDocumentsInContext'](_0x388105){await this['chatContext']['updateCurrentDocuments'](_0x388105);}['toggleAddCurrentDocumentOptionVisibility'](_0x25f995){this['chatContext']['toggleAddCurrentDocumentOptionVisibility'](_0x25f995);}['_hasSessionMismatch'](_0x29c98d){return!!_0x29c98d&&_0x29c98d['documents']['some'](_0x55211f=>{const _0xf98812=this['_channelsToEditors']['get'](_0x55211f['channelId']);return!_0xf98812||_0x55211f['sessionId']!==this['_getSessionId'](_0xf98812);});}['addSelectionToContext'](_0x3ca2d7){this['chatContext']['addSelectionToContext'](_0x3ca2d7);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x25134c){this['chatContext']['addFilesToContext'](_0x25134c);}['addUrlToContext'](_0x5547ed){this['chatContext']['addUrlToContext'](_0x5547ed);}['addToolItemToContext'](_0x5c5649){this['chatContext']['addToolItemToContext'](_0x5c5649);}['addResourceToContext'](_0x4f0639,_0x47b943){this['chatContext']['addResourceToContext'](_0x4f0639,_0x47b943);}['loadSourceResources'](_0x250c83,_0x3dbada,_0x1019c8){return this['chatContext']['loadSourceResources'](_0x250c83,_0x3dbada,_0x1019c8);}['removeFromContext'](_0xdb9e4){this['chatContext']['removeFromContext'](_0xdb9e4);}['setWebSearch'](_0xc3d6ff){this['chatCapabilities']['setWebSearch'](_0xc3d6ff);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x55eab2){this['chatCapabilities']['setReasoning'](_0x55eab2);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}['getPendingContextItems'](){return this['chatContext']['getPendingContextItems']();}async['setModel'](_0x43cc82){_0x43cc82?!0x1===await this['chatModels']['isAvailable'](_0x43cc82)&&(bt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x43cc82}),_0x43cc82=(await this['chatModels']['getAvailableModels']())[0x0]):(bt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x43cc82=(await this['chatModels']['getAvailableModels']())[0x0]),_0x43cc82['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x43cc82,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x43cc82}));}};function Rn({documentSuggestions:_0x545967,transform:_0x54e9b3,documentCompare:_0xe1cae8,documentCompareOptions:_0x25255d}){const _0x58c023=new Map();for(const [_0x50399b,{groups:_0x2b5bf4,documentContext:_0x2e6cb5,documentContent:_0x468e43,editor:_0x3ea79a}]of _0x545967){const _0x490fe8=_0x2e6cb5['content'],_0xc4a465=_0x2e6cb5['version'],_0x4ba7fd=_0x468e43['cloneNode'](!0x0);for(const {changes:_0x4a2b47}of _0x2b5bf4){const _0x5b1e3a=_0x4a2b47['filter'](_0x17be98=>'new'!=_0x17be98['type'])['map'](_0x2294e0=>Es('data-id',_0x2294e0['id'],_0x4ba7fd))['filter'](_0x10e0eb=>null!==_0x10e0eb),_0x5ce9f0=_0x4a2b47['filter'](_0x43e0b2=>'removed'!=_0x43e0b2['type'])['map'](_0x33bd1b=>_0x33bd1b['node']['cloneNode'](!0x0));let _0x2ef674=null;if(_0x5b1e3a['length']){_0x2ef674=_0x5b1e3a[0x0]['previousSibling'];for(let _0x54fbf0=0x0;_0x54fbf0<_0x5b1e3a['length'];_0x54fbf0++)_0x2a7599(_0x5b1e3a[_0x54fbf0]);}if(_0x5ce9f0['length']){_0x2ef674||(_0x4a2b47[0x0]['anchorId']?_0x2ef674=Es('data-id',_0x4a2b47[0x0]['anchorId'],_0x4ba7fd):(_0x2ef674=_0x5ce9f0['shift'](),_0x2dfbea(_0x4ba7fd,_0x2ef674)));for(let _0x5e8621=0x0;_0x5e8621<_0x5ce9f0['length'];_0x5e8621++)_0x218be5(_0x2ef674,_0x5ce9f0[_0x5e8621]),_0x2ef674=_0x5ce9f0[_0x5e8621];}}const _0x2bf207=ms(_0x4ba7fd),_0x188be0=_0xe1cae8['getDiff'](_0x490fe8,_0x2bf207,{'targetEditor':_0x3ea79a,'anchor':_0x2e6cb5['rootName'],..._0x25255d})['getOperations']();if(_0x54e9b3){const _0x4d899f=_0x3ea79a['model']['document']['history']['getOperations'](_0xc4a465),_0x1f7f16={'document':_0x3ea79a['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};_0x58c023['set'](_0x50399b,_0x29e916(_0x188be0,_0x4d899f,_0x1f7f16)['operationsA']);}else _0x58c023['set'](_0x50399b,_0x188be0);}return _0x58c023;}function On({groups:_0x4654a3,documentContextContent:_0x13fb24,documents:_0x249aec}){const _0x202cc8=new Map();for(const _0x1862e2 of _0x4654a3){const {documentId:_0x314834}=_0x1862e2,_0x5c9640=_0x202cc8['get'](_0x314834);if(_0x5c9640)_0x5c9640['groups']['push'](_0x1862e2),_0x5c9640['indexes']['push'](_0x1862e2['index']);else{const _0x428c6b=_0x249aec['find'](_0x7f74ef=>_0x7f74ef['id']===_0x314834),_0x3e7156=_0x13fb24['get'](_0x314834);if(!_0x428c6b||!_0x3e7156)continue;_0x202cc8['set'](_0x314834,{'groups':[_0x1862e2],'documentContext':_0x428c6b,'documentContent':_0x3e7156,'editor':_0x1862e2['editor'],'indexes':[_0x1862e2['index']]});}}return _0x202cc8;}function vn(_0x24c31c,_0x23bb03){const _0x425b7e=_0x24c31c['files']['length']>0x0&&_0x24c31c['files']['every'](_0x150a11=>_0x150a11['type']['startsWith']('image/')),_0x52d519=_0x24c31c['plainText']['trim']()['length']>0x0;if(_0x24c31c['files']['length']>0x0&&_0x23bb03['filesEnabled']&&(!_0x425b7e||!_0x52d519)){const _0x560fe9=_0x24c31c['files']['filter'](_0x1ad9a3=>_0x1ad9a3['name']);return _0x560fe9['length']>0x0?{'type':'file','files':_0x560fe9}:null;}if(_0x23bb03['urlsEnabled']){const _0x167179=function(_0x298458){const _0x1de3f7=_0x298458['trim']();if(/\s/['test'](_0x1de3f7))return null;try{const _0x106ba7=new URL(_0x1de3f7);return'http:'!==_0x106ba7['protocol']&&'https:'!==_0x106ba7['protocol']?null:_0x106ba7['toString']();}catch{return null;}}(_0x24c31c['plainText']);if(_0x167179)return{'type':'url','url':_0x167179};}const _0x4b1003=_0x24c31c['forceTextAttachment']?0x1:_0x23bb03['longTextThreshold']??0x1/0x0;if(_0x24c31c['plainText']['length']>=Math['max'](_0x4b1003,0x1)&&_0x23bb03['filesEnabled']){const _0x152696=_0x23bb03['pastedTextLabel']+'.txt';return{'type':'text','files':[new File([_0x24c31c['plainText']],_0x152696,{'type':'text/plain'})]};}return null;}var kn=class extends _0x5d28a2{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_hasAIChatBalloon']=!0x1;['_activeBalloon'];['_reporter'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];['_channelsToEditors']=new Map();static get['requires'](){return[ls,nn,_0x1cf5c4];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['set']('isConversationReady',!0x1),this['_bodyCollection']=ln(this['context']['locale']),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'](nn)['createReporter']('aichat'),this['_aiChatModels']=new Qs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0xb1ce3a=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x7e54a2,_0x25d832)=>{this['_handleUIUserMessage']({'message':_0x25d832});}),this['listenTo'](_0xb1ce3a['view'],'change:activeTab',(_0x23a271,_0x46bd3a,_0x4c9022)=>{'chat'!==_0x4c9022&&this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext'](),this['activeConversation']?.['cancelLastInteractionStream']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x57ddc3,_0x3e1498)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x3e1498));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x20515b,_0x57cb65)=>{this['activeConversation']?.['addUrlToContext'](_0x57cb65);}),this['listenTo'](this['_aiChatUi'],'promptInputPaste',(_0x4ed4ad,_0x1a2783)=>{const _0x5cf0ed=this['activeConversation'];if(!_0x5cf0ed)return;_0x1a2783['hasDirectory']&&(_0x1a2783['preventDefault'](),this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED'),'id':'folder-error-'+vt()}));const _0x5af76c=vn(_0x1a2783,{'pastedTextLabel':us(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')});_0x5af76c&&(_0x1a2783['preventDefault'](),'url'===_0x5af76c['type']?_0x5cf0ed['addUrlToContext'](_0x5af76c['url']):_0x5cf0ed['chatContext']['addFilesToContext'](_0x5af76c['files'],void 0x0,_0x5af76c['type']));}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0xc9b8d4,_0x862eee)=>{_0x862eee['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x59b8f2,_0x4dca10)=>{this['activeConversation']?.['addResourceToContext'](_0x4dca10['source'],_0x4dca10['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x2802e8,_0x55c7b2)=>{this['_removeFromContext'](_0x55c7b2);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x191f32,_0x581092)=>{this['activeConversation']?.['loadSourceResources'](_0x581092['sourceId'],_0x581092['query'],_0x581092['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x163243,_0x2a4fc9)=>{this['activeConversation']?.['setModel'](_0x2a4fc9);}),this['listenTo'](this['_aiChatUi'],'like',(_0x52c85f,{replyId:_0x52a976})=>{console['log']('Liked\x20response',_0x52a976);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x464a68,{replyId:_0x37efd2})=>{console['log']('Disliked\x20response',_0x37efd2);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x197108,_0x579101)=>{this['_insertSuggestion'](_0x579101);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x452d56,{replyId:_0x54409a,partIndex:_0x1d6be5})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x54409a,_0x1d6be5);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x60b0f6,{replyId:_0x4ad277,partIndex:_0x2b7995})=>{const _0x1ec419=this['_getDocumentRangeForReplyChanges'](_0x4ad277,_0x2b7995);if(!_0x1ec419)return;const {reply:_0x4ffafc}=this['getInteractionAndReplyById'](_0x4ad277);'$graveyard'!=_0x1ec419['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'editor':_0x4ffafc['changeGroups'][_0x2b7995]['editor'],'ranges':[_0x1ec419['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x574d93,_0x3999d1)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x3999d1);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x23ffc1,{replyId:_0x383415,showDiff:_0x22412d})=>{const {interaction:_0x41eb5f,reply:_0x2784a6}=this['getInteractionAndReplyById'](_0x383415),_0x517d6a=_0x2784a6['getContentParts']({'showDiff':_0x22412d});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x41eb5f['id']+':'+_0x2784a6['id'],'parts':_0x517d6a});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x25c6b5,{replyId:_0x863409,partIndex:_0x2379a7})=>{this['_rejectSuggestion']({'replyId':_0x863409,'partIndex':_0x2379a7}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['on']('interactionCreated',(_0x36cc87,_0x17924d)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x17924d);}),this['on']('replyCreated',(_0x5264a6,_0x57cdb3)=>{this['_addFeedItemReply'](_0x57cdb3);});}['afterInit'](){this['context']instanceof _0x1f7986?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x3666ca,_0x3f2028)=>{_0x3f2028['on']('ready',()=>{this['_integrateEditor'](_0x3f2028);});}),this['_initConversation']();}async['_initConversation'](){const _0x592333=this['context']['config']['get']('ai.chat.initialConversation');let _0x5f411e=_0x592333;('lastCreated'!=_0x592333||(_0x5f411e=await this['_getLastCreatedConversationId'](),_0x5f411e))&&('new'==_0x5f411e?await this['_startConversationSafely']():await this['loadConversation'](_0x5f411e));}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x51e367){this['_closeActiveBalloon'](),this['context']['plugins']['get'](cs)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),this['activeConversation']&&this['stopListening'](this['activeConversation']),await this['_stopLastInteraction']();try{this['_aiChatUi']['emptyConversationTitle'](),await this['_aiConnector']['fetchConversation'](_0x51e367)['getConversation'](),await this['_startConversationSafely']({'id':_0x51e367}),await this['activeConversation']['load'](_0x51e367),this['_aiChatUi']['enableControls'](),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x56d921){this['_aiChatUi']['resetConversationTitle'](),this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x51e367}),this['_reporter']['logError'](new ht('ai-chat-conversation-not-found',this,void 0x0,_0x56d921),{'context':{'operation':'load-conversation'}});}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x466794){let _0x40e29d=null,_0x3fe774=null;this['on']('toolDataReceived',(_0x21acec,_0x361a5c,_0x4a8d6b)=>{_0x4a8d6b['id']!==_0x40e29d&&(_0x40e29d=_0x4a8d6b['id'],_0x3fe774=this['_getAIChatFeedAPI'](_0x4a8d6b)),_0x466794(_0x361a5c,_0x3fe774);});}['addCurrentDocumentToChatContext'](){ds(this['context'])['length']&&this['activeConversation']?.['addCurrentDocumentToContext'](us(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](_0x379874){const _0x56a3d8=this['_aiEditing']['getSelectionText'](_0x379874);this['activeConversation']?.['addSelectionToContext'](_0x56a3d8),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0x269f2b){await this['_startConversationSafely']({'modelId':_0x269f2b?.['modelId']});}async['sendMessage'](_0x4a25bd){await this['_handleUIUserMessage'](_0x4a25bd);}['getGroupId'](){const _0x52e340=this['context']['config']['get']('collaboration.channelId');if(!_0x52e340)throw new ht('ai-missing-channel-id',this);return _0x52e340;}['_handleRemovedConversation'](_0x15b21d){this['activeConversation']['id']===_0x15b21d&&this['_startConversationSafely']();}['_prepareDocumentSuggestions'](_0x22f80a){const {reply:_0x54b175,interaction:_0x49b8aa}=this['getInteractionAndReplyById'](_0x22f80a['replyId']),_0xca862=void 0x0!==_0x22f80a['partIndex']?[_0x54b175['changeGroups'][_0x22f80a['partIndex']]]:_0x54b175['changeGroups']['filter'](_0x21549d=>'pending'==_0x21549d['state']);return _0xca862['map'](_0x3c6984=>_0x54b175['changeGroups']['indexOf'](_0x3c6984))['forEach'](_0x4b1e38=>{const _0x1c0b3e=this['_getDocumentRangeForReplyChanges'](_0x22f80a['replyId'],_0x4b1e38);_0x1c0b3e&&'$graveyard'!=_0x1c0b3e['range']['root']['rootName']?(_0x54b175['setChangeGroupState'](_0x4b1e38,'accepted'),void 0x0!==_0x22f80a['partIndex']&&this['_scrollToSuggestionRange'](_0x1c0b3e['range'],!0x1,_0x1c0b3e['targetEditor'])):_0x54b175['setChangeGroupState'](_0x4b1e38,'outdated');}),On({'groups':_0xca862['filter'](_0x4ec2ee=>'accepted'===_0x4ec2ee['state']),'documentContextContent':_0x54b175['documentContextContent'],'documents':_0x49b8aa['getDocumentContext']()?.['documents']??[]});}['_insertSuggestion'](_0x51e707){const _0x5f4046=this['context']['plugins']['get'](_0x1cf5c4),{reply:_0x474177,interaction:_0x4cab7c}=this['getInteractionAndReplyById'](_0x51e707['replyId']),_0x24916d=this['_prepareDocumentSuggestions'](_0x51e707),_0x4ada41=Rn({'documentSuggestions':_0x24916d,'transform':!0x0,'documentCompare':_0x5f4046,'documentCompareOptions':{'markDeletions':!0x0}});for(const [_0x416db4,_0x578490]of _0x4ada41){const {editor:_0xc4fc70,indexes:_0x444257}=_0x24916d['get'](_0x416db4);if(!_0xc4fc70['plugins']['has']('TrackChanges')){bt('ai-no-track-changes',{'editor':_0xc4fc70});continue;}let _0x425e90;zs(_0x578490,'chat'),_0xc4fc70['model']['change'](_0x20e117=>{_0x425e90=_0x20e117['batch'],_0xc4fc70['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x578490),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x425e90,{'interactionId':_0x4cab7c['id'],'replyId':_0x474177['id'],'indexes':_0x444257});}this['_updateRatings'](_0x474177);}['_applySuggestion'](_0x47bf0b){const _0x18ead6=this['context']['plugins']['get'](_0x1cf5c4),{reply:_0x4c5ec2,interaction:_0x49dbf9}=this['getInteractionAndReplyById'](_0x47bf0b['replyId']),_0x220d93=this['_prepareDocumentSuggestions'](_0x47bf0b),_0x29cd47=Rn({'documentSuggestions':_0x220d93,'transform':!0x0,'documentCompare':_0x18ead6,'documentCompareOptions':{'markDeletions':!0x1}});for(const [_0x4c0eab,_0x196e57]of _0x29cd47){const {editor:_0x1bf09d,indexes:_0x1f9bb5}=_0x220d93['get'](_0x4c0eab);let _0x139136;zs(_0x196e57,'chat');try{_0x1bf09d['model']['change'](_0x252d07=>{_0x139136=_0x252d07['batch'],_0x18ead6['applyOperations'](_0x252d07,_0x196e57);}),this['_batchToChanges']['set'](_0x139136,{'interactionId':_0x49dbf9['id'],'replyId':_0x4c5ec2['id'],'indexes':_0x1f9bb5});}catch(_0x5ebdb2){throw this['_reporter']['logError'](new sn({'code':'ai-applying-suggestion-failed','type':'runtime','cause':_0x5ebdb2})),_0x5ebdb2;}}this['_updateRatings'](_0x4c5ec2);}['_rejectSuggestion'](_0x40f58d){const {reply:_0x22cee3}=this['getInteractionAndReplyById'](_0x40f58d['replyId']);_0x22cee3['setChangeGroupState'](_0x40f58d['partIndex'],'rejected');}['_openBalloonFor'](_0x2a1508,_0xbe60cd){if(!this['_hasAIChatBalloon'])return;const {reply:_0x3c41de}=this['getInteractionAndReplyById'](_0x2a1508),_0x83f12a=_0x3c41de['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(!_0x83f12a['length'])return;let _0x2fad00,_0x2bb91d;if(void 0x0!==_0xbe60cd?(_0x2bb91d=_0x83f12a['find'](_0x2fe4ea=>_0x2fe4ea['index']==_0xbe60cd),_0x2fad00=_0x2bb91d?.['index']):(_0x2bb91d=_0x83f12a[0x0],_0x2fad00=_0x2bb91d['index']),!_0x2bb91d)return void _0x3c41de['setChangeGroupState'](_0xbe60cd??0x0,'outdated');if(this['_currentPreviewedChangeGroup']?.['replyId']==_0x2a1508&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x2fad00)return;const _0x3c1f5f=this['_getUserPresentableContentPartDocumentRange'](_0x2a1508,_0x3c41de,_0x2bb91d),_0x445980=_0x3c41de['changeGroups']['find'](_0x320ae1=>_0x320ae1['index']==_0x2fad00)['editor'],_0x4cd231=_0x445980['plugins']['get']('AIChatBalloon');if(this['_activeBalloon']&&this['_activeBalloon']!==_0x4cd231&&this['_activeBalloon']['close'](),!_0x3c1f5f)return _0x4cd231['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x4cd231,this['_currentPreviewedChangeGroup']={'replyId':_0x2a1508,'partIndex':_0x2fad00},this['_scrollToSuggestionRange'](_0x3c1f5f,!0x0,_0x445980);const _0x51a119=this['_getPresentableSiblingContentPartIndex'](_0x2a1508,_0x2fad00,'next');_0x4cd231['clearContent'](),_0x4cd231['updateContent']({'part':_0x2bb91d,'renderingStrategy':'static'}),_0x4cd231['open']({'index':_0x2fad00,'title':us(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x2fad00+0x1)['toString']()),'showRotator':null!==_0x51a119,'ranges':[_0x3c1f5f],'areActionsDisabled':_0x3c41de['areActionsDisabled'],'targetEditor':_0x445980}),_0x4cd231['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x2a1508,_0x2fad00),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x2a1508,'index':_0x2fad00,'isActive':!0x0});}['_closeActiveBalloon'](){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;}['_getPresentableSiblingContentPartIndex'](_0x3b4233,_0x2b876d,_0x29798c){const {reply:_0x4bc61a}=this['getInteractionAndReplyById'](_0x3b4233),_0x10101a=_0x4bc61a['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x10101a['length'])return null;const _0x4343eb='next'==_0x29798c?0x1:-0x1;function _0x485fbf(_0x72fe6){const _0x52afea=(_0x72fe6+_0x4343eb+_0x10101a['length'])%_0x10101a['length'];return{'siblingIndex':_0x52afea,'siblingPart':_0x10101a[_0x52afea]};}const _0x3abcff=_0x10101a['findIndex'](_0x166d81=>_0x166d81['index']==_0x2b876d);let {siblingIndex:_0xe9af9d,siblingPart:_0x19c93e}=_0x485fbf(_0x3abcff);for(;!this['_getUserPresentableContentPartDocumentRange'](_0x3b4233,_0x4bc61a,_0x19c93e);)if({siblingIndex:_0xe9af9d,siblingPart:_0x19c93e}=_0x485fbf(_0xe9af9d),_0xe9af9d===_0x3abcff)return null;return _0x19c93e['index'];}['_getUserPresentableContentPartDocumentRange'](_0x4751a9,_0x3968bb,_0x1d585d){const _0x599326=_0x3968bb['changeGroups'];if(!_0x1d585d['hasChanges'])return null;const _0x4f9054=_0x599326['find'](_0x46cb3e=>_0x46cb3e['index']==_0x1d585d['index']);if('pending'!==_0x4f9054?.['state'])return null;if(!_0x4f9054?.['editor']||'destroyed'===_0x4f9054['editor']['state'])return _0x3968bb['setChangeGroupState'](_0x1d585d['index'],'outdated'),null;const _0x434a6a=this['_getDocumentRangeForReplyChanges'](_0x4751a9,_0x1d585d['index']);if(!_0x434a6a)return _0x3968bb['setChangeGroupState'](_0x1d585d['index'],'outdated'),null;const {range:_0xc2e67d,currentIndex:_0x25375f}=_0x434a6a;return'$graveyard'==_0xc2e67d['root']['rootName']?(_0x3968bb['setChangeGroupState'](_0x25375f,'outdated'),null):_0x434a6a['range'];}['_getDocumentRangeForReplyChanges'](_0x45bf3f,_0x4316aa){const {reply:_0x543d2c,interaction:_0x4baba1}=this['getInteractionAndReplyById'](_0x45bf3f),_0x11495b=_0x543d2c['changeGroups']['filter'](_0x2fe535=>'pending'==_0x2fe535['state']),_0x5c0467=_0x11495b['map'](_0x33f88e=>_0x543d2c['changeGroups']['indexOf'](_0x33f88e));void 0x0===_0x4316aa&&(_0x4316aa=_0x5c0467[0x0]);const _0x440467=_0x5c0467['indexOf'](_0x4316aa);if(-0x1==_0x440467)return null;const _0x43575a=_0x11495b[_0x440467],_0x282be9=_0x43575a['editor'];if(!_0x282be9||'destroyed'===_0x282be9['state'])return null;if(!_0x30f76f(_0x282be9,_0x43575a['rootName']))return null;const _0x1f30fa=_0x543d2c['documentContextContent']['get'](_0x43575a['documentId']),_0x1707ed=new _0x3df49e([]),_0x68d88c=new _0x3df49e([]);for(const _0x5aeef3 of _0x43575a['changes'])if('removed'!=_0x5aeef3['type']&&_0x68d88c['children']['push'](_0x5aeef3['node']['cloneNode'](!0x0)),'new'!=_0x5aeef3['type']){const _0x4eb465=ti(_0x4f2d68=>fs(_0x4f2d68,'data-id')==_0x5aeef3['id'],_0x1f30fa,!0x0);_0x1707ed['children']['push'](_0x4eb465['cloneNode'](!0x0));}if(0x0==_0x1707ed['children']['length']){if(_0x43575a['changes'][0x0]['anchorId']){const _0x4bcff3=Es('data-id',_0x43575a['changes'][0x0]['anchorId'],_0x1f30fa);_0x1707ed['children']['unshift'](_0x4bcff3['cloneNode'](!0x0)),_0x68d88c['children']['unshift'](_0x4bcff3['cloneNode'](!0x0)),_0x4bcff3['nextSibling']&&(_0x1707ed['children']['push'](_0x4bcff3['nextSibling']['cloneNode'](!0x0)),_0x68d88c['children']['push'](_0x4bcff3['nextSibling']['cloneNode'](!0x0)));}else{const _0x237357=_0x1f30fa['children'][0x0];if(!_0x237357)return null;_0x1707ed['children']['push'](_0x237357['cloneNode'](!0x0)),_0x68d88c['children']['push'](_0x237357['cloneNode'](!0x0));}}const _0x17d2d0=_0x4baba1['getDocumentContext'](),_0x583581=_0x17d2d0['documents']['find'](_0x2cffbd=>_0x2cffbd['id']==_0x43575a['documentId'])['content'],_0x157bea=_0x282be9['model']['document']['getRoot'](_0x43575a['rootName']),_0x571982=_0x282be9['data']['parse'](_0x583581,_0x157bea),_0x4e2b1d=ms(_0x1707ed),_0x397d17=_0x282be9['data']['parse'](_0x4e2b1d,_0x157bea),_0x38eee6=_0x282be9['data']['parse'](_0x4e2b1d,_0x157bea),_0x38ae58=_0x282be9['model']['createPositionAt'](_0x397d17,0x0),_0x347bec=ms(_0x68d88c),_0x24c45e={'targetEditor':_0x282be9,'anchor':_0x38ae58,'markDeletions':!0x1};let _0x22ae2f;try{_0x22ae2f=_0x282be9['plugins']['get'](_0x1cf5c4)['getDiff'](_0x4e2b1d,_0x347bec,_0x24c45e)['getOperations']();}catch(_0x5ac8a0){return this['_reporter']['reportError'](new sn({'code':'ai-chat-suggestion-diff-failed','type':'runtime','severity':'warning','cause':_0x5ac8a0,'context':{'replyId':_0x45bf3f,'partIndex':_0x4316aa}})),null;}if(!_0x22ae2f['length'])return null;_0x282be9['model']['change'](_0x1fff46=>{for(const _0x325daa of _0x22ae2f)if('remove'==_0x325daa['type']){const _0x2a81b8=_0x325daa['sourcePosition'],_0x132806=_0x325daa['howMany'],_0x3edfa8=new _0x50ba30(_0x2a81b8,_0x132806);_0x1fff46['batch']['addOperation'](_0x3edfa8),_0x282be9['model']['applyOperation'](_0x3edfa8);}else'marker'!==_0x325daa['type']&&(_0x325daa['baseVersion']=null,_0x325daa['isDocumentOperation']=!0x1,_0x1fff46['batch']['addOperation'](_0x325daa),_0x282be9['model']['applyOperation'](_0x325daa));});const _0xcb229c=Gs(_0x282be9,_0x22ae2f,_0x397d17);Ks(_0x282be9['model'],_0xcb229c);const _0x25528f=_0xcb229c['getFirstRange']()['start']['path']['slice'](),_0x22f79b=_0xcb229c['getFirstRange']()['end']['path']['slice'](),_0x4557b0=[];let _0xc2449=_0x397d17,_0x2dd95b=_0x38eee6;for(let _0xabf0c7=0x0;_0xabf0c7<_0x22f79b['length'];_0xabf0c7++){const _0x39abf8=_0xc2449['maxOffset']-_0x22f79b[_0xabf0c7];_0x4557b0[_0xabf0c7]=_0x2dd95b['maxOffset']-_0x39abf8,_0xc2449=_0xc2449['getChildAtOffset'](_0x22f79b[_0xabf0c7]),_0x2dd95b=_0x2dd95b['getChildAtOffset'](_0x4557b0[_0xabf0c7]);}const _0x357854=_0x282be9['model']['createRange'](_0x282be9['model']['createPositionFromPath'](_0x38eee6,_0x25528f),_0x282be9['model']['createPositionFromPath'](_0x38eee6,_0x4557b0)),_0x5d08ea=_0x38eee6['getChild'](0x0)['getAttribute'](_0x5e92a3),_0x5738fc=Array['from'](_0x571982['getChildren']())['find'](_0x2a482c=>_0x2a482c['getAttribute'](_0x5e92a3)==_0x5d08ea)['getPath'](),_0x2edb77=_0x357854['start']['path']['slice'](),_0x4b2768=_0x357854['end']['path']['slice']();_0x2edb77[0x0]=_0x5738fc[0x0]+_0x2edb77[0x0],_0x4b2768[0x0]=_0x5738fc[0x0]+_0x4b2768[0x0];let _0x132d1f=_0x282be9['model']['createRange'](_0x282be9['model']['createPositionFromPath'](_0x282be9['model']['document']['getRoot'](_0x43575a['rootName']),_0x2edb77),_0x282be9['model']['createPositionFromPath'](_0x282be9['model']['document']['getRoot'](_0x43575a['rootName']),_0x4b2768));const _0x49cb5b=_0x17d2d0['documents']['find'](_0x2b9c18=>_0x2b9c18['id']==_0x43575a['documentId'])['version'],_0x34b68e=_0x282be9['model']['document']['history']['getOperations'](_0x49cb5b);for(const _0x217d64 of _0x34b68e)_0x132d1f=_0x4e8468['_createFromRanges'](_0x132d1f['getTransformedByOperation'](_0x217d64));return{'range':_0x132d1f,'currentIndex':_0x4316aa,'targetEditor':_0x282be9};}['_integrateEditorBalloon'](_0x3a7d97){if(!_0x3a7d97['plugins']['has']('AIChatBalloon'))return;const _0x474784=_0x3a7d97['plugins']['get']('AIChatBalloon');this['_hasAIChatBalloon']=!0x0,_0x474784['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x474784,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x4e0742,partIndex:_0x3c0ea2}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x5b86ae}=this['getInteractionAndReplyById'](_0x4e0742),_0x319c73=_0x5b86ae['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x3c0ea2});_0x474784['updateContent']({'part':_0x319c73[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x474784,'applySuggestion',()=>{const {replyId:_0x56e98c,partIndex:_0x5b91ee}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x56e98c,'partIndex':_0x5b91ee}),_0x474784['setState']('accepted');}),this['listenTo'](_0x474784,'insertSuggestion',()=>{const {replyId:_0x22bcba,partIndex:_0x14765d}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x22bcba,'partIndex':_0x14765d}),_0x474784['setState']('accepted');}),this['listenTo'](_0x474784,'rejectSuggestion',()=>{const {replyId:_0x54a46b,partIndex:_0x605ebb}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x54a46b,'partIndex':_0x605ebb}),_0x474784['setState']('rejected');}),this['listenTo'](_0x474784,'showNext',()=>{const {replyId:_0x3be21e,partIndex:_0x36ca45}=this['_currentPreviewedChangeGroup'],_0x3c30f1=this['_getPresentableSiblingContentPartIndex'](_0x3be21e,_0x36ca45,'next');null!==_0x3c30f1&&this['_openBalloonFor'](_0x3be21e,_0x3c30f1);}),this['listenTo'](_0x474784,'showPrevious',()=>{const {replyId:_0xa88de9,partIndex:_0x5a5224}=this['_currentPreviewedChangeGroup'],_0x39189c=this['_getPresentableSiblingContentPartIndex'](_0xa88de9,_0x5a5224,'previous');null!==_0x39189c&&this['_openBalloonFor'](_0xa88de9,_0x39189c);}),this['listenTo'](_0x474784,'dialogClosed',(_0x3b5ccd,{id:_0x127181})=>{if('aiChatBalloon'!==_0x127181)return;const {replyId:_0x2b1c1d,partIndex:_0x4083b0}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x2b1c1d,'index':_0x4083b0,'isActive':!0x1}),this['_activeBalloon']===_0x474784&&(this['_activeBalloon']=void 0x0);});}['_integrateEditor'](_0x578f5a){if(this['_channelsToEditors']['set'](_0x578f5a['config']['get']('collaboration.channelId'),_0x578f5a),this['_integrateEditorBalloon'](_0x578f5a),this['addCurrentDocumentToChatContext'](),_0x578f5a['once']('destroy',()=>{this['_checkRemoveCurrentDocumentFromChatContext']();}),_0x578f5a['plugins']['has']('Undo')){const _0x1c95ed=_0x578f5a['commands']['get']('undo'),_0x29e0f8=_0x578f5a['commands']['get']('redo');this['listenTo'](_0x1c95ed,'revert',(_0x4d7745,_0x368742,_0x490634)=>{const _0x174446=this['_batchToChanges']['get'](_0x368742);if(!_0x174446)return;const _0x9c0de7=this['activeConversation']['getInteraction'](_0x174446['interactionId']),_0x35a994=_0x9c0de7?.['getReply'](_0x174446['replyId']);this['_batchToChanges']['delete'](_0x368742),_0x9c0de7&&_0x35a994&&(_0x174446['indexes']['forEach'](_0x3fa303=>_0x35a994['setChangeGroupState'](_0x3fa303,'pending')),this['_batchToChanges']['set'](_0x490634,_0x174446));}),this['listenTo'](_0x29e0f8,'revert',(_0x5bc333,_0x2ce8cd,_0x41a1e1)=>{const _0x1b02eb=this['_batchToChanges']['get'](_0x2ce8cd);if(!_0x1b02eb)return;const _0x46c213=this['activeConversation']['getInteraction'](_0x1b02eb['interactionId']),_0xc342e4=_0x46c213?.['getReply'](_0x1b02eb['replyId']);this['_batchToChanges']['delete'](_0x2ce8cd),_0x46c213&&_0xc342e4&&(_0x1b02eb['indexes']['forEach'](_0x589882=>_0xc342e4['setChangeGroupState'](_0x589882,'accepted')),this['_batchToChanges']['set'](_0x41a1e1,_0x1b02eb));});}const _0x51e88b=_0x578f5a['config']['get']('ai.chat.context');_0x51e88b['alwaysAddSelection']&&_0x51e88b['document']['enabled']&&this['listenTo'](_0x578f5a['model']['document']['selection'],'change:range',(_0x239033,_0x5059fb)=>{_0x5059fb['directChange']&&'chat'===_0x578f5a['plugins']['get']('AITabs')['view']['activeTab']&&(_0x578f5a['model']['hasContent'](_0x578f5a['model']['document']['selection'])?this['addSelectionToChatContext'](_0x578f5a):this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x4dfd69=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x244fed=await _0x4dfd69['getConversations']();return _0x244fed['length']?_0x244fed[0x0]['id']:'new';}catch(_0x5758ad){return this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':vt()}),this['_reporter']['logError'](new ht('ai-chat-conversation-init-failed',this,{'error':_0x5758ad})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x16ee78={}){this['set']('isConversationReady',!0x1);try{await this['_handleStartConversation'](_0x16ee78);}catch(_0x3ff748){this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x16ee78['id']||vt()}),this['_reporter']['logError'](_0x3ff748),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0x217a5c,modelId:_0x4f189b}={}){this['_closeActiveBalloon']();let _0x55a04d=_0x4f189b;_0x55a04d||(_0x217a5c||!this['activeConversation']?_0x55a04d=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x55a04d=this['activeConversation']['selectedModel']['id'])),this['activeConversation']&&this['stopListening'](this['activeConversation']),await this['_stopLastInteraction']();const _0x22b7c3=this['getGroupId'](),_0x4af79c=_0x217a5c||vt();let _0x580260;this['activeConversation']=new Sn({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x55a04d,'conversationId':_0x4af79c,'group':_0x22b7c3,'locale':this['context']['locale'],'isFromHistory':!!_0x217a5c,'channelsToEditors':this['_channelsToEditors'],'getSessionId':_0x5ae304=>this['_aiEditing']['getSessionId'](_0x5ae304)}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['listenTo'](this['activeConversation'],'conversationInitialized',(_0x16e06e,_0x31895f)=>{this['_aiChatUi']['createConversation'](_0x31895f),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x217a5c||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['listenTo'](this['activeConversation'],'uploadProgressChanged',(_0x2bacb9,_0x92e8d)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x92e8d['isUploadInProgress']);}),this['listenTo'](this['activeConversation'],'webSearchStarted',()=>{const _0x47879d=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x47879d);}),this['listenTo'](this['activeConversation'],'reasoningStarted',()=>{const _0x5a2a67=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x5a2a67);}),this['listenTo'](this['activeConversation'],'webSearchFinished',(_0x3f67e3,_0x41b258)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x41b258,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['listenTo'](this['activeConversation'],'reasoningFinished',(_0x14b85e,_0x1a3eea)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1a3eea,{'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',(_0x299833,_0x439330)=>{this['_aiChatUi']['removeFeedInteraction'](_0x439330['id']);}),this['listenTo'](this['activeConversation'],'setConversationTitle',(_0x3470c3,_0x10f968,_0x46ef1e)=>{this['_updateConversationTitle'](_0x10f968,_0x46ef1e);}),this['listenTo'](this['activeConversation'],'replyContentUpdated',async(_0x1f84e3,_0x245c01)=>{void 0x0!==_0x580260&&_0x580260!==_0x245c01['id']&&this['_updateReplyContentThrottled']['flush'](),_0x580260=_0x245c01['id'],_0x245c01['isFromHistory']?await this['_updateReplyContent']({'reply':_0x245c01}):await this['_updateReplyContentThrottled']({'reply':_0x245c01});}),this['listenTo'](this['activeConversation'],'replyChangeGroupStateUpdated',(_0x32c229,{reply:_0x492ddb,index:_0x5a887d,state:_0xe4e0b8})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x492ddb['id'],'index':_0x5a887d,'state':_0xe4e0b8}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x492ddb['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x5a887d&&this['_activeBalloon']?.['setState'](_0xe4e0b8);}),this['listenTo'](this['activeConversation'],'contextItemAdded',(_0xcd6555,_0x1aef65)=>{if(this['_aiChatUi']['addContextItem'](_0x1aef65['contextItem'],_0x1aef65['isLoading']),'selection'===_0x1aef65['contextItem']['type']){const _0xa19f8d=_s(this['context']),_0x522c85=[..._0xa19f8d['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'editor':_0xa19f8d,'ranges':_0x522c85,'id':'context','priority':0x1});}}),this['listenTo'](this['activeConversation'],'contextItemRemoved',(_0x48663f,_0x9add17)=>{this['_aiChatUi']['removeContextItem'](_0x9add17['uiId']),'current-document'==_0x9add17['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x9add17['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['listenTo'](this['activeConversation'],'contextItemLoadingEnded',(_0x25b2c3,_0x44feb1)=>{this['_aiChatUi']['setContextItemLoading'](_0x44feb1['contextItem']['uiId'],_0x44feb1['isLoading']);}),this['listenTo'](this['activeConversation'],'contextSent',(_0x3b7671,_0x447eb9)=>{this['_aiChatUi']['setConversationContext'](_0x447eb9['contextItems']);}),this['listenTo'](this['activeConversation'],'addContextOptionsChanged',(_0x5e8c4d,_0x32099e)=>{this['_aiChatUi']['setAddContextOptions'](_0x32099e['options']);}),this['listenTo'](this['activeConversation'],'sourceResourcesLoaded',(_0x24211a,_0x9de79c)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x9de79c['sourceId'],_0x9de79c['source'],_0x9de79c['resources'],_0x9de79c['uid']);}),this['listenTo'](this['activeConversation'],'resourceStateChanged',(_0x1e59aa,_0x16b77f)=>{this['_aiChatUi']['updateResourceState'](_0x16b77f['sourceId'],_0x16b77f['resourceId'],_0x16b77f['isInContext']);}),this['listenTo'](this['activeConversation'],'capabilitiesUpdated',(_0x159fa5,_0x5566e2)=>{this['_aiChatUi']['updateCapabilities'](_0x5566e2);}),this['listenTo'](this['activeConversation'],'modelSelected',async(_0x27aaf1,_0x1cf860)=>{try{const _0x1228e4=(await this['_aiChatModels']['getAll']())['find'](_0x4d028f=>_0x4d028f['id']===_0x1cf860['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x1228e4,_0x1cf860['isDisabled']);}catch(_0x3703ee){this['_reporter']['logError'](new sn({'code':'ai-chat-models-unable-to-retrieve','type':'network','cause':_0x3703ee}),{'context':{'operation':'model-selected'}});}}),this['listenTo'](this['activeConversation'],'error',(_0x4a0776,{error:_0x2b5f12,interactionId:_0x4f384f,fileName:_0x33721f,url:_0x270f5d,sourceId:_0xed376,sourceLabel:_0x303ce8})=>{const _0x3d60f2=_0x4f384f?_0x4f384f+':'+vt():vt();this['_reporter']['reportError'](_0x2b5f12),_0x2b5f12['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':us(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x3d60f2}):_0x2b5f12['message']['startsWith']('ai-chat-conversation-init-failed')||_0x2b5f12['message']['startsWith']('ai-chat-conversation-start-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x3d60f2}):_0x2b5f12['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x33721f),'id':_0x3d60f2}):_0x2b5f12['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x270f5d),'id':_0x3d60f2}):_0x2b5f12['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x3d60f2}):_0x2b5f12['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x3d60f2}):_0x2b5f12['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0xed376&&this['_aiChatUi']['closeSourceResourceBalloon'](_0xed376),this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x303ce8||'source'),'id':_0x3d60f2})):_0x2b5f12['message']['startsWith']('ai-chat-resource-load-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x3d60f2}):_0x2b5f12['message']['startsWith']('ai-chat-invalid-request')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x3d60f2}):_0x2b5f12['message']['startsWith']('ai-chat-context-unsupported-file-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x3d60f2}):_0x2b5f12['message']['startsWith']('ai-chat-context-file-too-large')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x3d60f2}):_0x2b5f12['message']['startsWith']('ai-chat-context-file-too-many-pages')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x3d60f2}):_0x2b5f12['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x3d60f2}):this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x3d60f2});}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x217a5c||(await this['activeConversation']['start'](),this['_aiChatUi']['enableControls']()),this['set']('isConversationReady',!0x0);}async['_handleUIUserMessage']({message:_0x39c03f,attributes:_0x2e566e}){if(!this['activeConversation'])throw new ht('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x3108a3=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentsInContext'](_0x3108a3);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x39c03f,'attributes':_0x2e566e});}['_removeFromContext'](_0x2d5d21){this['activeConversation']?.['removeFromContext'](_0x2d5d21);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x67fabd){const [_0x30dafa,_0x47b9dd]=_0x67fabd['split'](':'),_0x4e3010=this['activeConversation']['getInteraction'](_0x30dafa);return{'interaction':_0x4e3010,'reply':_0x4e3010['getReply'](_0x47b9dd)};}['_scrollToSuggestionRange'](_0xbc1091,_0x35415e=!0x1,_0x246042){const _0x13072d={'target':_0x246042['editing']['view']['domConverter']['viewRangeToDom'](_0x246042['editing']['mapper']['toViewRange'](_0xbc1091)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x35415e};_0x35415e&&(_0x13072d['alignToTop']=!0x0),Rt(_0x13072d);}['_updateConversationTitle'](_0x423cc3,_0x5f4775=!0x1){this['_aiChatUi']['setConversationTitle'](_0x423cc3||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x5f4775);}['_addFeedItemReply'](_0x2bf93d){'text'===_0x2bf93d['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x2bf93d):this['_aiChatUi']['addFeedItemAISuggestion'](_0x2bf93d);}async['_updateReplyContent']({reply:_0x5b0035,renderingStrategy:_0x572f0a}){const {id:_0x427a6f,interactionId:_0x4f651d,isDone:_0x109741,type:_0x342ed6,parsedContent:_0x2de264}=_0x5b0035,_0x3d4284=_0x4f651d+':'+_0x427a6f;if('modification'===_0x342ed6){const _0x3ded4f=_0x5b0035['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3d4284,'parts':_0x3ded4f,'isDone':_0x109741,'skipLoadingEffects':_0x5b0035['isFromHistory']});}else'text'===_0x342ed6&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x3d4284,'parsedContent':_0x2de264['get']('text'),'renderingStrategy':_0x572f0a,'isDone':_0x109741});_0x109741&&_0x5b0035['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x3d4284,_0x5b0035['sources']);}['_updateReplyContentThrottled']=_0x2150f4(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x2f1a3a=this['activeConversation']?.['lastInteraction'];_0x2f1a3a&&(_0x2f1a3a['stop'](),this['_aiChatUi']['stopInteraction'](_0x2f1a3a)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0x4f573a=this['activeConversation']?.['lastInteraction'];if(_0x4f573a){for await(const _0x28f274 of _0x4f573a['replies'])this['_aiChatUi']['hasFeedItem'](_0x28f274['id'])||this['_addFeedItemReply'](_0x28f274),await this['_updateReplyContent']({'reply':_0x28f274,'renderingStrategy':'static'});}}['_updateRatings'](_0x9fb4fc){const _0x5d79e4={'positiveCount':_0x9fb4fc['changeGroups']['filter'](_0xd8bb48=>'accepted'===_0xd8bb48['state'])['length'],'totalCount':_0x9fb4fc['changeGroups']['length'],'modificationId':_0x9fb4fc['id']},_0x9016c7=this['activeConversation']['getInteraction'](_0x9fb4fc['interactionId'])['messageId'];_0x9016c7&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x9016c7,_0x5d79e4);}['_getAIChatFeedAPI'](_0x32b46a){const _0x312300=this['_aiChatUi'],_0x2aed53=()=>{_0x32b46a['resetWebSearchState'](),_0x32b46a['resetReasoningState'](),_0x312300['clearLoadingMessage']();},_0x48b446=()=>{_0x32b46a['currentReply']&&(_0x32b46a['currentReply']['done'](),_0x32b46a['currentReply']=void 0x0);};return{'insertTextReply':(_0x98692,_0x1c4466)=>{_0x48b446(),_0x2aed53();const _0xc80a01=_0x32b46a['currentReply']=_0x32b46a['createReply']({'type':'text','interactionId':_0x32b46a['id'],'id':_0x1c4466||vt(),'channelsToEditors':this['_channelsToEditors']});return _0xc80a01['appendContent'](_0x98692),_0x48b446(),_0xc80a01;},'insertCustomElement':async(_0x1ace82,_0x406de9)=>(_0x48b446(),_0x2aed53(),_0x312300['addFeedItemCustomElement'](_0x1ace82,_0x406de9||vt())),'setLoadingMessage':_0x44d3d3=>{_0x312300['setLoadingMessage'](_0x44d3d3);},'clearLoadingMessage':()=>{_0x312300['clearLoadingMessage']();}};}['_checkRemoveCurrentDocumentFromChatContext'](){ds(this['context'])['find'](_0x3c476b=>'destroyed'!==_0x3c476b['state'])||(this['activeConversation']?.['removeFromContext']('current-document'),this['activeConversation']?.['toggleAddCurrentDocumentOptionVisibility'](!0x1));}};const Nn=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],yn=[...Nn,'startConversation','sendUserMessage','promptInputPaste','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];function xn(_0x52e316){const _0x1af2b1=new AbortController();return{'promise':new Promise((_0xca641f,_0x40d054)=>{const _0x202b2b=setTimeout(_0xca641f,_0x52e316);_0x1af2b1['signal']['addEventListener']('abort',()=>{clearTimeout(_0x202b2b),_0x40d054();});}),'abortController':_0x1af2b1};}var Ln=class{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x1f646b){this['options']={'delay':_0x1f646b?.['delay']??0xa,'textNodeStyle':_0x1f646b?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x4fd009,targetElement:_0x53ba12,abortSignal:_0x58de84}){this['isStreaming']&&this['stop'](),_0x58de84?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x373861(_0x4fd009,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x197521=0x0;_0x197521<this['currentIndex'];_0x197521++)this['nodesList'][_0x197521]['shouldBeStreamed']=!0x0;do{const _0x47a12f=Date['now'](),_0x9d654b=this['nodesList'][this['currentIndex']],_0x5b3d2a=_0x47a12f-this['lastUpdateTime'];if(_0x9d654b){_0x9d654b['shouldBeStreamed']=!0x0;let _0x509905=_0x9d654b['parent'];for(;_0x509905;)_0x509905['shouldBeStreamed']=!0x0,_0x509905=_0x509905['parent'];}if(_0x5b3d2a<this['options']['delay'])try{const {promise:_0x383ac9,abortController:_0x1dd74f}=xn(this['options']['delay']-_0x5b3d2a);this['timeoutAbortController']=_0x1dd74f,await _0x383ac9;}catch(_0x2aaebc){return;}_0x312697(_0x53ba12,'<'+_0x53ba12['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x53ba12['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:_0x1adc62}){Array['from'](_0x1adc62['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x3f6328=>{_0x3f6328['replaceWith'](_0x3f6328['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x2b56ea){let _0x1e68b5='';if(function(_0x5808d1){return _0x1f806c(_0x5808d1);}(_0x2b56ea)){for(const _0x2ad752 of _0x2b56ea['children'])_0x1e68b5+=this['renderNode'](_0x2ad752);}else{if(Hn(_0x2b56ea)){if(!_0x2b56ea['shouldBeStreamed'])return'';const _0xaec030=_0x2b56ea,_0x2b9b54=Object['entries'](_0xaec030['attribs'])['map'](([_0xfbc3c9,_0x3d5f62])=>_0xfbc3c9+'=\x22'+_0x3d5f62+'\x22')['join']('\x20');_0x1e68b5+='<'+_0xaec030['tagName']+(_0x2b9b54?'\x20'+_0x2b9b54:'')+'>';for(const _0x2602c9 of _0x5b482f(_0xaec030))_0x1e68b5+=this['renderNode'](_0x2602c9);_0x1e68b5+='</'+_0xaec030['tagName']+'>';}else{if(!Pn(_0x2b56ea))return'';if(!_0x2b56ea['shouldBeStreamed'])return'';!function(_0x522660){return!(!_0x522660['parent']||!Hn(_0x522660['parent']))&&(!!Dn['includes'](_0x522660['parent']['tagName'])&&!_0x1d60b7(_0x522660)['match'](/^\s*[<>]\s*$/));}(_0x2b56ea)?_0x1e68b5+=_0x1dbe92(_0x2b56ea):_0x1e68b5+=_0x1dbe92(new _0x1a4ef3('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x2b56ea]));}}return _0x1e68b5;}['getParsedDocumentNodeList'](){const _0x1e7212=[];return function(_0x3f150f,_0x4f0f51){const _0x2ff969=_0x4def9c=>{if(_0x4f0f51(_0x4def9c),_0x4def9c instanceof _0x9749e)for(let _0x1de984=0x0;_0x1de984<_0x4def9c['children']['length'];_0x1de984++){const _0x230d38=_0x4def9c['children'][_0x1de984];_0x2ff969(_0x230d38);}};for(let _0x556b3f=0x0;_0x556b3f<_0x3f150f['children']['length'];_0x556b3f++)_0x2ff969(_0x3f150f['children'][_0x556b3f]);}(this['document'],_0xf825df=>{if(Pn(_0xf825df)){const _0x19236f=this['splitTextNodeIntoWordNodes'](_0xf825df);_0x19236f['length']&&_0x1e7212['push'](..._0x19236f);}_0xf825df['isWordSplitSource']||_0xf825df['isWordSplitResult']||_0x1e7212['push'](_0xf825df);}),_0x1e7212;}['splitTextNodeIntoWordNodes'](_0x8361db){if(_0x8361db['isWordSplitSource']||_0x8361db['isWordSplitResult'])return[];const _0x52e939=_0x1d60b7(_0x8361db)['match'](/(?:\s*\S+\s*)/g),_0x43940b=[];if(_0x52e939&&_0x52e939['length']>0x1){for(const _0x31190a of _0x52e939){const _0x27b832=new _0xecc90d(_0x31190a);_0x27b832['isWordSplitResult']=!0x0,_0x201d1c(_0x8361db,_0x27b832),_0x43940b['push'](_0x27b832);}_0x8361db['isWordSplitSource']=!0x0,_0x2a7599(_0x8361db);}return _0x43940b;}};const Dn=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Pn(_0x1ae8d7){return _0x506b37(_0x1ae8d7);}function Hn(_0x3256bd){return _0x489441(_0x3256bd);}function Mn(_0x4ce1f1,_0x31218d){_0x4ce1f1['cleanUpAnimations']({'targetElement':_0x31218d}),_0x31218d['querySelectorAll']('[data-id]')['forEach'](_0x5e2263=>{_0x5e2263['removeAttribute']('data-id');});}var Vn=class extends _0x215f6f{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x38f411){super();const _0x47a1ea=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new Ln(),this['options']=_0x38f411,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x47a1ea['if']('isDone','ck-ai-chat__feed__item_done'),_0x47a1ea['if']('isVisible','ck-hidden',_0x529f0b=>!_0x529f0b),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){Mn(this['htmlStreamer'],this['element']),this['isDone']=!0x0;}async['streamIntoElement'](_0x201cd7,_0x4fd373,_0x476545){await this['htmlStreamer']['stream']({'document':_0x201cd7,'targetElement':_0x4fd373,'abortSignal':_0x476545});}},Un=class extends _0x215f6f{['showChangesToggleView'];constructor(_0x11cfa6,_0x3ac5b3){super(_0x11cfa6),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Bn(_0x11cfa6),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+hn,'label':us(_0x11cfa6,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x3ac5b3['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x4bcd2d=>_0x4bcd2d?et:tt),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x8b73f1=new Yt();_0x8b73f1['content']=_0x97af05,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x3ac5b3['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x8b73f1,{'tag':'span','children':[us(_0x11cfa6,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}},Bn=class extends Ht{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}};const Gn={'accepted':_0x3cdc95,'rejected':_0x2cae61,'outdated':_0x2cae61};var Fn=class extends _0x215f6f{['stateIconView'];constructor(_0xeee098){super(_0xeee098);const _0x2d56f1=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new Kn(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x2d56f1['to']('state',_0x1d2def=>'ck-ai-suggestion__content-part-state_'+_0x1d2def),_0x2d56f1['if']('isVisible','ck-hidden',_0x21d96a=>!_0x21d96a)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x2d56f1['to']('state',_0x338da1=>{switch(_0x338da1){case'accepted':return us(_0xeee098,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return us(_0xeee098,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return us(_0xeee098,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x12d4ed){this['state']=_0x12d4ed;}},Kn=class extends Yt{constructor(){super(),this['set']('state','accepted'),this['content']=Gn[this['state']],this['on']('change:state',()=>{this['content']=Gn[this['state']];});}},Wn=class extends _0x116a57{['_applyButton'];['_suggestButton'];constructor(_0x134894,_0x4a7686,_0x1532f7){super(_0x134894);const _0x4c6b52=Boolean(_0x1532f7);this['set']('isEnabled',!_0x4c6b52),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x550ba5=[];if(_0x4c6b52){const _0x18614f=new Ht(_0x134894);_0x18614f['set']({'label':us(_0x134894,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4d8e0c}),_0x18614f['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x550ba5['push'](_0x18614f);}else{_0x4a7686['includes']('applySuggestion')&&(this['_applyButton']=new Ht(_0x134894),this['_applyButton']['set']({'label':us(_0x134894,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3cdc95}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['bind']('isVisible')['to'](this,'isTrackChangesOn',_0x45551a=>!_0x45551a),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x550ba5['push'](this['_applyButton'])),_0x4a7686['includes']('insertSuggestion')&&(this['_suggestButton']=new Ht(_0x134894),this['_suggestButton']['set']({'label':us(_0x134894,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x41c137}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x550ba5['push'](this['_suggestButton']));const _0x3804ae=new Ht(_0x134894);_0x3804ae['set']({'label':us(_0x134894,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x2cae61}),_0x3804ae['bind']('isEnabled')['to'](this),_0x3804ae['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x550ba5['push'](_0x3804ae);}this['items']['addMany'](_0x550ba5);const _0x235a5c=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x235a5c['if']('isVisible','ck-hidden',_0x490ea5=>!_0x490ea5)]}});}['setButtonsVisibility']({showApplyButton:_0x257104,showSuggestButton:_0x553ebb}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x257104),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x553ebb);}},Yn=class extends _0x215f6f{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x3ea895,{part:_0x1acda3,uiIndex:_0x4764cc,availableActions:_0xbecfb0,areActionsDisabled:_0x31b6ff}){super(_0x3ea895),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['set']('isTrackChangesOn',!0x1),this['toolbarView']=new Wn(_0x3ea895,_0xbecfb0,_0x31b6ff),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x1acda3['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x1acda3['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x1acda3['index']});}),this['toolbarView']['bind']('isEnabled','isTrackChangesOn')['to'](this),this['stateView']=new Fn(_0x3ea895),this['titleLabelView']=new $n(_0x3ea895,_0x4764cc),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',(_0x56fb95,_0xc34fdf,_0x64026e,_0x34b102)=>{'pending'===_0x34b102?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x64026e?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x64026e),this['children']['add'](this['stateView']));});}},$n=class extends _0x215f6f{constructor(_0x58c5d0,_0x42b9a4){super(_0x58c5d0),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[us(_0x58c5d0,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x42b9a4['toString']())]});}},qn=class extends _0x215f6f{['htmlStreamer'];constructor(_0x201dff){super(_0x201dff),this['htmlStreamer']=new Ln(),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x4778ba,renderingStrategy:_0x690c4b,abortSignal:_0x2cf519}){const _0x149880=_0x373861(_0x4778ba['content'],!0x0);for(const _0x5829ba of ws(_0x149880))_0x2a7599(_0x5829ba);'streaming'===_0x690c4b?await this['htmlStreamer']['stream']({'document':_0x149880,'targetElement':this['element'],'abortSignal':_0x2cf519}):_0x312697(this['element'],'<'+this['element']['tagName']+'>'+ms(_0x149880)+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='',this['element']['scrollTop']=0x0;}['cleanUpStreamingArtifacts'](){Mn(this['htmlStreamer'],this['element']);}},Qn=class extends _0x215f6f{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x3e1137,{part:_0x3ec587,uiIndex:_0x2731e6,areActionsDisabled:_0x8638c3,availableActions:_0x31c85f}){super(_0x3e1137);const _0x169f6e=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1),this['set']('isTrackChangesOn',!0x1);const _0x3bf664=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x8638c3;};this['on']('change:state',_0x3bf664),this['on']('change:isDone',_0x3bf664),_0x3bf664(),this['_children']=this['createCollection'](),this['_headerView']=new Yn(_0x3e1137,{'part':_0x3ec587,'uiIndex':_0x2731e6,'availableActions':_0x31c85f,'areActionsDisabled':_0x8638c3}),this['_headerView']['bind']('isEnabled','state','isTrackChangesOn')['to'](this),this['_headerView']['delegate'](...Nn)['to'](this),this['_streamableContentView']=new qn(_0x3e1137),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x169f6e['to']('state',_0x4e5577=>'ck-ai-suggestion__body__content-part_'+_0x4e5577),_0x169f6e['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x169f6e['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x169f6e['if']('isVisible','ck-hidden',_0x1d72f8=>!_0x1d72f8)]},'children':this['_children'],'on':{'mouseenter':_0x169f6e['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x3ec587['index']});}),'mouseleave':_0x169f6e['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x3ec587['index']});}),'click':_0x169f6e['to'](_0x118875=>{const _0x171f30=_0x118875['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x171f30)&&this['fire']('showChangeInText',{'index':_0x3ec587['index']});})}});}async['updateContent']({part:_0x5999f1,showUnchangedParts:_0x13fddf=!0x1,abortSignal:_0xf17bce}){this['partDefinition']=_0x5999f1,this['isVisible']=this['partDefinition']['hasChanges']||_0x13fddf,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x5999f1,'renderingStrategy':'static','abortSignal':_0xf17bce});}['markAsDone'](){this['isDone']=!0x0;}},Xn=class extends _0x215f6f{constructor(_0x1ab1a6,_0x140815){super(_0x1ab1a6),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x3cea51=>!_0x3cea51)]},'children':this['_createSkeletonItems'](_0x140815)});}['_createSkeletonItems'](_0xaa10f1){const _0x4b8d4c=['ck','ck-ai-skeleton__item'];return _0xaa10f1['map'](_0x12bf36=>{let _0x52f099='';switch(_0x12bf36['attributes']['align']){case'right':_0x52f099='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x52f099='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x52f099='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x12bf36['tag'],'attributes':{'class':[..._0x4b8d4c,_0x12bf36['attributes']['class']?_0x12bf36['attributes']['class']:''],'style':'width:\x20'+_0x12bf36['attributes']['width']+';\x20height:\x20'+_0x12bf36['attributes']['height']+';'+_0x52f099}};});}};const zn={'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':jn(0x5,'100%','44px','right'),'aiChatResources':jn(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 jn(_0x32f0fc,_0x4e4a40,_0x4b2c9d,_0x3865f4){return new Array(_0x32f0fc)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x4e4a40,'height':_0x4b2c9d,'align':_0x3865f4}}));}const Jn=/* #__PURE__ -- @preserve */
33
- ut();var Zn=class extends Jn{['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x7f3853){const _0x554619=this['createTask'](_0x7f3853);return this['queue']['push'](_0x554619),this['_processQueue'](),_0x554619['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(_0x3240fb=>{this['once']('_queueEmpty',()=>{_0x3240fb();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x4f04cb=this['queue']['shift']();try{await _0x4f04cb['callback'](this['_abortController']['signal']),_0x4f04cb['resolve']();}catch(_0x42a655){_0x4f04cb['reject'](_0x42a655);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x43d26e){let _0xb2476c,_0x56a343;const _0x1ca897=new Promise((_0xab3e6c,_0x3e4c2a)=>{_0xb2476c=_0xab3e6c,_0x56a343=_0x3e4c2a;});return{'callback':_0x43d26e,'resolve':_0xb2476c,'reject':_0x56a343,'completePromise':_0x1ca897};}},tr=class extends Vn{constructor(_0x4fe1b7){super(_0x4fe1b7),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x4fe1b7['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x424917){this['element']['innerHTML']=_0x424917;}};const er=['applySuggestion','insertSuggestion'];var ir=class extends _0x215f6f{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x30d9d9,_0x5aa352=[...er],_0x3f6ab2){super(_0x30d9d9);const _0x8d24ae=this['bindTemplate'],_0x18be2d=Boolean(_0x3f6ab2);if(this['set']('isEnabled',!_0x18be2d),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x18be2d){const _0x27863b=new Ht(_0x30d9d9);_0x27863b['set']({'label':us(_0x30d9d9,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4d8e0c}),_0x27863b['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x503c38=new _0x215f6f(_0x30d9d9);_0x503c38['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[us(_0x30d9d9,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x27863b]}]}),this['children']['add'](_0x503c38);}else this['_applyChangesButton']=new Ht(_0x30d9d9),this['_applyChangesButton']['set']({'label':us(_0x30d9d9,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x5aa352['includes']('applySuggestion'),'class':on}),this['_insertSuggestionsButton']=new Ht(_0x30d9d9),this['_insertSuggestionsButton']['set']({'label':us(_0x30d9d9,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x5aa352['includes']('insertSuggestion'),'class':an}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x2190e1=>{_0x2190e1['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',_0x8d24ae['if']('isVisible','ck-hidden',_0x314236=>!_0x314236)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x33fc74){this['isVisible']=_0x33fc74;}['_switchButtonLabelsPlurality'](_0x1c1847){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x1c1847?(this['_applyChangesButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}},sr=class extends _0x215f6f{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x1183f7,_0x12d4f3){super(_0x1183f7),this['bodyCollection']=_0x12d4f3,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',_0x478196=>!_0x478196)]},'children':this['children']});const _0x1ba361=new _0x215f6f(this['locale']),_0x1b9e63=new Yt();_0x1b9e63['content']=at,_0x1ba361['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x1b9e63,{'tag':'span','children':[{'text':us(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x1ba361),this['_setupBalloonPanel'](_0x1183f7);}['addSource'](_0x366130){this['children']['add'](new nr(this['locale'],_0x366130,this['balloonPanelView']));}['_setupBalloonPanel'](_0x5312c9){this['balloonPanelView']=new yt(_0x5312c9),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}},nr=class extends Ht{['balloonPanelView'];['source'];constructor(_0x55410f,_0x2136cb,_0x23d548){super(_0x55410f),this['source']=_0x2136cb,this['balloonPanelView']=_0x23d548,this['set']({'label':_0x2136cb['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x5c4029=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x5c4029['to'](()=>{window['open'](_0x2136cb['url'],'_blank');}),'mouseenter':_0x5c4029['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x5c4029['to'](()=>{this['_hideTooltip']();})}}),_0x2136cb['favicon']){const _0x166ce1=new _0x215f6f(_0x55410f);_0x166ce1['setTemplate']({'tag':'img','attributes':{'src':_0x2136cb['favicon']||at,'alt':_0x2136cb['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x166ce1);}else this['set']('icon',at);}['_createTooltipContentView'](_0x7a3bc8,_0x32d379){const _0x1832f8=new _0x215f6f(_0x7a3bc8),_0x52fc43=[];let _0x12c782;_0x32d379?.['favicon']?(_0x12c782=new _0x215f6f(_0x7a3bc8),_0x12c782['setTemplate']({'tag':'img','attributes':{'src':_0x32d379['favicon'],'alt':_0x32d379['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x12c782=new Yt(),_0x12c782['content']=at,_0x12c782['extendTemplate']({'attributes':{'alt':_0x32d379['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x52fc43['push'](_0x12c782);const _0x2eb3c3=new _0x215f6f(_0x7a3bc8);_0x2eb3c3['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x32d379['url']},'children':[{'text':new URL(_0x32d379['url'])?.['hostname']}]}),_0x52fc43['push'](_0x2eb3c3);const _0x406210=new _0x215f6f(_0x7a3bc8);_0x406210['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x52fc43});const _0x410bc7=new _0x215f6f(_0x7a3bc8);return _0x410bc7['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x32d379['title']['length']>0x190?_0x32d379['title']['substring'](0x0,0x190)+'...':_0x32d379['title']}]}),_0x1832f8['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x406210,_0x410bc7]}),_0x1832f8;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[yt['defaultPositions']['northArrowSouth'],yt['defaultPositions']['northArrowSouthWest'],yt['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 _0x3bb5e9=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x3bb5e9);}},rr=class extends _0x215f6f{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0x5d2c2e(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x3d001a,_0x1a4aca){super(_0x3d001a);const {areActionsDisabled:_0x541196,showUnchangedParts:_0x4de8a2,availableActions:_0x434e21}=_0x1a4aca;this['_areActionsDisabled']=_0x541196,this['_showUnchangedParts']=_0x4de8a2,this['_availableActions']=_0x434e21,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new Xn(_0x3d001a,zn['aiSuggestionBody']),this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now'](),this['_children']['add'](this['_skeletonView']),this['_updateContentPartsPromiseQueue']=new Zn(),this['_emptyPartsWarningView']=new tr({'id':'empty-parts-warning','initialContent':us(_0x3d001a,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ir(_0x3d001a,_0x1a4aca['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new sr(this['locale'],_0x1a4aca['bodyCollection']),_0x1a4aca['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...Nn)['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'](_0x5608ee=>_0x5608ee instanceof Qn);}async['updateContentParts']({parts:_0x40aa42,abortSignal:_0xe51461,skipLoadingEffects:_0x1958b5}){this['_cachedContentParts']['length']?_0x40aa42['forEach'](_0x28855c=>{const _0x5c1876=this['_cachedContentParts']['findIndex'](_0x172df9=>_0x172df9['index']==_0x28855c['index']);-0x1===_0x5c1876?this['_cachedContentParts']['push'](_0x28855c):this['_cachedContentParts'][_0x5c1876]=_0x28855c;}):this['_cachedContentParts']=_0x40aa42;const _0x374e24=this['_showUnchangedParts']?_0x40aa42:_0x40aa42['filter'](_0x4b19fc=>_0x4b19fc['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x374e24['length']>0x1),_0x1958b5&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0xd39898 of _0x374e24)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x574cc7=>{let _0x43f1f5=this['getPartView'](_0xd39898['index']);if(!_0x43f1f5){if(_0x43f1f5=new Qn(this['locale'],{'part':_0xd39898,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x43f1f5['delegate'](...Nn)['to'](this),_0x43f1f5['bind']('isTrackChangesOn')['to'](this),!_0x1958b5&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x574cc7),_0x574cc7['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x43f1f5,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0x1958b5||this['_showSkeletonDebounced']();}await _0x43f1f5['updateContent']({'part':_0xd39898,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x574cc7}),_0x43f1f5['markAsDone']();});return _0xe51461?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x240729,_0x52bb21){const _0x12ee2a=this['getPartView'](_0x240729);_0x12ee2a&&(_0x12ee2a['state']=_0x52bb21),this['hasPendingParts']='pending'==_0x52bb21||this['_contentPartViews']['some'](_0x442adb=>'pending'==_0x442adb['state']);}['setPartActive'](_0x590ebb,_0x8d9cc9){if(!0x1===_0x590ebb){for(const _0x2748f3 of this['_contentPartViews'])_0x2748f3['isActive']=!0x1;}else{const _0x2bcb03=this['getPartView'](_0x590ebb);_0x2bcb03&&(_0x2bcb03['isActive']=_0x8d9cc9);}}['updateSources'](_0x445fde){_0x445fde['forEach'](_0x226384=>this['_sourcesView']['addSource'](_0x226384)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x2d42d8){return this['_contentPartViews']['find'](_0x25fa49=>_0x25fa49['partDefinition']['index']==_0x2d42d8)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x542c19=!this['_cachedContentParts']['find'](({hasChanges:_0x38824c})=>_0x38824c),_0x355746=!!this['_cachedContentParts']['find'](({hasChanges:_0x358087})=>!_0x358087);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x355746,_0x542c19?this['_emptyPartsWarningView']['setContent'](us(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](us(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_contentPartViews']['forEach'](_0x4790a6=>_0x4790a6['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x4c3f46){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x1824bd=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x1824bd>0x0){const {promise:_0x4f3cf1,abortController:_0x542230}=xn(_0x1824bd);_0x4c3f46?.['addEventListener']('abort',()=>_0x542230['abort']()),await _0x4f3cf1['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0x3188e0=>_0x3188e0['partDefinition']['hasChanges'])['length']>0x0;}},or=class extends _0x215f6f{['bodyView'];['children'];['headerView'];constructor(_0x38aa6a,_0x52796d,_0xa21ee5){super(_0x38aa6a);const {showDiff:_0x1f2986,areActionsDisabled:_0x149010,showUnchangedParts:_0x282ff1,availableActions:_0x5e5de3}=_0x52796d;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new Un(_0x38aa6a,{'showDiff':_0x1f2986}),this['headerView']['on']('toggleShowChanges',(_0x3fef17,_0x748d56)=>{this['areChangesVisible']=_0x748d56['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x748d56['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new rr(_0x38aa6a,{'areActionsDisabled':_0x149010,'showUnchangedParts':!!_0x282ff1,'availableActions':_0x5e5de3,'bodyCollection':_0xa21ee5}),this['bodyView']['delegate'](...Nn)['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'](_0xd29a56){await this['bodyView']['updateContentParts'](_0xd29a56);}['updateSources'](_0x2b29c5){this['bodyView']['updateSources'](_0x2b29c5);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}},ar=class extends Vn{['containerView'];constructor(_0x1fad5b,_0x11fd86,_0x541101){super(_0x11fd86),this['set']('isTrackChangesOn',!0x1),this['containerView']=new or(_0x1fad5b,{'showDiff':_0x11fd86['showDiff'],'areActionsDisabled':_0x11fd86['areActionsDisabled'],'availableActions':_0x11fd86['availableActions']},_0x541101),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x1a8813,_0x48b7d8)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x48b7d8['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',(_0x105096,{index:_0x1df433})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x1df433});}),this['containerView']['on']('applySuggestion',(_0x19176d,{index:_0x20a5ca}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x20a5ca});}),this['containerView']['on']('insertSuggestion',(_0x596e6a,{index:_0x598f81}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x598f81});}),this['containerView']['on']('rejectSuggestion',(_0x4ab241,{index:_0x343dda})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x343dda});}),this['containerView']['on']('mouseOverSuggestion',(_0x1174c6,{index:_0x4c6db5})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4c6db5});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x3429de,{index:_0x32b2b2})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x32b2b2});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x9cba72){await this['containerView']['updateContent'](_0x9cba72);}['updatePartState'](_0x117e2c,_0x5eadb0){this['containerView']['bodyView']['updatePartState'](_0x117e2c,_0x5eadb0);}['setPartActive'](_0x181384,_0x24e2d7){!0x1===_0x181384?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x181384,_0x24e2d7);}['updateSources'](_0x4d7e5f){this['containerView']['updateSources'](_0x4d7e5f);}['getPartView'](_0x2ebc6a){return this['containerView']['bodyView']['getPartView'](_0x2ebc6a);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}},hr=class extends Vn{['replyContainer'];['_bodyCollection'];constructor(_0xcd9763,_0x53defe,_0x511072){super(_0x53defe),this['_bodyCollection']=_0x511072,this['locale']=_0xcd9763,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x215f6f(),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':ps(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x393b6b,renderingStrategy:_0xd393f0,abortSignal:_0xd2206d}){'streaming'===_0xd393f0?await this['streamIntoElement'](_0x393b6b,this['replyContainer']['element'],_0xd2206d):this['replyContainer']['element']['innerHTML']=_0x1dbe92(_0x393b6b);}['updateSources'](_0x481327){const _0x428983=new sr(this['locale'],this['_bodyCollection']);_0x428983['children']['addMany'](_0x481327['map'](_0x952bb0=>new nr(this['locale'],_0x952bb0,_0x428983['balloonPanelView']))),_0x428983['isVisible']=!0x0,this['children']['add'](_0x428983);}},cr=class extends _0x3a0dfe{constructor(_0x25f999=void 0x0){super();const _0x46d426=_0x25f999?'ck-ai-spinner_'+_0x25f999:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x46d426]}});}};const lr={'file':_0x43190a,'image':_0xfe36cf,'document':_0x97af05,'web-resource':_0x2906fb,'text':_0x43190a,'selection':_0xc348c2,'mcp-tool-context':_0x97af05},ur='ck-ai-chat-context-chip',dr='ck-ai-chat-context-chip_wide',_r='ck-ai-chat-context-chip_document',gr='ck-ai-chat-context-chip__label',Ar='ck-ai-chat-context-chip__type-icon',Ir='ck-ai-chat-context-controls__chip-tooltip',pr='n';var mr=class extends Ht{constructor(_0x475c26,_0x3166db,_0x437843,_0x599761,_0x4a31c9=!0x1){super(_0x475c26),this['_isAnimationOnEnterEnabled']=_0x599761,this['_initializeProperties'](_0x3166db,_0x437843,_0x4a31c9),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'](_0x51edbf,_0xa563d6,_0x516c6c){this['set']('label',_0x51edbf['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x51edbf['type']),this['set']('id',_0x51edbf['uiId']),this['set']('readonly',_0xa563d6),this['set']('isLoading',_0x516c6c);}['_setupTemplate'](){const _0x57ad15=this['_createIconView'](),_0x2e9e53=this['_createRemoveButton'](),_0x2ab0eb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x2ab0eb),'children':this['_createTemplateChildren'](_0x57ad15,_0x2e9e53,_0x2ab0eb)});}['_createTemplateAttributes'](_0x52a9f1){return{'class':[ur,_0x52a9f1['if']('itemType',_r,_0xbd93d7=>'document'==_0xbd93d7),_0x52a9f1['if']('itemType',dr,_0x59f5c2=>'selection'==_0x59f5c2)],'data-cke-tooltip-text':_0x52a9f1['to']('label',Er),'data-cke-tooltip-position':pr,'data-cke-tooltip-class':Ir};}['_createTemplateChildren'](_0xdac1dd,_0x52e21a,_0x3dd149){const _0x21a787=this['_createLabelElement'](_0x3dd149),_0x5de487=this['_createLoaderIcon']();return this['readonly']?[_0xdac1dd,_0x21a787]:[_0xdac1dd,_0x5de487,_0x21a787,_0x52e21a];}['_createLabelElement'](_0x31ff5d){return{'tag':'span','attributes':{'class':gr},'children':[{'text':_0x31ff5d['to']('label')}]};}['_createRemoveButton'](){const _0x354781=new Ht(this['locale']);return _0x354781['set']({'label':us(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x27af74}),this['_setupRemoveButtonEvent'](_0x354781),_0x354781;}['_setupRemoveButtonEvent'](_0x21d2bb){_0x21d2bb['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x11bc3a=this['bindTemplate'],_0x262373=new Yt();return _0x262373['content']=lr[this['itemType']],_0x262373['extendTemplate']({'attributes':{'class':[Ar,_0x11bc3a['if']('isLoading','ck-hidden',_0x5a1719=>_0x5a1719)]}}),_0x262373;}['_handleAnimationEndOnce'](_0x28a384,_0x1c1bab){if(!_0x28a384)return;const _0x3ecd9b=()=>{_0x1c1bab(),_0x28a384['removeEventListener']('animationend',_0x3ecd9b),_0x28a384['removeEventListener']('webkitAnimationEnd',_0x3ecd9b);};_0x28a384['addEventListener']('animationend',_0x3ecd9b),_0x28a384['addEventListener']('webkitAnimationEnd',_0x3ecd9b);}['_createLoaderIcon'](){const _0x924076=new cr('small');return _0x924076['bind']('isVisible')['to'](this,'isLoading',_0x2135e6=>_0x2135e6),_0x924076;}};function Er(_0x30cdf5){if(!_0x30cdf5)return _0x30cdf5;if(_0x30cdf5['length']<=0x78)return _0x30cdf5;const _0x3de7c3=_0x30cdf5['slice'](0x0,0x78),_0x1bbc6a=_0x3de7c3['lastIndexOf']('\x20');return(_0x1bbc6a>0x0?_0x3de7c3['slice'](0x0,_0x1bbc6a):_0x3de7c3)+'…';}const Tr={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},wr='300px';var Cr=class{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x19c6d6,_0x55eec3,_0x1385a9,_0x4b1afa,_0x23ff37){this['_locale']=_0x19c6d6,this['_visibleChips']=_0x55eec3,this['_config']={...Tr,..._0x1385a9,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x1385a9['cssClasses']}},this['_overflowChips']=new ct(),this['_bodyCollection']=_0x4b1afa,this['_parentView']=_0x23ff37||null;}['setContainerElement'](_0x2cf711){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x2cf711,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 _0x35d3fa=[...this['_visibleChips'],...this['_overflowChips']],_0x462681=this['_createCalculationContainer'](),_0x229621=this['_calculateOverflowInContainer'](_0x462681,_0x35d3fa),_0x4d4c9b=_0x462681['_ancestorsToRestore'];_0x4d4c9b&&this['_restoreAncestorVisibility'](_0x4d4c9b),_0x462681['remove'](),this['_applyOverflowResults'](_0x35d3fa,_0x229621);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x191c5a({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x2585c6=new Ht(this['_locale']);_0x2585c6['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x49062a=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x49062a['push'](this['_config']['cssClasses']['controlsButton']),_0x2585c6['extendTemplate']({'attributes':{'class':_0x49062a}}),_0x2585c6;}['_createShowMoreBalloonPanelView'](){const _0x208474=new yt(this['_locale']);return _0x208474['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x208474),_0x208474;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x2413cc=>{_0x2413cc['disableAnimationOnEnter']();});const _0x594e4f=new _0x215f6f(this['_locale']);_0x594e4f['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x594e4f);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x18d1bd=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x18d1bd?'':'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'](_0x54fd2e){const _0x13de41=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x4d5703=this['_containerElement']?.['classList'];if(_0x4d5703){const _0x22a7fa=_0x4d5703[0x0]||'',_0x4347d4=_0x54fd2e['querySelector']('.'+_0x22a7fa),_0x18a28b=_0x54fd2e['querySelector'](_0x13de41);return _0x4347d4||_0x18a28b||_0x54fd2e;}return _0x54fd2e['querySelector'](_0x13de41)||_0x54fd2e;}['_calculateContainerWidth'](){const _0x40ae39=this['_parentView']?.['element']||this['_containerElement'];if(!_0x40ae39)return wr;const _0x5ec72e=window['getComputedStyle'](_0x40ae39)['width'];if('auto'===_0x5ec72e||'0px'===_0x5ec72e||!_0x5ec72e){const _0x366da0=_0x40ae39['parentElement'];if(_0x366da0){const _0x19e7e9=window['getComputedStyle'](_0x366da0);return'auto'!==_0x19e7e9['width']?_0x19e7e9['width']:wr;}return wr;}return _0x5ec72e;}['_applyCalculationStyles'](_0x30658e,_0x265c33){this['_config']['cssClasses']['calculationContainer']&&_0x30658e['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x30658e['style']['width']=_0x265c33,_0x30658e['style']['position']='absolute',_0x30658e['style']['top']='-9999px',_0x30658e['style']['left']='-9999px',_0x30658e['style']['opacity']='0',_0x30658e['style']['pointerEvents']='none',_0x30658e['style']['zIndex']='-1',_0x30658e['style']['visibility']='visible\x20!important',_0x30658e['style']['display']='block\x20!important',_0x30658e['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x4b749b){_0x4b749b['forEach'](({element:_0x299712,originalDisplay:_0x12b1fb,originalVisibility:_0x2dcf2d})=>{_0x299712['style']['display']=_0x12b1fb,_0x299712['style']['visibility']=_0x2dcf2d;});}['_makeAncestorsVisible'](_0x49b327){const _0x5bec8d=[];let _0xf0a062=_0x49b327;for(;_0xf0a062&&_0xf0a062!==document['body'];){const _0xc057f9=window['getComputedStyle'](_0xf0a062);'none'!==_0xc057f9['display']&&'hidden'!==_0xc057f9['visibility']||(_0x5bec8d['push']({'element':_0xf0a062,'originalDisplay':_0xf0a062['style']['display'],'originalVisibility':_0xf0a062['style']['visibility']}),_0xf0a062['style']['display']='block',_0xf0a062['style']['visibility']='visible'),_0xf0a062=_0xf0a062['parentElement'];}return _0x5bec8d;}['_createContainerElements'](){let _0x555526,_0x22c746;return this['_parentView']?.['element']?(_0x555526=this['_parentView']['element']['cloneNode'](!0x0),_0x22c746=this['_findTargetContainer'](_0x555526)):(_0x555526=document['createElement']('div'),_0x22c746=_0x555526),{'calculationContainer':_0x555526,'targetContainer':_0x22c746};}['_createCalculationContainer'](){const {calculationContainer:_0x5d6466,targetContainer:_0x9961c1}=this['_createContainerElements'](),_0x2d9fc1=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x5d6466,_0x2d9fc1);const _0x3f87dc=(this['_parentView']?.['element']||this['_containerElement'])?.['parentElement'];_0x3f87dc?_0x3f87dc['appendChild'](_0x5d6466):document['body']['appendChild'](_0x5d6466),_0x5d6466['_targetContainer']=_0x9961c1;const _0x42f975=this['_makeAncestorsVisible'](_0x3f87dc||null);return _0x5d6466['offsetWidth'],_0x5d6466['_ancestorsToRestore']=_0x42f975,_0x5d6466;}['_calculateOverflowInContainer'](_0xf676c7,_0x51490c){const _0x4a173d=_0xf676c7['_targetContainer']||_0xf676c7,_0x594ff6=[],{rowCount:_0x5be90b}=this['_renderChipsAndCountRows'](_0x4a173d,_0x51490c);if(_0x5be90b<=this['_config']['maxVisibleRows'])return _0x594ff6;const _0x115044=_0x51490c['slice']();for(;_0x115044['length']>0x0;){if(this['_testButtonFit'](_0xf676c7,_0x4a173d,_0x115044)){const _0x32c8bd=_0x51490c['filter'](_0x3178ba=>!_0x115044['includes'](_0x3178ba));_0x594ff6['push'](..._0x32c8bd);break;}if(!_0x115044['pop']())break;}return _0x594ff6;}['_renderChipsAndCountRows'](_0x54093a,_0x4232ff){_0x54093a['innerHTML']='',_0x4232ff['forEach'](_0x95610c=>{if(_0x95610c['element']){const _0x3a88cc=_0x95610c['element']['cloneNode'](!0x0);_0x54093a['appendChild'](_0x3a88cc);}}),_0x54093a['offsetWidth'];const _0xf3de19=_0x54093a['children'],_0x410fd7=[];return Array['from'](_0xf3de19)['forEach'](_0x349035=>{const _0x375831=_0x349035['getBoundingClientRect']()['top'];_0x410fd7['some'](_0x2e70e1=>Math['abs'](_0x2e70e1-_0x375831)<this['_config']['rowDetectionTolerance'])||_0x410fd7['push'](_0x375831);}),{'rowCount':_0x410fd7['length']};}['_createMockButton'](){const _0x58072f=document['createElement']('button');return _0x58072f['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x58072f['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x58072f['textContent']='+\x201',_0x58072f;}['_testButtonFit'](_0x60612e,_0x34e63d,_0x35d328){this['_renderChipsAndCountRows'](_0x34e63d,_0x35d328);const _0x31778a=this['_createMockButton']();_0x60612e['appendChild'](_0x31778a),_0x60612e['offsetWidth'];const _0x371848=[..._0x34e63d['children'],_0x31778a],_0x11fce9=[];_0x371848['forEach'](_0x1f14b6=>{const _0x15fc13=_0x1f14b6['getBoundingClientRect']()['top'];_0x11fce9['some'](_0x369000=>Math['abs'](_0x369000-_0x15fc13)<this['_config']['rowDetectionTolerance'])||_0x11fce9['push'](_0x15fc13);});const _0xd6c81c=_0x11fce9['length'];return _0x31778a['remove'](),_0xd6c81c<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x581923,_0xf4d51c){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x581923['forEach'](_0x458430=>{_0xf4d51c['includes'](_0x458430)?this['_overflowChips']['add'](_0x458430):this['_visibleChips']['add'](_0x458430);});}['_updateOverflowUI'](_0x1558e3){if(_0x1558e3>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x1558e3>0x0&&this['_showMoreButtonView']){const _0x597068=''+this['_config']['showMoreLabelPrefix']+(_0x1558e3<0x63?_0x1558e3:'99');this['_showMoreButtonView']['label']=_0x597068;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x367076,_0xeec443){this['_distributeChips'](_0x367076,_0xeec443),this['_updateOverflowUI'](_0xeec443['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x1df282=>{_0x1df282[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 _0x4a9b08=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x4a9b08['width']||0x0===_0x4a9b08['height'])return!0x1;const _0x11b6cd=window['innerHeight']||document['documentElement']['clientHeight'],_0x3b8252=window['innerWidth']||document['documentElement']['clientWidth'];return _0x4a9b08['bottom']>=-0xc8&&_0x4a9b08['top']<=_0x11b6cd+0xc8&&_0x4a9b08['right']>=-0xc8&&_0x4a9b08['left']<=_0x3b8252+0xc8;}};const fr='ck-ai-chat__feed__context-chips',br='ck-ai-chat-context-chips-wrapper',Sr='ck-ai-chat-context-chips-wrapper-balloon',Rr='ck-ai-chat-controls-button',Or='ck-ai-chat-controls_context_show-more-button',vr='ck-ai-chat-context-controls__show-more-balloon-panel';var kr=class extends _0x215f6f{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x14cdcb,_0x19f598,_0x291f3c){super(_0x14cdcb),this['_bodyCollection']=_0x291f3c,this['_createContextChips'](_0x19f598);const _0x4787fc={'cssClasses':{'showMoreButton':Or+'\x20'+hn,'showMoreBalloon':vr,'overflowContainer':Sr,'controlsButton':Rr}};this['_overflowManager']=new Cr(_0x14cdcb,this['_contextChips'],_0x4787fc,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[fr,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':br},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x3c1613=this['element']['querySelector']('.'+br);_0x3c1613&&(this['_overflowManager']['setContainerElement'](_0x3c1613),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x3dda8f){for(const _0x534f0a of _0x3dda8f){const _0x40825e=new mr(this['locale'],_0x534f0a,!0x0,!0x1);this['_contextChips']['add'](_0x40825e);}}},Nr=class extends Vn{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x49e063,_0x275552,_0x3d15f8){super(_0x275552),this['_locale']=_0x49e063,this['_bodyCollection']=_0x3d15f8,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 kr(this['_locale'],this['options']['contextItems']['filter'](_0x25aa01=>!_0x25aa01['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x215f6f(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']=this['options']['initialContent'],this['markAsDone']();}},yr=class extends Vn{['capabilities'];constructor(_0x2fd960,_0x12258b){super(_0x12258b);const {isWebSearchEnabled:_0x209a76,isReasoningEnabled:_0x4865f2}=_0x12258b['capabilities'],_0x3fca99=[];let _0x3b7d5d='';_0x209a76&&_0x4865f2?(_0x3b7d5d=us(_0x2fd960,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x3fca99['push'](xr(at)),_0x3fca99['push'](xr(_0x1c8883))):_0x209a76?(_0x3b7d5d=us(_0x2fd960,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x3fca99['push'](xr(at))):_0x4865f2&&(_0x3b7d5d=us(_0x2fd960,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x3fca99['push'](xr(_0x1c8883))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x3b7d5d?'':'ck-hidden']}});const _0x55b722=new _0x215f6f();_0x55b722['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x3fca99,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x3b7d5d]}]}),this['children']['add'](_0x55b722),this['capabilities']=_0x12258b['capabilities'];}};function xr(_0x95988){const _0x3695f0=new Yt();return _0x3695f0['content']=_0x95988,_0x3695f0;}const Lr=['wheel','touchstart','pointerdown','keydown'],Dr=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];var Pr=class{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0x22bb06){this['element']=_0x22bb06,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x11a659 of Lr){const _0x47a75e='keydown'!==_0x11a659;this['element']['addEventListener'](_0x11a659,this['_onUserEvent']['bind'](this),{'passive':_0x47a75e,'signal':this['abortController']['signal']});}}['start']({smooth:_0x3b560d=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x3b560d?'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'](_0x51a51a){if(this['isRunning']){if('keydown'===_0x51a51a['type']){const _0x9a1ffc=_0x51a51a['key'];if(!Dr['includes'](_0x9a1ffc))return;}_0x51a51a instanceof WheelEvent?_0x51a51a['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x18cc92,scrollHeight:_0x1e3786,clientHeight:_0x2a49aa}=this['element'];return _0x1e3786-_0x18cc92-_0x2a49aa<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':this['scrollBehavior']}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}},Hr=class extends Vn{constructor(_0xdb8596){super(_0xdb8596),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']);}},Mr=class extends _0x215f6f{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x2d41d1,_0x5d1771){super(_0x2d41d1),this['_bodyCollection']=_0x5d1771,this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...yn)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Pr(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x2474e0,_0x349779){let _0x5b89fe;return'ai-reply'===_0x2474e0?_0x5b89fe=new hr(this['locale'],_0x349779,this['_bodyCollection']):'ai-suggestion-reply'===_0x2474e0?(_0x5b89fe=new ar(this['locale'],_0x349779,this['_bodyCollection']),_0x5b89fe['bind']('isTrackChangesOn')['to'](this)):_0x5b89fe='user-message'===_0x2474e0?new Nr(this['locale'],_0x349779,this['_bodyCollection']):'interaction-header'===_0x2474e0?new yr(this['locale'],_0x349779):'custom-element'===_0x2474e0?new Hr(_0x349779):new tr(_0x349779),this['children']['add'](_0x5b89fe),_0x5b89fe;}async['updateReplyItem']({id:_0x1baecb,parsedContent:_0x96eb9e,renderingStrategy:_0x38bcfa,abortSignal:_0x259581}){const _0x2fad84=this['getItemById'](_0x1baecb);if(!(_0x2fad84 instanceof hr))throw new ht('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x2fad84,'id':_0x1baecb,'parsedContent':_0x96eb9e});await _0x2fad84['updateContent']({'parsedContent':_0x96eb9e,'renderingStrategy':_0x38bcfa,'abortSignal':_0x259581});}async['updateWebSources'](_0x2aa047,_0x36a2aa){const _0x58a1da=this['getItemById'](_0x2aa047);if(_0x58a1da instanceof ar)_0x58a1da['updateSources'](_0x36a2aa);else{if(!(_0x58a1da instanceof hr))throw new ht('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x58a1da,'id':_0x2aa047,'sources':_0x36a2aa});_0x58a1da['updateSources'](_0x36a2aa);}}async['updateSuggestionItem']({id:_0x2a0644,parts:_0x50d002,abortSignal:_0x8759bb,skipLoadingEffects:_0x14d0bd}){const _0x2cce92=this['getItemById'](_0x2a0644);if(!(_0x2cce92 instanceof ar))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x2cce92,'id':_0x2a0644,'parts':_0x50d002});await _0x2cce92['updateContent']({'parts':_0x50d002,'abortSignal':_0x8759bb,'skipLoadingEffects':_0x14d0bd});}['updateSuggestionPartState']({id:_0x5297f4,index:_0x322b23,state:_0x21c106}){const _0x3d48d6=this['getItemById'](_0x5297f4);if(!(_0x3d48d6 instanceof ar))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x5297f4});_0x3d48d6['updatePartState'](_0x322b23,_0x21c106);}['setSuggestionPartActive']({id:_0x32b70c,index:_0x377996,isActive:_0x38ed0e}){const _0x13222f=this['getItemById'](_0x32b70c);if(!(_0x13222f instanceof ar))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x32b70c});this['children']['filter'](_0x28445d=>_0x28445d instanceof ar)['forEach'](_0x24cd73=>{_0x24cd73['setPartActive'](!0x1);}),_0x13222f['setPartActive'](_0x377996,_0x38ed0e);}['markItemAsDone'](_0x17c70a){this['getItemById'](_0x17c70a)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x48b3bd=>_0x48b3bd['options']['id']);}['removeItem'](_0xaf8084){this['children']['remove'](this['getItemById'](_0xaf8084));}['hasItem'](_0x594cad){return!!this['children']['find'](_0x323553=>_0x323553['options']['id']['includes'](_0x594cad));}['scrollToSuggestion'](_0x3d72e5,_0x56ebda){const _0x2e493e=this['getItemById'](_0x3d72e5);if(!(_0x2e493e instanceof ar))return void bt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x3d72e5,'partIndex':_0x56ebda});const _0xeca349=_0x2e493e['getPartView'](_0x56ebda);_0xeca349?St(_0xeca349['element'],0x14,this['element']['parentElement'],!0x0,!0x0):bt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x3d72e5,'partIndex':_0x56ebda});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x162706=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x162706,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0xd7a71d=new Xn(this['locale'],zn['aiFeed']);return _0xd7a71d['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0xd7a71d;}['_createFeedItems'](){const _0x50a862=new _0x215f6f(this['locale']);return _0x50a862['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x50a862;}['_createFeedLoader'](){const _0x170b11=new _0x215f6f(this['locale']);return _0x170b11['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x2c5bc2=>!_0x2c5bc2)]},'children':this['_createLoaderChildren']()}),_0x170b11;}['_createLoaderChildren'](){const _0x137801=new cr();return _0x137801['isVisible']=!0x0,[_0x137801,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x121f78){const _0x4e7ac=this['children']['find'](_0x1ec20b=>_0x1ec20b['options']['id']['includes'](_0x121f78));if(!_0x4e7ac)throw new ht('ai-chat-feed-view-item-not-found',this,{'id':_0x121f78});return _0x4e7ac;}['setLoadingMessage'](_0x5611ae){this['set']('loadingMessage',_0x5611ae);}['toggleLoadingSkeleton'](_0x3278e0){this['set']('isLoadingSkeletonVisible',_0x3278e0);}['startAutoScroll'](_0x1f7924={}){this['scrollManager']['start'](_0x1f7924);}['stopAutoScroll'](){this['scrollManager']['stop']();}},Vr=class extends jt{['filter'](){let _0x590c3f=0x0;for(const _0x3d4dec of this['items'])_0x590c3f+=_0x3d4dec['items']['length'];return{'resultsCount':_0x590c3f,'totalItemsCount':_0x590c3f};}};function Ur(_0x1c0c06){const _0x40fab3=[];let _0x29edf3=!0x1;for(const _0x168d77 of Array['from'](_0x1c0c06['items'])){if('file'!==_0x168d77['kind'])continue;if(_0x168d77['webkitGetAsEntry']()?.['isDirectory']){_0x29edf3=!0x0;continue;}const _0x3550fd=_0x168d77['getAsFile']();_0x3550fd&&_0x40fab3['push'](_0x3550fd);}return{'files':_0x40fab3,'hasDirectory':_0x29edf3};}const Br='ck-ai-chat__prompt-input_highlighted';var Gr=class AIChatPromptInputView extends Nt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x594a8b,_0x1d0c2a){super(_0x594a8b,{'queryView':{'label':'','creator':_0x30e284,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Vr(_0x594a8b),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x1d0c2a,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',(_0x2f7902,_0x38d1e3)=>!_0x2f7902&&!_0x38d1e3),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x354fd7,_0x25505e)=>{this['isUploadInProgress']||this['isEmpty']||_0x354fd7['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x25505e());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();}),this['queryView']['fieldView']['element']['addEventListener']('paste',_0x399204=>this['_handlePaste'](_0x399204)),this['element']['addEventListener']('drop',_0x5861a3=>this['_handleDrop'](_0x5861a3));}['_handlePaste'](_0x1d1742){const _0x16941e=_0x1d1742['clipboardData'];if(!_0x16941e)return;const {files:_0x32bf56,hasDirectory:_0xd2a28c}=Ur(_0x16941e),_0x162675={'files':_0x32bf56,'plainText':_0x16941e['getData']('text/plain'),'hasDirectory':_0xd2a28c,'forceTextAttachment':!0x1,'preventDefault':()=>_0x1d1742['preventDefault']()};this['fire']('promptInputPaste',_0x162675);}['_handleDrop'](_0x2dbfb8){const _0x3be5f3=_0x2dbfb8['dataTransfer'];if(!_0x3be5f3)return;const _0x5ba208={'files':[],'plainText':_0x3be5f3['getData']('text/uri-list')||_0x3be5f3['getData']('text/plain'),'hasDirectory':!0x1,'forceTextAttachment':!0x1,'preventDefault':()=>_0x2dbfb8['preventDefault']()};this['fire']('promptInputPaste',_0x5ba208);}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0xb2aff6=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0xb2aff6)return this['queryView']['errorText']=us(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x4bb3ea=_0x33f243(_0xb2aff6);this['fire']('sendUserMessage',_0x4bb3ea),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x2a4b78){this['queryView']['fieldView']['set']('placeholder',_0x2a4b78);}['focus'](_0x668ea5=!0x1){super['focus'](),_0x668ea5&&(this['element']['classList']['contains'](Br)||(this['element']['classList']['add'](Br),setTimeout(()=>{this['element']['classList']['remove'](Br);},0x320)));}['_createSubmitButton'](){const _0x40bbd0=new Ht(this['locale']);return _0x40bbd0['set']({'icon':st,'label':us(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+on,'isEnabled':!0x1}),_0x40bbd0['on']('execute',()=>{this['submit']();}),_0x40bbd0;}['setIsUploadInProgress'](_0x4410f3){this['isUploadInProgress']=_0x4410f3;}['_setUpAddContextButtonPositioning'](){const _0x42cb7c=this['locale'],_0x1daa9f=()=>{Tt['window']['requestAnimationFrame'](()=>{if(Ct(this['element'])){const _0x4215b4=new At(this['queryView']['fieldView']['element']),_0x57eb47=new At(this['_addContextButtonView']['element']),_0x287fba=_0x4215b4['width'],_0xaa3cab='rtl'===_0x42cb7c['uiLanguageDirection']?'right':'left';_0x4215b4['excludeScrollbarsAndBorders']();const _0x25da01=_0x287fba-_0x4215b4['width']+0x1;this['_addContextButtonView']['element']['style'][_0xaa3cab]='calc('+(_0x287fba-_0x57eb47['width']-_0x25da01)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x1daa9f),this['on']('render',()=>{_0x1daa9f(),this['_queryViewResizeObserver']=new It(this['queryView']['fieldView']['element'],()=>{_0x1daa9f();});});}},Fr=class extends _0x215f6f{constructor(_0x38c245){super(_0x38c245);const _0x4dc307=new Yt();_0x4dc307['content']=_0x43190a,this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls__drop-overlay']},'children':[_0x4dc307,{'tag':'span','attributes':{'class':['ck-ai-chat-controls__drop-overlay__label']},'children':[{'text':us(_0x38c245,'AI_CHAT_DROP_ZONE_HINT')}]}]});}['attach'](_0x60af86){let _0xf3c5e7=0x0;_0x60af86['addEventListener']('dragenter',_0x211221=>{_0x211221['dataTransfer']&&(_0xf3c5e7++,0x1===_0xf3c5e7&&this['fire']('dragEnter'),_0x60af86['classList']['add']('ck-ai-chat-controls_drag-over'));}),_0x60af86['addEventListener']('dragover',_0x38d668=>{_0x38d668['dataTransfer']&&_0x38d668['preventDefault']();}),_0x60af86['addEventListener']('dragleave',()=>{--_0xf3c5e7<=0x0&&(_0xf3c5e7=0x0,_0x60af86['classList']['remove']('ck-ai-chat-controls_drag-over'));}),_0x60af86['addEventListener']('drop',_0x5084c3=>{_0x5084c3['preventDefault'](),_0xf3c5e7=0x0,_0x60af86['classList']['remove']('ck-ai-chat-controls_drag-over'),this['_handleDrop'](_0x5084c3);});}['_handleDrop'](_0x2e44b6){const _0x29af66=_0x2e44b6['dataTransfer'];if(!_0x29af66)return;const {files:_0x524a54,hasDirectory:_0x53106a}=Ur(_0x29af66),_0x17c04d={'files':_0x524a54,'plainText':_0x29af66['getData']('text/uri-list')||_0x29af66['getData']('text/plain'),'hasDirectory':_0x53106a,'forceTextAttachment':!0x0,'preventDefault':()=>{}};this['fire']('promptInputPaste',_0x17c04d);}};const Kr='ck-ai-chat__prompt-capabilities',Wr='ck-ai-chat-controls-button',Yr='ck-ai-chat-controls-button--commands',$r='ck-ai-chat-controls__model-selection',qr='ck-ai-chat-controls__model-selection__item-name',Qr='ck-ai-chat-controls__model-selection__item-description',Xr='ck-ai-chat-controls__model-selection__item-capabilities',zr='n';var jr=class extends _0x215f6f{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x1f97e0){super(_0x1f97e0),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',_0x50b645=>'selector'===_0x50b645),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x3719d4=>_0x3719d4?this['_modelSelectionDropdown']['buttonView']['label']:us(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x166193=>_0x166193),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x2b4831=>_0x2b4831),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x3be5bd=>us(this['locale'],_0x3be5bd?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x22fc12=>_0x22fc12),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x175de2=>us(this['locale'],_0x175de2?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Kr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new ct(),_0x1d523e(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x5ed1bb,_0xff902){if(_0xff902)this['set']('modelDisplayMode','hidden');else{const _0x303d2b=0x1===_0x5ed1bb['length'];this['set']('modelDisplayMode',_0x303d2b?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x5ed1bb?.['length'])for(const _0x2bc90c of _0x5ed1bb){const _0x169293=new _0x24dcce({'label':_0x2bc90c['name'],'withText':!0x0,'role':'menuitemradio','id':_0x2bc90c['id'],'model':_0x2bc90c});_0x169293['bind']('isOn')['to'](this,'activeModelId',_0x3b1ba4=>_0x3b1ba4===_0x2bc90c['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x169293,'labelView':new Jr(this['locale'],_0x2bc90c)});}}['setWebSearch'](_0xb8643e){this['set']('webSearchActive',_0xb8643e);}['setReasoning'](_0x38e273){this['set']('reasoningActive',_0x38e273);}['setModel'](_0x19be92){if(!_0x19be92)return;this['activeModelId']=_0x19be92['id'],this['activeModelName']=_0x19be92['name']||_0x19be92['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x19be92['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x19be92['name']);const _0x147bc1=_0x19be92['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x147bc1),this['_webSearchButton']['set']('isVisible',_0x147bc1);const _0x3f698f=_0x19be92['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x3f698f),this['_reasoningButton']['set']('isVisible',_0x3f698f);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x24d3b0){this['set']('modelSelectorEnabled',!0x1),_0x24d3b0&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x2255b1=new Ht();return _0x2255b1['set']({'label':us(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':at,'class':Wr+'\x20'+hn,'isToggleable':!0x0,'tooltipPosition':zr}),_0x2255b1['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x2255b1;}['_createReasoningButton'](){const _0x1d4951=new Ht();return _0x1d4951['set']({'label':us(this['locale'],'AI_CHAT_REASONING'),'icon':_0x1c8883,'class':Wr+'\x20'+hn,'isToggleable':!0x0,'tooltipPosition':zr}),_0x1d4951['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x1d4951;}['_createCommandsButton'](){const _0x4ee295=new Ht();return _0x4ee295['set']({'label':us(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x170240,'withText':!0x0,'class':Wr+'\x20'+hn,'isToggleable':!0x0,'tooltip':us(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':zr}),_0x4ee295['extendTemplate']({'attributes':{'class':[Yr]}}),_0x4ee295['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x4ee295;}['_createModelSelectionDropdown'](){const _0x39158d=_0x32dc43(this['locale']);return _0x39158d['set']({'panelPosition':'ne','class':[$r]}),_0x39158d['buttonView']['set']({'label':us(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':zr,'class':hn}),this['listenTo'](_0x39158d,'execute',_0x4e72db=>{this['fire']('selectModel',_0x4e72db['source']['model']);}),_0x39158d;}['_createModelNameView'](){const _0x1265f3=new Zr(this['locale']);return _0x1265f3['bind']('text')['to'](this,'activeModelName',_0x5d558d=>_0x5d558d??''),_0x1265f3['bind']('isVisible')['to'](this,'modelDisplayMode',_0xd35861=>'name'===_0xd35861),_0x1265f3;}},Jr=class extends Dt{constructor(_0x3f3ee3,_0x3f5a4d){super();const _0x435851=this['bindTemplate'],_0xe6c49f=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x435851['to']('style'),'id':_0x435851['to']('id')},'children':[{'tag':'div','attributes':{'class':[qr]},'children':[{'text':_0x435851['to']('text')}]},{'tag':'div','attributes':{'class':[Qr]},'children':[{'tag':'span','children':[{'text':_0x3f5a4d['description']}]}]},{'tag':'div','attributes':{'class':[Xr]},'children':_0xe6c49f}]}),_0xe6c49f['addMany'](this['_getCapabilityParts'](_0x3f3ee3,at,'AI_CHAT_SEARCH_WEB',_0x3f5a4d['capabilities']['webSearch']?.['enabled']??!0x1)),_0xe6c49f['addMany'](this['_getCapabilityParts'](_0x3f3ee3,_0x1c8883,'AI_CHAT_REASONING',_0x3f5a4d['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x3744a0,_0x419365,_0x579418,_0x4a71a2){const _0x20edfc=new Yt();_0x20edfc['content']=_0x419365;const _0x59c17f=new _0x215f6f(_0x3744a0);_0x59c17f['setTemplate']({'tag':'span','children':[{'text':us(_0x3744a0,_0x579418)+':\x20'}]});const _0x222f31=new _0x215f6f(_0x3744a0);return _0x222f31['setTemplate']({'tag':'span','children':[{'text':us(_0x3744a0,_0x4a71a2?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x20edfc,_0x59c17f,_0x222f31];}},Zr=class extends _0x215f6f{constructor(_0x456158){super(_0x456158),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x110750=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x110750['if']('isVisible','ck-hidden',_0x54b7e9=>!_0x54b7e9)]},'children':[{'text':_0x110750['to']('text')}]});}};const to='ck-ai-chat-context-controls__url-form',eo='ck-ai-chat-context-controls__url-input-section';var io=class extends _0x215f6f{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x469303){super(_0x469303),this['focusTracker']=new dt(),this['keystrokes']=new _t(),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 Gt({'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'](_0xd36b0e=>{this['focusTracker']['add'](_0xd36b0e['element']),this['keystrokes']['listenTo'](_0xd36b0e['element']);}),_0x1dbba7({'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'](_0x340dee){this['urlInputField']['errorText']=_0x340dee,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x384ffa=new Ht(this['locale']);return _0x384ffa['set']({'icon':_0x1901d7,'tooltip':us(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x5a294b,_0x3dc48a,_0x16935e)=>{_0x384ffa['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x16935e?'':'\x20ck-hidden')]});}),_0x384ffa;}['_createUrlInputField'](){const _0x129cca=new qt(this['locale'],_0x4fc470);return _0x129cca['set']({'label':us(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x129cca['fieldView']['set']({'placeholder':us(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x129cca;}['_createConfirmButton'](){const _0x3a4644=new Ht(this['locale']);return _0x3a4644['set']({'icon':_0x27c014,'tooltip':us(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x3a4644;}['_setupTemplate'](){const _0x6f154a=new Ft(this['locale'],{'label':us(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x6f154a['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':to,'tabindex':'-1'},'children':[_0x6f154a,{'tag':'div','attributes':{'class':eo},'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',_0x2360e4=>{_0x2360e4['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x62e6a6,_0x7b5ab1)=>{this['clear'](),this['fire']('cancel'),_0x7b5ab1();});}['_handleSubmit'](){const _0x116a18=this['getValue']()['trim']();_0x116a18?this['_isValidUrl'](_0x116a18)?(this['clearError'](),this['fire']('submitUrl',_0x116a18)):this['setError'](us(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](us(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x53d6d7=this['getValue']()['trim'](),_0x2d82c5=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x53d6d7['length']>0x0&&!_0x2d82c5;}['_isValidUrl'](_0x217a63){try{return!!new URL(_0x217a63);}catch{return!0x1;}}};const so='ck-ai-chat-resources__item',no='ck-ai-chat-resources__item--in-context',ro='ck-ai-chat-resources__item-title',oo='ck-ai-chat-resources__item__icon';var ao=class extends zt{['resource'];['_titleView'];['_iconView'];constructor(_0x5667c6,_0x55b811){super(_0x5667c6),this['resource']=_0x55b811,this['set']('isInContext',!!_0x55b811['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x280d45){if(_0x280d45['isInContext'])return _0x27c014;switch(_0x280d45['type']){case'document':return _0x97af05;case'web-resource':return _0x2906fb;case'file':case'text':return _0x43190a;default:return _0x31a9ab;}}['highlightText'](_0x2758fd){if(!_0x2758fd||''===_0x2758fd['trim']())return void this['_titleView']['highlightText'](null);const _0x56129c=new RegExp(_0x49ade4(_0x2758fd),'gi');this['_titleView']['highlightText'](_0x56129c);}['updateResourceState'](_0x39f93d){this['resource']['isInContext']=_0x39f93d,this['isInContext']=_0x39f93d,this['_updateIcon']();}['_createTitleView'](){const _0x3f4f1d=new Wt();return _0x3f4f1d['text']=this['resource']['label'],_0x3f4f1d['extendTemplate']({'tag':'span','attributes':{'class':[ro]}}),_0x3f4f1d;}['_createIconView'](){const _0x12c7a3=new Yt();return _0x12c7a3['content']=this['getResourceIcon'](this['resource']),_0x12c7a3;}['_setupTemplate'](){const _0x1a8257=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[so,_0x1a8257['if']('isVisible','ck-hidden',_0x8e99bb=>!_0x8e99bb),_0x1a8257['if']('isInContext',no)]},'children':[{'tag':'div','attributes':{'class':[oo]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x1a8257['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}};const ho='ck-ai-chat-resources__list';var co=class extends jt{['_source'];constructor(_0x53a9e8,_0x4179ce){super(_0x53a9e8),this['_source']=_0x4179ce,this['extendTemplate']({'attributes':{'class':[ho]}});}['setResources'](_0x5ab803,_0x4ba506){this['items']['clear']();let _0x28dc0f=_0x5ab803;if(this['_source']['useDefaultFiltering']&&_0x4ba506&&''!==_0x4ba506['trim']()){const _0x582e2e=new RegExp(_0x4ba506['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x28dc0f=_0x5ab803['filter'](_0x4bcd1d=>_0x582e2e['test'](_0x4bcd1d['label']));}for(const _0x2fb80a of _0x28dc0f){const _0x317df5=new ao(this['locale'],_0x2fb80a);_0x317df5['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x2fb80a);}),this['items']['add'](_0x317df5);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x4ba506);}['highlightText'](_0x3c00b0){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x573268=>{_0x573268['highlightText'](_0x3c00b0);});}['updateResourceState'](_0x50571c,_0xaaae0a){for(const _0x15d791 of this['items']){const _0x3cabd8=_0x15d791;_0x3cabd8['resource']['id']===_0x50571c&&_0x3cabd8['updateResourceState'](_0xaaae0a);}}['_handleResourceSelection'](_0x3019f3,_0x292c57){this['fire']('addResourceToContext',{'source':_0x3019f3,'resource':_0x292c57});}},lo=class extends qt{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x24375d){const t=_0x24375d['t'],_0x232942={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x4fc470,'label':us(_0x24375d,'AI_CHAT_SEARCH_RESOURCES')};super(_0x24375d,_0x232942['creator']),this['label']=_0x232942['label'],this['_viewConfig']=_0x232942,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x24375d,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x4f7009){this['fire']('search',_0x4f7009);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new Yt(),this['iconView']['content']=_0x11ac1a,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x2575d4,t){this['resetButtonView']=new Ht(_0x2575d4),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x27af74,'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',_0x16e6d2=>!_0x16e6d2),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);}},uo=class extends _0x215f6f{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x2cbc93,_0x4ca663){super(_0x2cbc93),this['_source']=_0x4ca663['source'],this['_searchInputVisibleFrom']=_0x4ca663['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 _0x498844([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new lo(this['locale']);}['_createSearchSection'](){const _0x315720=new _0x215f6f(this['locale']);return _0x315720['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x634735,_0x135eaa)=>{this['loadResources'](_0x135eaa),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x135eaa);}),_0x315720;}['_createResourcesListView'](){const _0x31799d=new co(this['locale'],this['_source']);return _0x31799d['delegate']('addResourceToContext')['to'](this),_0x31799d['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x31799d;}['_createSkeletonView'](){const _0x3f6e3a=new Xn(this['locale'],zn['aiChatResources']);return _0x3f6e3a['bind']('isVisible')['to'](this,'isLoading'),_0x3f6e3a;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x46ae5c){const _0x48a96c=vt();this['_latestLoadResourcesUid']=_0x48a96c,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x46ae5c,'uid':_0x48a96c}),this['isLoading']=!0x0;}['setResources'](_0x5ecf94,_0x1c83f2){if(_0x1c83f2&&_0x1c83f2!==this['_latestLoadResourcesUid'])return;const _0x1f819e=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x5ecf94,_0x1f819e),_0x5ecf94['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x15c216,_0x1dc813){this['_resourcesListView']['updateResourceState'](_0x15c216,_0x1dc813);}};const _o='ck-ai-chat-context-controls__source-balloon-panel',go='ck-button-icon\x20ck-button-back',Ao='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';var Io=class{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x146415,_0x3ed044,_0x24252b){this['_locale']=_0x146415,this['_bodyCollection']=_0x3ed044,this['_config']=_0x24252b;}['showSourceResourcesBalloon']({source:_0x39ebca,withBackButton:_0x3873a3}){let _0x574c64=this['_sourceResourceBalloons']['get'](_0x39ebca['id']);_0x574c64||(_0x574c64=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x39ebca['id'],_0x574c64),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x574c64)),this['_addSourceResourceContent']({'balloonPanel':_0x574c64,'source':_0x39ebca,'withBackButton':_0x3873a3}),_0x574c64['show']();const _0x55c108=this['_config']['getTargetElement']();_0x55c108&&_0x574c64['pin']({'target':_0x55c108,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x16b2de,_0x3a1337,_0x117807){const _0x2ec053=this['_sourceResourceBalloons']['get'](_0x16b2de);if(!_0x2ec053)return;const _0x19b56c=this['_getResourcesViewFromBalloon'](_0x2ec053);_0x19b56c&&(_0x19b56c['setResources'](_0x3a1337,_0x117807),_0x19b56c['once']('change:isLoading',()=>{_0x2ec053['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x55e021){const _0x2a215b=this['_sourceResourceBalloons']['get'](_0x55e021);_0x2a215b&&requestAnimationFrame(()=>{_0x2a215b['hide'](),this['_sourceResourceBalloons']['delete'](_0x55e021),this['_config']['onBalloonClosed']();});}['closeAll'](){for(const _0x47e944 of Array['from'](this['_sourceResourceBalloons']['keys']()))this['closeSourceResourceBalloon'](_0x47e944);}['isAnyResourceBalloonVisible'](){for(const _0x5125f5 of this['_sourceResourceBalloons']['values']())if(_0x5125f5['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x4ac40b,_0x3aab5c,_0x1271a){const _0x3c94b8=this['_sourceResourceBalloons']['get'](_0x4ac40b);if(!_0x3c94b8||!_0x3c94b8['isVisible'])return;const _0x158cd6=this['_config']['getTargetElement']();if(!_0x158cd6)return;_0x3c94b8['pin']({'target':_0x158cd6,'limiter':this['_config']['getLimiterElement']()});const _0xb8c922=this['_getResourcesViewFromBalloon'](_0x3c94b8);_0xb8c922&&_0xb8c922['updateResourceState'](_0x3aab5c,_0x1271a);}['destroy'](){for(const _0x5e3b99 of this['_sourceResourceBalloons']['values']())_0x5e3b99['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x2836c0=new yt(this['_locale']);return _0x2836c0['extendTemplate']({'attributes':{'class':_o}}),this['_bodyCollection']['add'](_0x2836c0),_0x2836c0;}['_addSourceResourceContent']({balloonPanel:_0x5bdca6,source:_0x317347,withBackButton:_0x1d4548}){_0x5bdca6['content']['clear']();const _0x2b2916=this['_createBalloonHeader']({'balloonPanel':_0x5bdca6,'source':_0x317347,'withBackButton':_0x1d4548});_0x5bdca6['content']['add'](_0x2b2916);const _0x10c6a5=this['_createBalloonResourcesView'](_0x317347);_0x5bdca6['content']['add'](_0x10c6a5);}['_createBalloonHeader']({balloonPanel:_0x418c75,source:_0x63c63,withBackButton:_0x51f0b4}){const _0x4fba98=new Ft(this['_locale'],{'label':_0x63c63['label'],'class':Ao});return _0x51f0b4&&_0x4fba98['children']['add'](this['_createBackButton'](_0x418c75),0x0),_0x4fba98;}['_createBackButton'](_0xefc740){const _0x1a3cd6=new Ht(this['_locale']);return _0x1a3cd6['set']({'icon':_0x1901d7,'tooltip':us(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':go}),_0x1a3cd6['on']('execute',()=>{_0xefc740['hide'](),this['_config']['onBackToContext']();}),_0x1a3cd6;}['_createBalloonResourcesView'](_0x53f925){const _0x1bb096=new uo(this['_locale'],{'source':_0x53f925,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x1bb096['on']('loadSourceResources',(_0x4a4390,_0x2a22ef)=>{this['_config']['onLoadSourceResources'](_0x2a22ef);}),_0x1bb096['on']('addResourceToContext',(_0x463992,_0x277ff4)=>{this['_config']['onResourceSelected'](_0x277ff4['source'],_0x277ff4['resource']),this['closeSourceResourceBalloon'](_0x53f925['id']);}),_0x1bb096;}['_getResourcesViewFromBalloon'](_0x224a05){const _0x5d5384=_0x224a05['content']['get'](0x1);return _0x5d5384 instanceof uo?_0x5d5384:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x38464f){_0x191c5a({'emitter':_0x38464f,'contextElements':[_0x38464f['element']],'callback':()=>{_0x38464f['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x38464f['isVisible']});}};const po=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],mo='ck-ai-chat-context-controls',Eo='ck-ai-chat-context-controls__pending-contexts',To='ck-ai-chat-context-controls__add-context-balloon-panel',wo='ck-ai-chat-context-controls__add-context-button',Co='ck-ai-chat-context-controls__url-balloon-panel',fo='ck-ai-chat-context-controls__balloon-button',bo='ck-ai-chat-context-controls__balloon-button-source',So='ck-ai-chat-controls-button',Ro='ck-ai-chat-context-chips-wrapper-balloon',Oo='ck-ai-chat-controls_context_show-more-button',vo='ck-ai-chat-context-controls__show-more-balloon-panel',ko='ck-ai-chat',No=[yt['defaultPositions']['northArrowSouthWest'],yt['defaultPositions']['northArrowSouth'],yt['defaultPositions']['northArrowSouthEast'],yt['defaultPositions']['southArrowNorthWest'],yt['defaultPositions']['southArrowNorth'],yt['defaultPositions']['southArrowNorthEast']];var yo=class extends _0x215f6f{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x422018,_0x3a0afe){super(_0x422018),this['bodyCollection']=_0x3a0afe['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x422018),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x422018),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x422018),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x422018,_0x3a0afe);const _0x5c0c94={'cssClasses':{'showMoreButton':Oo+'\x20'+hn,'showMoreBalloon':vo,'overflowContainer':Ro,'controlsButton':So}};this['_overflowManager']=new Cr(_0x422018,this['_currentContextsChips'],_0x5c0c94,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'](_0x45e8d2,_0x25d80e){const _0x18df6c=this['_createContextButton'](_0x45e8d2,'current',!0x0,_0x25d80e);this['_addContextToCollection'](_0x18df6c,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x16c978){this['_removeContextFromCollection'](_0x16c978,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x16c978,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x3c2c62,_0x36e0a8){let _0x409fdc=this['_currentContextsChips']['find'](_0x292540=>_0x292540['id']===_0x3c2c62);_0x409fdc||(_0x409fdc=this['_overflowManager']['overflowChips']['find'](_0x2958a1=>_0x2958a1['id']===_0x3c2c62)),_0x409fdc&&(_0x409fdc['isLoading']=_0x36e0a8);}['setConversationContext'](_0x5f3816){this['_conversationContextsChips']['clear']();for(const _0x200b5c of _0x5f3816){const _0x4e3de2=this['_createContextButton'](_0x200b5c,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x4e3de2,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x38e177,_0x141bea,_0x139d9b){this['_resourcesBalloonView']['updateResourceState'](_0x38e177,_0x141bea,_0x139d9b);}['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:_0x11d960,withBackButton:_0xe11b88}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x11d960,'withBackButton':_0xe11b88}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x5147cf,_0x49ab17,_0x1fcce5,_0x14e4c2){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x5147cf,_0x1fcce5,_0x14e4c2);}['closeSourceResourceBalloon'](_0x26f55b){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x26f55b),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x33e6d1){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x33e6d1),this['_setAddContextButtonEnabled'](_0x33e6d1);}['_setAddContextButtonEnabled'](_0x54a9e9){const _0x286edf=!_0x54a9e9['document']['isHidden']&&_0x54a9e9['document']['enabled'],_0x298b6d=_0x54a9e9['urls']['enabled'],_0x3a8f74=_0x54a9e9['files']['enabled'],_0x199072=_0x54a9e9['sources']['length']>0x0,_0x5dfbf3=_0x54a9e9['customItems']&&_0x54a9e9['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x286edf||_0x298b6d||_0x3a8f74||_0x199072||_0x5dfbf3;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[mo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Eo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x2b0588){const _0x4aa3ca=new Ht(_0x2b0588);return _0x4aa3ca['set']({'label':us(_0x2b0588,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':So+'\x20'+wo+'\x20'+hn,'icon':_0x14f9ee,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x4aa3ca;}['_createAddContextBalloonPanelView'](_0x59d288){return this['_createBaseBalloonPanel'](_0x59d288,To);}['_createUrlBalloonPanelView'](_0x29a25c){const _0x310ad1=this['_createBaseBalloonPanel'](_0x29a25c,Co);return this['_addUrlContent'](_0x310ad1,_0x29a25c),_0x310ad1;}['_createResourcesBalloonView'](_0x1f7f6e,_0x404daa){const _0xd582aa={'searchInputVisibleFrom':_0x404daa['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':No});},'onResourceSelected':(_0x482c77,_0x248196)=>{this['fire']('addResourceToContext',{'source':_0x482c77,'resource':_0x248196});},'onLoadSourceResources':_0xc316c1=>{this['fire']('loadSourceResources',_0xc316c1);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Io(_0x1f7f6e,_0x404daa['bodyCollection'],_0xd582aa);}['_getLimiterElement'](){return this['element']?.['closest']('.'+ko)||document['body'];}['_createBaseBalloonPanel'](_0x4caf57,_0x37ce68){const _0x55b8d9=new yt(_0x4caf57);return _0x55b8d9['extendTemplate']({'attributes':{'class':_0x37ce68}}),this['bodyCollection']['add'](_0x55b8d9),_0x55b8d9;}['_setBalloonPanelContent'](_0x5082b4,_0x17bdc6,_0x48faa5){if(_0x5082b4['content']['clear'](),!_0x48faa5['document']['isHidden']&&_0x48faa5['document']['enabled']){const _0x5e52bf=this['_createBalloonButton'](_0x17bdc6,{'label':us(_0x17bdc6,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x97af05});_0x5e52bf['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x5082b4['content']['add'](_0x5e52bf);}if(_0x48faa5['urls']['enabled']){const _0x5a4607=this['_createBalloonButton'](_0x17bdc6,{'label':us(_0x17bdc6,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x2906fb});_0x5a4607['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':No}),this['_urlInputView']['focus']();}),_0x5082b4['content']['add'](_0x5a4607);}if(_0x48faa5['files']['enabled']){const _0x519656=new Bt(_0x17bdc6);_0x519656['set']({'label':us(_0x17bdc6,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x50cb94,'withText':!0x0,'tooltip':!0x0,'class':fo,'allowMultipleFiles':!0x0}),_0x519656['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x519656['on']('done',(_0xdfc5c,_0x1bd76f)=>{this['fire']('addFileToContext',_0x1bd76f);}),_0x519656['tooltip']=!0x0,_0x5082b4['content']['add'](_0x519656);}for(const _0x53ed05 of _0x48faa5['sources']){const _0x3c2b07=this['_createBalloonButton'](_0x17bdc6,{'label':_0x53ed05['label'],'icon':_0x53ed05['icon']||_0x31a9ab,'type':'source'});_0x5082b4['content']['add'](_0x3c2b07),_0x3c2b07['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x53ed05,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x200440 of _0x48faa5['customItems']||[]){const _0x58c3c5=this['_createBalloonButton'](_0x17bdc6,{'label':_0x200440['label'],'icon':_0x200440['icon']||_0x31a9ab,'type':'customItem'});_0x5082b4['content']['add'](_0x58c3c5),_0x58c3c5['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x200440);});}this['_hasExactlyOneSource']=0x1===_0x5082b4['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x349630,_0x22bacb){this['_urlInputView']=new io(_0x22bacb),this['_urlInputView']['on']('submitUrl',(_0x5c84a4,_0x597c98)=>{this['_handleUrlSubmit'](_0x597c98);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':No}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':No});}),_0x349630['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x13ef88,_0x3f80eb){const _0x30021d='source'===_0x3f80eb['type']?new xo(_0x13ef88):new Ht(_0x13ef88);return _0x30021d['set']({'label':_0x3f80eb['label'],'icon':_0x3f80eb['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':fo}),_0x30021d;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x191c5a({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0xf48167){const _0x57e7f9=this['_addContextBalloonConfig'];_0x57e7f9['buttonView']['isOn']=_0xf48167,_0xf48167?_0x57e7f9['balloonView']['show']():_0x57e7f9['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x1d93a7,buttonView:_0x48bb98,hideMethod:_0x2ac746}=this['_addContextBalloonConfig'];_0x191c5a({'emitter':_0x1d93a7,'contextElements':[_0x1d93a7['element'],_0x48bb98['element']],'callback':()=>{_0x2ac746();},'activator':()=>_0x48bb98['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x10d8f4,_0x59dda9,_0x57239d=!0x1,_0x7acb90=!0x1){const _0x3af9af='conversation'===_0x59dda9||!0x0===_0x10d8f4['isReadOnly'],_0x114df6=new mr(this['locale'],_0x10d8f4,_0x3af9af,_0x57239d,_0x7acb90);return _0x3af9af||_0x114df6['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x114df6['id']);}),_0x114df6;}['_addContextToCollection'](_0x44c3b3,_0x401ea6){_0x401ea6['add'](_0x44c3b3,0x0);}['_removeContextFromCollection'](_0x435976,_0x1817eb){const _0x82e7c9=_0x1817eb['find'](_0x2e2534=>_0x2e2534['id']===_0x435976);_0x82e7c9&&_0x1817eb['remove'](_0x82e7c9);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':No}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x17df39){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x17df39);}},xo=class extends Ht{['arrowView'];constructor(_0x147e51){super(_0x147e51),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[bo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x4a72e7=new Yt();return _0x4a72e7['content']=_0x20cf00,_0x4a72e7['extendTemplate']({'attributes':{'class':bo+'__arrow'}}),_0x4a72e7;}},Lo=class extends _0x215f6f{['_cancelButtonView'];['_loaderView'];constructor(_0x51143a){super(_0x51143a),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 _0x4f7587=new Ht(this['locale']);return _0x4f7587['set']({'label':us(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':an+'\x20ck-ai-button-stop-generating','icon':it}),_0x4f7587['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x4f7587;}['_createLoaderView'](){const _0x461488=new _0x215f6f(this['locale']);return _0x461488['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':us(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x461488;}},Do=class extends _0x215f6f{['_contextPanelView'];['_promptInputView'];['_dropZoneView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];['_filesEnabled'];constructor(_0x5d4be6,_0x31ad43){super(_0x5d4be6),this['_filesEnabled']=_0x31ad43['filesEnabled'],this['_contextPanelView']=this['_createContextPanelView'](_0x5d4be6,{'bodyCollection':_0x31ad43['bodyCollection'],'searchInputVisibleFrom':_0x31ad43['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x5d4be6),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x5d4be6),this['_loaderView']=this['_createLoaderView'](_0x5d4be6),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x5d4be6),this['_dropZoneView']=new Fr(_0x5d4be6),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage','promptInputPaste')['to'](this),this['_dropZoneView']['delegate']('promptInputPaste')['to'](this),this['_dropZoneView']['on']('dragEnter',()=>this['_contextPanelView']['hideAllBalloons']()),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'](...po)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x554f8f=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x554f8f['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x554f8f['if']('isLoading','ck-hidden',_0x4a6e9d=>_0x4a6e9d||!this['isModelAvailable']),_0x554f8f['if']('isModelAvailable','ck-hidden',_0x177a89=>!_0x177a89||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x554f8f['if']('isLoading','ck-hidden',_0x4cd253=>!_0x4cd253)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x554f8f['if']('isModelAvailable','ck-hidden',_0x34fdfb=>_0x34fdfb)]},'children':[this['_modelUnavailableMessageView']]},this['_dropZoneView']]}),_0x191c5a({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['render'](){super['render'](),this['_filesEnabled']&&this['_dropZoneView']['attach'](this['element']);}['_createContextPanelView'](_0x6cb4,_0x2fc196){return new yo(_0x6cb4,_0x2fc196);}['_createPromptInputView'](_0x9c1d5e){return new Gr(_0x9c1d5e,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x56cda3){return new jr(_0x56cda3);}['_createLoaderView'](_0x1da2cb){return new Lo(_0x1da2cb);}['_createModelUnavailableMessageView'](_0x4aa28d){const _0x16ab6c=new Po(_0x4aa28d);return _0x16ab6c['delegate']('startConversation')['to'](this),_0x16ab6c;}['_handlePromptInputFocus'](_0x350663,_0x7bbe,_0x5e4daa){_0x5e4daa?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1d05f1,_0x3b68eb){this['_contextPanelView']['addContextItem'](_0x1d05f1,_0x3b68eb);}['removeContextItem'](_0x3be1fb){this['_contextPanelView']['removeContextItem'](_0x3be1fb);}['setContextItemLoading'](_0x24178c,_0x2afb36){this['_contextPanelView']['setContextItemLoading'](_0x24178c,_0x2afb36);}['setIsUploadInProgress'](_0x2c2d9b){this['_promptInputView']['setIsUploadInProgress'](_0x2c2d9b);}['setConversationContext'](_0x59edc4){this['_contextPanelView']['setConversationContext'](_0x59edc4);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x57ff5a,_0x59ef28,_0x239c46){this['_contextPanelView']['updateResourceState'](_0x57ff5a,_0x59ef28,_0x239c46);}['setWebSearch'](_0x3b3752){this['_promptCapabilitiesView']['setWebSearch'](_0x3b3752);}['setReasoning'](_0x2c18ae){this['_promptCapabilitiesView']['setReasoning'](_0x2c18ae);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x53c3fa){this['_contextPanelView']['setAddContextOptions'](_0x53c3fa);}['setInputPlaceholder'](_0xae4fac){this['_promptInputView']['setPlaceholderText'](_0xae4fac);}['setModelList'](_0x3eaac7,_0x4f8f87){this['_promptCapabilitiesView']['setModelList'](_0x3eaac7,_0x4f8f87);}['setModel'](_0x383fd6){_0x383fd6?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x383fd6)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x3d90fe){this['_promptCapabilitiesView']['disableModelSelector'](_0x3d90fe);}['populateSourceResourceBalloon'](_0x49dcbf,_0x1a4de8,_0x496ee5,_0x22d282){this['_contextPanelView']['populateSourceResourceBalloon'](_0x49dcbf,_0x1a4de8,_0x496ee5,_0x22d282);}['closeSourceResourceBalloon'](_0x157813){this['_contextPanelView']['closeSourceResourceBalloon'](_0x157813);}['focusPromptInput'](_0xcc151=!0x1){this['_promptInputView']['focus'](_0xcc151);}['setPromptInputValue'](_0x158d83){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x158d83;}},Po=class extends _0x215f6f{constructor(_0x501ad2){super(_0x501ad2);const _0x2b399c=new Ht(_0x501ad2);_0x2b399c['set']({'label':us(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x2b399c['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':us(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x2b399c]}]});}},Ho=class extends Ft{['resizeButton'];constructor(_0x4ef842,_0x32cad2){super(_0x4ef842,{'label':_0x32cad2['label'],'class':'ck-ai-header\x20'+_0x32cad2['class'],'icon':_0x32cad2['icon']}),this['set']('isMaximized',!0x1),_0x32cad2['content']&&this['children']['add'](_0x32cad2['content']),_0x32cad2['showResizeButton']&&(this['resizeButton']=cn(_0x4ef842,this),this['children']['add'](this['resizeButton']));}},Mo=class extends _0x215f6f{constructor(_0x5af6a0){super(_0x5af6a0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':us(_0x5af6a0,'AI_DISCLAIMER_TEXT')}]}]});}};function Vo(_0x234fff,_0x5efd90){const _0x5cc8cc=new Ht(_0x234fff);return _0x5cc8cc['set']({'label':us(_0x234fff,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x3927b2,'class':'ck-ai-chat__start-conversation\x20'+an}),_0x5cc8cc['on']('execute',()=>{_0x5efd90['fire']('startConversation');}),_0x5cc8cc;}var Uo=class extends _0x215f6f{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x8ddf7f,_0x2eaab5){super(_0x8ddf7f),this['_bodyCollection']=ln(_0x8ddf7f);const _0x5bb8bf=Vo(_0x8ddf7f,this);this['chatHeader']=new Ho(_0x8ddf7f,{'label':us(_0x8ddf7f,'AI_CHAT_HEADING'),'icon':_0x4282d3,'class':'ck-ai-header_chat','content':_0x5bb8bf,'showResizeButton':_0x2eaab5['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new Mr(_0x8ddf7f,this['_bodyCollection']),this['chatFeed']['delegate'](...yn)['to'](this),this['chatControls']=new Do(_0x8ddf7f,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x2eaab5['contextResourcesSearchInputVisibleFrom'],'filesEnabled':_0x2eaab5['filesEnabled']}),this['chatControls']['delegate'](...yn)['to'](this),this['chatDisclaimer']=new Mo(_0x8ddf7f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x8ddf7f['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x36080f,_0x203d13,_0xf89281,_0x225676){this['chatControls']['populateSourceResourceBalloon'](_0x36080f,_0x203d13,_0xf89281,_0x225676);}['closeSourceResourceBalloon'](_0x4efaa6){this['chatControls']['closeSourceResourceBalloon'](_0x4efaa6);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}},Bo=class extends _0x5d28a2{static get['requires'](){return[cs];}['_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(_0x580b2f){super(_0x580b2f);const _0x1be413=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new Zn(),this['_view']=new Uo(this['context']['locale'],{'showResizeButton':_0x1be413['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'](_0x1be413),this['_view']['delegate'](...yn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x5c8c14,{showDiff:_0x32fb98})=>{this['showDiff']=_0x32fb98;}),this['disableControls'](),_0x1be413['view']['addTab']({'id':'chat','buttonLabel':us(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x4282d3,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x1be413['view'],'isMaximized',_0x99a435=>_0x99a435),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x3c5429=>_0x3c5429),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x4b56e2){const _0x1f9973=this['context']['config']['get']('ai.chat.welcomeMessage')??us(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x4b56e2['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x1f9973}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x4794dd,staticMessage:_0x568b40}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x4794dd,'initialContent':'<p>'+_0x568b40+'</p>'});});}async['addFeedItemUserMessage'](_0x863ae8){const _0x389a90=_0x863ae8['attributes']?.['displayedPrompt']||_0x863ae8['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x863ae8['contextItems']['values']()),'initialContent':'<p>'+_0x389a90+'</p>','id':_0x863ae8['id']});});}async['addFeedItemError']({errorMessage:_0x5ab472,id:_0x4b6082}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x5ab472+'</p>','id':_0x4b6082});});}async['addFeedItemAIReply'](_0x3892f5){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x3892f5['interactionId']+':'+_0x3892f5['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x530375){const _0x52d5f0=ds(this['context']),_0x762ed=_0x52d5f0['map'](_0x2a6f38=>_0x2a6f38['config']['get']('ai.availableReplyActions')||[...er]);let _0x5df42e=_0x762ed['reduce']((_0x566ffd,_0x1f82af)=>_0x566ffd['filter'](_0x35ca00=>_0x1f82af['includes'](_0x35ca00)),_0x762ed[0x0]||[...er]);const _0x4f5c8b=_0x52d5f0['every'](_0x4658a6=>_0x4658a6['plugins']['has']('TrackChanges')),_0x4b2e31=_0x52d5f0['map'](_0x1cd091=>_0x1cd091['commands']['get']('trackChanges'));return _0x4f5c8b?this['_isTrackChangesCommandValueBound']||(this['_isTrackChangesCommandValueBound']=!0x0,this['_view']['chatFeed']['bind']('isTrackChangesOn')['toMany'](_0x4b2e31,'value',(..._0x2b2370)=>_0x2b2370['some'](_0x52c2ad=>_0x52c2ad))):_0x5df42e=_0x5df42e['filter'](_0x5be07d=>'insertSuggestion'!=_0x5be07d),this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x530375['interactionId']+':'+_0x530375['id'],'areActionsDisabled':_0x530375['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x5df42e}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x1df191,_0x39a32c){return this['_promiseQueue']['enqueue'](async()=>{const _0x10215d=this['_view']['chatFeed']['children']['last'];if(_0x10215d instanceof yr)return this['_view']['chatFeed']['children']['remove'](_0x10215d),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1df191['id'],'capabilities':{'isWebSearchEnabled':_0x10215d['capabilities']['isWebSearchEnabled']||_0x39a32c['isWebSearchEnabled'],'isReasoningEnabled':_0x10215d['capabilities']['isReasoningEnabled']||_0x39a32c['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1df191['id'],'capabilities':_0x39a32c});});}async['addFeedItemCustomElement'](_0x2a87cc,_0x608d5b){let _0x23ac0c;return await this['_promiseQueue']['enqueue'](async()=>{_0x23ac0c=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x2a87cc,'id':_0x608d5b});}),_0x23ac0c;}['removeFeedItem'](_0x2a0ee0){this['_view']['chatFeed']['removeItem'](_0x2a0ee0);}['hasFeedItem'](_0x3c2c7d){return this['_view']['chatFeed']['hasItem'](_0x3c2c7d);}['updateFeedInteractionHeader'](_0x224d07){const _0x4daff0=this['_view']['chatFeed']['children']['find'](_0x1b41ce=>_0x1b41ce['options']['id']==_0x224d07['id']&&_0x1b41ce instanceof yr);_0x4daff0&&_0x4daff0['set']('isVisible',_0x224d07['isVisible']);}async['updateFeedItemAIReplyContent'](_0x2e0363){const _0x21039d=_0x2e0363['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x3d58b7=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x2e0363,'abortSignal':_0x3d58b7,'renderingStrategy':_0x21039d}),_0x2e0363['isDone']&&this['markFeedItemAsDone'](_0x2e0363['id']);});}['updateFeedItemAIReplySources'](_0x4bda55,_0x8eb1d5){this['_view']['chatFeed']['updateWebSources'](_0x4bda55,_0x8eb1d5);}async['updateFeedItemAIReplySuggestionContent'](_0x45734b){return this['_promiseQueue']['enqueue'](async _0x2b4922=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x45734b,'abortSignal':_0x2b4922}),_0x45734b['isDone']&&this['markFeedItemAsDone'](_0x45734b['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x59c7bb){this['_view']['chatFeed']['updateSuggestionPartState'](_0x59c7bb);}['setFeedItemAIReplySuggestionPartActive'](_0x3054f2){this['_view']['chatFeed']['setSuggestionPartActive'](_0x3054f2);}['markFeedItemAsDone'](_0x29f584){this['_view']['chatFeed']['markItemAsDone'](_0x29f584);}['removeFeedInteraction'](_0x5da8d5){this['_view']['chatFeed']['getItemIds']()['filter'](_0x1c321b=>_0x1c321b['startsWith'](_0x5da8d5))['forEach'](_0x5f540c=>this['_view']['chatFeed']['removeItem'](_0x5f540c));}['startInteraction'](){const _0x1d6746=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x1d6746),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x36a225){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x4aa66f=>_0x4aa66f['startsWith'](_0x36a225['id']))['forEach'](_0x46a7ff=>this['markFeedItemAsDone'](_0x46a7ff)),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'](_0x384b01,_0x54c839){this['_view']['chatControls']['addContextItem'](_0x384b01,_0x54c839);}['removeContextItem'](_0x364be0){this['_view']['chatControls']['removeContextItem'](_0x364be0);}['setContextItemLoading'](_0xb77f5e,_0x5b32cb){this['_view']['chatControls']['setContextItemLoading'](_0xb77f5e,_0x5b32cb);}['setIsUploadInProgress'](_0x4dc93b){this['_view']['chatControls']['setIsUploadInProgress'](_0x4dc93b);}['setConversationContext'](_0x1d91f5){this['_view']['chatControls']['setConversationContext'](_0x1d91f5);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x172284,_0x321542,_0x150790){this['_view']['chatControls']['updateResourceState'](_0x172284,_0x321542,_0x150790);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x3e3852){this['_view']['chatControls']['setAddContextOptions'](_0x3e3852);}['updateCapabilities'](_0x48551d){this['_view']['chatControls']['setWebSearch'](_0x48551d['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x48551d['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x48551d));}['setSelectedModel'](_0xdbb24a,_0x5714a5){this['_view']['chatControls']['setModel'](_0xdbb24a),_0x5714a5&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x44fda8){this['feedItemRenderingStrategy']=_0x44fda8;}['toggleLoadingSkeleton'](_0x22a411){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x22a411);}['resetConversationTitle'](){this['setConversationTitle'](us(this['context']['locale'],'AI_CHAT_HEADING'));}['emptyConversationTitle'](){this['setConversationTitle']('');}['setConversationTitle'](_0x14c09d,_0x1244fd=!0x1){if(clearInterval(this['_titleAnimationInterval']),_0x1244fd&&!pt()&&_0x14c09d['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x14c09d);this['_view']['chatHeader']['label']=_0x14c09d;}['setLoadingMessage'](_0x388a5d){this['_view']['chatFeed']['setLoadingMessage'](_0x388a5d);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x1d0a4f){let _0x4a73db=0x0;this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x1d0a4f[_0x4a73db],_0x4a73db++,_0x4a73db===_0x1d0a4f['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x1eebfe){return _0x1eebfe['isWebSearchEnabled']&&_0x1eebfe['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x1eebfe['isWebSearchEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x1eebfe['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x595cdc){return _0x595cdc?_0x595cdc['isWebSearchEnabled']&&_0x595cdc['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x595cdc['isWebSearchEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x595cdc['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x38a397,_0x4ca5b1,_0x5c3597,_0x48c488){this['_view']['populateSourceResourceBalloon'](_0x38a397,_0x4ca5b1,_0x5c3597,_0x48c488);}['closeSourceResourceBalloon'](_0x414c95){this['_view']['closeSourceResourceBalloon'](_0x414c95);}['setPromptInputValue'](_0x670e61){this['_view']['chatControls']['setPromptInputValue'](_0x670e61);}['focusPromptInput'](_0x478e03=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x478e03);}['scrollFeedToSuggestion'](_0x42c939,_0xfc2eba){this['_view']['chatFeed']['scrollToSuggestion'](_0x42c939,_0xfc2eba);}['startAutoScroll'](_0x3038bf={}){this['_view']['chatFeed']['startAutoScroll'](_0x3038bf);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}},Go=class extends jt{['sections'];constructor(_0x920089,_0x4acc32){super(_0x920089),this['sections']=_0x4acc32,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x4bc36e){let _0x18eb3f=0x0,_0x4ec2c0=0x0;for(const _0xf1c203 of this['sections']){const {resultsCount:_0xe03563,totalItemsCount:_0x36b4db}=_0xf1c203['filter'](_0x4bc36e);_0x18eb3f+=_0xe03563,_0x4ec2c0+=_0x36b4db;}return{'resultsCount':_0x18eb3f,'totalItemsCount':_0x4ec2c0};}},Fo=class extends zt{['title'];['itemsViews'];['_itemsListView'];constructor(_0xb81b6e,{title:_0x36d55e,items:_0xe99e71}){super(_0xb81b6e);const _0x135ddd=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x36d55e,this['itemsViews']=_0xe99e71;const _0x2c013f=new _0x215f6f(_0xb81b6e);_0x2c013f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new jt(_0xb81b6e),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x135ddd['if']('isVisible','ck-hidden',_0x421951=>!_0x421951)]},'children':[_0x2c013f,this['_itemsListView']]});}['filter'](_0x3cc0e6){const _0x177ecd=this['itemsViews']['length'];let _0x544ea7=0x0;for(const _0x39a626 of this['itemsViews'])_0x3cc0e6?(_0x39a626['isVisible']=!!_0x39a626['isMatching'](_0x3cc0e6),_0x39a626['highlightText'](_0x3cc0e6)):(_0x39a626['isVisible']=!0x0,_0x39a626['highlightText'](null)),_0x39a626['isVisible']&&_0x544ea7++;return this['isVisible']=_0x544ea7>0x0,{'resultsCount':_0x544ea7,'totalItemsCount':_0x177ecd};}['getItem'](_0x45949f){return this['itemsViews']['find'](_0x1432e9=>_0x1432e9['id']===_0x45949f);}['removeItem'](_0x20ad27){const _0x38c33b=this['itemsViews']['indexOf'](_0x20ad27);-0x1!==_0x38c33b&&(this['itemsViews']['splice'](_0x38c33b,0x1),this['_itemsListView']['items']['remove'](_0x20ad27));}};const Ko=/* #__PURE__ -- @preserve */
34
- _0x3688b4(zt);var Wo=class AIChatHistoryListItemView extends Ko{['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(_0x44a468,_0x44e929){super(_0x44a468);const _0xa9eebe=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x44e929['pinned']),this['set']('loadingState',null),this['set']('title',_0x44e929['title']),this['id']=_0x44e929['id'];const {createdAt:_0xc0786b,active:_0x4be912=!0x1}=_0x44e929;this['_titleView']=new Wt(),this['_titleView']['bind']('text')['to'](this,'title'),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x32b239=this['_createCheckView'](),_0x2b21b6=this['_createPinButtonView'](_0x44a468),_0x50609c=this['_createMenuDropdownView'](),_0x3f2c80=this['_createEditInputView'](_0x44a468),_0x1a7a97=this['_createAcceptEditButtonView'](_0x44a468,_0x3f2c80),_0x24a2c7=this['_createCancelEditButtonView'](_0x44a468);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x2b21b6),this['actions']['add'](_0x50609c),this['on']('change:isEdit',(_0x5a1d4f,_0x29984c,_0x4aa925)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x4aa925?(this['actions']['add'](_0x1a7a97),this['actions']['add'](_0x24a2c7),this['mainContent']['add'](_0x3f2c80),_0x3f2c80['element']['value']=this['title']||'',_0x3f2c80['element']['focus']()):(this['actions']['add'](_0x2b21b6),this['actions']['add'](_0x50609c),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x4be912?'ck-ai-chat-history__item--active':'',_0xa9eebe['if']('isVisible','ck-hidden',_0x32dd0d=>!_0x32dd0d),_0xa9eebe['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',_0xa9eebe['if']('loadingState','ck-hidden',_0x2cf5a8=>!!_0x2cf5a8)]},'children':_0x4be912?[_0x32b239]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0xa9eebe['if']('loadingState','ck-hidden',_0x3efb73=>!_0x3efb73)]},'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',_0xa9eebe['if']('loadingState','ck-hidden',_0x3db0f8=>!!_0x3db0f8)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0xa9eebe['if']('loadingState','ck-hidden',_0x12a99a=>!_0x12a99a)]},'children':[{'text':_0xa9eebe['to']('loadingState',_0x55c84c=>_0x55c84c?us(this['locale'],AIChatHistoryListItemView['LOADING_LABELS'][_0x55c84c]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0xc0786b]}]},{'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'](_0x5a037e){this['set']('title',_0x5a037e);}['updateLoadingState'](_0x14122c,_0x5644a6){this['set']('loadingState',_0x5644a6?_0x14122c:null);}['_createCheckView'](){const _0x16cc39=new Yt();return _0x16cc39['set']({'content':_0x27c014}),_0x16cc39;}['_createPinButtonView'](_0x13fec9){const _0x28de00=new Ht(_0x13fec9);return _0x28de00['set']({'label':us(_0x13fec9,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x1f7bdc,'withText':!0x1,'tooltip':!0x0}),_0x28de00['bind']('isOn')['to'](this,'pinned'),_0x28de00['on']('execute',()=>{const _0x107ffa=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x107ffa});}),_0x28de00;}['_createMenuDropdownView'](){const _0x588fd1=_0x32dc43(this['locale']),_0x277b79=_0x588fd1['panelView']['children'];_0x588fd1['buttonView']['set']({'label':us(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':nt}),_0x588fd1['panelPosition']='sw';const _0x3b6a23=new Ht(this['locale']);_0x3b6a23['label']=us(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x3b6a23['withText']=!0x0,_0x3b6a23['on']('execute',()=>{this['isEdit']=!0x0;});const _0x341593=new Ht(this['locale']);_0x341593['label']=us(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x341593['withText']=!0x0,_0x341593['on']('execute',()=>{this['showConfirm'](us(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x243e3d=new jt(this['locale']),_0x33e2f7=new zt(this['locale']);_0x33e2f7['children']['add'](_0x3b6a23);const _0x783494=new zt(this['locale']);return _0x783494['children']['add'](_0x341593),_0x243e3d['items']['addMany']([_0x33e2f7,_0x783494]),_0x277b79['add'](_0x243e3d),_0x588fd1;}['_createEditInputView'](_0x1939a5){const _0x4aadff=new $t(_0x1939a5),_0x1d58a9=_0x4aadff['bindTemplate'];return _0x4aadff['extendTemplate']({'on':{'keydown':_0x1d58a9['to'](_0x2668e4=>{'Enter'==_0x2668e4['key']&&this['_commitEditInputValue'](_0x4aadff);})}}),_0x4aadff;}['_createAcceptEditButtonView'](_0x525c50,_0x2fc7f9){const _0xfe670a=new Ht(_0x525c50);return _0xfe670a['set']({'icon':_0x27c014,'withText':!0x1,'tooltip':us(_0x525c50,'AI_CHAT_HISTORY_ACCEPT')}),_0xfe670a['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0xfe670a['on']('execute',()=>{this['_commitEditInputValue'](_0x2fc7f9);}),_0xfe670a;}['_commitEditInputValue'](_0x2b1bd3){const _0x1d7424=_0x2b1bd3['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x1d7424});}['_createCancelEditButtonView'](_0x1a7c4f){const _0x592668=new Ht(_0x1a7c4f);return _0x592668['set']({'icon':_0x27af74,'withText':!0x1,'tooltip':us(_0x1a7c4f,'AI_CHAT_HISTORY_CANCEL')}),_0x592668['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x592668['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x592668;}['_createSpinnerView'](){const _0x4feb68=new cr('tiny');return _0x4feb68['isVisible']=!0x0,_0x4feb68;}['isMatching'](_0x45fd1c){return'string'==typeof this['title']&&this['title']['match'](_0x45fd1c)?{'title':!0x0}:null;}['highlightText'](_0x239bfc){this['_titleView']['highlightText'](_0x239bfc);}},Yo=class extends _0x215f6f{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x55fc77,_0x2767eb){super(_0x55fc77),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x3323bb=Vo(_0x55fc77,this);this['headerView']=new Ho(_0x55fc77,{'label':us(_0x55fc77,'AI_CHAT_HISTORY_HEADING'),'icon':_0x5c358f,'class':'ck-ai-header_history','content':_0x3323bb,'showResizeButton':_0x2767eb}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new Go(_0x55fc77,[]),this['sectionsView']['delegate'](...$o)['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',_0x147f11=>!_0x147f11)]}}),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 _0x466d02=new _0x27b4c4(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':us(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x2bc466=>us(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x2bc466),'secondary':us(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0xf35df0=this['_createErrorView']();return _0xf35df0['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x3df05e=>!_0x3df05e)]}}),_0x466d02['on']('render',()=>{_0x466d02['children']['add'](_0xf35df0,0x1);}),_0x466d02['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x16f04a=>!_0x16f04a)]}}),_0x466d02;}['_createSkeletonView'](){const _0x207a95=new Xn(this['locale'],zn['aiHistory']);return _0x207a95['bind']('isVisible')['to'](this,'isLoading'),_0x207a95;}['_createErrorView'](){const _0x28cb84=new _0x215f6f(this['locale']),_0x29efc4=new Ht(this['locale']);_0x29efc4['set']({'withText':!0x1,'icon':_0x27af74,'class':'ck-ai-notification_error__dismiss-button'}),_0x29efc4['bind']('isVisible')['to'](this,'hasItems',_0xdaebef=>!!_0xdaebef),_0x29efc4['on']('execute',()=>{this['errorMessage']='';});const _0x2d9db1=this['bindTemplate'];return _0x28cb84['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x2d9db1['to']('errorMessage')}]},_0x29efc4]}),_0x28cb84;}['_createEmptyStateView'](){const _0x2b85c6=new _0x215f6f(this['locale']);return _0x2b85c6['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x4da2f7=>!_0x4da2f7)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[us(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x2b85c6;}['_createListItemViews'](_0x526f9b,_0x518da6){const _0x4a690e=[];for(const _0x16f075 of _0x526f9b){const _0x256cc0=new Wo(_0x518da6,_0x16f075);_0x256cc0['delegate'](...$o)['to'](this),_0x4a690e['push'](_0x256cc0);}return _0x4a690e;}['updateHistoryItemsWithCategories'](_0x14edad){const _0x5b0dd0=this['locale']||'en',_0x2ddf82=[];for(const _0x40ee36 of _0x14edad){const _0x378bdf=this['_createListItemViews'](_0x40ee36['items'],_0x5b0dd0);_0x2ddf82['push'](new Fo(_0x5b0dd0,{'title':_0x40ee36['title'],'items':_0x378bdf}));}this['sectionsView']['sections']=_0x2ddf82,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x2ddf82),this['hasItems']=_0x14edad['some'](_0x325ea5=>_0x325ea5['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0xd1a553){for(const _0x493860 of this['sectionsView']['sections']){const _0x5f045b=_0x493860['getItem'](_0xd1a553);if(_0x5f045b){if(_0x493860['removeItem'](_0x5f045b),0x0===_0x493860['itemsViews']['length']){const _0x199f02=this['sectionsView']['sections']['indexOf'](_0x493860);-0x1!==_0x199f02&&(this['sectionsView']['sections']['splice'](_0x199f02,0x1),this['sectionsView']['items']['remove'](_0x493860));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x1eb6ae,_0x2f2fd4){for(const _0x15ed37 of this['sectionsView']['sections']){const _0x52553f=_0x15ed37['getItem'](_0x1eb6ae);if(_0x52553f){_0x52553f['updateTitle'](_0x2f2fd4);break;}}}['updateItemLoadingState'](_0x56639b,_0x2a3cb7,_0x33684b){for(const _0x269930 of this['sectionsView']['sections']){const _0x580620=_0x269930['getItem'](_0x56639b);if(_0x580620){_0x580620['updateLoadingState'](_0x2a3cb7,_0x33684b);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x3268f6=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x3268f6);}}};const $o=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];var qo=class extends _0x5d28a2{static get['requires'](){return[cs];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2e64d3){super(_0x2e64d3);const _0x571549=this['context']['plugins']['get']('AITabs');this['_historyView']=new Yo(this['context']['locale'],_0x571549['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x571549),this['_historyView']['delegate'](...$o)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x571549['view'],'isMaximized',_0xdff76c=>_0xdff76c),_0x571549['view']['addTab']({'id':'history','buttonLabel':us(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x5c358f,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x381e12){this['_historyView']['removeHistoryItem'](_0x381e12);}['updateItems'](_0x4e3598){this['_historyView']['updateHistoryItemsWithCategories'](_0x4e3598);}['updateItemTitle'](_0xbd6c1a,_0x19032f){this['_historyView']['updateItemTitle'](_0xbd6c1a,_0x19032f);}['updateItemLoadingState'](_0x16df53,_0x5a5269,_0x538a3b){this['_historyView']['updateItemLoadingState'](_0x16df53,_0x5a5269,_0x538a3b);}['setLoadingSkeleton'](_0x4f22b3){this['_historyView']['isLoading']=_0x4f22b3;}['showError'](_0x3726e6){this['_historyView']['errorMessage']=_0x3726e6;}['hideError'](){this['_historyView']['errorMessage']='';}};const Qo=/* #__PURE__ -- @preserve */
35
- gt();var Xo=class extends Qo{['id'];['createdAt'];constructor({id:_0x4029e2,title:_0x2749f0,createdAt:_0x161519,updatedAt:_0x209db9,pinned:_0x2bef97}){super(),this['id']=_0x4029e2,this['createdAt']=new Date(_0x161519),this['set']('title',_0x2749f0),this['set']('updatedAt',_0x209db9?new Date(_0x209db9):null),this['set']('pinned',_0x2bef97||!0x1);}['updateTitle'](_0x1a55ba){this['set']('title',_0x1a55ba),this['updatedAt']=new Date();}['updatePinned'](_0x484c2f){this['set']('pinned',_0x484c2f),this['updatedAt']=new Date();}};const zo=/* #__PURE__ -- @preserve */
36
- ut();var jo=class extends zo{['items']=[];['connector'];['group'];constructor({connector:_0x39ead4,group:_0x37a129}){super(),this['connector']=_0x39ead4,this['group']=_0x37a129;}async['init'](){try{const _0x4271b3=await this['connector']['fetchConversations'](this['group'])['getConversations']();this['loadItems'](_0x4271b3);}catch(_0x31c462){this['fire']('error',{'error':_0x31c462,'operation':'init'});}}['addItem'](_0x11c4b8){this['items']['push'](_0x11c4b8);}async['removeItem'](_0x45a8f1){const _0xa84a25=this['items']['findIndex'](_0x51c089=>_0x51c089['id']===_0x45a8f1);if(-0x1===_0xa84a25)return!0x1;try{return await this['connector']['deleteConversation'](_0x45a8f1)['execute'](),this['items']['splice'](_0xa84a25,0x1),this['fire']('itemRemoved',{'itemId':_0x45a8f1}),!0x0;}catch(_0x45e048){return this['fire']('error',{'error':_0x45e048,'operation':'removeItem','itemId':_0x45a8f1}),!0x1;}}['getItem'](_0x35c4b1){return this['items']['find'](_0x32d0a9=>_0x32d0a9['id']===_0x35c4b1);}async['updateItemTitle'](_0x386a74,_0x328e5e){const _0x10ad1b=this['getItem'](_0x386a74);if(!_0x10ad1b)return!0x1;try{return await this['connector']['updateConversation'](_0x386a74,{'title':_0x328e5e})['getResult'](),_0x10ad1b['updateTitle'](_0x328e5e),this['fire']('itemUpdated',{'itemId':_0x386a74,'updates':{'title':_0x328e5e}}),!0x0;}catch(_0xfe64b0){return this['fire']('error',{'error':_0xfe64b0,'operation':'updateItemTitle','itemId':_0x386a74}),!0x1;}}async['updateItemPinned'](_0xdfa182,_0x3c03b8){const _0x33adb7=this['getItem'](_0xdfa182);if(!_0x33adb7)return!0x1;try{return await this['connector']['updateConversation'](_0xdfa182,{'pinned':_0x3c03b8})['getResult'](),_0x33adb7['updatePinned'](_0x3c03b8),this['fire']('itemUpdated',{'itemId':_0xdfa182,'updates':{'pinned':_0x3c03b8}}),!0x0;}catch(_0x4c9a67){return this['fire']('error',{'error':_0x4c9a67,'operation':'updateItemPinned','itemId':_0xdfa182}),!0x1;}}['loadItems'](_0x26e55e){try{this['items']=[],_0x26e55e['map'](_0x4b3531=>{this['addItem'](new Xo(_0x4b3531));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x411f77){this['fire']('error',{'error':_0x411f77,'operation':'loadItems'});}}['getItems'](_0x16c988={}){const _0x4a0d82=void 0x0!==_0x16c988['pinned']&&_0x16c988['pinned'],_0xc8afea=_0x16c988['from']?new Date(_0x16c988['from']['getFullYear'](),_0x16c988['from']['getMonth'](),_0x16c988['from']['getDate']()):null,_0x19b1df=_0x16c988['to']?new Date(_0x16c988['to']['getFullYear'](),_0x16c988['to']['getMonth'](),_0x16c988['to']['getDate']()):null;return this['items']['filter'](_0x3edd22=>{if(_0x3edd22['pinned']!==_0x4a0d82)return!0x1;if(_0x19b1df){const _0x45c81f=new Date(_0x3edd22['createdAt']['getFullYear'](),_0x3edd22['createdAt']['getMonth'](),_0x3edd22['createdAt']['getDate']());return _0xc8afea?_0xc8afea['getTime']()===_0x19b1df['getTime']()?_0x45c81f['getTime']()===_0xc8afea['getTime']():_0x45c81f<_0x19b1df&&_0x45c81f>=_0xc8afea:_0x45c81f<_0x19b1df;}return!0x0;});}},Jo=class extends _0x5d28a2{['_aiConnector'];['_reporter'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[ls,nn,kn,qo,cs];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](ls),this['_aiChatHistoryUi']=this['context']['plugins']['get'](qo),this['_aiChatController']=this['context']['plugins']['get'](kn),this['_reporter']=this['context']['plugins']['get'](nn)['createReporter']('aichathistory');const _0x587740=this['context']['plugins']['get'](cs);try{const _0x62c665=this['_aiChatController']['getGroupId']();this['history']=new jo({'connector':this['_aiConnector'],'group':_0x62c665}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x268cf5,_0xca9fb0)=>{this['_setItemLoading'](_0xca9fb0['id'],'remove'),this['_handleRemove'](_0xca9fb0['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x3422b1,_0x34588c)=>{this['_setItemLoading'](_0x34588c['id'],'rename'),this['_handleEditTitle'](_0x34588c['id'],_0x34588c['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x21a807,_0x330623)=>{void 0x0!==_0x330623['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x330623['itemId'],_0x330623['updates']['title']),void 0x0!==_0x330623['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x330623['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x386baf,_0x465ca4)=>{this['_aiChatController']['_handleRemovedConversation'](_0x465ca4['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x465ca4['itemId']),this['_clearItemLoading'](_0x465ca4['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x513ec3,_0x11848d)=>{this['_handleHistoryErrorUI'](_0x11848d['error'],_0x11848d['operation'],_0x11848d['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x346a1e,_0x332871)=>{this['_handleSelectConversation'](_0x332871['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x2b0f0f,_0x5858b9)=>{const _0x30703d=_0x5858b9['pinned']?'pin':'unpin';this['_setItemLoading'](_0x5858b9['id'],_0x30703d),this['_handleTogglePin'](_0x5858b9['id'],_0x5858b9['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x587740['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x587740['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x15ad67){this['_handleHistoryErrorUI'](_0x15ad67,'init');}}async['_handleEditTitle'](_0x48a3a3,_0x567209){await this['history']['updateItemTitle'](_0x48a3a3,_0x567209);}async['_handleTogglePin'](_0x5df7fa,_0x10db30){await this['history']['updateItemPinned'](_0x5df7fa,_0x10db30);}async['_handleRemove'](_0x14b5f2){await this['history']['removeItem'](_0x14b5f2);}async['_handleSelectConversation'](_0x55220b){await this['_aiChatController']['loadConversation'](_0x55220b);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0xaabf40=this['_aiChatController']['activeConversation']?.['id'],_0x260b74=this['_getCategorizedItems']()['map'](_0xb565a0=>({'title':_0xb565a0['title'],'items':_0xb565a0['items']['map'](_0x11b946=>({'id':_0x11b946['id'],'title':_0x11b946['title']||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x11b946['createdAt'])['toLocaleDateString'](),'active':_0x11b946['id']===_0xaabf40,'pinned':_0x11b946['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x260b74);}['_setItemLoading'](_0x1a8c96,_0x24ae6f){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x1a8c96,_0x24ae6f,!0x0);}['_clearItemLoading'](_0x3c9db3){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x3c9db3,null,!0x1);}['_handleHistoryErrorUI'](_0x29d995,_0x426b51,_0x2e002f){const _0x3d9f06=this['_generateErrorMessage'](_0x426b51,_0x2e002f);this['_aiChatHistoryUi']['showError'](_0x3d9f06),this['_reporter']['reportError'](_0x29d995,{'context':{'operation':_0x426b51}}),_0x2e002f&&this['_clearItemLoading'](_0x2e002f),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0xde9e68,_0x3095cc){const _0x5699f5=_0x3095cc?this['history']['getItem'](_0x3095cc):null,_0x56b780=_0x5699f5?.['title']||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0xde9e68){case'updateItemTitle':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x56b780);case'updateItemPinned':{const _0x580afe=us(this['context']['locale'],_0x5699f5?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x580afe,_0x56b780]);}case'removeItem':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x56b780);case'init':case'loadItems':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x259d03=new Date(),_0x1fa6ae=new Date(_0x259d03['getFullYear'](),_0x259d03['getMonth'](),_0x259d03['getDate']()),_0x306df2=new Date(_0x1fa6ae);_0x306df2['setDate'](_0x306df2['getDate']()-0x1);const _0x494d93=new Date(_0x1fa6ae);_0x494d93['setDate'](_0x494d93['getDate']()-0xe);const _0x4fab43=this['history']['getItems']({'pinned':!0x0}),_0x116dc9=this['history']['getItems']({'from':_0x1fa6ae,'to':_0x1fa6ae}),_0x1be021=this['history']['getItems']({'from':_0x306df2,'to':_0x306df2}),_0x3ec583=this['history']['getItems']({'from':_0x494d93,'to':_0x306df2}),_0x145b77=this['history']['getItems']({'to':_0x494d93}),_0x12122b=[];return _0x4fab43['length']>0x0&&_0x12122b['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x4fab43}),_0x116dc9['length']>0x0&&_0x12122b['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x116dc9}),_0x1be021['length']>0x0&&_0x12122b['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x1be021}),_0x3ec583['length']>0x0&&_0x12122b['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x3ec583}),_0x145b77['length']>0x0&&_0x12122b['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x145b77}),_0x12122b;}},Zo=class extends _0x5d28a2{static get['requires'](){return[Jo,qo];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},ta=class extends _0x5d28a2{static get['requires'](){return[kn,Is,Bo,Zo,tn];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xfec276){super(_0xfec276),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[],'alwaysAddSelection':!0x1,'paste':{'textThreshold':0x5dc}}),this['context']['config']['define']('ai.chat.initialConversation','new');}},ea=class extends Ht{['id'];constructor(_0x5f4a38,_0x379a65){super(_0x5f4a38);const {id:_0x5363d7,type:_0x38a756,icon:_0x25e19e}=_0x379a65;this['id']=_0x5363d7,this['set']({'label':_0x379a65['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x379a65['id']}}),_0x25e19e?this['icon']=_0x25e19e:'chat'===_0x38a756?this['icon']=_0x4282d3:'review'===_0x38a756?this['icon']=_0x5bd10a:'translate'===_0x38a756&&(this['icon']=_0x4dd947);}},ia=class extends _0x215f6f{['listView'];constructor(_0x500b2c,_0x409d38){super(_0x500b2c),this['set']('isEnabled',!0x0);const _0x48d8a9=_0x409d38['map'](_0x2be126=>{const _0x37d1bd=new zt(this['locale']),_0x278d2b=new ea(this['locale'],_0x2be126);return _0x278d2b['bind']('isEnabled')['to'](this),_0x37d1bd['children']['add'](_0x278d2b),_0x278d2b['delegate']('execute')['to'](this),_0x37d1bd;});this['listView']=new jt(this['locale']),this['listView']['items']['addMany'](_0x48d8a9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}};const sa='chat-shortcuts';var na=class extends _0x5d28a2{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];['_listenedConversation'];static get['requires'](){return[Bo];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](Bo),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x756d90=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{const _0x5d5afd=_0x756d90['activeConversation'];_0x5d5afd['isFromHistory']||this['_injectShortcuts'](_0x5d5afd);}),this['listenTo'](_0x756d90,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x2120d0=['chat','review','translate'];this['_shortcuts']['forEach'](_0x311348=>{let _0x4f8338=!0x0;if(_0x311348['id']&&_0x311348['label']&&_0x2120d0['includes'](_0x311348['type'])?'chat'===_0x311348['type']&&(_0x4f8338='string'==typeof _0x311348['prompt']):_0x4f8338=!0x1,!_0x4f8338)throw new ht('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x311348});});}['_injectShortcuts'](_0xefa369){this['_removeShortcuts'](),this['_shortcutsView']=new ia(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),this['_aiChatUI']['addFeedItemCustomElement'](this['_shortcutsView']['element'],sa),this['_shortcutsView']['on']('execute',_0x94e09a=>{const _0x5678d7=_0x94e09a['source']['id'];this['_executeShortcut'](_0x5678d7);}),this['_listenedConversation']=_0xefa369,this['listenTo'](_0xefa369,'uploadProgressChanged',(_0x50f077,_0xec1cad)=>{this['_shortcutsView']['isEnabled']=!_0xec1cad['isUploadInProgress'];});}['_removeShortcuts'](){const _0x22d456=this['context']['plugins']['get'](Bo);_0x22d456['hasFeedItem'](sa)&&_0x22d456['removeFeedItem'](sa),this['_listenedConversation']&&(this['stopListening'](this['_listenedConversation'],'uploadProgressChanged'),this['_listenedConversation']=void 0x0),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x15f6b2){const _0x13af8c=this['_shortcuts']['find'](_0x31521c=>_0x31521c['id']===_0x15f6b2),_0x3cb264=_0x13af8c['type'];'chat'===_0x3cb264?this['_runChatShortcut'](_0x13af8c):'review'===_0x3cb264?_0x13af8c['commandId']?this['_runReviewShortcut'](_0x13af8c):this['_switchTab']('reviewMode'):'translate'===_0x3cb264&&(_0x13af8c['language']?this['_runTranslateShortcut'](_0x13af8c):this['_switchTab']('translate'));}['_switchTab'](_0x5c50f5){if(!this['context']['plugins']['has']('AITabs'))throw new ht('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x5c50f5});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x5c50f5);}async['_runChatShortcut']({prompt:_0x861f52,draftMode:_0x484c98,useWebSearch:_0x43ccbd=!0x1,useReasoning:_0x13c1af=!0x1,model:_0x48ffb0}){const _0x10ddb6=this['context']['plugins']['get']('AIChatController'),_0x24dffb=_0x10ddb6['activeConversation'];let _0x1bb271;_0x1bb271=_0x48ffb0?await _0x24dffb['chatModels']['getModel'](_0x48ffb0):await _0x24dffb['chatModels']['getDefault'](),_0x1bb271&&await _0x24dffb['setModel'](_0x1bb271),_0x24dffb['setWebSearch'](_0x43ccbd),_0x24dffb['setReasoning'](_0x13c1af),_0x10ddb6['addCurrentDocumentToChatContext'](),_0x484c98?(this['_aiChatUI']['setPromptInputValue'](_0x861f52),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x10ddb6['sendMessage']({'message':_0x861f52});}['_runReviewShortcut']({commandId:_0x4cc5ba,model:_0x16458d,prompt:_0xd374b0,params:_0x46d9b8}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ht('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x3c4c64={'id':_0x4cc5ba,'isCustom':'custom'===_0x4cc5ba};_0x16458d&&_0xd374b0&&(_0x3c4c64['args']={'model':_0x16458d,'prompt':_0xd374b0}),_0x46d9b8&&(_0x3c4c64['params']=_0x46d9b8),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x3c4c64);}['_runTranslateShortcut']({language:_0x3decfc}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new ht('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x3decfc,'args':{'language':_0x3decfc}});}},ra=class extends _0x24f2c3{constructor(_0x4ce865){super(_0x4ce865);const _0x1e63b6=_0x4ce865['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x1e63b6,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x5df990=this['editor']['plugins']['get']('AITabs')['view'];_0x5df990['isVisible']=!_0x5df990['isVisible'];}},oa=class extends _0x3688ab{static get['requires'](){return[cs];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4ab69d=this['editor'];_0x4ab69d['commands']['add']('toggleAi',new ra(_0x4ab69d)),_0x4ab69d['ui']['componentFactory']['add']('toggleAi',()=>{const _0x2c1712=this['_createAIUIButton'](Ht);return _0x2c1712['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x2c1712;}),_0x4ab69d['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x1bb4cf=this['_createAIUIButton'](Jt);return _0x1bb4cf['set']({'role':'menuitemcheckbox'}),_0x1bb4cf;});}['_createAIUIButton'](_0x2cc561){const _0x28b219=this['editor'],_0x4583cf=_0x28b219['commands']['get']('toggleAi'),_0x250404=new _0x2cc561(_0x28b219['locale']);return _0x250404['set']({'label':us(_0x28b219['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x3adddc,'isToggleable':!0x0}),_0x250404['bind']('isEnabled')['to'](_0x4583cf),_0x250404['bind']('isOn')['to'](_0x4583cf,'value',_0x1df3ae=>!!_0x1df3ae),this['listenTo'](_0x250404,'execute',()=>{_0x4583cf['execute']();}),_0x250404;}};const aa=['applySuggestion','insertSuggestion','showNext','showPrevious'];var ha=class extends _0x215f6f{['_errorView'];constructor(_0x213ec5){super(_0x213ec5),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x28f6b6){this['showError'](_0x28f6b6);}['showError'](_0x410426){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x410426,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x2b6e81=new _0x215f6f(this['locale']),_0x5a9bce=new _0x215f6f(this['locale']);return _0x5a9bce['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x2b6e81['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x10cbbc=>!_0x10cbbc)]},'children':[_0x5a9bce]}),_0x2b6e81;}};const ca=0xa;var la=class extends _0x5d28a2{static get['requires'](){return[Is];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_editor'];['_isUpdatingMarkers']=!0x1;['open'](_0xce5419){const {id:_0xc89739}=this['_currentConfig']??{};this['_currentConfig']=_0xce5419,this['_editor']=_0xce5419['targetEditor'];const {id:_0x5f042a}=this['_currentConfig'];this['isOpen']&&_0xc89739===_0x5f042a?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x4bb6ee=this['_editor'];if(!_0x4bb6ee)return;const _0x523e2d=_0x4bb6ee['plugins']['get']('Dialog');_0x523e2d['isOpen']&&this['_currentConfig']&&_0x523e2d['id']===this['_currentConfig']['id']&&_0x523e2d['hide']();}['_updateDialog'](){const _0x46f890=this['_editor']['plugins']['get']('Dialog'),{icon:_0x4142f8,title:_0x416ffa}=this['_currentConfig'];_0x46f890['view']?.['headerView']&&(_0x46f890['view']['headerView']['label']=_0x416ffa,_0x46f890['view']['headerView']['iconView']&&_0x4142f8&&(_0x46f890['view']['headerView']['iconView']['content']=_0x4142f8)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x46f890['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](Is)['showFakeVisualSelection']({'editor':this['_editor'],'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](Is)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x58ef97=this['_editor']['plugins']['get']('Dialog'),{id:_0x55749b,title:_0xdeecad,icon:_0x11fde3,class:_0xb8e546,mainView:_0x338780}=this['_currentConfig'];_0x338780['delegate'](...aa)['to'](this),_0x58ef97['show']({'title':_0xdeecad,'icon':_0x11fde3,'hasCloseButton':!0x0,'id':_0x55749b,'position':this['_calculateDialogPosition']['bind'](this),'getRootName':this['_getCurrentDomRootName']['bind'](this),'className':'ck-ai-balloon\x20'+(_0xb8e546||''),'content':_0x338780,'onShow':_0x4bc2ea=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x4bc2ea['view']?.['updatePosition']();const _0x51c065=this['_getSelectionElements']();_0x51c065&&_0x51c065[0x0]&&Rt({'target':_0x51c065[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x4bc2ea['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x55749b});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x55749b}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x3547a7,_0x1e0036,_0x4d6876){const _0x24d837=_0x1e0036||_0x4d6876;if(!_0x24d837)return null;const _0x424e08=this['_getSelectionElements']();if(!_0x424e08||0x0===_0x424e08['length'])return{'left':Math['round'](_0x24d837['left']+_0x24d837['width']/0x2-_0x3547a7['width']/0x2),'top':Math['round'](_0x24d837['top']+_0x24d837['height']/0x2-_0x3547a7['height']/0x2)};const _0x20805e=Math['round'](_0x24d837['left']+_0x24d837['width']/0x2-_0x3547a7['width']/0x2),_0x12261=_0x424e08['map'](_0x879cec=>new At(_0x879cec)),_0x415aa2=_0x3547a7['height'];return{'left':_0x20805e,'top':this['_calculateOptimalTopPosition'](_0x12261,_0x415aa2,_0x24d837)};}['_calculateOptimalTopPosition'](_0x2484a2,_0x172528,_0x14921f){const _0xe9817=new At(Tt['window']),_0xd55b94=_0x2484a2['map'](_0x1ca0e4=>_0x1ca0e4['getVisible']())['filter'](_0x40e74a=>_0x40e74a),_0x5aa470=At['getBoundingRect'](_0xd55b94);if(!_0x5aa470)return Math['round'](_0x14921f['top']+_0x14921f['height']/0x2);const _0x571edd=_0xe9817['getIntersection'](_0x5aa470);if(!_0x571edd)return Math['round'](_0x14921f['top']+_0x14921f['height']/0x2);const _0x16adc9=_0x14921f['getVisible'](),_0x44aabd=_0x16adc9&&_0x5aa470['height']>_0x16adc9['height'],_0x3d9e90=_0x571edd['top'],_0x8cd257=_0x571edd['bottom'];if(_0x44aabd){const _0xe41023=_0xe9817['top']+_0xe9817['height']/0x2-_0x172528/0x2,_0x1023a0=_0x3d9e90-ca-_0xe9817['top'],_0x48bb76=_0xe9817['bottom']-_0x8cd257-ca;return _0x1023a0>=_0x172528?Math['max'](ca,_0x3d9e90-_0x172528-ca):_0x48bb76>=_0x172528?_0x8cd257+ca:Math['max'](ca,_0xe41023);}const _0x586924=_0x3d9e90-_0x172528,_0x323fc3=_0xe9817['bottom']-_0x8cd257-ca,_0x26a189=_0x3d9e90-ca-_0xe9817['top'];let _0x2ec8d9;return _0x2ec8d9=_0x323fc3>=_0x172528?_0x8cd257+ca:_0x26a189>=_0x172528?_0x586924-ca:_0x3d9e90+_0x5aa470['height']/0x2-_0x172528/0x2,_0x2ec8d9;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x34eca6=this['_editor'];this['listenTo'](_0x34eca6['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x10f158,data:{newRange:_0x347e0b}}of _0x34eca6['model']['document']['differ']['getChangedMarkers']())if(_0x10f158['startsWith']('ai-selection:')&&(_0x347e0b&&(_0x347e0b['start']['isEqual'](_0x347e0b['end'])||'$graveyard'==_0x347e0b['root']['rootName'])||null==_0x347e0b)){const _0x2171e7=us(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x2171e7),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0xfa87be=this['_editor'];this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0xfa87be['model']['document']);}['_getSelectionElements'](){const _0x56ebb3=this['_editor'];return _0x456453(_0x56ebb3['editing'],[..._0x56ebb3['model']['markers']['getMarkersGroup']('ai-selection'),..._0x56ebb3['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getCurrentDomRootName'](){const _0x42d9c9=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];return _0x42d9c9&&_0x42d9c9['rootName']?_0x42d9c9['rootName']:null;}},ua=class extends _0x116a57{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x213a33,_0x219f5c={}){super(_0x213a33),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x219f5c};const _0x27f542=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x27f542?'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'](_0x7b9265){this['showChangesButton']['isEnabled']=_0x7b9265;}['_setupRatingButtons'](){this['likeButton']=new Ht(this['locale']),this['likeButton']['set']({'icon':ot,'label':us(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':hn,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new Ht(this['locale']),this['dislikeButton']['set']({'icon':rt,'label':us(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':hn,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new Ht(this['locale']),this['copyButton']['set']({'icon':_0x26f268,'label':us(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+hn,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0xf8219d=new Yt();_0xf8219d['set']({'content':_0x27c014}),_0xf8219d['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'+hn,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+hn;},0x7d0);}),this['copyButton']['children']['add'](_0xf8219d);}['_setupShowChangesButton'](){this['showChangesButton']=new Ht(this['locale']),this['showChangesButton']['set']({'icon':tt,'label':us(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':hn}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x242624=>_0x242624?et:tt),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}},da=class extends ha{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x4f866e,_0x259329){super(_0x4f866e);const _0x13170a=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new dt(),this['_keystrokes']=new _t(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Gt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x259329,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new qn(_0x4f866e),this['_partToolbarView']=new Wn(_0x4f866e,_0x259329['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x259329),this['_stateView']=new Fn(_0x4f866e),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ua(_0x4f866e,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new _a(_0x4f866e,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x5777cb,_0x468713,_0x41763f,_0x564bad)=>{let _0x136314,_0x4fdaf3;'pending'===_0x564bad?(_0x136314=this['_partToolbarView'],_0x4fdaf3=this['_stateView']):(_0x136314=this['_stateView'],_0x4fdaf3=this['_partToolbarView']),this['_stateView']['setState'](_0x41763f),_0x136314['isVisible']=!0x1,_0x4fdaf3['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x13170a['to']('_state',_0x5b7ce8=>'ck-ai-chat-balloon-main_state_'+_0x5b7ce8)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x259329);});}['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'](_0x5192d8){_0x5192d8?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x5192d8);}['clearContent'](){this['_streamableContentView']['clear']();}['setState'](_0x53d84c){this['_state']=_0x53d84c;}['showError'](_0x114ebd){super['showError'](_0x114ebd),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x1ec724){super['showBlockingError'](_0x1ec724),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x5bebdd){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x5bebdd;}['togglePartToolbarEnabled'](_0x11a1ca){this['_partToolbarView']['isEnabled']=_0x11a1ca;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x273983,showSuggestButton:_0x3c8f71}){_0x273983=_0x273983&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x3c8f71=_0x3c8f71&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x273983,'showSuggestButton':_0x3c8f71});}['_createNextButtonView'](){const _0x4db576=new Ht(this['locale']);return _0x4db576['set']({'icon':_0x13018d,'label':us(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x4db576['on']('execute',()=>{this['fire']('showNext');}),_0x4db576;}['_createPreviousButtonView'](){const _0x4a215d=new Ht(this['locale']);return _0x4a215d['set']({'icon':_0x53c774,'label':us(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x4a215d['on']('execute',()=>{this['fire']('showPrevious');}),_0x4a215d;}},_a=class extends _0x215f6f{constructor(_0x46c109,_0x5ca3ac){super(_0x46c109),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x5ca3ac});}},ga=class extends _0x3688ab{static get['requires'](){return[Mt,la];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x3bbb37){super(_0x3bbb37),this['set']('showDiff',!0x1);}['open'](_0x174bd1){const _0x5f3426=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x5f3426['plugins']['get']('AIBalloon')['open']({..._0x174bd1,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x174bd1['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x174bd1['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x2fe4df){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x2fe4df);}['clearContent'](){this['_chatBalloonView']&&this['_chatBalloonView']['clearContent']();}['setState'](_0x502df9){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x502df9);}['_createChatBalloonView'](){const _0x285682=this['editor'],_0x11d8d5=_0x285682['plugins']['get']('AIBalloon'),_0x205ec0=_0x285682['commands']['get']('trackChanges');let _0x23fcf9=_0x285682['config']['get']('ai.availableReplyActions')||[...er];_0x285682['plugins']['has']('TrackChanges')||(_0x23fcf9=_0x23fcf9['filter'](_0x1a7ce1=>'insertSuggestion'!=_0x1a7ce1));const _0x16bb53=new da(_0x285682['locale'],{'availableActions':_0x23fcf9,'showApplyButton':!0x0,'showSuggestButton':!!_0x205ec0});return _0x16bb53['bind']('showDiff')['to'](this),_0x16bb53['delegate'](...Nn)['to'](this),_0x16bb53['delegate']('showPrevious','showNext')['to'](this),_0x11d8d5['delegate']('dialogClosed')['to'](this),_0x16bb53['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x16bb53['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x16bb53['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x205ec0&&_0x16bb53['bind']('isTrackChangesOn')['to'](_0x205ec0,'value'),_0x16bb53['render'](),_0x16bb53;}['_toggleRotatorButtonsInDialogHeader'](_0x58f24e){const _0x116bc9=this['editor'],_0x547c24=_0x116bc9['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x58f24e),_0x547c24['has'](this['_chatBalloonView']['previousButtonView'])||(_0x547c24['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x116bc9['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x547c24['remove'](this['_chatBalloonView']['previousButtonView']),_0x547c24['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}},Aa=class extends _0x3688ab{static get['requires'](){return[oa,ga,_0x611eb6];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};function Ia(_0x584a53){const {editor:_0x4c75bc,action:_0x4795d1,withText:_0x5d3a74=!0x1,withIcon:_0x18b5d3=!0x0,isInDropdown:_0x9a0abb=!0x0,shouldPreventFocus:_0x1c5507=!0x1,actionButtons:_0x38653f}=_0x584a53;return()=>{const _0x5b4271=_0x4c75bc['locale'],_0x21bb7a=new Ht(_0x5b4271),_0xdc4917=_0x21bb7a['bindTemplate'];_0x9a0abb&&_0x21bb7a['extendTemplate']({'on':{'mouseenter':_0xdc4917['to'](()=>{_0x1c5507&&_0x1c5507()||_0x21bb7a['focus']();})}}),_0x38653f['push']({'buttonView':_0x21bb7a,'action':_0x4795d1});const _0x122a85=_0x4795d1['icon']??_0x4795d1['parent']?.['icon'];return _0x21bb7a['set']({'label':_0x4795d1['label'],'withText':_0x5d3a74,'role':'menuitem','icon':_0x18b5d3?_0x122a85??_0x27a3d4:void 0x0,'tooltip':!_0x5d3a74,'class':'ck-ai-quick-actions-button','isEnabled':_0x4795d1['isEnabled']}),_0x21bb7a['on']('execute',()=>{_0x4c75bc['editing']['view']['focus'](),_0x4c75bc['commands']['execute']('aiQuickAction',_0x4795d1);}),_0x21bb7a;};}var pa=class extends Qt{['arrowView'];constructor(_0x5c1abd,_0x2b3b91){super(_0x5c1abd,_0x2b3b91);const _0xe8be58=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',_0x3d4c84=>String(_0x3d4c84)),'data-cke-tooltip-disabled':_0xe8be58['to']('isOn')},'on':{'mouseenter':_0xe8be58['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x565bd2=new Yt();return _0x565bd2['content']=_0x20cf00,_0x565bd2['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x565bd2;}},ma=class extends jt{['_allListItems'];['_allSearchableItems'];constructor(_0x1cdfe9,_0x552854,_0x954dda){super(_0x1cdfe9),this['_allListItems']=_0x552854,this['_allSearchableItems']=_0x954dda;}['filter'](_0x436820){if(!_0x436820)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0xa7926a=_0x436820['source']['toLowerCase']()['trim'](),_0x5878d9=this['_allSearchableItems']['filter'](_0xd16080=>(_0xd16080['groupLabel']?_0xd16080['label']+'\x20('+_0xd16080['groupLabel']+')':_0xd16080['label'])['toLowerCase']()['includes'](_0xa7926a));return this['items']['clear'](),this['items']['addMany'](_0x5878d9['sort']((_0x54aa7b,_0x3621a8)=>{const _0x212819=_0x54aa7b['groupLabel'],_0x11269c=_0x3621a8['groupLabel'];return _0x212819||_0x11269c?_0x212819?0x1:-0x1:0x0;})['map'](_0x5c4582=>_0x5c4582['item'])),this['_highlightQuery'](_0xa7926a,_0x5878d9),{'resultsCount':_0x5878d9['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x42487a,_0x49c772){if(!_0x42487a)return;const _0x5e5d17=new RegExp(_0x49ade4(_0x42487a),'gi');_0x49c772['forEach'](_0x20240f=>{_0x20240f['highlightViews']&&_0x20240f['highlightViews']['forEach'](_0x586613=>{'function'==typeof _0x586613['highlightText']&&_0x586613['highlightText'](_0x5e5d17);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x1ea2bd=>{_0x1ea2bd['highlightViews']&&_0x1ea2bd['highlightViews']['forEach'](_0x565d45=>{'function'==typeof _0x565d45['highlightText']&&_0x565d45['highlightText'](null);});});}};const Ea='menu',Ta='menuitem';var wa=class extends _0x215f6f{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];['_actionButtons'];constructor(_0x42bb4e,_0x45b19a,_0x1b5dbb,_0x81e7b6,_0x4d9da1=!0x1,_0x481996=[]){const _0x335bd5=_0x42bb4e['locale'];super(_0x335bd5),this['_bodyCollection']=_0x81e7b6,this['_hasSearch']=_0x4d9da1,this['_actionButtons']=_0x481996;const _0x230343=this['_createListItems'](_0x42bb4e,_0x45b19a,_0x1b5dbb);this['optionsListView']=new ma(_0x335bd5,_0x230343,this['_allSearchableItems']),this['optionsListView']['role']=Ea,this['optionsListView']['items']['addMany'](_0x230343),this['focusTracker']=new dt(),this['keystrokes']=new _t(),_0x4d9da1&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x230343,this['focusCycler']=new Gt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x4d9da1&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x394e1f=_0x4d9da1&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x498844(_0x394e1f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x335bd5['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x27b4c4(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':us(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':us(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x3609bc=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x3609bc);}['_createListItems'](_0x29763f,_0x592ccf,_0x519650){const _0x567ec2=new _0x498844();return _0x592ccf['forEach'](_0x1e487b=>{if('actions'in _0x1e487b){const {listItem:_0x36e662}=this['_createActionGroupButton'](_0x29763f,_0x1e487b,_0x519650);_0x567ec2['add'](_0x36e662),_0x1e487b['actions']['forEach'](_0x9b5de5=>{const {listItem:_0xdd107a,highlightViews:_0xb9c29}=this['_createSearchResultActionButton'](_0x29763f,_0x9b5de5,_0x1e487b['label'],_0x1e487b['icon']);this['_allSearchableItems']['push']({'item':_0xdd107a,'label':_0x9b5de5['label'],'groupLabel':_0x1e487b['label'],'highlightViews':_0xb9c29});});}else{const {listItem:_0x4d20ba}=this['_createActionButton'](_0x29763f,_0x1e487b);_0x567ec2['add'](_0x4d20ba);const _0x8b43d2=_0x4d20ba['children']['first'];if(_0x8b43d2){const {listItem:_0x13a1df,highlightViews:_0x14f769}=this['_createSearchResultActionButton'](_0x29763f,_0x1e487b);this['_allSearchableItems']['push']({'item':_0x13a1df,'label':_0x8b43d2['label']||'','highlightViews':_0x14f769});}}}),_0x567ec2;}['_createActionButton'](_0xdfba,_0x4bfb5c,_0x1ccf9a,_0x18956f){const _0x18f658=new zt(this['locale']);if(_0x1ccf9a&&_0x18956f){const _0xfd5494=new Ht(this['locale']),_0x10f766=_0xfd5494['bindTemplate'],_0x2fe8a4=new Wt();_0x2fe8a4['text']=_0x4bfb5c['label'];const _0x41cd6c=new Wt();_0x41cd6c['text']=_0x1ccf9a;const _0x55f6d6=new Yt();_0x55f6d6['content']=_0x18956f,_0x55f6d6['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x33a90a=new _0x215f6f(this['locale']);_0x33a90a['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x3df91b=new _0x215f6f(this['locale']);return _0x3df91b['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0xfd5494['set']({'label':_0x4bfb5c['label']+'\x20('+_0x1ccf9a+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1,'isEnabled':_0x4bfb5c['isEnabled']}),_0xfd5494['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group',_0x10f766['if']('isEnabled','ck-disabled',_0x37ba55=>!_0x37ba55)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x2fe8a4,_0x33a90a,_0x55f6d6,_0x41cd6c,_0x3df91b],'on':{'mouseenter':_0x10f766['to'](()=>{this['_isSearchFocused']()||_0xfd5494['focus']();}),'click':_0x10f766['to'](()=>{_0xfd5494['fire']('execute');})}}),_0xfd5494['on']('execute',()=>{_0xfd5494['isEnabled']&&(_0xdfba['editing']['view']['focus'](),_0xdfba['commands']['execute']('aiQuickAction',_0x4bfb5c));}),_0x18f658['children']['add'](_0xfd5494),this['_actionButtons']['push']({'buttonView':_0xfd5494,'action':_0x4bfb5c}),{'listItem':_0x18f658,'highlightViews':[_0x2fe8a4,_0x41cd6c]};}{const _0x169ae0=new Pt(),_0xb6962a=new Ht(this['locale'],_0x169ae0),_0x413108=_0xb6962a['bindTemplate'],_0x5a1a03=_0x4bfb5c['icon']??_0x4bfb5c['parent']?.['icon'],_0x49c3bd=void 0x0!==_0x4bfb5c['icon'];return _0xb6962a['set']({'label':_0x4bfb5c['label'],'withText':!0x0,'role':'menuitem','icon':_0x49c3bd?_0x5a1a03??_0x27a3d4:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button','isEnabled':_0x4bfb5c['isEnabled']}),_0xb6962a['extendTemplate']({'on':{'mouseenter':_0x413108['to'](()=>{this['_isSearchFocused']()||_0xb6962a['focus']();})}}),_0xb6962a['on']('execute',()=>{_0xdfba['editing']['view']['focus'](),_0xdfba['commands']['execute']('aiQuickAction',_0x4bfb5c);}),_0x18f658['children']['add'](_0xb6962a),this['_actionButtons']['push']({'buttonView':_0xb6962a,'action':_0x4bfb5c}),{'listItem':_0x18f658,'highlightViews':[_0x169ae0]};}}['_createSearchResultActionButton'](_0x565aaa,_0x257ea6,_0x540289,_0x35a08b){return _0x540289&&_0x35a08b?this['_createSearchResultGroupedActionButton'](_0x565aaa,_0x257ea6,_0x540289,_0x35a08b):this['_createSearchResultIndividualActionButton'](_0x565aaa,_0x257ea6);}['_createSearchResultGroupedActionButton'](_0x959375,_0x3235bc,_0x4c8db6,_0x51d944){const _0x55cca4=new zt(this['locale']),_0x887346=new Ht(this['locale']),_0x59bad4=_0x887346['bindTemplate'],{view:_0x48ea71,highlightView:_0xa7a1cb}=this['_createSearchResultGroupRow'](_0x4c8db6,_0x51d944),{view:_0x578899,highlightView:_0x2b592e}=this['_createSearchResultActionRow'](_0x3235bc['label']),_0x14e665=this['_createSearchResultContentView'](_0x48ea71,_0x578899);return _0x887346['set']({'label':_0x3235bc['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':_0x3235bc['isEnabled']}),_0x887346['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',_0x59bad4['if']('isEnabled','ck-disabled',_0x5a6a15=>!_0x5a6a15)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x14e665],'on':{'mouseenter':_0x59bad4['to'](()=>{this['_isSearchFocused']()||_0x887346['focus']();}),'click':_0x59bad4['to'](()=>{this['_handleSearchResultButtonClick'](_0x887346);})}}),this['_setupActionButtonExecution'](_0x887346,_0x959375,_0x3235bc),_0x55cca4['children']['add'](_0x887346),this['_actionButtons']['push']({'buttonView':_0x887346,'action':_0x3235bc}),{'listItem':_0x55cca4,'highlightViews':[_0xa7a1cb,_0x2b592e]};}['_createSearchResultIndividualActionButton'](_0x417acc,_0x592e57){const _0x44732b=new zt(this['locale']),_0x32f6ec=new Pt(),_0x1cc766=new Ht(this['locale'],_0x32f6ec),_0x49811a=_0x1cc766['bindTemplate'];return _0x1cc766['set']({'label':_0x592e57['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button','isEnabled':_0x592e57['isEnabled']}),_0x1cc766['extendTemplate']({'on':{'mouseenter':_0x49811a['to'](()=>{this['_isSearchFocused']()||_0x1cc766['focus']();})}}),this['_setupActionButtonExecution'](_0x1cc766,_0x417acc,_0x592e57),_0x44732b['children']['add'](_0x1cc766),this['_actionButtons']['push']({'buttonView':_0x1cc766,'action':_0x592e57}),{'listItem':_0x44732b,'highlightViews':[_0x32f6ec]};}['_createSearchResultGroupRow'](_0xed535e,_0x2d8010){const _0x48a4fe=new _0x215f6f(this['locale']),_0x376eda=new Yt();_0x376eda['content']=_0x2d8010,_0x376eda['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x5f559b=new Wt();return _0x5f559b['text']=_0xed535e,_0x48a4fe['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x376eda,_0x5f559b]}),{'view':_0x48a4fe,'highlightView':_0x5f559b};}['_createSearchResultActionRow'](_0xcd17bd){const _0x26c41e=new _0x215f6f(this['locale']),_0x9a5e44=new Wt();return _0x9a5e44['text']=_0xcd17bd,_0x26c41e['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x9a5e44]}),{'view':_0x26c41e,'highlightView':_0x9a5e44};}['_createSearchResultContentView'](_0x1a042e,_0x4066e5){const _0x8579b0=new _0x215f6f(this['locale']);return _0x8579b0['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x1a042e,_0x4066e5]}),_0x8579b0;}['_setupActionButtonExecution'](_0x5f134f,_0x23f385,_0x3b88e1){_0x5f134f['on']('execute',()=>{_0x5f134f['isEnabled']&&(_0x23f385['editing']['view']['focus'](),_0x23f385['commands']['execute']('aiQuickAction',_0x3b88e1));});}['_createActionGroupButton'](_0x4e3be1,_0xd0fd1a,_0x109ac6){const _0x3f0d57=new zt(this['locale']),_0x3e8d1c=new Pt(),_0x5ebffc=new pa(this['locale'],_0x3e8d1c),_0x4f4f6d=_0x5ebffc['bindTemplate'],_0x461d8f=this['_getPanelKeystroke'](_0x109ac6),_0x2cbea5=this['_createGroupActionsList'](_0x4e3be1,_0xd0fd1a['actions'],_0x109ac6);_0x5ebffc['set']({'label':_0xd0fd1a['label'],'withText':!0x0,'role':Ta,'icon':_0xd0fd1a['icon']??_0x27a3d4,'isEnabled':_0xd0fd1a['actions']['some'](_0x3f694b=>_0x3f694b['isEnabled'])}),_0x5ebffc['extendTemplate']({'on':{'mouseenter':_0x4f4f6d['to'](()=>{this['_isSearchFocused']()||_0x5ebffc['focus']();})}});const _0xf0bddc=new yt(this['locale']);return _0xf0bddc['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x4f4f6d['to'](_0x204520=>{this['_handlePanelKeydown'](_0x204520,_0x461d8f,_0x5ebffc,_0xf0bddc);})}}),_0x5ebffc['bind']('isOn')['to'](_0xf0bddc,'isVisible'),this['_bodyCollection']['add'](_0xf0bddc),_0xf0bddc['content']['add'](_0x2cbea5),this['_setupGroupMenuBehavior'](_0x5ebffc,_0xf0bddc),_0x3f0d57['children']['add'](_0x5ebffc),this['_actionButtons']['push']({'buttonView':_0x5ebffc,'action':_0xd0fd1a}),{'listItem':_0x3f0d57,'highlightView':_0x3e8d1c};}['_createGroupActionsList'](_0x2a90fa,_0x4757f1,_0x2bf3aa){const _0x3bb53e=new jt(this['locale']);return _0x3bb53e['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x4757f1['forEach'](_0x769fa2=>{const _0x229d35=new zt(this['locale']),_0x16feae=Ia({'editor':_0x2a90fa,'action':_0x769fa2,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused'](),'actionButtons':this['_actionButtons']})();_0x229d35['children']['add'](_0x16feae),_0x2bf3aa['focusTracker']['add'](_0x16feae),_0x3bb53e['items']['add'](_0x229d35);}),_0x3bb53e;}['_setupGroupMenuBehavior'](_0x55db99,_0x30ae06){const _0x300d69=_0x55db99['bindTemplate'],_0x99adb1=this['_getButtonKeystroke'](_0x55db99);_0x55db99['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x300d69['to'](()=>{this['_showNestedPanel'](_0x30ae06,_0x55db99);}),'mouseleave':_0x300d69['to'](_0x44b9fe=>{const _0x3e9bf9=_0x44b9fe['relatedTarget'];this['_isMovingToNestedMenu'](_0x3e9bf9,_0x30ae06)||this['_hideNestedPanel'](_0x30ae06);}),'keydown':_0x300d69['to'](_0x555d04=>{_0x555d04['key']==_0x99adb1&&(this['_showNestedPanel'](_0x30ae06,_0x55db99),_0x30ae06['content']['get'](0x0)['focus']());})}}),_0x30ae06['on']('render',()=>{_0x30ae06['element']?.['addEventListener']('mouseleave',_0x1854b1=>{const _0x1a10b=_0x1854b1['relatedTarget'];_0x55db99['element']?.['contains'](_0x1a10b)||this['_isMovingToNestedMenu'](_0x1a10b,_0x30ae06)||this['_hideNestedPanel'](_0x30ae06);});});}['_showNestedPanel'](_0x4dd373,_0x3640da){this['_openNestedPanels']['forEach'](_0xb097f4=>{_0xb097f4!==_0x4dd373&&_0xb097f4['isVisible']&&_0xb097f4['hide']();}),_0x4dd373['show'](),_0x4dd373['pin']({'positions':[Ut['eastSouth']],'target':_0x3640da['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x4dd373);}['_hideNestedPanel'](_0x4eb99a){_0x4eb99a['hide'](),this['_openNestedPanels']['delete'](_0x4eb99a);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x43de34=>_0x43de34['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x5335ea,_0x11fcab){if(!_0x5335ea)return!0x1;if(_0x11fcab['element']?.['contains'](_0x5335ea))return!0x0;const _0x223586=_0x5335ea;return _0x223586['closest']&&(null!==_0x223586['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x223586['closest']('.ck-ai-quick-actions-group-list')||null!==_0x223586['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'](_0x3079d8){return'rtl'===_0x3079d8['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x5a1af2){return'rtl'===_0x5a1af2['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x23669f,_0x46f9f1,_0x4cb4f5,_0x54eabd){_0x23669f['key']==_0x46f9f1&&(_0x4cb4f5['focus'](),this['_hideNestedPanel'](_0x54eabd));}['_handleSearchResultButtonClick'](_0x12e36c){_0x12e36c['fire']('execute');}};function Ca(_0x14b981){const {editor:_0x1957cf,content:_0x3d254d,buttonDefinition:_0xa35693,bodyCollection:_0x79afeb,hasSearch:_0x487694=!0x1,actionButtons:_0x554e85}=_0x14b981;return()=>{const _0x47d8dc=_0x1957cf['locale'],_0x2087e0=_0x1957cf['commands']['get']('aiQuickAction'),_0x2b800c=_0x32dc43(_0x47d8dc);_0x2b800c['bind']('isEnabled')['to'](_0x2087e0),_0x2b800c['buttonView']['set']({'icon':_0xa35693['icon']??_0x27a3d4,'label':_0xa35693['label'],'tooltip':!0x0}),_0x2b800c['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x254f7a=new wa(_0x1957cf,_0x3d254d,_0x2b800c,_0x79afeb,_0x487694,_0x554e85);return _0x2b800c['panelView']['children']['add'](_0x254f7a),_0x487694&&_0x2b800c['on']('change:isOpen',(_0xb7895e,_0x271d43,_0x36a7e8)=>{if(_0x36a7e8){if(_0x1957cf['plugins']['has']('AIEditing')){const _0x5acd71=_0x1957cf['plugins']['get'](Is),_0x2df9bc=_0x1957cf['model']['document']['selection'],_0x39d360=Array['from'](_0x2df9bc['getRanges']());_0x39d360['length']>0x0&&_0x5acd71['showFakeVisualSelection']({'editor':_0x1957cf,'ranges':_0x39d360,'id':'quick-action','priority':0x14});}}else _0x1957cf['plugins']['has']('AIEditing')&&_0x1957cf['plugins']['get'](Is)['hideFakeVisualSelection']('quick-action'),_0x254f7a['resetSearch']();}),_0x2b800c;};}const fa='<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>',ba='<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>',Sa='<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>',Ra=/* #__PURE__ -- @preserve */
37
- ((()=>({'chat':'AIChat','action':'AIActions'}))());var Oa=class AIQuickActionsUI extends _0x3688ab{['_actionButtons']=[];['_menuBarGroupViews']=[];['_reporter'];static get['requires'](){return[xt,ls,nn];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_reporter']=this['editor']['plugins']['get'](nn)['createReporter']('aiquickactions');const _0x181189=this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x181189),this['_initializeQuickActionsComponentsAndCommands'](),this['_initActionTypeQuickActions'](),this['_initChatTypeQuickActions']();}static['getDefaultQuickActions'](_0x1a38e2){return function(_0x7bf58c){const _0x2cf7c8=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x7bf58c['uiLanguage'])||'English';return[{'id':'ask-ai','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x573020},{'id':'chat-commands','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x573020,'actions':[{'id':'explain','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':us(_0x7bf58c,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':fa['replace']('%0',_0x2cf7c8),'type':'chat'},{'id':'summarize','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':us(_0x7bf58c,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ba['replace']('%0',_0x2cf7c8),'type':'chat'},{'id':'highlight-key-points','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':us(_0x7bf58c,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Sa['replace']('%0',_0x2cf7c8),'type':'chat'}]},{'id':'improve-writing','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x1382e4},{'id':'continue','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x33e37e},{'id':'fix-grammar','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0xc4a56a},{'id':'adjust-length','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x4bdbb4,'actions':[{'id':'make-shorter','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0xc3c3ab,'actions':[{'id':'make-tone-casual','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x4dd947,'actions':[{'id':'translate-to-english','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':us(_0x7bf58c,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x1c72b8,'actions':[]}];}(_0x1a38e2);}['_getDefaultAndCustomActions'](){const _0x1628b4=AIQuickActionsUI['getDefaultQuickActions'](this['editor']['locale']),_0x292f45=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x35a5cf=>({..._0x35a5cf,'type':'chat'===_0x35a5cf['type']?'chat':'action','icon':void 0x0}));return _0x1628b4['find'](_0x11be94=>'other'===_0x11be94['id'])['actions']['push'](..._0x292f45),_0x1628b4;}async['_initActionTypeQuickActions'](){try{const _0xd60cb0=new Qs({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']}),_0x2ee4d3=await _0xd60cb0['getAll'](),_0x148234=(await _0xd60cb0['getDefault']())?.['id'];this['_assignDefaultModelToCustomActions'](_0x148234),this['_enableButtonsByType']('action',_0x93ba54=>!!_0x2ee4d3['find'](_0x45b0bd=>_0x45b0bd['id']===_0x93ba54['model'])||void 0x0===_0x93ba54['model']);}catch(_0x21cfb1){const _0x59f6f5=new ht('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x21cfb1});this['_reporter']['logError'](_0x59f6f5);}}['_initChatTypeQuickActions'](){if(!this['editor']['plugins']['has']('AIChatController'))return;const _0x3afe8b=this['editor']['plugins']['get']('AIChatController');this['listenTo'](_0x3afe8b,'change:isConversationReady',(_0xa2d3a6,_0x49bfdc,_0x471049)=>{_0x471049&&this['_enableButtonsByType']('chat',()=>!0x0);}),_0x3afe8b['isConversationReady']&&this['_enableButtonsByType']('chat',()=>!0x0);}['_enableButtonsByType'](_0x484179,_0x28f707){this['_quickActionsDefinition']['forEach'](_0x4236d1=>{'actions'in _0x4236d1?_0x4236d1['actions']['forEach'](_0x12d346=>{_0x12d346['type']===_0x484179&&(_0x12d346['isEnabled']=_0x28f707(_0x12d346));}):_0x4236d1['type']===_0x484179&&(_0x4236d1['isEnabled']=_0x28f707(_0x4236d1));}),this['_actionButtons']['forEach'](_0x7183d=>{if(va(_0x7183d['action']))return;if(_0x7183d['action']['type']!==_0x484179)return;const _0x36c982=_0x28f707(_0x7183d['action']);if(_0x7183d['action']['isEnabled']=_0x36c982,_0x7183d['buttonView']['isEnabled']=_0x36c982,!_0x36c982&&_0x7183d['action']['model']){const _0x397d61=new ht('ai-quick-actions-unavailable-model',this,{'actionId':_0x7183d['action']['id'],'modelId':_0x7183d['action']['model']});this['_reporter']['logError'](_0x397d61);}}),this['_actionButtons']['filter'](_0x26702c=>va(_0x26702c['action']))['forEach'](_0x19b4b2=>{_0x19b4b2['buttonView']['isEnabled']=_0x19b4b2['action']['actions']['some'](_0x39fe28=>_0x39fe28['isEnabled']);}),this['_menuBarGroupViews']['forEach'](({view:_0x1d64a8,group:_0x597a6d})=>{_0x1d64a8['isEnabled']=_0x597a6d['actions']['some'](_0x252706=>_0x252706['isEnabled']);});}['_assignDefaultModelToCustomActions'](_0x313297){this['_actionButtons']['forEach'](_0x30b98d=>{va(_0x30b98d['action'])||'action'===_0x30b98d['action']['type']&&(_0x30b98d['action']['model']||(_0x30b98d['action']['model']=_0x313297));});}['_initializeQuickActionsComponentsAndCommands'](){const _0x3a1129=new Lt(this['editor']['locale']);_0x3a1129['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x3a1129),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x3a1129);}['_initializeQuickActionsDropdown'](_0x5a8e0a){const _0x923f44=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Ca({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x27a3d4,'label':us(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x5a8e0a,'hasSearch':_0x923f44,'actionButtons':this['_actionButtons']}));}['_prepareQuickActionsDefinition'](_0x345850){this['_quickActionsDefinition']=_0x345850['map'](_0x39dca0=>{if('actions'in _0x39dca0){const _0x3f6a96=_0x39dca0;return{..._0x3f6a96,'actions':_0x3f6a96['actions']['map'](_0x5cc6c6=>{const {actions:_0x33482a,..._0x46b24}=_0x3f6a96;return{..._0x5cc6c6,'isEnabled':!0x1,'parent':_0x46b24};})['filter'](_0x23ed9b=>this['_shouldIncludeAction'](_0x23ed9b))};}return{..._0x39dca0,'isEnabled':!0x1};})['filter'](_0x34edde=>'actions'in _0x34edde?_0x34edde['actions']['length']>0x0:this['_shouldIncludeAction'](_0x34edde));}['_shouldIncludeAction'](_0x1dc363){const _0x56e427=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ra[_0x1dc363['type']])&&!_0x56e427['includes'](_0x1dc363['id'])&&!('chat'===_0x1dc363['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x4c58a9){this['_quickActionsDefinition']['forEach'](_0x98a1a1=>{if('actions'in _0x98a1a1){const _0x1b624b=Ca({'editor':this['editor'],'content':_0x98a1a1['actions'],'buttonDefinition':_0x98a1a1,'bodyCollection':_0x4c58a9,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x98a1a1['id'],_0x1b624b),_0x98a1a1['actions']['forEach'](_0x530ca2=>{const _0x5cc14c=Ia({'editor':this['editor'],'action':_0x530ca2,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x530ca2['id'],_0x5cc14c);});}else{const _0x5a0b7a=Ia({'editor':this['editor'],'action':_0x98a1a1,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x98a1a1['id'],_0x5a0b7a);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x5a5d77=>{const _0x231081=this['editor']['commands']['get']('aiQuickAction'),_0xc79c27=new _0x42746f(_0x5a5d77),_0x5172f5=us(_0x5a5d77,'AI_QUICK_ACTIONS_HEADING');_0xc79c27['buttonView']['set']({'label':_0x5172f5,'icon':_0x27a3d4});const _0x356643=new te(_0x5a5d77);return _0x356643['set']({'ariaLabel':_0x5172f5,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x284fe3=>{if('actions'in _0x284fe3){const _0x13e5fd=_0x284fe3,_0x2a3a03=new Zt(_0x5a5d77,_0xc79c27),_0x212004=new _0x42746f(_0x5a5d77),_0x82afa9=new te(_0x5a5d77);_0x212004['buttonView']['set']({'label':_0x13e5fd['label'],'icon':_0x13e5fd['icon']}),_0x13e5fd['actions']['forEach'](_0x20cae8=>{const _0x1ec055=new Zt(_0x5a5d77,_0x212004),_0x7195f4=new Jt(_0x5a5d77);_0x7195f4['set']({'label':_0x20cae8['label'],'icon':_0x20cae8['icon'],'role':'menuitem','isEnabled':_0x20cae8['isEnabled']}),_0x7195f4['on']('execute',()=>{this['_executeQuickAction'](_0x20cae8);}),this['_actionButtons']['push']({'buttonView':_0x7195f4,'action':_0x20cae8}),_0x7195f4['delegate']('execute')['to'](_0x212004),_0x1ec055['children']['add'](_0x7195f4),_0x82afa9['items']['add'](_0x1ec055);}),_0x212004['isEnabled']=_0x13e5fd['actions']['some'](_0x56a7a4=>_0x56a7a4['isEnabled']),this['_menuBarGroupViews']['push']({'view':_0x212004,'group':_0x13e5fd}),_0x212004['panelView']['children']['add'](_0x82afa9),_0x2a3a03['children']['add'](_0x212004),_0x356643['items']['add'](_0x2a3a03);}else{const _0x36e377=_0x284fe3,_0x292cc8=new Zt(_0x5a5d77,_0xc79c27),_0xb065c2=new Jt(_0x5a5d77);_0xb065c2['set']({'label':_0x36e377['label'],'icon':_0x36e377['icon'],'role':'menuitem','isEnabled':_0x36e377['isEnabled']}),this['_actionButtons']['push']({'buttonView':_0xb065c2,'action':_0x36e377}),_0xb065c2['on']('execute',()=>{this['_executeQuickAction'](_0x36e377);}),_0xb065c2['delegate']('execute')['to'](_0xc79c27),_0x292cc8['children']['add'](_0xb065c2),_0x356643['items']['add'](_0x292cc8);}}),Object['values'](Ra)['some'](_0x5711dd=>this['editor']['plugins']['has'](_0x5711dd))?_0xc79c27['bind']('isEnabled')['to'](_0x231081):_0xc79c27['set']({'isEnabled':!0x1}),_0xc79c27['panelView']['children']['add'](_0x356643),_0xc79c27;});}['_executeQuickAction'](_0x521ddf){const _0x49dec1=this['editor'];_0x49dec1['editing']['view']['focus'](),_0x49dec1['commands']['execute']('aiQuickAction',_0x521ddf);const _0x207a76=_0x49dec1['ui']['view']['menuBarView'];_0x207a76&&_0x207a76['close']&&_0x207a76['close']();}};function va(_0x19e899){return'actions'in _0x19e899;}function ka(_0x1e8821,_0x510cb0){const _0x766ae9=_0x1e8821['plugins']['get']('AITabs')['view'];_0x766ae9['isVisible']=!0x0,_0x766ae9['activateTab'](_0x510cb0);}var Na=class extends _0x24f2c3{['execute'](_0x5767c8){switch(this['_expandSelectionIfCollapsed'](),_0x5767c8['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x3e54bc=us(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x3e54bc});}this['_handleAIChatAction'](_0x5767c8);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x57dde8=us(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x57dde8});}this['_handleAIActionsAction'](_0x5767c8);}}async['_handleAIChatAction'](_0x106c06){const _0x323005=this['editor']['plugins']['get']('AIChatController');if(ka(this['editor'],'chat'),'ask-ai'===_0x106c06['id'])_0x323005['removeSelectionFromChatContext'](),_0x323005['addSelectionToChatContext'](this['editor']),_0x323005['focusPromptInput']();else await _0x323005['startConversation']({'modelId':_0x106c06['model']}),_0x323005['removeSelectionFromChatContext'](),_0x323005['addSelectionToChatContext'](this['editor']),_0x323005['focusPromptInput'](),await _0x323005['sendMessage']({'message':_0x106c06['prompt']||_0x106c06['displayedPrompt']||_0x106c06['label'],'attributes':{'quickActionData':{'id':_0x106c06['id']},'displayedPrompt':_0x106c06['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x3f61e6=this['editor'],_0x5812b0=_0x3f61e6['model']['document']['selection'];if(!_0x5812b0['isCollapsed'])return;const _0x141e5f=mt(_0x5812b0['getSelectedBlocks']())||_0x3f61e6['model']['schema']['getLimitElement'](_0x5812b0);_0x3f61e6['model']['change'](_0x343243=>{_0x343243['setSelection'](_0x141e5f,'in');});}['_handleAIActionsActionLabel'](_0x4ed8af){return _0x4ed8af['parent']?.['label']&&'other'!==_0x4ed8af['parent']?.['id']?_0x4ed8af['parent']['label']+':\x20'+_0x4ed8af['label']:_0x4ed8af['label'];}async['_handleAIActionsAction'](_0x5e9711){const _0x576cbc=this['editor']['plugins']['get']('AIActions'),_0x5aa037=_0x5e9711['prompt']?{'userMessage':_0x5e9711['prompt'],'model':_0x5e9711['model']}:{'actionName':_0x5e9711['actionName']||_0x5e9711['id'],'args':_0x5e9711['args']},_0x2305b5=this['_handleAIActionsActionLabel'](_0x5e9711);await _0x576cbc['executeAction'](_0x5aa037,_0x2305b5,_0x5e9711['icon']);}},ya=class extends _0x3688ab{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x547347=this['editor'],_0x51e5bf=new Na(this['editor']);if(_0x547347['commands']['add']('aiQuickAction',_0x51e5bf),_0x547347['plugins']['has']('AIChat')){const _0x5ee42a=this['editor']['plugins']['get']('AIChatController');_0x547347['model']['document']['selection']['on']('change:range',(_0x183a8c,_0x1d2a21)=>{_0x1d2a21['directChange']&&_0x5ee42a['removeSelectionFromChatContext']();});}}},xa=class extends dn{['appendContent'](_0x3b31f8,_0x4deadd='text'){'modification'===this['type']&&'text'===_0x4deadd&&(_0x4deadd=this['documentContextContent']['keys']()['next']()['value']),super['appendContent'](_0x3b31f8,_0x4deadd);}['updateChangeGroups'](_0x54abe1){const _0x5fd03b=this['parsedContent']['get'](_0x54abe1)['cloneNode'](!0x0);if(this['parsedMergedContent']['set'](_0x54abe1,_0x5fd03b),this['changeGroups']=[],0x0==_0x5fd03b['childNodes']['length'])return;Ds(this['documentContextContent']['get'](_0x54abe1),this['parsedMergedContent']['get'](_0x54abe1));const _0x271284=_0x118114(this['documentContextContent']['get'](_0x54abe1)['children']['map'](_0xe81bba=>({'node':_0xe81bba,'id':fs(_0xe81bba,'data-id')})),_0x5fd03b['children']['map'](_0x419110=>({'node':_0x419110,'id':fs(_0x419110,'data-id')||vt()})),{'comparator':(_0x5cec35,_0x4f190b)=>_0x5cec35['id']==_0x4f190b['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x271284['length']&&_0x271284[_0x271284['length']-0x1]['removed'];)_0x271284['pop']();}const _0x40316b=_0x271284['map'](_0x426a8e=>{const _0x966466=_0x426a8e['added']?'new':_0x426a8e['removed']?'removed':'modified';return{'node':_0x426a8e['value'][0x0]['node'],'type':_0x966466,'id':_0x426a8e['value'][0x0]['id']};}),_0x10f44a=this['_documentIdToSource']['get'](_0x54abe1);this['changeGroups']['push']({'changes':_0x40316b,'state':'pending','index':this['changeGroups']['length'],'editor':_0x10f44a['editor'],'rootName':_0x10f44a['rootName'],'documentId':_0x54abe1});}['_getDifferentChangeGroups'](_0x158347,_0x1dcf79){return _0x1dcf79;}},La=class extends An{['content'];['version'];['editor'];['rootName'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x13246d){super(_0x13246d),this['content']=_0x13246d['content'],this['version']=_0x13246d['version'],this['editor']=_0x13246d['editor'],this['rootName']=_0x13246d['rootName'],this['actionName']=_0x13246d['actionName'],this['args']=_0x13246d['args'],this['userMessage']=_0x13246d['userMessage'],this['model']=_0x13246d['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':'document','documents':[{'id':this['id'],'content':this['content'],'version':this['version'],'rootName':this['rootName'],'sessionId':vt(),'channelId':this['editor']['config']['get']('collaboration.channelId')}],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x52a87d){const _0x2c43f3=this['editor']['config']['get']('collaboration.channelId'),_0x26d376=new xa({..._0x52a87d,'locale':this['locale'],'documentContextContent':[{'id':this['id'],'content':this['content'],'channelId':_0x2c43f3,'rootName':this['rootName']}],'channelsToEditors':new Map([[_0x2c43f3,this['editor']]])});return this['replies']['push'](_0x26d376),_0x26d376['delegate'](...gn)['to'](this),this['fire']('replyCreated',_0x26d376),_0x26d376;}},Da=class extends _0x116a57{constructor(_0x598b69,_0x3df8fd=!0x0,_0x5d108a=!0x0){super(_0x598b69),this['set']('isEnabled',!0x1),_0x3df8fd&&(this['applyButton']=this['_createButton'](us(_0x598b69,'AI_BALLOON_APPLY_BUTTON'),on),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x5d108a&&(this['suggestButton']=this['_createButton'](us(_0x598b69,'AI_BALLOON_SUGGEST_BUTTON'),_0x3df8fd?an:on),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x3df8fd,'showSuggestButton':_0x5d108a}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x3c270e,showSuggestButton:_0x1e2362}){this['applyButton']&&(this['applyButton']['isVisible']=_0x3c270e),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x1e2362);}['_createButton'](_0x508188,_0x514b47){const _0xe7efa2=new Ht(this['locale']);return _0xe7efa2['set']({'label':_0x508188,'class':_0x514b47,'isVisible':!0x0,'withText':!0x0}),_0xe7efa2;}},Pa=class extends _0x215f6f{constructor(_0x54c882){super(_0x54c882),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':us(_0x54c882,'AI_DISCLAIMER_TEXT')}]}]});}},Ha=class extends _0x215f6f{constructor(_0x1d0250){super(_0x1d0250),this['set']('isVisible',!0x0);const _0x445044=new cr('small');_0x445044['isVisible']=!0x0;const _0x7e7436=new _0x215f6f(this['locale']);_0x7e7436['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[us(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x1dc91d=>!_0x1dc91d)]},'children':[_0x445044,_0x7e7436]});}},Ma=class extends ha{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_miniToolbarResizeObserver'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x535eb7,_0xe128b){super(_0x535eb7),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0xe128b,this['_focusTracker']=new dt(),this['_keystrokes']=new _t(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Gt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x498844(),this['_addContentWrapper'](_0xe128b),this['_addDisclaimerView'](),this['_addToolbar'](_0xe128b),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'](_0xe128b);}),this['on']('render',()=>{this['_setupMiniToolbarPositioning']();});}['render'](){super['render']();for(const _0x173f9c of this['_focusables'])this['_focusTracker']['add'](_0x173f9c['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy'](),this['_miniToolbarResizeObserver']&&this['_miniToolbarResizeObserver']['destroy']();}['focus'](_0xdf150d){-0x1===_0xdf150d?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x36842e){this['_isLoading']=_0x36842e;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x1b8600){super['showError'](_0x1b8600),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x3240ad){super['showBlockingError'](_0x3240ad),this['setErrorState']();}['addMiniToolbarItem'](_0x3fd1b8){this['_miniToolbarView']['items']['has'](_0x3fd1b8)||this['_miniToolbarView']['items']['add'](_0x3fd1b8);}['removeMiniToolbarItem'](_0x5a2b7c){this['_miniToolbarView']['items']['has'](_0x5a2b7c)&&this['_miniToolbarView']['items']['remove'](_0x5a2b7c);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x3a6700,showSuggestButton:_0x420199}){_0x3a6700=_0x3a6700&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x420199=_0x420199&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x3a6700,'showSuggestButton':_0x420199});}async['updateContent'](_0x9b8ba8){await this['_streamableContentView']['update'](_0x9b8ba8);}['finalizeContent'](){this['_streamableContentView']['cleanUpStreamingArtifacts']();}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x29de0c){this['_contentWrapper']=new _0x215f6f(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content',this['bindTemplate']['if']('_isErrorVisible','ck-hidden')]},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x29de0c['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new Pa(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x1d730f,showSuggestButton:_0x323b6e}){this['_toolbarView']=new Da(this['locale'],_0x1d730f,_0x323b6e),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',(_0x25ba34,_0x45cec4,_0x574f10)=>!(_0x25ba34||_0x45cec4||_0x574f10)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x1d730f,'showSuggestButton':_0x323b6e}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x5b6b9d){return this['_miniToolbarView']=new ua(this['locale'],_0x5b6b9d),this['_miniToolbarView']['delegate'](...Nn)['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',(_0x106f74,_0x8d63aa)=>!(_0x106f74||_0x8d63aa)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Ha(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new qn(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x8619e8=new Ht(this['locale']),_0x6e276b=new Ht(this['locale']),_0x2a4608=new Va(this['locale']),_0x254468=new Ht(this['locale']);_0x8619e8['set']({'icon':_0xd0bd37,'label':us(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+hn}),_0x6e276b['set']({'icon':_0x1901d7,'tooltip':us(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+hn}),_0x254468['set']({'icon':_0x1a35f7,'tooltip':us(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+hn}),_0x8619e8['bind']('isEnabled')['to'](this,'isBusy',_0xa09580=>!_0xa09580),_0x8619e8['on']('execute',()=>{this['fire']('tryAgain');}),_0x6e276b['bind']('isEnabled')['to'](this,'isBusy',_0x1b0000=>!_0x1b0000),_0x6e276b['on']('execute',()=>{this['fire']('showPrevious');}),_0x254468['bind']('isEnabled')['to'](this,'isBusy',_0x48c90b=>!_0x48c90b),_0x254468['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x6e276b,this['_navigationCounter']=_0x2a4608,this['_navigationNextButton']=_0x254468,this['_navigationTryAgainButton']=_0x8619e8;}['updateMiniToolbarButtons'](_0x21d471,_0x42faf0){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x3182df=_0x21d471>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x3182df){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x3ed1ab=_0x21d471-_0x42faf0;this['_navigationCounter']['setInteractionCount'](_0x3ed1ab+'/'+_0x21d471),this['_navigationPreviousButton']['isEnabled']=_0x42faf0<_0x21d471-0x1,this['_navigationNextButton']['isEnabled']=_0x42faf0>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'](_0x11b610){this['_isLoading']=_0x11b610;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_setupMiniToolbarPositioning'](){const _0x3a5b43=this['_streamableContentView']['element'],_0x527595=this['_miniToolbarView']['element'],_0x8a90ed=()=>{Tt['window']['requestAnimationFrame'](()=>{const _0x343bb1=_0x3a5b43['offsetWidth']-_0x3a5b43['clientWidth'];_0x527595['style']['right']='calc('+_0x343bb1+'px\x20+\x20var(--ck-spacing-large))';});};_0x8a90ed(),this['_miniToolbarResizeObserver']=new It(_0x3a5b43,()=>{_0x8a90ed();});}['_initializeScrollManager'](){const _0x11e337=this['_getScrollableElement']();_0x11e337&&!this['_scrollManager']&&(this['_scrollManager']=new Pr(_0x11e337));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}},Va=class extends _0x215f6f{constructor(_0x23a665){super(_0x23a665);const _0x29034a=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x29034a['to']('interactionCount')}]});}['setInteractionCount'](_0x41e7bb){this['set']('interactionCount',_0x41e7bb);}},Ua=class extends _0x3688ab{static get['requires'](){return[ls,nn,Mt,Is,la,_0x1cf5c4];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];['_reporter'];constructor(_0x75e961){super(_0x75e961),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['_reporter']=this['editor']['plugins']['get'](nn)['createReporter']('aiactions'),this['set']('isBusy',!0x1),this['_promiseQueue']=new Zn();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x2e2738,_0x131967,_0x1df22a){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')&&this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x146944,anchorData:_0x5cd27e,root:_0x2eb286}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x2e2738,_0x146944,_0x5cd27e,_0x2eb286,_0x131967,_0x1df22a);}const {modelFragment:_0x1feb72,anchorData:_0x8851de,root:_0x317905}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x2e2738,_0x1feb72,_0x8851de,_0x317905,_0x131967,_0x1df22a);}async['destroy'](){return this['_stopInteraction'](),super['destroy']();}['_createActionsBalloonView'](){const _0x3d8b64=this['editor']['plugins']['has']('TrackChanges');let _0x53163f=this['editor']['config']['get']('ai.availableReplyActions')||[...er];_0x3d8b64||(_0x53163f=_0x53163f['filter'](_0x89d4=>'insertSuggestion'!=_0x89d4));const _0xcbf5e8=this['editor']['commands']['get']('trackChanges'),_0x2e7a02=new Ma(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x3d8b64,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x53163f});return _0x2e7a02['bind']('isBusy')['to'](this),_0xcbf5e8&&_0x2e7a02['bind']('isTrackChangesOn')['to'](_0xcbf5e8,'value'),_0x2e7a02['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x2e7a02['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x2e7a02['on']('showNext',()=>{this['_navigateToNext']();}),_0x2e7a02;}['_normalizeSelectionStart'](){const _0x54de6b=this['editor']['model'],_0x3c758f=_0x54de6b['document']['selection'],_0x2dcd7d=_0x3c758f['getFirstRange']();if(!_0x2dcd7d||_0x2dcd7d['isCollapsed'])return;const _0x43f52e=mt(_0x3c758f['getSelectedBlocks']());if(!_0x43f52e)return;const _0x8e306b=_0x54de6b['createPositionAt'](_0x43f52e,0x0);_0x8e306b['isAfter'](_0x2dcd7d['start'])&&_0x54de6b['change'](_0x2d239c=>{_0x2d239c['setSelection'](_0x2d239c['createRange'](_0x8e306b,_0x2dcd7d['end']));});}['_getExecuteDataRegular'](){const _0x271bf4=this['editor']['model']['document']['selection'],_0x4ac055=_0x271bf4['getFirstRange']()['start']['root'];if(_0x271bf4['isCollapsed']){const _0x4b3879=mt(_0x271bf4['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x271bf4);this['editor']['model']['change'](_0xb054b1=>{_0xb054b1['setSelection'](_0x4b3879,'in');});}this['_normalizeSelectionStart']();const _0x3682f1=_0x271bf4['getFirstRange'](),_0x2aa2f6=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x271bf4),_0x3682f1['start'],_0x3682f1['end']);this['_copyMarkersToFragment'](_0x2aa2f6,_0x271bf4,{'isTableSelection':!0x1});const _0x2b7918=_0x271bf4['getFirstRange']()['start'],_0x345c73=new Map();let _0x34d576=_0x2aa2f6;for(let _0x5d6b9c=0x0;_0x5d6b9c<_0x2b7918['path']['length'];_0x5d6b9c++)_0x345c73['set'](_0x34d576,_0x2b7918['path'][_0x5d6b9c]),_0x34d576=_0x34d576['getChild'](0x0);return{'modelFragment':_0x2aa2f6,'anchorData':_0x345c73,'root':_0x4ac055};}['_getExecuteDataInTable'](){const _0x323079=this['editor']['model']['document']['selection'],_0x30d8b7=this['editor']['plugins']['get']('TableSelection'),_0x5410ad=_0x323079['getFirstRange']()['start']['root'],_0x1864f3=_0x30d8b7['getSelectionAsFragment'](),_0x3303da=_0x323079['getFirstRange']()['start']['parent']['parent'],_0x291b4d=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x3303da),this['editor']['model']['createPositionAfter'](_0x3303da)),_0x189d26=this['_wrapWithCommonAncestors'](_0x1864f3,_0x291b4d['start'],_0x291b4d['end']);this['_copyMarkersToFragment'](_0x189d26,_0x323079,{'isTableSelection':!0x0});const _0x111641=_0x323079['getFirstRange']()['start'],_0x4e04a8=new Map();let _0x2b1f71=_0x189d26;for(let _0x528e38=0x0;_0x528e38<_0x111641['path']['length'];_0x528e38++)if(_0x4e04a8['set'](_0x2b1f71,_0x111641['path'][_0x528e38]),_0x528e38<_0x111641['path']['length']-0x1)_0x2b1f71=_0x2b1f71['getChild'](0x0);else{let _0x4b5b92=_0x2b1f71['nextSibling'];for(;_0x4b5b92;)_0x4e04a8['set'](_0x4b5b92,_0x111641['path'][_0x528e38]),_0x4b5b92=_0x4b5b92['nextSibling'];}return{'modelFragment':_0x189d26,'anchorData':_0x4e04a8,'root':_0x5410ad};}async['_executeAction'](_0x30b601,_0x514277,_0x1dab08,_0x81c5d8,_0x4a0bc0,_0x3c7c42){const _0x5b6a2c=this['editor']['plugins']['get'](Is),_0x430692=this['editor']['plugins']['get'](la),_0x3a42f5=this['editor']['model']['document']['selection'],_0x4cb4db=await _0x5b6a2c['modelToDataWithIds'](_0x514277,this['editor']),_0x2ac90b=this['editor']['model']['document']['version'],_0x2c1c7e=[..._0x3a42f5['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x430692['open']({'targetEditor':this['editor'],'index':0x3e8*Math['random']()%0x3e8,'title':_0x4a0bc0,'icon':_0x3c7c42||_0x27a3d4,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x2c1c7e,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x430692),this['_interactionParams']={'action':_0x30b601,'content':_0x4cb4db,'version':_0x2ac90b,'aiBalloon':_0x430692,'modelFragment':_0x514277,'anchorData':_0x1dab08,'root':_0x81c5d8},this['_setupApplyListeners'](),this['listenTo'](_0x430692,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x430692,'dialogClosed',(_0x36cec2,{id:_0x31a0c9})=>{if('aiActionsBalloon'===_0x31a0c9){for(const _0xc28140 of this['_interactions']){if(0x0===_0xc28140['replies']['length']||_0xc28140['stoppedExplicitly'])continue;const _0x9a2064=_0xc28140['replies'][_0xc28140['replies']['length']-0x1],_0x59156c=_0x9a2064['changeGroups'][0x0];_0x59156c&&'pending'===_0x59156c['state']&&_0x9a2064['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x430692);}}),this['_createInteraction'](_0x4cb4db,_0x2ac90b,_0x430692,_0x30b601);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x1827f4,anchorData:_0x256ae1,root:_0x250ab7}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x1827f4,_0x256ae1,_0x250ab7,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x1827f4,_0x256ae1,_0x250ab7,!0x0);});}['_wrapWithCommonAncestors'](_0x13144e,_0x2a0d98,_0x24ab94){const _0x37369f=this['editor']['model']['createRange'](_0x2a0d98,_0x24ab94)['getCommonAncestor'](),_0x47df9e=_0x37369f['is']('documentFragment')?[]:_0x37369f['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x47df9e['length']){const _0x43051b=_0x47df9e['map'](_0x3f6645=>_0x3f6645['_clone'](!0x1));for(let _0x48157a=0x1;_0x48157a<_0x43051b['length'];_0x48157a++)_0x43051b[_0x48157a-0x1]['_appendChild'](_0x43051b[_0x48157a]);return _0x43051b[_0x43051b['length']-0x1]['_appendChild'](_0x13144e),new _0x2868da(_0x43051b[0x0]);}return _0x13144e;}['_copyMarkersToFragment'](_0x512c28,_0x565996,_0x2a65c0={'isTableSelection':!0x1}){const _0x689fbb=this['editor']['model'],_0x1300a4=Array['from'](_0x565996['getRanges']()),_0x630f95=_0x565996['getFirstRange']()['start'];for(const _0x5d83df of _0x689fbb['markers']){if(_0x5d83df['name']['startsWith']('ai-selection')||!_0x5d83df['affectsData'])continue;const _0x4377a5=_0x5d83df['getRange']();if(!_0x1300a4['some'](_0x3dcd7b=>_0x3dcd7b['containsRange'](_0x4377a5,!0x0)))continue;const _0x483dfd=this['_regularCalculateMarkerPath'](_0x4377a5['start'],_0x630f95,_0x2a65c0['isTableSelection']),_0x3c0b07=this['_regularCalculateMarkerPath'](_0x4377a5['end'],_0x630f95,_0x2a65c0['isTableSelection']),_0x59c9d3=_0x689fbb['createPositionFromPath'](_0x512c28,_0x483dfd),_0x57594c=_0x689fbb['createPositionFromPath'](_0x512c28,_0x3c0b07);if(!_0x59c9d3['isEqual'](_0x57594c)){const _0x31ce9a=_0x689fbb['createRange'](_0x59c9d3,_0x57594c);_0x512c28['markers']['set'](_0x5d83df['name'],_0x31ce9a);}}}['_regularCalculateMarkerPath'](_0x22210e,_0xc446d,_0x3e56a9=!0x1){const _0x40330d=[..._0x22210e['path']['slice']()];for(let _0x57910f=0x0;_0x57910f<Math['max'](_0xc446d['path']['length'],_0x22210e['path']['length']);_0x57910f++){const _0x3a4d33=_0xc446d['path'][_0x57910f]||0x0,_0x56b9ad=(_0x22210e['path'][_0x57910f]||0x0)-_0x3a4d33;if(_0x40330d[_0x57910f]=_0x56b9ad,0x0!==_0x56b9ad&&!_0x3e56a9)break;}return _0x40330d;}async['_createInteraction'](_0x46ad9a,_0x3d4b39,_0xb8a269,_0x2523ff){const _0x3f4f03=this['editor'],_0x4b3b68=_0x3f4f03['model']['document']['selection']['getFirstRange']()['start']['root'];if(!_0x30f76f(_0x3f4f03,_0x4b3b68['rootName']))return this['_actionsBalloonView']['showBlockingError'](us(this['editor']['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')),Promise['resolve']();this['_interactionParams']||(this['_interactionParams']={'action':_0x2523ff,'content':_0x46ad9a,'version':_0x3d4b39,'aiBalloon':_0xb8a269,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':_0x4b3b68});const _0x5d86d7=new La({'connector':this['_aiConnector'],'locale':_0x3f4f03['locale'],'content':_0x46ad9a,'version':_0x3d4b39,'editor':_0x3f4f03,'rootName':_0x4b3b68['rootName'],..._0x2523ff});this['_interactions']['push'](_0x5d86d7);const _0x4f90c7=(_0x185d19,_0x57b456=!0x1,_0x484df0='streaming')=>{const {isDone:_0x378a28}=_0x185d19;return this['_promiseQueue']['enqueue'](async _0x3bd1fb=>{try{const _0x1edf4d=Vs({'changeGroups':_0x185d19['changeGroups'],'documentContextContent':_0x185d19['documentContextContent'],'showDiff':_0x57b456,'trimUnchanged':!0x1});_0x1edf4d['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x1edf4d[0x0],'renderingStrategy':_0x484df0,'abortSignal':_0x3bd1fb}),_0x378a28&&this['_actionsBalloonView']['finalizeContent']();}catch(_0x4059a6){if(en(_0x4059a6))return;throw _0x4059a6;}});};_0x5d86d7['on']('replyCreated',(_0x28bef7,_0x62aa66)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x4f90c7(_0x62aa66)['catch'](_0x697c30=>{this['_reporter']['logError'](_0x697c30,{'context':{'operation':'reply-create'}}),this['_setErrorState'](_0x5d86d7,_0x697c30);});}),_0x5d86d7['on']('replyContentUpdated',(_0x11c8a4,_0x118c99)=>{_0x4f90c7(_0x118c99)['catch'](_0x4db264=>{this['_reporter']['logError'](_0x4db264,{'context':{'operation':'reply-update'}}),this['_setErrorState'](_0x5d86d7,_0x4db264);});}),_0x5d86d7['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x59141f){this['_reporter']['logError'](_0x59141f,{'context':{'operation':'interaction-finish'}}),this['_setErrorState'](_0x5d86d7,_0x59141f);}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x327186,{showDiff:_0x4da728})=>{try{this['_balloonShowDiff']=_0x4da728;const _0xb1f0d=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0xb1f0d&&await _0x4f90c7(_0xb1f0d,_0x4da728,'static');}catch(_0x5be561){this['_reporter']['logError'](_0x5be561,{'context':{'operation':'toggle-suggestion-display'}}),this['_setErrorState'](_0x5d86d7,_0x5be561);}}),_0x5d86d7['on']('replyChangeGroupStateUpdated',()=>{const _0x1e8d76={'positiveCount':_0x5d86d7['replies']['reduce']((_0x22e4fe,_0x4d6215)=>_0x22e4fe+_0x4d6215['changeGroups']['filter'](_0x2a567c=>'accepted'===_0x2a567c['state'])['length'],0x0),'totalCount':_0x5d86d7['replies']['reduce']((_0x350f3d,_0x3b87c2)=>_0x350f3d+_0x3b87c2['changeGroups']['length'],0x0)},_0x390ed9=_0x5d86d7['actionCallId'],_0x38f4fa=_0x5d86d7['actionName'];_0x38f4fa?this['_aiConnector']['upsertAIActionRating'](_0x38f4fa,_0x390ed9,_0x1e8d76):this['_aiConnector']['upsertCustomAIActionRating'](_0x390ed9,_0x1e8d76);}),this['_setLoadingState']();try{const _0x491d84=await _0x5d86d7['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x491d84;}catch(_0x2d3271){en(_0x2d3271)||this['_actionsBalloonView']['hideLoader'](),this['_reporter']['logError'](_0x2d3271,{'context':{'operation':'create-interaction'}}),this['_setErrorState'](_0x5d86d7,_0x2d3271);}}['_applyChanges'](_0x3535e4,_0x5a4a9d,_0x574074,_0xc6bce7){const _0x85b88f=this['editor'];if(_0xc6bce7&&!_0x85b88f['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',null);const _0x482f43=this['editor']['plugins']['get'](_0x1cf5c4),_0x3076dd=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x3076dd||!_0x3076dd['replies']['length'])return;const _0x2e7f6e=_0x3076dd['replies'][_0x3076dd['replies']['length']-0x1];_0x2e7f6e['setChangeGroupState'](0x0,'accepted');const _0x52f703=Rn({'documentSuggestions':On({'groups':[_0x2e7f6e['changeGroups'][0x0]],'documentContextContent':_0x2e7f6e['documentContextContent'],'documents':_0x3076dd['getDocumentContext']()['documents']}),'transform':!0x1,'documentCompare':_0x482f43,'documentCompareOptions':{'anchor':_0x85b88f['model']['createPositionAt'](_0x3535e4,0x0),'markDeletions':_0xc6bce7}})['values']()['next']()['value']??[],_0x174786=this['_filterOperationsOutsideRange'](_0x52f703,_0x5a4a9d);for(const _0x2d1eec of _0x174786)this['_anchorOperation'](_0x5a4a9d,_0x2d1eec,_0x574074);const _0x15c9fc=_0x3076dd['getDocumentContext']()['documents'][0x0]['version'],_0x2a7650=_0x29e916(_0x174786,_0x85b88f['model']['document']['history']['getOperations'](_0x15c9fc),{'document':_0x85b88f['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1})['operationsA'];zs(_0x2a7650,'quickActions');try{_0x85b88f['model']['change'](_0xc4349c=>{_0xc4349c['setSelection'](_0x85b88f['model']['document']['selection']['focus']),_0xc6bce7?_0x85b88f['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x2a7650):_0x482f43['applyOperations'](_0xc4349c,_0x2a7650);});}catch(_0x447947){throw this['_reporter']['logError'](new sn({'code':'ai-applying-suggestion-failed','type':'runtime','cause':_0x447947})),_0x447947;}this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x8c96cb,_0x1de15f){return _0x8c96cb['filter'](_0x176c64=>{if('rename'==_0x176c64['type']){const _0x772fbc=_0x176c64['position']['nodeAfter'];return!_0x1de15f['has'](_0x772fbc);}if(_0x176c64['type']['indexOf']('Attribute')>-0x1){const _0x3d42ca=_0x176c64['range']['start']['nodeAfter'];return!_0x1de15f['has'](_0x3d42ca);}return!0x0;});}['_anchorOperation'](_0x23c9c7,_0x55d13f,_0x13db0e){const _0x16f25a=_0x55d13f['clone']();for(const _0x3abefc in _0x55d13f){const _0x2cd749=_0x55d13f[_0x3abefc];_0x2cd749 instanceof _0x4e8468?_0x55d13f[_0x3abefc]=new _0x4e8468(_0x198765(_0x2cd749['start']),_0x198765(_0x2cd749['end'])):_0x2cd749 instanceof _0x5d12c5&&(_0x55d13f[_0x3abefc]=_0x198765(_0x2cd749));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x16f25a['type'])){if(_0x16f25a['isDocumentOperation']=!0x1,_0x16f25a['baseVersion']=null,'remove'==_0x16f25a['type']){const _0xf22f97=_0x16f25a['sourcePosition'],_0x2deabb=_0x16f25a['howMany'];new _0x50ba30(_0xf22f97,_0x2deabb)['_execute']();}else _0x16f25a['_execute']();}function _0x198765(_0x115ebc){if('$graveyard'==_0x115ebc['root']['rootName'])return _0x115ebc;const _0x4369e8=[];let _0xac1a74=_0x115ebc['root'];for(let _0x3ff8a5=0x0;_0x3ff8a5<_0x115ebc['path']['length'];_0x3ff8a5++){const _0x288c65=_0x23c9c7['get'](_0xac1a74)||0x0;_0x4369e8[_0x3ff8a5]=_0x115ebc['path'][_0x3ff8a5]+_0x288c65,_0xac1a74=_0xac1a74['getChildAtOffset'](_0x115ebc['path'][_0x3ff8a5]);}return new _0x5d12c5(_0x13db0e,_0x4369e8,_0x115ebc['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x1b61fb,content:_0x24bd84,version:_0xd631e2,aiBalloon:_0x2239cf}=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'](_0x24bd84,_0xd631e2,_0x2239cf,_0x1b61fb)['catch'](_0x449eb2=>{this['_reporter']['logError'](_0x449eb2,{'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['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x5fb78d=this['_interactions']['length'];this['_currentInteractionIndex']<_0x5fb78d-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x271675){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x271675;const _0x5c0170=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x5c0170)return;if(_0x5c0170['hasError'])return this['_setErrorState'](_0x5c0170),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x5c0170['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x59435a=_0x5c0170['replies'][_0x5c0170['replies']['length']-0x1];if(_0x59435a)try{const _0x238ee5=Vs({'changeGroups':_0x59435a['changeGroups'],'documentContextContent':_0x59435a['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x287688=>setTimeout(_0x287688,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x238ee5[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x2c7abe){this['_reporter']['logError'](_0x2c7abe,{'context':{'operation':'navigation-update'}});}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x4173ef,_0x983767){if(void 0x0!==_0x983767&&en(_0x983767))return;const _0x21f6f3=us(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x21f6f3),_0x4173ef['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);}},Ba=class extends _0x3688ab{static get['requires'](){return[Oa,ya,Ua];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x186c18){super(_0x186c18),_0x186c18['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}},Ga=class extends _0x215f6f{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x414857,_0x2a8565){super(_0x414857),this['id']=_0x2a8565,this['set']('status','pending'),this['set']('changeId',_0x2a8565),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',(_0x4debc5,_0x791510)=>{_0x791510&&_0x791510['target']&&'A'===_0x791510['target']['tagName']&&_0x791510['preventDefault'](),this['fire']('activateChange',{'id':_0x2a8565,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x2a8565,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x2a8565,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x4b4038=new _0x215f6f(this['locale']);return _0x4b4038['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',_0x2e5ae2=>!_0x2e5ae2)]}}),_0x4b4038;}['_createAcceptButtonView'](){const _0x18adf9=new Ht(this['locale']);return _0x18adf9['set']({'label':us(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x18adf9['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x204c7e=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x204c7e['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x52b320=>'pending'!==_0x52b320&&'accepted'!==_0x52b320),this['bindTemplate']['if']('status',an,_0x368f7b=>'pending'===_0x368f7b),this['bindTemplate']['if']('status',hn,_0x1ad420=>'pending'!==_0x1ad420),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x4bf6a0=>'accepted'===_0x4bf6a0)]}}),this['on']('change:status',(_0x36adec,_0x5a749c,_0x3897ad)=>{_0x18adf9['isEnabled']='pending'===_0x3897ad,'accepted'===_0x3897ad&&(_0x18adf9['label']=us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x18adf9['icon']=_0x27c014);}),_0x18adf9;}['_createDismissButtonView'](){const _0x414a4f=new Ht(this['locale']);return _0x414a4f['set']({'label':us(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x414a4f['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x45809d=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x45809d['stopPropagation']();})},'attributes':{'class':[hn,this['bindTemplate']['if']('status','ck-hidden',_0x80a261=>'pending'!==_0x80a261&&'rejected'!==_0x80a261),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0xc143d9=>'pending'===_0xc143d9),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x36218b=>'rejected'===_0x36218b)]}}),this['on']('change:status',(_0x40df77,_0x45fcd7,_0x4eee22)=>{_0x414a4f['isEnabled']='pending'===_0x4eee22,'rejected'===_0x4eee22&&(_0x414a4f['label']=us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x414a4f['icon']=_0x27af74);}),_0x414a4f;}['_createInfoButtonView'](){const _0x28a4ca=new Ht(this['locale']);return _0x28a4ca['set']({'label':us(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x4d8e0c,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':hn+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x28a4ca['bind']('isOn')['to'](this,'isInfoToggleOn',_0x30438e=>_0x30438e),_0x28a4ca['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x28a4ca;}['_createOutdatedButtonView'](){const _0x50ba79=new Ht(this['locale']);return _0x50ba79['set']({'label':us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x4f2173,'withText':!0x0,'isEnabled':!0x1}),_0x50ba79['extendTemplate']({'attributes':{'class':[hn,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x4a91c3=>'outdated'!==_0x4a91c3)],'disabled':'disabled'}}),_0x50ba79;}},Fa=class extends yt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x42dab0,_0x414ee5){super(_0x42dab0),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']()),_0x414ee5['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x31ffd9){this['resultItemView']['changeId']=_0x31ffd9['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x31ffd9['contentDiffed'];}['showBalloon'](_0x10d13c,_0x3256fe,_0x2a43d1,_0x25682b,_0x330095,_0x4def4e){const _0x3097ed=_0x3256fe();if(!_0x3097ed)return;this['updateContent'](_0x10d13c),this['show']();const _0x5e5086=Array['from'](_0x3097ed['getClientRects']())['reverse'](),_0x4ac65f=this['_getPointedRectIndexFromEvent'](_0x2a43d1,_0x5e5086),_0x5dc4fc=_0x5e5086[_0x4ac65f??0x0];'click'===_0x25682b?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x3256fe(),_0x4ac65f,_0x10d13c['id'],_0x330095,_0x4def4e)||_0x5dc4fc})):'hover'===_0x25682b&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x3256fe(),_0x4ac65f,_0x10d13c['id'])||_0x5dc4fc}));}['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'](){_0x191c5a({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x25b48a=[this['element']];return this['_pinnedTargetElement']&&_0x25b48a['push'](this['_pinnedTargetElement']),_0x25b48a;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x38dad6=new _0x215f6f();return this['resultItemView']=new Ga(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x38dad6['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']]}]}),_0x38dad6;}['_getBestRectPositionOnClick'](_0x594c23,_0xb2e0c1,_0x44186e,_0x2223c7,_0x2c0684){if(!_0x594c23)return null;const _0x191612=this['position']['replace']('arrow_',''),_0x1ab00e=Array['from'](_0x594c23['getClientRects']());let _0x1fd6cc,_0x2d83e1=_0x1ab00e['reverse']();return void 0x0!==_0xb2e0c1&&this['_isPinnedRectVisible'](_0x2d83e1[_0xb2e0c1],_0x2223c7,_0x2c0684)?(_0x1fd6cc=_0x2d83e1[_0xb2e0c1],this['_pinnedRectIndex']=_0xb2e0c1):this['_isPinnedRectVisible'](_0x2d83e1[0x0],_0x2223c7,_0x2c0684)&&void 0x0===_0xb2e0c1?_0x1fd6cc=_0x2d83e1[0x0]:(_0x2d83e1='s'==_0x191612[0x0]?[..._0x1ab00e]['reverse']():_0x1ab00e,_0x2d83e1['forEach'](_0x238538=>{this['_isPinnedRectVisible'](_0x238538,_0x2223c7,_0x2c0684)&&(_0x1fd6cc=_0x238538);})),this['_pinnedTargetChangeId']=_0x44186e,this['_pinnedTargetElement']=_0x594c23,_0x1fd6cc||_0x594c23['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x560486,_0xdb4b52,_0x4dbf47){if(!_0x560486)return null;const _0x6b4586=Array['from'](_0x560486['getClientRects']())['reverse']();return void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0xdb4b52&&this['_pinnedTargetChangeId']!==_0x4dbf47?(this['_pinnedRectIndex']=_0xdb4b52,this['_pinnedTargetElement']=_0x560486,this['_pinnedTargetChangeId']=_0x4dbf47,_0x6b4586[_0xdb4b52]):void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x4dbf47?_0x560486!==this['_pinnedTargetElement']?Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']]:_0x6b4586[this['_pinnedRectIndex']]:void 0x0!==_0xdb4b52&&this['_pinnedTargetChangeId']!==_0x4dbf47?(this['_pinnedRectIndex']=_0xdb4b52,this['_pinnedTargetElement']=_0x560486,this['_pinnedTargetChangeId']=_0x4dbf47,_0x6b4586[_0xdb4b52]):_0x560486['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0xbeb919,_0x77f1bc){if(_0xbeb919)for(let _0x370f15=0x0;_0x370f15<_0x77f1bc['length'];_0x370f15++){const _0x3b5c66=_0x77f1bc[_0x370f15];if(_0xbeb919['clientX']>=_0x3b5c66['left']-0x3&&_0xbeb919['clientX']<=_0x3b5c66['right']+0x3&&_0xbeb919['clientY']>=_0x3b5c66['top']-0x3&&_0xbeb919['clientY']<=_0x3b5c66['bottom']+0x3)return _0x370f15;}}['_isPinnedRectVisible'](_0x5d8fb1,_0x308e32,_0xa94654){const _0xd8d9f4=new At(_0x5d8fb1),_0x528c9e=_0x308e32||document['documentElement'],_0x434c0d=_0xd8d9f4['getIntersection'](Et(_0xa94654)),_0x12fd44=new At(_0x528c9e)['getIntersection'](_0xd8d9f4);return!!(_0x434c0d&&_0x12fd44&&_0xd8d9f4['width']>0x0);}};const Ka=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];var Wa=class extends _0x5d28a2{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[cs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x432ba3){super(_0x432ba3),this['_bodyCollection']=ln(this['context']['locale']),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...Ka)['to'](this),this['_balloonSuggestionView']=new Fa(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x1f1865=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x1f1865);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x4f5c70){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x36843c=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x4f5c70,_0x36843c);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x231302){_0x231302&&('error-general'!==_0x231302['status']?'error-chunk'!==_0x231302['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0xa327af){this['_mainView']['addCheckRunResult'](_0xa327af);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x28d7f9){this['_mainView']['showGeneralReviewCoreErrorView'](_0x28d7f9??us(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x956919,_0x993365){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x956919,_0x993365);}['setActiveStateInResults'](_0x5cb996){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4af95b=>{_0x4af95b['id']===_0x5cb996&&_0x4af95b['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x47ff51=>_0x47ff51['setItemAsInactive']());}['updateChangeState'](_0x53a832,_0x546dc2){'accepted'===_0x546dc2||'rejected'===_0x546dc2||'outdated'===_0x546dc2?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x53a832,_0x546dc2):this['_mainView']['reviewCheckResultsView']['showResult'](_0x53a832,_0x546dc2);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x4a38b5,_0x379f17,_0x2fed72,_0x4c321f,_0xd07056,_0x4731e5){this['_balloonSuggestionView']['showBalloon'](_0x4a38b5,_0x379f17,_0x2fed72,_0x4c321f,_0xd07056,_0x4731e5);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x21cf50){const _0x1e2409=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x22e37f=>_0x22e37f['id']===_0x21cf50);return _0x1e2409?_0x1e2409['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}},Ya=class extends _0x215f6f{constructor(_0xa3a491){super(_0xa3a491),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x5d3f77=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x5d3f77['if']('isVisible','ck-hidden',_0x50b87e=>!_0x50b87e)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x5d3f77['to']('errorMessage')}]}]});}},$a=class extends _0x215f6f{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x58960d,_0x58626a){super(_0x58960d),this['reviewCoreHeader']=_0x58626a['header'],this['generalErrorView']=new Ya(_0x58960d),this['reviewCheckListView']=_0x58626a['list'],this['reviewCheckListView']['delegate'](...Ka)['to'](this),this['reviewCheckResultsView']=_0x58626a['results'],this['reviewCheckResultsView']['delegate'](...Ka)['to'](this),this['reviewCompletedView']=_0x58626a['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'](_0x49fa7f){this['reviewCheckResultsView']['addResult'](_0x49fa7f),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'](_0xce6925){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0xce6925;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}},qa=class extends Ht{constructor(_0x3c758d,_0x42614c){super(_0x42614c),this['set']({'label':_0x3c758d,'withText':!0x0,'class':on}),this['on']('execute',()=>{this['fire']('finishReview');});}},Qa=class extends zt{['_resultViews'];['_resultsHeader'];['_resultsBody'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x136e5b,_0x533f1f){super(_0x136e5b),this['_contents']=_0x533f1f,this['_resultViews']=new _0x498844(),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 Mo(_0x136e5b),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 _0x511f52=this['_createCombinedSkeletonLoader'](),_0x3451ed=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x3451ed['if']('isLoading','ck-ai_review__check-run_loading',_0x27dae2=>_0x27dae2),_0x3451ed['if']('isResultReady','ck-ai_review__check-run_ready',_0x314abe=>_0x314abe),_0x3451ed['if']('isVisible','ck-hidden',_0x389046=>!_0x389046)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x511f52,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0x41d6bb){const _0x4dda5d=new Ga(this['locale'],_0x41d6bb['id']);_0x4dda5d['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x4dda5d),_0x4dda5d['resultResponseView']['element']['innerHTML']=_0x41d6bb['contentDiffed'];}['hideResult'](_0x4714e9,_0x45f625){if('pending'===_0x45f625)return;const _0xd51f44=this['_resultViews']['find'](_0x5418c7=>_0x5418c7['id']===_0x4714e9);_0xd51f44&&(_0xd51f44['status']=_0x45f625,_0xd51f44['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x385e97,_0x38e4b6){if('pending'!==_0x38e4b6)return;const _0x3bd5b1=this['_resultViews']['find'](_0x482592=>_0x482592['id']===_0x385e97);_0x3bd5b1&&(_0x3bd5b1['status']=_0x38e4b6,_0x3bd5b1['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x40bf53,_0xd7192c){this['headerTitle']=_0x40bf53,this['headerSubtitle']=_0xd7192c||'';}['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 Xn(this['locale'],zn['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x536372=new _0x215f6f(this['locale']),_0x54cb04=[];for(let _0x23c9f6=0x0;_0x23c9f6<0x10;_0x23c9f6++){const _0x4f2649=this['_createSkeletonLoader']();_0x4f2649['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x54cb04['push'](_0x4f2649);}return _0x536372['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x40d849=>!_0x40d849)]},'children':_0x54cb04}),_0x536372;}['_createResultsBodyView'](){const _0x27fd03=new _0x215f6f(this['locale']);return _0x27fd03['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x3602fa=>_0x3602fa)]},'children':this['_resultViews']}),_0x27fd03;}['_createErrorView'](){const _0x4a6b49=new _0x215f6f(this['locale']),_0x315da5=new Ht(this['locale']),t=this['locale']['t'];return _0x4a6b49['delegate']('retryReview')['to'](this),_0x315da5['set']({'label':t('Try\x20again'),'withText':!0x0,'class':an+'\x20ck-ai_review__check-run-error-retry-button'}),_0x315da5['on']('execute',()=>{this['fire']('retryReview');}),_0x4a6b49['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x550213=>!_0x550213),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x8e2767=>'chunk'===_0x8e2767)]},'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',_0x1bac68=>'chunk'===_0x1bac68)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x34788a=>'general'!==_0x34788a)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x338686=>'chunk'!==_0x338686)]},'children':[{'text':us(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x315da5]}),_0x4a6b49;}['_createCancelButtonView'](){const _0x15945d=new Ht(this['locale']);return _0x15945d['set']({'label':us(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[an+'\x20ck-ai-button-stop-generating'],'icon':it}),_0x15945d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3dd719=>_0x3dd719),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1a9289=>_0x1a9289)]}}),_0x15945d['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x15945d;}['_createToggleDiffButtonView'](){const _0x111e21=new Ht(this['locale']);_0x111e21['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x111e21['bind']('isEnabled')['to'](this,'isError',_0x57aaa0=>!_0x57aaa0),_0x111e21['extendTemplate']({'attributes':{'class':[an,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x52be32=>!_0x52be32),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x51f964=>_0x51f964)]}});const _0x1544e5=us(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x32b5d8=us(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x111e21['bind']('isOn')['to'](this,'isToggleDiffOn',_0x163160=>_0x163160),_0x111e21['bind']('icon')['to'](this,'isToggleDiffOn',_0x52836a=>_0x52836a?_0x236ceb:_0x2ee912),_0x111e21['bind']('label')['to'](this,'isToggleDiffOn',_0x59f03e=>_0x59f03e?_0x1544e5:_0x32b5d8),_0x111e21['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x111e21;}['_createAcceptAllButtonView'](){const _0x2c7e81=new Ht(this['locale']);return _0x2c7e81['set']({'label':us(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x2c7e81['bind']('isEnabled')['to'](this,'isError',_0x19c981=>!_0x19c981),_0x2c7e81['extendTemplate']({'attributes':{'class':[on,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x1d2c98=>!_0x1d2c98),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x18110c=>_0x18110c)]}}),_0x2c7e81['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x2c7e81;}['_createExitReviewButtonView'](){const _0x1cc96d=new Ht(this['locale']);return _0x1cc96d['set']({'label':us(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x1cc96d['extendTemplate']({'attributes':{'class':[hn,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x25d122=>!_0x25d122),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x52e7e9=>_0x52e7e9)]}}),_0x1cc96d['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x1cc96d;}['_createResultHeaderView'](){const _0x2d1744=new _0x215f6f(this['locale']),_0xeaa8e7=this['_createTitleView']();return _0x2d1744['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x50c81e=>_0x50c81e)]},'children':[_0xeaa8e7,{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0xd063e8=>!_0xd063e8)],'title':us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')},'children':[{'text':us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x2d1744;}['_createTitleView'](){const _0xec9982=new _0x215f6f(this['locale']),_0x1b97e8=new cr();return _0x1b97e8['bind']('isVisible')['to'](this,'isResultReady',_0x4a596f=>!_0x4a596f),_0xec9982['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x48f12a=>_0x48f12a)]},'children':[_0x1b97e8,{'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']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]}]}),_0xec9982;}['_createFinishReviewButtonView'](){const _0x6e18f8=new qa(us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x6e18f8['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x29fd3f=>!_0x29fd3f)]}}),_0x6e18f8['delegate']('finishReview')['to'](this),_0x6e18f8;}},Xa=class extends zt{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x5a40c3,_0x2c6a5b){super(_0x5a40c3),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x2c6a5b['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x2c6a5b['headerText']);const _0x3b0824=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x3b0824['if']('isVisible','ck-hidden',_0x1d7190=>!_0x1d7190)]},'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':_0x2c6a5b['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x33b334){const _0x2a1c70=new qa(_0x33b334,this['locale']);return _0x2a1c70['delegate']('finishReview')['to'](this),_0x2a1c70;}['_createResultHeaderView'](_0x4eda49){const _0x14a267=new _0x215f6f(this['locale']);return _0x14a267['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title'],'title':_0x4eda49},'children':[{'text':_0x4eda49}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x14a267;}},za=class extends _0x215f6f{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x1afa7d,_0x98d9c7){super(_0x1afa7d),this['_defaultValue']=_0x98d9c7['default']||(_0x98d9c7['data']['length']>0x0?_0x98d9c7['data'][0x0]['id']:''),this['_defaultLabel']=_0x98d9c7['data']['find'](_0x2e014e=>_0x2e014e['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x32dc43(this['locale']);const _0x554d18=this['_prepareListOptions'](_0x98d9c7['data']);_0x1d523e(this['_dropdownView'],_0x554d18,{'role':'menu','ariaLabel':_0x98d9c7['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2583ad=>{_0x2583ad['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x323a03=>{this['formValue']=_0x323a03['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x323a03['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'](_0x5b89de=[]){const _0x4d4efd=new ct();this['resetToDefault']();for(const _0x511368 of _0x5b89de){const _0x4d6f5f=new _0x24dcce({'label':_0x511368['label'],'withText':!0x0,'role':'menuitemradio','id':_0x511368['id'],'model':_0x511368});_0x4d6f5f['bind']('isOn')['to'](this,'formValue',_0x8498db=>_0x8498db===_0x4d6f5f['id']);const _0x1be3eb={'type':'button','model':_0x4d6f5f};_0x4d4efd['add'](_0x1be3eb);}return _0x4d4efd;}},ja=class extends zt{['_formItem']=null;constructor(_0x441ae0,_0xc6fc43,_0x58a6db){if(super(_0x441ae0),this['argsKey']=_0xc6fc43?.['argsKey'],'dropdown'===_0xc6fc43['formType'])this['_formItem']=new za(this['locale'],_0xc6fc43);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x47f593=new Kt(this['locale'],{'children':[this['_formItem']],'class':[_0x58a6db?'ck-form__row_with-submit':'']});_0x58a6db&&_0x47f593['children']['add'](_0x58a6db),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x47f593]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}},Ja=class AIReviewCorePromptInputView extends _0x5455d5{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x308adf){super(_0x308adf),this['set']('isEmpty',!0x0),this['keystrokes']=new _t(),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']);}},Za=class extends _0x215f6f{['focusTracker']=new dt();['keystrokes']=new _t();['focusCycler'];['_focusables']=new _0x498844();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x3f267d,_0x5b2fab,_0x3fd417=!0x1){super(_0x3f267d),this['_check']=_0x5b2fab,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x5b2fab['defaultModel']?_0x5b2fab['defaultModel']['id']:'',this['_defaultLabel']=_0x5b2fab['defaultModel']?_0x5b2fab['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new qt(this['locale'],()=>new Ja(_0x3f267d)),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 ct(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x3fd417),_0x1d523e(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new Kt(this['locale'],{'children':[this['promptInputView']]}),new Kt(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x4dc505,_0x37b064)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x37b064()):_0x37b064();}),this['focusCycler']=new Gt({'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'](_0x472dc8=>{this['_focusables']['add'](_0x472dc8),this['focusTracker']['add'](_0x472dc8['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 _0x429b6c of this['_getFormValidators']()){const _0x2a4b86=_0x429b6c();if(_0x2a4b86)return this['promptInputView']['errorText']=_0x2a4b86,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return us(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x586448=new Ht(this['locale']),t=this['locale']['t'];return _0x586448['set']({'label':t('Submit'),'withText':!0x0,'class':on}),_0x586448['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x586448;}['_createCancelButtonView'](){const _0x421a5d=new Ht(this['locale']),t=this['locale']['t'];return _0x421a5d['set']({'label':t('Cancel'),'withText':!0x0,'class':hn}),_0x421a5d['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x402646=>{_0x402646['stopPropagation']();})}}),_0x421a5d['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x421a5d;}['_setModelList'](_0x43b09b){this['_modelSelectionDropdownItems']['clear']();const _0x42e131=this['_check']['models'];if(_0x43b09b)this['set']('modelDisplayMode','hidden');else{const _0x5388f5=0x1===_0x42e131['length'];this['set']('modelDisplayMode',_0x5388f5?'name':'selector');}if(this['resetToDefault'](),_0x42e131?.['length']){0x1===_0x42e131['length']&&this['set']('activeModelName',_0x42e131[0x0]['name']||_0x42e131[0x0]['id']);for(const _0x3d34a6 of _0x42e131){const _0x4c9ba2=new _0x24dcce({'label':_0x3d34a6['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3d34a6['id'],'model':_0x3d34a6});_0x4c9ba2['bind']('isOn')['to'](this,'modelId',_0x81584=>_0x81584===_0x3d34a6['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4c9ba2,'labelView':new eh(this['locale'],_0x3d34a6)});}}}['_createModelSelectionDropdown'](){const _0x17c001=_0x32dc43(this['locale']);return _0x17c001['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x17c001['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':hn}),_0x17c001['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x193241=>'selector'===_0x193241),this['listenTo'](_0x17c001,'execute',_0x131ce7=>{this['modelId']=_0x131ce7['source']['model']['id'],_0x17c001['buttonView']['label']=_0x131ce7['source']['label'];}),_0x17c001;}['_createModelNameView'](){const _0x3c094b=new th(this['locale']);return _0x3c094b['bind']('text')['to'](this,'activeModelName',_0x22c0a9=>_0x22c0a9??''),_0x3c094b['bind']('isVisible')['to'](this,'modelDisplayMode',_0x4b0631=>'name'===_0x4b0631),_0x3c094b;}['_createActionsFooterView'](){const _0x4daf78=new _0x215f6f(this['locale']);return _0x4daf78['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']]}]}),_0x4daf78;}},th=class extends _0x215f6f{constructor(_0x556ace){super(_0x556ace),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x56e271=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x56e271['if']('isVisible','ck-hidden',_0x460a0f=>!_0x460a0f)]},'children':[{'text':_0x56e271['to']('text')}]});}},eh=class extends Dt{constructor(_0x540502,_0x29142b){super();const _0x3cfb4c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x3cfb4c['to']('style'),'id':_0x3cfb4c['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x3cfb4c['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x29142b['description']||'']}]}]});}},ih=class extends zt{['_formItemsCollection']=new _0x498844();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0xf334e1,_0x7f1cbd,_0x3736d0,_0x1e5117=!0x1){super(_0xf334e1),this['_hideModels']=_0x1e5117,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x7f1cbd['isParameterized']);const _0x4ceaaa=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',_0x3f3bc4=>_0x3f3bc4),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0xdad81e=>_0xdad81e)],'style':{'--ck-ai-review-check-list-item-index':_0x3736d0}},'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':_0x7f1cbd['title']}]},_0x4ceaaa]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x7f1cbd['description']?[{'text':_0x7f1cbd['description']}]:[]}]}]},..._0x7f1cbd['isParameterized']?[this['_createParameterizedView'](_0x7f1cbd)]:[],...'custom'===_0x7f1cbd['id']?[this['_createCustomView'](_0x7f1cbd,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x7f1cbd['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x7f1cbd['id'],'args':_0x7f1cbd['useArgs']?_0x7f1cbd['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x191c5a({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x2d6cf7=>{_0x2d6cf7['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x383e82=new Yt();return _0x383e82['content']=_0x1d567d,_0x383e82['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x383e82;}['_createParameterizedView'](_0x45ef22){const _0x2d7bac=new _0x215f6f(),_0x4d14f8=this['_createFormView'](_0x45ef22);return _0x2d7bac['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x9deee=>!_0x9deee)]},'children':[_0x4d14f8]}),_0x2d7bac;}['_createFormView'](_0x48d61a){const _0x41e712=new _0x215f6f(),_0x32bdba=Array['isArray'](_0x48d61a['options'])?_0x48d61a['options']:[],_0x2a6aa1=new Ht(this['locale']),t=this['locale']['t'];_0x2a6aa1['set']({'label':t('Submit'),'withText':!0x0,'class':on}),_0x2a6aa1['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x16b3d8=>{_0x16b3d8['stopPropagation']();})}}),_0x2a6aa1['on']('execute',()=>{const _0x4283a4=[],_0x258d59={};this['_formItemsCollection']['forEach'](_0x282ffa=>{_0x4283a4['push'](_0x282ffa['value']),_0x48d61a['useArgs']&&_0x48d61a['options']&&(_0x258d59[_0x282ffa['argsKey']]=_0x282ffa['value']);}),this['fire']('runReviewCheck',{'id':_0x48d61a['id'],'params':_0x4283a4['length']?_0x4283a4:void 0x0,'args':Object['keys'](_0x258d59)['length']?_0x258d59:void 0x0});});const _0x330e68=_0x32bdba['length'];return _0x32bdba['forEach']((_0x204f36,_0x915f8a)=>{const _0x49ecd1=_0x915f8a===_0x330e68-0x1;this['_formItemsCollection']['add'](new ja(this['locale'],_0x204f36,_0x49ecd1?_0x2a6aa1:null));}),_0x41e712['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x41e712;}['_createCustomView'](_0x32c18d,_0x1befa4=!0x1){return this['_customCheckView']=new Za(this['locale'],_0x32c18d,_0x1befa4),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',_0x450cd8=>!_0x450cd8)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x2d3db4,_0x5a2e68,_0x31ed7b)=>{_0x31ed7b||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}},sh=class extends zt{['_checkViews'];constructor(_0x1c5e61){super(_0x1c5e61),this['_checkViews']=new _0x498844(),this['_setupTemplate']();}['setChecks'](_0x14736f,_0x519627=!0x1){this['_checkViews']['clear']();for(const [_0x1090da,_0x151c22]of _0x14736f['entries']()){const _0x228db6=new ih(this['locale'],_0x151c22,_0x1090da,_0x519627);_0x228db6['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x228db6);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x13a67f of this['_checkViews'])_0x13a67f instanceof ih&&_0x13a67f['resetToDefault']();}['_setupTemplate'](){const _0x211084=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x211084['if']('isVisible','ck-hidden',_0xefbf69=>!_0xefbf69)]},'children':this['_checkViews']});}},nh=class extends Wa{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x6b6c92=this['context']['plugins']['get']('AITabs'),_0x4d4cc4=this['context']['locale'],_0x9c6a4=new Ho(_0x4d4cc4,{'label':us(_0x4d4cc4,'AI_REVIEW_MODE'),'icon':_0x5bd10a,'class':'ck-ai-header_review','showResizeButton':_0x6b6c92['showResizeButton']});return _0x9c6a4['delegate']('resizeTabs')['to'](_0x6b6c92),_0x9c6a4['bind']('isMaximized')['to'](_0x6b6c92['view'],'isMaximized',_0x612b93=>_0x612b93),new $a(this['context']['locale'],{'header':_0x9c6a4,'list':new sh(_0x4d4cc4),'results':new Qa(_0x4d4cc4,{'generalErrorText':us(_0x4d4cc4,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new Xa(_0x4d4cc4,{'headerText':us(_0x4d4cc4,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':us(_0x4d4cc4,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':us(_0x4d4cc4,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x1658a7=this['context']['plugins']['get']('AITabs');_0x1658a7['view']['on']('activateTab',(_0x503d8e,{newTab:_0x22fb26,oldTab:_0x1bfc78})=>{'reviewMode'===_0x22fb26?this['fire']('getReviewCheckList'):'reviewMode'===_0x1bfc78&&this['fire']('leaveReview');}),_0x1658a7['view']['addTab']({'id':'reviewMode','buttonLabel':us(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x5bd10a,'order':0x0,'content':this['_mainView']});}};const rh='review-',oh=['softBreak'],ah=['htmlScript','htmlStyle','htmlCustomElement'];var hh=class extends _0x5d28a2{static get['requires'](){return[_0x1cf5c4,Is];}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(_0x2d2b65){super(_0x2d2b65),this['_domEmitter']=new(lt())(),this['_eventEmitter']=new(ut())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x4575cc=_0x477b8b=>this['_scheduleAttachReviewEditingToEditor'](_0x477b8b);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x1f7986)return void _0x4575cc(this['context']);const _0x397a8b=this['context'];for(const _0x374495 of _0x397a8b['editors'])_0x4575cc(_0x374495);this['listenTo'](_0x397a8b['editors'],'add',(_0x179fc1,_0x2939ee)=>{_0x4575cc(_0x2939ee);}),this['listenTo'](_0x397a8b['editors'],'remove',(_0x541c06,_0x339b8e)=>{for(const [_0x103808,_0x2395bd]of this['_markers'])_0x2395bd['editor']===_0x339b8e&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x103808,'changeId':_0x2395bd['groupId']}),this['_markers']['delete'](_0x103808));});}['_scheduleAttachReviewEditingToEditor'](_0x3b17a2){const _0x360804=()=>{'destroyed'!==_0x3b17a2['state']&&_0x3b17a2['conversion']&&this['_attachReviewEditingToEditor'](_0x3b17a2);};if('ready'===_0x3b17a2['state'])return void _0x360804();const _0xe4c2cb=()=>{this['stopListening'](_0x3b17a2,'ready',_0xe4c2cb),_0x360804();};this['listenTo'](_0x3b17a2,'ready',_0xe4c2cb);}['_attachReviewEditingToEditor'](_0x509389){this['_reviewEditingAttachedEditors']['has'](_0x509389)||(_0x509389['conversion']['for']('editingDowncast')['markerToElement']({'model':rh+'insert','view':(_0x2fd339,{writer:_0x3d2d5b})=>{const _0x5a103b=this['_markers']['get'](_0x2fd339['markerName']),_0x170dcf={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x5a103b?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x2fd339['markerName']};return _0x3d2d5b['createUIElement']('span',_0x170dcf,function(_0xb4de95){const _0x5f4429=this['toDomElement'](_0xb4de95);return _0x5f4429['innerHTML']=_0x5a103b?.['content']?.['asString']||'',_0x5f4429;});}}),_0x509389['conversion']['for']('editingDowncast')['markerToHighlight']({'model':rh+'remove-only','view':_0x2b9cea=>{const _0x5b35e5=this['_markers']['get'](_0x2b9cea['markerName']),_0x22b773=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x5b35e5?.['id']||'')&&_0x22b773['push']('ck-ai_review__change_active'),{'classes':_0x22b773,'attributes':{'data-marker-id':_0x2b9cea['markerName']}};}}),_0x509389['conversion']['for']('editingDowncast')['markerToHighlight']({'model':rh+'remove-context','view':_0xf033f5=>{const _0x30a190=this['_markers']['get'](_0xf033f5['markerName']),_0x2c70b1=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x30a190?.['id']||'')&&_0x2c70b1['push']('ck-ai_review__change_active'),{'classes':_0x2c70b1,'attributes':{'data-marker-id':_0xf033f5['markerName']}};}}),_0x509389['conversion']['for']('editingDowncast')['markerToHighlight']({'model':rh+'remove-text','view':_0x3fc3ba=>{const _0x350717=this['_markers']['get'](_0x3fc3ba['markerName']),_0x56c220=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x350717?.['id']||'')&&_0x56c220['push']('ck-ai_review__change_active'),{'classes':_0x56c220,'attributes':{'data-marker-id':_0x3fc3ba['markerName']}};}}),_0x509389['conversion']['for']('dataDowncast')['markerToElement']({'model':rh+'suggestion-context','view':(_0x4bde73,{writer:_0x36a902})=>_0x36a902['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x4bde73['isOpening']?'start':'end')})}),_0x509389['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x5e92a3,'view':_0x2d4fde}),this['_updateMouseMarkerInteractionListeners'](_0x509389),this['listenTo'](_0x509389,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x509389),{'priority':'lowest'}),this['listenTo'](_0x509389,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x509389),{'priority':'lowest'}),_0x509389['model']['document']['registerPostFixer'](_0x796c7c=>this['_validateMarkers'](_0x509389,_0x796c7c)),_0x509389['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x509389)),this['_reviewEditingAttachedEditors']['add'](_0x509389));}['_updateMouseMarkerInteractionListeners'](_0x1f7852){let _0x9f1db5=this['_boundEditables']['get'](_0x1f7852);_0x9f1db5||(_0x9f1db5=new Map(),this['_boundEditables']['set'](_0x1f7852,_0x9f1db5));const _0x34e1c4=new Set(_0x1f7852['ui']['getEditableElementsNames']());for(const _0x511527 of _0x34e1c4){if(_0x9f1db5['has'](_0x511527))continue;const _0x1df22c=_0x1f7852['ui']['getEditableElement'](_0x511527);_0x9f1db5['set'](_0x511527,_0x1df22c),this['_attachMouseMarkerInteractionListeners'](_0x1df22c);}for(const [_0x30bc2d,_0x1cf6a5]of _0x9f1db5)_0x34e1c4['has'](_0x30bc2d)||(_0x9f1db5['delete'](_0x30bc2d),this['_domEmitter']['stopListening'](_0x1cf6a5));}['_attachMouseMarkerInteractionListeners'](_0x15f13b){this['_domEmitter']['listenTo'](_0x15f13b,'mouseup',(_0x526297,_0xd167ec)=>{const _0x2b662d=_0xd167ec['target'],_0x410113=this['_findMarkerElement'](_0x2b662d);if(!_0x410113)return;const _0x248208=_0x410113['getAttribute']('data-marker-id'),_0x5023fd=_0x248208['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x248208,'changeId':_0x5023fd,'markerElement':()=>this['_findMarkerElementById'](_0x248208),'domEvent':_0xd167ec});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x15f13b,'mouseover',(_0x59731b,_0x59fc74)=>{const _0x2fc52d=_0x59fc74['target'],_0x3ab5f1=_0x59fc74['relatedTarget'];let _0x339f0e=this['_findMarkerElement'](_0x2fc52d);if(!_0x339f0e&&_0x3ab5f1&&(_0x339f0e=this['_findMarkerElement'](_0x3ab5f1)),!_0x339f0e)return;const _0x356bdd=_0x339f0e['getAttribute']('data-marker-id'),_0x14bc07=_0x356bdd['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x14bc07,'markerElement':()=>this['_findMarkerElementById'](_0x356bdd),'domEvent':_0x59fc74});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0x5d2c2e((_0x5b3a0d,_0x5963aa)=>{const _0x2c35e7=_0x5963aa['target'];this['_findMarkerElement'](_0x2c35e7)||_0x2c35e7['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x453ca1=this['context']['plugins']['get']('AIEditing'),_0x5097b9=ds(this['context']);if(!_0x5097b9['length'])throw new ht('ai-get-editor-from-context-no-editor',this);const _0x3682eb=new Set(),_0x3d0098=[],_0xeb844c=new Map();for(const _0x556a7c of _0x5097b9)for(const _0x29d001 of _0x556a7c['model']['document']['getRoots']()){if('$graveyard'===_0x29d001['rootName'])continue;const _0x2f93db=this['_buildDocumentDataSliceForRoot'](_0x556a7c,_0x29d001,_0x453ca1,_0x3682eb);_0x3d0098['push'](_0x2f93db['content']);for(const [_0x124fc7,_0x6c4bf0]of _0x2f93db['elements'])_0xeb844c['set'](_0x124fc7,_0x6c4bf0);}return{'elements':_0xeb844c,'content':_0x3d0098['join']('')};}['_buildDocumentDataSliceForRoot'](_0x590ff5,_0x55c5b4,_0x3530f6,_0x576af6){const _0x68688b=_0x590ff5['model'],_0x10e98e=new _0x2868da();for(const _0x3c80e8 of _0x55c5b4['getChildren']())_0x10e98e['_appendChild'](_0x3c80e8['_clone'](!0x0));for(const _0x3370f2 of _0x68688b['markers']){const _0x13d07b=_0x3370f2['getRange']();_0x13d07b&&_0x13d07b['root']['rootName']===_0x55c5b4['rootName']&&_0x10e98e['markers']['set'](_0x3370f2['name'],this['_changeRangeOwnerDocument'](_0x13d07b['clone'](),_0x10e98e));}const _0x197990=new Map(),_0x12ae4c=_0x68688b['document']['version'],_0x41aa26=new _0x143bbc({'ignoreElementEnd':!0x0,'startPosition':_0x68688b['createPositionAt'](_0x10e98e,0x0)});for(const {item:_0x36776e}of _0x41aa26){if(_0x36776e['is']('element')&&_0x36776e['name']&&ah['includes'](_0x36776e['name'])){const _0x398239=this['_upsertDataId'](_0x36776e,()=>_0x3530f6['_nextDataId'](_0x576af6));_0x576af6['add'](_0x398239);}if(!_0x36776e['is']('$textProxy'))continue;const _0x97e24=_0x36776e['parent'];if(!_0x97e24||!_0x97e24['is']('element'))continue;const _0x2db340=this['_upsertDataId'](_0x97e24,()=>_0x3530f6['_nextDataId'](_0x576af6));_0x576af6['add'](_0x2db340);for(const _0x1296b3 of _0x97e24['getChildren']())_0x1296b3['is']('element')&&(_0x1296b3['name']&&oh['includes'](_0x1296b3['name'])||_0x576af6['add'](this['_upsertDataId'](_0x1296b3,()=>_0x3530f6['_nextDataId'](_0x576af6))));let _0x20705f=_0x97e24;for(;_0x20705f['parent']&&!_0x20705f['parent']['is']('documentFragment');)_0x20705f=_0x20705f['parent'],_0x20705f['hasAttribute'](_0x5e92a3)&&_0x20705f['_removeAttribute'](_0x5e92a3);_0x197990['set'](_0x2db340,{'editor':_0x590ff5,'rootName':_0x55c5b4['rootName'],'path':_0x97e24['getPath'](),'documentVersion':_0x12ae4c,'getContent':this['_createGetContentUsingDataIdFn'](_0x20705f['_clone'](!0x0),_0x2db340,_0x590ff5['data'])}),_0x41aa26['jumpTo'](_0x68688b['createPositionAfter'](_0x97e24));}return{'content':_0x590ff5['data']['processor']['toData'](_0x590ff5['data']['toView'](_0x10e98e)),'elements':_0x197990};}['diffContent'](_0x512c54,_0x5f1d5a,_0x44d4fd,_0x3c45bd=!0x1){const {contentInitial:_0x3e64b4,contentNew:_0x1b419d}=this['_neutralizeChangesOnUnsupportedElements'](_0x5f1d5a,_0x44d4fd),_0x459566=[],_0x3273ce=_0x512c54['data']['parse'](_0x1b419d,'$documentFragment'),_0x1e7fa4=_0x512c54['data']['parse'](_0x3e64b4,'$documentFragment'),_0x8feecb=_0x512c54['model']['createPositionAt'](_0x1e7fa4,0x0);if(this['_haveSingleTopLevelElement'](_0x3273ce)){if(!this['_hasSameTopLevelElement'](_0x1e7fa4,_0x3273ce))return _0x459566;}else{const _0x1487b1=_0x512c54['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x1e7fa4,_0x1487b1)||!this['_haveOnlyInlineContent'](_0x3273ce,_0x1487b1))return _0x459566;}const _0x5158d1=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x3e64b4,_0x1b419d,{'targetEditor':_0x512c54,'anchor':_0x8feecb,'markDeletions':!0x0})['getOperations']()['filter'](_0x4adc02=>'insert'===_0x4adc02['type']||'marker'===_0x4adc02['type']&&_0x4adc02['name']['startsWith']('$markedRemove')),_0x115255=this['_groupAdjacentOperations'](_0x5158d1),_0x5de421=[];if(_0x3c45bd){if(_0x115255['length']){const _0x1e6740=_0x115255[0x0]['operations'][0x0],_0x293609='insert'===_0x1e6740['type']?_0x1e6740['position']:_0x1e6740['newRange']['start'],_0x381831=this['_getPositionLimitingRange'](_0x293609,_0x512c54,'inside'),_0x436ac8=_0x381831?_0x3273ce['getChild'](0x0)['getChildren']():_0x3273ce['getChildren'](),_0x4c341e=_0x381831||_0x512c54['model']['createRangeIn'](_0x1e7fa4),_0x1cde21=[new _0x11ea10('$markedRemove:synthetic'+vt(),null,_0x4c341e,_0x512c54['model']['document']['model']['markers'],!0x0,_0x512c54['model']['document']['version']+0x1),new _0x416680(_0x4c341e['end'],_0x436ac8,_0x512c54['model']['document']['version']+0x2)];_0x5de421['push']({'operations':_0x1cde21,'operationsIsolated':_0x1cde21,'groupOffset':0x0});}}else _0x5de421['push'](..._0x115255);let _0x401b3c=0x0;return _0x512c54['model']['change'](_0x4ae01b=>{for(let _0x303d0a=0x0;_0x303d0a<_0x5de421['length'];_0x303d0a++){const _0x50b934=_0x5de421[_0x303d0a],_0x285496=_0x4ae01b['createDocumentFragment']();for(const _0x544eef of _0x1e7fa4['getChildren']())_0x4ae01b['append'](_0x544eef['_clone'](!0x0),_0x285496);for(const _0x84daf of _0x50b934['operationsIsolated'])if('insert'===_0x84daf['type']){const _0x42e4c9=_0x84daf;_0x42e4c9['baseVersion']=null,_0x42e4c9['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x42e4c9,_0x285496),_0x4ae01b['batch']['addOperation'](_0x84daf),_0x512c54['model']['applyOperation'](_0x84daf);const _0x2ce20e='suggestion:insertion:id:authorId:'+_0x401b3c++,_0x26ab08=_0x512c54['model']['createRange'](_0x42e4c9['position'],_0x42e4c9['position']['getShiftedBy'](_0x42e4c9['howMany']));_0x285496['markers']['set'](_0x2ce20e,_0x26ab08);}else{if('marker'===_0x84daf['type']&&_0x84daf['name']['startsWith']('$markedRemove')){const _0x5edf0c=_0x84daf,_0x16dbea='suggestion:deletion:id:authorId:'+_0x401b3c++;this['_changeOperationOwnerDocument'](_0x5edf0c,_0x285496),_0x285496['markers']['set'](_0x16dbea,_0x5edf0c['newRange']);}}if(_0x3c45bd)_0x459566['push']({..._0x50b934,'context':this['_createGetContentFn'](_0x1e7fa4,_0x512c54['data']),'content':this['_createGetContentFn'](_0x1e7fa4,_0x512c54['data'])});else{const _0x35b03b=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x50b934['operationsIsolated'][0x0]),_0x285496),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x50b934['operationsIsolated'][_0x50b934['operationsIsolated']['length']-0x1]),_0x285496),_0x512c54);_0x285496['markers']['set'](rh+'suggestion-context',new _0x4e8468(_0x35b03b['start'],_0x35b03b['end'])),_0x459566['push']({..._0x50b934,'context':this['_createGetContextFn'](_0x285496,_0x512c54['data'],{'ellipsisBefore':_0x35b03b['hasContentBefore'],'ellipsisAfter':_0x35b03b['hasContentAfter']}),'content':this['_createGetContentFn'](_0x285496,_0x512c54['data'])});}}}),_0x459566;}['markChangePositionInEditorContent'](_0x3f397e,_0x1545f8){if(!_0x3f397e['length'])return;const _0x50b76c=_0x3f397e[0x0]['parent']['id'],_0x1a3784=_0x1545f8['elements']['get'](_0x50b76c);if(!_0x1a3784)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x50b76c);const _0x2fa2c9=_0x1a3784['path'],_0x1871f6=_0x1a3784['editor'],_0x3d4e27=_0x1871f6['model']['document']['getRoot'](_0x1a3784['rootName']);if(!_0x3d4e27)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x1a3784['rootName']);const _0x1aebb2=_0x1871f6['model']['document']['history']['getOperations'](_0x1a3784['documentVersion']),_0x1bb2b7=[];for(const _0x7895ce of _0x3f397e){const _0x49d581=_0x7895ce['operationsIsolated']['map'](_0x3a8581=>this['_translateOperationToEditorContent'](_0x3a8581,_0x2fa2c9,_0x3d4e27));if(!_0x49d581||!_0x49d581['length'])continue;const _0x2559da=_0x49d581['every'](_0x454ad5=>'marker'===_0x454ad5['type']&&_0x454ad5['name']['startsWith']('$markedRemove')),_0x1fc834=_0x29e916(_0x49d581,_0x1aebb2,{'document':_0x1871f6['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1})['operationsA'];for(const _0x424660 of _0x1fc834)if('insert'===_0x424660['type']){const _0x15fd41=_0x424660,_0x2816dc=_0x15fd41['nodes'];_0x1871f6['model']['change'](_0x32f1eb=>{const _0x2cc4b5=_0x32f1eb['createDocumentFragment']();for(const _0x5107e7 of _0x2816dc)_0x32f1eb['append'](_0x5107e7['_clone'](!0x0),_0x2cc4b5);_0x1bb2b7['push']({'start':_0x15fd41['position'],'end':_0x15fd41['position'],'type':'insert','groupId':_0x7895ce['id'],'content':{'asString':this['_createGetContentFn'](_0x2cc4b5,_0x1871f6['data'])(),'asFragment':_0x2cc4b5}});});}else{if('marker'===_0x424660['type']&&_0x424660['name']['startsWith']('$markedRemove')){const _0x7e9926=_0x424660;let _0xe6ae73='remove-text';if(_0x2559da){const _0x24c522=this['_findAdjacentContextDistance'](_0x7e9926['newRange']['start'],'backward',_0x1871f6['model']['schema']),_0xea5e98=this['_findAdjacentContextDistance'](_0x7e9926['newRange']['end'],'forward',_0x1871f6['model']['schema']);if(_0x24c522||_0xea5e98){const _0x111120=_0x7e9926['newRange']['start']['getShiftedBy'](-_0x24c522),_0x3c74c7=_0x7e9926['newRange']['end']['getShiftedBy'](_0xea5e98);_0x1bb2b7['push']({'start':_0x111120,'end':_0x3c74c7,'groupId':_0x7895ce['id'],'type':'remove-context'});}else _0xe6ae73='remove-only';}_0x1bb2b7['push']({'start':_0x7e9926['newRange']['start'],'end':_0x7e9926['newRange']['end'],'groupId':_0x7895ce['id'],'type':_0xe6ae73});}}}this['_insertMarkers'](_0x1bb2b7,_0x1871f6);}['clearAllMarkers'](){const _0x1f143a=new Map();for(const _0x2bcc77 of this['_markers']['keys']()){const _0x5c550c=this['_markers']['get'](_0x2bcc77);_0x5c550c?.['editor']&&(_0x1f143a['has'](_0x5c550c['editor'])||_0x1f143a['set'](_0x5c550c['editor'],[]),_0x1f143a['get'](_0x5c550c['editor'])['push'](_0x2bcc77));}for(const [_0x273a82,_0x7bd1e8]of _0x1f143a)_0x273a82['model']['change'](_0x2777b9=>{for(const _0x167488 of _0x7bd1e8)_0x273a82['model']['markers']['get'](_0x167488)&&_0x2777b9['removeMarker'](_0x167488);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0x4ad304 of ds(this['context']))_0x4ad304['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0x5074ff of ds(this['context']))_0x5074ff['disableReadOnlyMode']('ai-review');}['applyChange'](_0x3c0f00,_0x12253f=null){const _0x538c0b=_0x3c0f00['map'](_0x9b9348=>this['_getMarkersDataForGroup'](_0x9b9348))['flat'](),_0xc8c2bb=new Map();for(const _0x1754e8 of _0x538c0b)_0xc8c2bb['has'](_0x1754e8['editor'])||_0xc8c2bb['set'](_0x1754e8['editor'],[]),_0xc8c2bb['get'](_0x1754e8['editor'])['push'](_0x1754e8);for(const [_0x238841,_0x319448]of _0xc8c2bb){const _0x303799=_0x238841['model'],_0x50ba03=_0x238841['plugins']['has']('TrackChangesEditing')?_0x238841['plugins']['get']('TrackChangesEditing'):null,_0x5a8a20=_0x12253f&&_0x50ba03?new Set(_0x50ba03['getSuggestions']()['map'](_0x292750=>_0x292750['id'])):null;_0x303799['change'](_0x4456fb=>{const _0x1b2315=_0x4456fb['batch']['operations']['length'];for(const _0x264810 of _0x319448){const _0x46645b=_0x238841['model']['markers']['get'](_0x264810['id']);if(_0x46645b){if('insert'===_0x264810['type']){if(!_0x264810['content'])continue;_0x303799['insertContent'](_0x264810['content']['asFragment']||null,_0x46645b['getRange']()['start']);}else'remove-text'!==_0x264810['type']&&'remove-only'!==_0x264810['type']||_0x303799['deleteContent'](_0x303799['createSelection'](_0x46645b['getRange']()));_0x4456fb['removeMarker'](_0x264810['id']),this['_markers']['delete'](_0x264810['id']);}}if(_0x12253f&&(zs(_0x4456fb['batch']['operations']['slice'](_0x1b2315),_0x12253f),_0x50ba03)){for(const _0x19bbbe of _0x50ba03['getSuggestions']())_0x5a8a20['has'](_0x19bbbe['id'])||_0x19bbbe['setAttribute']('@ai',{'type':_0x12253f});}});}}['rejectChange'](_0x4e44fd){const _0x510af6=this['_getMarkersDataForGroup'](_0x4e44fd),_0x251202=new Map();for(const _0x333762 of _0x510af6)_0x251202['has'](_0x333762['editor'])||_0x251202['set'](_0x333762['editor'],[]),_0x251202['get'](_0x333762['editor'])['push'](_0x333762);for(const [_0x5d3b85,_0x41fdea]of _0x251202)_0x5d3b85['model']['change'](_0x4a6dd5=>{for(const _0xd6878f of _0x41fdea)_0x4a6dd5['removeMarker'](_0xd6878f['id']),this['_markers']['delete'](_0xd6878f['id']);});}['getEditor'](){return _s(this['context']);}['getEditors'](){return ds(this['context']);}['getEditorForChange'](_0x4e047d){return this['_getMarkersDataForGroup'](_0x4e047d)[0x0]?.['editor'];}['getMarkerElementForChange'](_0x55cb9a){const _0x272c06=Array['from'](this['_markers']['values']())['filter'](_0x25f82d=>_0x25f82d['groupId']===_0x55cb9a);if(!_0x272c06['length'])return null;const _0x3eb975=0x1===_0x272c06['length']?_0x272c06[0x0]:this['_sortMarkers'](_0x272c06)[0x0],_0x56023d=_0x3eb975['editor']['model']['markers']['get'](_0x3eb975['id']);return _0x56023d?{'modelRange':_0x56023d['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x3eb975['id'])}:null;}['getContentElementForChange'](_0x1b0cc8){const _0xd0945c=Array['from'](this['_markers']['values']())['filter'](_0x8167c6=>_0x8167c6['groupId']===_0x1b0cc8);if(!_0xd0945c['length'])return null;const _0x19d3ba=0x1===_0xd0945c['length']?_0xd0945c[0x0]:this['_sortMarkers'](_0xd0945c)[0x0],_0x594300=_0x19d3ba['editor'],_0x7d2045=_0x594300['model']['markers']['get'](_0x19d3ba['id']);if(!_0x7d2045)return null;const _0x2b6617=_0x7d2045['getRange'](),_0x2408df=_0x594300['editing']['view']['getDomRoot'](_0x2b6617['root']['rootName'])||_0x594300['editing']['view']['getDomRoot']();if(!_0x2408df||!_0x2b6617)return null;let _0x4d7220=_0x2b6617['start']['parent'];for(;_0x4d7220['parent']&&!_0x4d7220['parent']['is']('rootElement');)_0x4d7220=_0x4d7220['parent'];if(!_0x4d7220||!_0x4d7220['name'])return null;const _0x59854f=_0x2408df['querySelector']('[data-marker-id=\x22'+_0x19d3ba['id']+'\x22]');if(!_0x59854f)return null;let _0x196c89=null;_0x594300['model']['change'](_0x50a96d=>{_0x196c89=_0x50a96d['createDocumentFragment'](),_0x50a96d['append'](_0x4d7220['_clone'](!0x0),_0x196c89);});const _0x54293d=_0x594300['data']['toView'](_0x196c89)['getChild'](0x0);return _0x59854f['closest'](_0x54293d['name']);}['reactivateMarkers'](_0x17a091){const _0x3c4288=this['_getMarkersDataForGroup'](_0x17a091);if(!_0x3c4288['length'])return;const _0x2621aa=Array['from'](this['_activeMarkers'])['sort'](),_0x196ca9=Array['from'](new Set(_0x3c4288['map'](_0x1922b5=>_0x1922b5['id'])))['sort']();_0x2621aa['join']('|')!==_0x196ca9['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x17a091));}['setMarkersInElementAsActive'](_0x5de44d){const _0x54b970=this['_getMarkersDataForGroup'](_0x5de44d);if(!_0x54b970['length'])return;const _0x466025=_0x54b970[0x0]['editor'],_0x524075=new Set(_0x54b970['map'](_0x1b86bb=>_0x1b86bb['id'])),_0x433cb1=Array['from'](_0x524075['values']())['map'](_0x3f1815=>_0x466025['model']['markers']['get'](_0x3f1815))['filter'](_0x5d923a=>!!_0x5d923a);_0x524075['forEach'](_0x29e167=>{this['_activeMarkers']['add'](_0x29e167);}),_0x466025['model']['change'](()=>{_0x433cb1['forEach'](_0x123a5a=>{_0x466025['editing']['reconvertMarker'](_0x123a5a);});});}['setAllMarkersAsInactive'](){const _0xc5271e=Array['from'](this['_activeMarkers']);if(!_0xc5271e['length'])return;this['_activeMarkers']['clear']();const _0x29940d=new Map();for(const _0x33aa85 of _0xc5271e){const _0x479538=this['_markers']['get'](_0x33aa85);if(!_0x479538)continue;const _0x5663a9=_0x479538['editor'],_0x67cb8f=_0x5663a9['model']['markers']['get'](_0x33aa85);_0x67cb8f&&(_0x29940d['has'](_0x5663a9)||_0x29940d['set'](_0x5663a9,[]),_0x29940d['get'](_0x5663a9)['push'](_0x67cb8f));}for(const [_0x5861bc,_0x2a302f]of _0x29940d)_0x5861bc['model']['change'](()=>{_0x2a302f['forEach'](_0xa1900=>{_0x5861bc['editing']['reconvertMarker'](_0xa1900);});});}['_getPositionLimitingRange'](_0x4d88b5,_0x5dd0ed,_0x405505='outside'){if(!_0x4d88b5)return null;let _0x1b5c0d=_0x4d88b5['parent'];for(;_0x1b5c0d&&_0x1b5c0d['parent']&&!_0x1b5c0d['parent']['is']('rootElement')&&!_0x5dd0ed['model']['schema']['isLimit'](_0x1b5c0d)&&!_0x5dd0ed['model']['schema']['isBlock'](_0x1b5c0d);)_0x1b5c0d=_0x1b5c0d['parent'];if(!_0x1b5c0d||!_0x1b5c0d['name']||_0x1b5c0d['is']('rootElement'))return null;let _0xad3a56=null;return _0x5dd0ed['model']['change'](_0x42995d=>{_0xad3a56='inside'===_0x405505?_0x42995d['createRangeIn'](_0x1b5c0d):_0x42995d['createRangeOn'](_0x1b5c0d);}),_0xad3a56;}['_validateMarkers'](_0x41e85e,_0x4c4c59){const _0x133c65=Array['from'](this['_markers']['keys']()),_0x209b6b=new Map();for(const _0x5c253a of _0x133c65){const _0x39b764=_0x41e85e['model']['markers']['get'](_0x5c253a);if(!_0x39b764)continue;const _0x403f52=_0x39b764['getStart']()['root']['rootName']+':'+_0x39b764['getStart']()['path'][0x0];_0x209b6b['has'](_0x403f52)||_0x209b6b['set'](_0x403f52,[]),_0x209b6b['get'](_0x403f52)['push'](_0x39b764);}const _0x2ce69b=new Set();for(const _0x1b5ff0 of _0x41e85e['model']['document']['differ']['getChanges']()){let _0x2e0f1e='',_0x484273=null;if('insert'===_0x1b5ff0['type'])_0x484273=new _0x4e8468(_0x1b5ff0['position'],_0x1b5ff0['position']['getShiftedBy'](_0x1b5ff0['length'])),_0x2e0f1e=_0x1b5ff0['position']['root']['rootName']+':'+_0x1b5ff0['position']['path'][0x0];else{if('remove'!==_0x1b5ff0['type'])continue;_0x484273=new _0x4e8468(_0x1b5ff0['position']),_0x2e0f1e=_0x1b5ff0['position']['root']['rootName']+':'+_0x1b5ff0['position']['path'][0x0];}const _0x4992ba=_0x209b6b['get'](_0x2e0f1e)||[];if(_0x4992ba['length']){for(const _0x20563d of _0x4992ba)if(_0x484273['root']['rootName']===_0x20563d['getRange']()['root']['rootName']&&('insert'!==_0x1b5ff0['type']||!_0x484273['containsRange'](_0x20563d['getRange']()))&&(_0x484273['isIntersecting'](_0x20563d['getRange']())||_0x484273['start']['isTouching'](_0x20563d['getRange']()['end'])||_0x484273['end']['isTouching'](_0x20563d['getRange']()['start']))){const _0xfdb3b4=this['_parseMarkerName'](_0x20563d['name']);Array['from'](this['_markers']['values']())['filter'](_0xca819c=>_0xca819c['groupId']===_0xfdb3b4['groupId'])['forEach'](_0x3b67fc=>_0x2ce69b['add'](_0x3b67fc['id']));}}}if(_0x2ce69b['size']){for(const _0xbdd01a of _0x2ce69b)_0x4c4c59['removeMarker'](_0xbdd01a);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x356507){for(const {name:_0x1c3cf1,data:_0x1d5078}of _0x356507['model']['document']['differ']['getChangedMarkers']()){if(!_0x1c3cf1['startsWith'](rh))continue;const _0x3d3148=_0x1d5078['oldRange'],_0x1517c9=_0x1d5078['newRange'],_0x3e38cc=_0x3d3148&&'$graveyard'===_0x3d3148['root']['rootName'],_0x2cc604=_0x1517c9&&'$graveyard'===_0x1517c9['root']['rootName'];if(_0x3e38cc&&_0x2cc604)continue;const _0x573f02=this['_parseMarkerName'](_0x1c3cf1);this['_markers']['get'](_0x1c3cf1)&&(_0x2cc604||!_0x1517c9?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x1c3cf1,'changeId':_0x573f02['groupId']}):_0x3e38cc&&_0x1517c9&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x1c3cf1,'changeId':_0x573f02['groupId']}));}}['_parseMarkerName'](_0x388d8e){const _0xa3a855=_0x388d8e['split'](':'),_0x367d4d=(_0xa3a855[0x1]||'')['split']('_');return{'prefix':_0xa3a855[0x0],'groupId':_0x367d4d[0x0],'suffix':_0x367d4d[0x1]};}['_translateOperationToEditorContent'](_0x9909d4,_0xf293c7,_0x532a25){if('insert'===_0x9909d4['type']){const _0x3cd6c3=_0x9909d4;return new _0x416680(this['_changePosition'](_0xf293c7['concat'](_0x3cd6c3['position']['offset']),_0x532a25),_0x3cd6c3['nodes'],_0x3cd6c3['baseVersion']);}if('marker'===_0x9909d4['type']&&_0x9909d4['name']['startsWith']('$markedRemove')){const _0x100b27=_0x9909d4;return new _0x11ea10(_0x100b27['name'],_0x100b27['oldRange'],this['_changeRange'](_0x100b27['newRange'],_0xf293c7['concat'](_0x100b27['newRange']['start']['offset']),_0xf293c7['concat'](_0x100b27['newRange']['end']['offset']),_0x532a25),_0x100b27['_markers'],_0x100b27['affectsData'],_0x100b27['baseVersion']);}return _0x9909d4;}['_groupAdjacentOperations'](_0x52bc5f){if(!_0x52bc5f['length'])return[];const _0x820566=[];let _0x54461f=0x0,_0x6aa858=0x0,_0x21aa98=[];for(let _0x5dd967=0x0;_0x5dd967<=_0x52bc5f['length'];_0x5dd967++){const _0x57be30=_0x52bc5f[_0x5dd967],_0x1b0215=_0x52bc5f[_0x5dd967-0x1];!_0x57be30||_0x1b0215&&!this['_getOperationEnd'](_0x1b0215)['isTouching'](this['_getOperationStart'](_0x57be30))?(_0x820566['push']({'operations':_0x21aa98,'operationsIsolated':_0x21aa98['map'](_0x1a4878=>this['_shiftOperation'](_0x1a4878['clone'](),-_0x6aa858)),'groupOffset':_0x54461f}),_0x21aa98=_0x57be30?[_0x57be30]:[],_0x6aa858+=_0x54461f,_0x54461f=0x0):_0x21aa98['push'](_0x57be30),_0x57be30&&'insert'===_0x57be30['type']&&(_0x54461f+=_0x57be30['howMany']);}return _0x820566;}['_findAdjacentContextDistance'](_0x470c4c,_0x2045cc,_0x441696,_0x15ec78=0x1){const _0x1f9a4e=new _0x143bbc({'startPosition':_0x470c4c,'direction':_0x2045cc});let _0x3991b2=0x0;for(let _0x360c7e=0x0;_0x360c7e<_0x15ec78;_0x360c7e++){let _0x41071d=0x0,_0x7a86be=!0x1,_0xc723df='forward'===_0x2045cc?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x1b584c}of _0x1f9a4e)if(_0x1b584c['is']('$textProxy')){const _0x4f96c7=_0xc723df['exec'](_0x1b584c['data']);if(_0x4f96c7&&_0x4f96c7['length']){if(_0x41071d+='forward'===_0x2045cc?_0x4f96c7['index']+_0x4f96c7[0x0]['length']:_0x1b584c['data']['length']-_0x4f96c7['index'],_0x4f96c7[0x0]['length']!==_0x1b584c['data']['length'])break;_0x7a86be=!0x0,_0xc723df='forward'===_0x2045cc?/^\w+/:/\w+$/;}else{if(_0x7a86be)break;_0x41071d+=_0x1b584c['offsetSize'];}}else{if(_0x1b584c['is']('element')){_0x441696['isInline'](_0x1b584c)&&!_0x7a86be&&(_0x41071d+=0x1);break;}}_0x3991b2+=_0x41071d,_0x1f9a4e['jumpTo'](_0x470c4c['getShiftedBy']('forward'===_0x2045cc?_0x3991b2:-_0x3991b2));}return _0x3991b2;}['_getChangeContext'](_0x26fdfc,_0x13ad47,_0x3b9473){const _0x5e8f24=_0x3b9473['model']['schema'],_0x26b554=this['_findAdjacentContextDistance'](_0x26fdfc,'backward',_0x5e8f24,0x6),_0x457bb8=this['_findAdjacentContextDistance'](_0x13ad47,'forward',_0x5e8f24,0x6),_0x5d0b01=_0x26fdfc['getShiftedBy'](-_0x26b554),_0x427d39=_0x13ad47['getShiftedBy'](_0x457bb8);return{'start':_0x5d0b01,'end':_0x427d39,'hasContentBefore':!_0x5d0b01['isAtStart'],'hasContentAfter':!_0x427d39['isAtEnd']};}['_insertMarkers'](_0x2ebe2c,_0x120d1b){const _0x479f12=this['context']['plugins']['get']('AIEditing'),_0x299b53=new Set();_0x120d1b['model']['change'](_0x42b19b=>{for(const _0x306f8d of _0x2ebe2c){const _0x498e4a=''+rh+_0x306f8d['type']+':'+_0x306f8d['groupId']+'_'+_0x479f12['_nextDataId'](_0x299b53);this['_markers']['set'](_0x498e4a,{'id':_0x498e4a,'groupId':_0x306f8d['groupId'],'type':_0x306f8d['type'],'content':_0x306f8d['content'],'editor':_0x120d1b}),_0x42b19b['addMarker'](_0x498e4a,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x42b19b['createRange'](_0x306f8d['start'],_0x306f8d['end'])});}});}['_createGetContextFn'](_0x358433,_0xa731bf,_0x4d9bca){let _0x5e1608='';return()=>{if(!_0x5e1608){const _0x20703f=_0xa731bf['toView'](_0x358433,{'showSuggestionHighlights':!0x0});let _0x30d13e=_0x20703f['getChild'](0x0);if(_0x30d13e['is']('containerElement')||(_0x30d13e=_0x20703f),!_0x30d13e)return'';let _0x5733d0=!0x1;const _0x5a1af9=[];for(const _0x54a7a7 of _0x30d13e['getChildren']())_0x54a7a7['is']('element','span')&&_0x54a7a7['hasClass']('ck-ai_review-marker_context-end')&&(_0x5733d0=!0x1),_0x5733d0&&_0x5a1af9['push'](_0x54a7a7),_0x54a7a7['is']('element','span')&&_0x54a7a7['hasClass']('ck-ai_review-marker_context-start')&&(_0x5733d0=!0x0);_0x30d13e['_removeChildren'](0x0,_0x30d13e['childCount']),_0x4d9bca?.['ellipsisBefore']&&_0x30d13e['_appendChild']('…'),_0x30d13e['_appendChild'](_0x5a1af9),_0x4d9bca?.['ellipsisAfter']&&_0x30d13e['_appendChild']('…');const _0x1d2327=_0xa731bf['htmlProcessor']['domConverter']['viewToDom'](_0x20703f),_0x207bbb=_0xa731bf['htmlProcessor']['htmlWriter']['getHtml'](_0x1d2327);_0x5e1608=this['_removeUnsupportedElements'](_0x207bbb);}return _0x5e1608;};}['_createGetContentFn'](_0x560bfb,_0x2332ea){let _0x542c83='';return()=>(_0x542c83||(_0x542c83=this['_removeUnsupportedElements'](_0x2332ea['stringify'](_0x560bfb,{'showSuggestionHighlights':!0x0}))),_0x542c83);}['_createGetContentUsingDataIdFn'](_0x13f28f,_0x426626,_0x1057fd){let _0x322072='';return()=>{if(!_0x322072){const _0x2d2fd4=_0x1057fd['toView'](new _0x2868da(_0x13f28f));_0x322072=_0x1057fd['htmlProcessor']['domConverter']['viewToDom'](_0x2d2fd4)['querySelector']('[data-id=\x22'+_0x426626+'\x22]')?.['outerHTML']||'';}return _0x322072;};}['_removeUnsupportedElements'](_0x5a0ad1){if(!_0x5a0ad1)return'';const _0x1adfd7=ps(_0x5a0ad1,{'decodeEntities':!0x1}),_0x1c314f=ws(_0x1adfd7);if(!_0x1c314f['length'])return _0x5a0ad1;for(const _0x3b0f94 of _0x1c314f)_0x2a7599(_0x3b0f94);return ms(_0x1adfd7,{'encodeEntities':!0x1});}['_neutralizeChangesOnUnsupportedElements'](_0xe35631,_0x424b18){const _0x4bae61=ps(_0xe35631,{'decodeEntities':!0x1}),_0xff1b42=ps(_0x424b18,{'decodeEntities':!0x1}),_0x31692a=ws(_0x4bae61),_0x597d8e=ws(_0xff1b42);if(!_0x31692a['length']&&!_0x597d8e['length'])return{'contentInitial':_0xe35631,'contentNew':_0x424b18};const _0x11b9fb=new Map();for(const _0x53d05a of _0x31692a)_0x11b9fb['set'](fs(_0x53d05a,'data-id'),_0x53d05a);for(const _0x8364e9 of _0x597d8e){const _0x52828c=fs(_0x8364e9,'data-id'),_0x2a938f=_0x52828c?_0x11b9fb['get'](_0x52828c):void 0x0;_0x2a938f?_0x43a070(_0x8364e9,_0x373861(_0x2a938f,!0x0)):_0x2a7599(_0x8364e9);}return{'contentInitial':ms(_0x4bae61,{'encodeEntities':!0x1}),'contentNew':ms(_0xff1b42,{'encodeEntities':!0x1})};}['_findMarkerElement'](_0x2aaf37,_0x370ba3=0x5){let _0x2075a4=_0x2aaf37,_0x55fd26=null;for(let _0x419bac=0x0;_0x419bac<_0x370ba3&&_0x2075a4;_0x419bac++)if(_0x2075a4['className']){if((''+_0x2075a4['className'])['includes']('ck-ai_review-marker_')){if(!_0x2075a4['getAttribute']('data-marker-id'))break;_0x55fd26=_0x2075a4;break;}_0x2075a4=_0x2075a4['parentElement'];}else _0x2075a4=_0x2075a4['parentElement'];return _0x55fd26;}['_findMarkerElementById'](_0xd7f378){const _0x3c2f8e=this['_markers']['get'](_0xd7f378);if(!_0x3c2f8e)return null;const _0x50e7eb=_0x3c2f8e['editor']['model']['markers']['get'](_0xd7f378);return _0x50e7eb?_0x5e0b30(_0x3c2f8e['editor']['editing'],_0x50e7eb):null;}['_getMarkersDataForGroup'](_0x264217){return Array['from'](this['_markers']['values']())['filter'](_0x568f9c=>_0x568f9c['groupId']===_0x264217);}['_getOperationStart'](_0xabaf30){return'insert'===_0xabaf30['type']?_0xabaf30['position']:_0xabaf30['newRange']['start'];}['_getOperationEnd'](_0x467033,_0x3cf86e=!0x1){return'insert'===_0x467033['type']?_0x3cf86e?_0x467033['position']:_0x467033['position']['getShiftedBy'](_0x467033['howMany']):_0x467033['newRange']['end'];}['_shiftOperation'](_0x364088,_0x1c1d8c){return'insert'===_0x364088['type']?_0x364088['position']=_0x364088['position']['getShiftedBy'](_0x1c1d8c):'marker'===_0x364088['type']&&_0x364088['newRange']&&(_0x364088['newRange']=new _0x4e8468(_0x364088['newRange']['start']['getShiftedBy'](_0x1c1d8c),_0x364088['newRange']['end']['getShiftedBy'](_0x1c1d8c))),_0x364088;}['_changeOperationOwnerDocument'](_0x52b635,_0x3ad44f){'insert'===_0x52b635['type']?_0x52b635['position']=this['_changePositionOwnerDocument'](_0x52b635['position'],_0x3ad44f):'marker'===_0x52b635['type']&&_0x52b635['newRange']&&(_0x52b635['newRange']=this['_changeRangeOwnerDocument'](_0x52b635['newRange'],_0x3ad44f));}['_changePositionOwnerDocument'](_0x51ade5,_0x3bf94e){return new _0x5d12c5(_0x3bf94e,_0x51ade5['path']);}['_changeRangeOwnerDocument'](_0x4a86ba,_0x32ec48){return new _0x4e8468(this['_changePositionOwnerDocument'](_0x4a86ba['start'],_0x32ec48),this['_changePositionOwnerDocument'](_0x4a86ba['end'],_0x32ec48));}['_changePosition'](_0x2ef5d6,_0x2f42ee){return new _0x5d12c5(_0x2f42ee,[..._0x2ef5d6]);}['_changeRange'](_0x5b6af9,_0x38b08a,_0xe4bd1d,_0x2ce34f){return new _0x4e8468(this['_changePosition'](_0x38b08a,_0x2ce34f),this['_changePosition'](_0xe4bd1d,_0x2ce34f));}['_sortMarkers'](_0x3aea5e){const _0x222cd8=_0x2cd6b9=>{switch(_0x2cd6b9){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x3aea5e['sort']((_0x31105a,_0xb79af5)=>_0x222cd8(_0x31105a['type'])-_0x222cd8(_0xb79af5['type']));}['_hasSameTopLevelElement'](_0x4b8fba,_0x1e0acf){const _0x1e8501=_0x4b8fba['getChild'](0x0),_0xbff150=_0x1e0acf['getChild'](0x0);return!(!_0x1e8501||!_0xbff150)&&((!_0x1e8501['is']('element')||!_0xbff150['is']('element')||_0x1e8501['name']===_0xbff150['name'])&&!(_0x1e8501['is']('element')&&!_0xbff150['is']('element')||!_0x1e8501['is']('element')&&_0xbff150['is']('element')));}['_haveSingleTopLevelElement'](_0x1b80f0){return 0x1===_0x1b80f0['childCount'];}['_haveOnlyInlineContent'](_0x3f251,_0x89134b){for(const _0x562fae of _0x3f251['getChildren']())if(_0x562fae['is']('element')&&!_0x89134b['isInline'](_0x562fae))return!0x1;return!0x0;}['_upsertDataId'](_0xff85ef,_0x4ebe1b){let _0x1bab49=_0xff85ef['getAttribute'](_0x5e92a3);return _0x1bab49||(_0x1bab49=_0x4ebe1b(),_0xff85ef['_setAttribute'](_0x5e92a3,_0x1bab49)),_0x1bab49;}};const ch=/* #__PURE__ -- @preserve */
38
- ut();var lh=class extends ch{['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x38d447,contentNew:_0x2c8860,contentInitial:_0x336ecc,documentVersion:_0x4ddd09}){super(),this['id']=_0x38d447,this['contentNew']=_0x2c8860,this['contentInitial']=_0x336ecc,this['documentVersion']=_0x4ddd09;}};const uh=/* #__PURE__ -- @preserve */
39
- gt();var dh=class extends uh{['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x32c048,_0x3c1bb5,_0x3050cf){super(),this['id']=_0x32c048,this['parent']=_0x3050cf,this['_data']=_0x3c1bb5,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']['slice']();}get['operationsIsolated'](){return this['_data']['operationsIsolated']['slice']();}};const _h=/* #__PURE__ -- @preserve */
40
- gt();var gh=class extends _h{['id']=vt();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x57dffa,_0x1839fe,_0x1a4b7d,_0x1c8e22,_0xb03c34){super(),this['_sourceCheck']=_0x1839fe,this['_documentData']=_0x57dffa,this['_aiConnector']=_0x1a4b7d,this['_reviewParams']=_0x1c8e22,this['_reviewArgs']=_0xb03c34,this['on']('change:status',(_0xab1bc2,_0x3117b2,_0x13523d)=>{'aborted'==_0x13523d&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x13523d,'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'](_0x568328=>'pending'===_0x568328['status']);}get['currentError'](){return this['_currentError'];}get['results'](){return Array['from'](this['_results']['values']());}['updateDocumentData'](_0x3244cb){this['_documentData']=_0x3244cb;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x1b3252=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x3b6449 of _0x1b3252)'unmodified'!==_0x3b6449['data']['operation']&&('error'!==_0x3b6449['data']['operation']?'review-metadata'!==_0x3b6449['event']?this['_addReviewCheckResult'](_0x3b6449['data']['dataId'],_0x3b6449['data']['textDelta']):this['callId']=_0x3b6449['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(_0x308f1f){this['_currentError']=_0x308f1f,en(_0x308f1f)?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'](_0x4c0f75,_0x3f1dff){const _0x4448b4=this['_results']['get'](_0x4c0f75);if(!_0x4448b4)return;if(0x0===_0x3f1dff['length'])return;const _0x437c85=[];_0x3f1dff['forEach']((_0x31862a,_0x52e6a9)=>{const _0x35bc72=new dh(_0x4448b4['id']+'-'+_0x52e6a9,_0x31862a,_0x4448b4);_0x35bc72['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x35bc72,'status':_0x35bc72['status']});}),_0x35bc72['on']('change:isActivated',()=>{_0x35bc72['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x35bc72}):this['fire']('reviewCheckResultDeactivated',{'change':_0x35bc72});}),this['_changes']['push'](_0x35bc72),_0x437c85['push'](_0x35bc72);}),this['fire']('reviewCheckResultReady',{'changes':_0x437c85,'result':_0x4448b4,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x4382b5){const _0x52a213=this['_changes']['find'](_0x1e6022=>_0x1e6022['id']===_0x4382b5);return!(!_0x52a213||'pending'!==_0x52a213['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x326d31=>!0x0===_0x326d31['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x3f7947=>'pending'===_0x3f7947['status']);}['getChangeById'](_0x1f83dd){return this['_changes']['find'](_0x3afc9d=>_0x3afc9d['id']===_0x1f83dd);}['markAllChangesAsAccepted'](){for(const _0x2402d2 of this['_changes'])'pending'===_0x2402d2['status']&&(_0x2402d2['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x36c7b6){const _0x13dcd0=this['_changes']['find'](_0xc5a06e=>_0xc5a06e['id']===_0x36c7b6);_0x13dcd0&&'pending'===_0x13dcd0['status']&&(_0x13dcd0['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0xc4a14d){const _0x3e3846=this['_changes']['find'](_0x431502=>_0x431502['id']===_0xc4a14d);_0x3e3846&&'pending'===_0x3e3846['status']&&(_0x3e3846['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x2c0039){const _0x1f40fb=this['_changes']['find'](_0x5d4e97=>_0x5d4e97['id']===_0x2c0039);_0x1f40fb&&'pending'===_0x1f40fb['status']&&(_0x1f40fb['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x57c668){const _0x532e0a=this['_changes']['find'](_0x23574f=>_0x23574f['id']===_0x57c668);_0x532e0a&&'outdated'===_0x532e0a['status']&&(_0x532e0a['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x5f133a){this['_changes']['filter'](_0x55c528=>_0x55c528['isActivated']&&_0x55c528['id']!==_0x5f133a)['forEach'](_0x5695fa=>{_0x5695fa['isActivated']=!0x1;});const _0x5371ee=this['_changes']['find'](_0x427b04=>_0x427b04['id']===_0x5f133a);_0x5371ee&&'pending'===_0x5371ee['status']&&(_0x5371ee['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x39609a=>_0x39609a['isActivated'])['forEach'](_0x1dbdee=>{_0x1dbdee['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x50461a){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x158b15;if(_0x50461a){const _0x532972=this['_changes']['find'](_0x2535c7=>_0x2535c7['id']===_0x50461a);if(_0x532972&&_0x532972['isRated'])return;_0x532972&&(_0x158b15=_0x532972['parent']['id'],_0x532972['isRated']=!0x0);}const _0x15fe45={'positiveCount':this['_changes']['filter'](_0xa546d=>'accepted'===_0xa546d['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x15fe45,this['callId'],_0x158b15);}['_addReviewCheckResult'](_0x5c33b5,_0x58933b){const _0x4c7388=this['_documentData']['elements']['get'](_0x5c33b5);if(!_0x4c7388)return;const _0x550e0f=_0x4c7388['getContent']();if(_0x550e0f===_0x58933b)return;const _0x2dc611=new lh({'id':_0x5c33b5,'contentInitial':_0x550e0f,'contentNew':_0x58933b,'documentVersion':_0x4c7388['documentVersion']});this['_results']['set'](_0x2dc611['id'],_0x2dc611),this['fire']('reviewCheckResultAdded',{'result':_0x2dc611,'source':this,'editor':_0x4c7388['editor']});}['_checkIfFinished'](){'finished'===this['status']&&this['_changes']['filter'](_0x2b79e4=>'pending'===_0x2b79e4['status'])['length']>0x0&&(this['status']='ready'),'ready'===this['status']&&0x0===this['_changes']['filter'](_0x543e8c=>'pending'===_0x543e8c['status'])['length']&&(this['status']='finished');}},Ah=class extends gh{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x5a5a46=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x36d7f6=0x0;_0x36d7f6<this['_reviewParams']['length'];_0x36d7f6++){if(!this['_reviewParams'][_0x36d7f6]||!this['_sourceCheck']['options'][_0x36d7f6])continue;const _0x27f6e0=this['_sourceCheck']['options'][_0x36d7f6]['data']?.['find'](_0x22866e=>_0x22866e['id']===this['_reviewParams'][_0x36d7f6]);_0x27f6e0&&_0x5a5a46['push'](_0x27f6e0['label']);}return _0x5a5a46['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x2efa7e,_0x3af891,_0x3ab096){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x3af891,_0x2efa7e,_0x3ab096);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}},Ih=class extends _0x5d28a2{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_availableReviewChecks'];['_reporter'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_initRequiredPlugins'](),this['_initAvailableReviewChecks'](),this['_initUIListeners']();}async['_initAvailableReviewChecks'](){this['_availableReviewChecks']=await this['_getReviewChecks'](),this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}['_initUIListeners'](){this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_availableReviewChecks']&&this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',(_0x2e38fd,_0x1c762)=>this['runCheck'](_0x1c762)),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{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 _0x30799b=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x30799b['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x30799b['map'](_0x2e32c4=>_0x2e32c4['id']),this['_aiSource']);const _0x11781c=this['_currentReviewCheckRun'];_0x11781c['markAllChangesAsAccepted'](),_0x11781c['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x1aa0dd,_0x282ac6)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x282ac6['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x282ac6['id']],this['_aiSource']),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x282ac6['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x282ac6['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x1fe26d,_0x2994c6)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x2994c6['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x2994c6['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x2994c6['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x2994c6['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',(_0x88bb96,_0x3888ab)=>{this['_onActivateChange'](_0x3888ab);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x4a1030,_0x3a92d5)=>{this['_onDeactivateChange'](_0x3a92d5);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x3412d0,_0x549158)=>{this['_onChangeMarkerClicked'](_0x3412d0,_0x549158);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x1bf4d2,_0x2d7394)=>{this['_onChangeMarkerHovered'](_0x1bf4d2,_0x2d7394);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x3c5a91,_0x77f5af)=>{this['_onChangeMarkerRemoved'](_0x3c5a91,_0x77f5af);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x1bedb8,_0x3c7daf)=>{this['_onChangeMarkerRestored'](_0x1bedb8,_0x3c7daf);});}async['runCheck'](_0x47f4d6){if(!this['_availableReviewChecks'])return;const _0x2d47b1=this['_availableReviewChecks']['find'](_0x478101=>_0x478101['id']===_0x47f4d6['id']);if(_0x2d47b1){this['_onReviewCheckRun'](_0x47f4d6),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x47f4d6,_0x2d47b1),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x2a9b62,_0x180413)=>{switch(_0x180413['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x180413);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 ht('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new ht('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'!==_0x180413['status']&&'error-chunk'!==_0x180413['status']&&'error-general'!==_0x180413['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x5be8d9,_0x199fe6)=>{if(!this['_currentReviewCheckRun'])throw new ht('ai-review-mode-no-current-check-run',this);const _0x214410=this['_diffContent'](_0x199fe6['editor'],_0x199fe6['result']['contentInitial'],_0x199fe6['result']['contentNew']);_0x199fe6['source']['addResultChanges'](_0x199fe6['result']['id'],_0x214410);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x1e4680,_0x4d89fd)=>{for(const _0x353d25 of _0x4d89fd['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x353d25);this['_markChangePositionInEditorContent'](_0x4d89fd['changes'],_0x4d89fd['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x35285c,_0x1e7427)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x1e7427['change']['id'],_0x1e7427['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x1ba4e0,_0x5879f0)=>{this['_onReviewCheckResultActivated'](_0x5879f0);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x421e92){if(en(_0x421e92))return;_0x421e92 instanceof ht?this['_logError'](_0x421e92):this['_logError'](new ht('ai-review-mode-check-run-failed',this,void 0x0,_0x421e92));}}else this['_logError'](new ht('ai-review-mode-source-check-not-found',this,{'checkId':_0x47f4d6['id']}));}['abort'](){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}['getAvailableChecks'](){return(this['_availableReviewChecks']??[])['slice']();}['getCurrentCheckRun'](){return this['_currentReviewCheckRun'];}['_createReviewCheckRun'](_0x27e362,_0x414587){return new Ah(this['_aiReviewCoreEditing']['getDocumentData'](),_0x414587,this['_aiConnector'],_0x27e362['params'],_0x27e362['args']);}['_onChangeMarkerRemoved'](_0x3ee497,_0x13af3c){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x13af3c['changeId']);}['_onChangeMarkerRestored'](_0x121e01,_0x25dea3){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x25dea3['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_reporter']=this['context']['plugins']['get'](nn)['createReporter']('aireview');}['_onReviewRunLeave'](_0x353c06=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x353c06&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x3f6f5a of this['_aiReviewCoreEditing']['getEditors']())_0x3f6f5a['editing']['view']['change'](_0x2b2d80=>{for(const _0x59ef33 of _0x3f6f5a['editing']['view']['document']['getRoots']())_0x2b2d80['removeClass']('ck-ai_review-diff',_0x59ef33),_0x2b2d80['removeClass']('ck-ai_review-highlights',_0x59ef33),_0x2b2d80['removeClass']('ck-ai-translate-mode-content',_0x59ef33);});}['_logError'](_0x2f57a5){this['_reporter']['logError'](_0x2f57a5),'ai-review-mode-models-unable-to-retrieve'===function(_0x975421){return _0x975421 instanceof sn?_0x975421['code']:_0x975421 instanceof Error?_0x975421['message']['match'](/^\S+/)?.[0x0]:void 0x0;}(_0x2f57a5)?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']();}['_scrollToChange'](_0x7548eb){if('content'===this['_changeActivationSource']){const _0x556fcd=this['_aiReviewCoreUi']['getChangeElement'](_0x7548eb);_0x556fcd&&St(_0x556fcd['closest']('.ck-ai_review__check-run-result')||_0x556fcd);}else{if('panel'===this['_changeActivationSource']){const _0x1e671b=this['_getChangeContentElement'](_0x7548eb);if(!_0x1e671b)return;Rt({'target':_0x1e671b,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}},ph=class extends gh{['_prompt'];['_model'];constructor(_0x3283e1,_0x17f70d,_0x3e4d1a,_0x55d455,_0x1fdb4f){super(_0x3e4d1a,_0x55d455,_0x1fdb4f),this['_prompt']=_0x3283e1,this['_model']=_0x17f70d;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x1e7046,_0x4897aa,_0x33422e){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x4897aa,_0x1e7046,_0x33422e);}},mh=class{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x159226){this['id']=_0x159226['id'],this['commandId']=_0x159226['commandId'],this['title']=_0x159226['title'],this['description']=_0x159226['description'],this['isParameterized']=_0x159226['isParameterized'],this['useArgs']=_0x159226['useArgs'],this['options']=_0x159226['options'],this['args']=_0x159226['args'];}},Eh=class extends mh{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x4d8194,_0x316b1b,_0x19726c){super(_0x4d8194),this['prompt']=_0x4d8194['prompt'],this['model']=_0x4d8194['model'],this['model']?this['_defaultModel']=_0x316b1b['find'](_0x2bcaba=>_0x2bcaba['id']===this['model'])||null:this['_defaultModel']=_0x19726c;}get['defaultModel'](){return this['_defaultModel'];}},Th=class extends ph{get['subTitle'](){return'';}set['prompt'](_0x9c1a13){this['_prompt']=_0x9c1a13;}set['model'](_0x54bbb7){this['_model']=_0x54bbb7;}},wh=class extends _0x5d28a2{static get['requires'](){return[ls,nn];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_cache'];['_reporter'];['init'](){this['_reporter']=this['context']['plugins']['get'](nn)['createReporter']('aireview');}['getChecksList'](){return this['_cache']||(this['_cache']=this['_loadChecksList']()),this['_cache'];}};const Ch=[{'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'}]}]}],fh=/* #__PURE__ -- @preserve */
41
- gt();var bh=class extends fh{['_checks']=[];['setupChecks'](_0x5267b6){this['_checks']=_0x5267b6['map'](_0x37cbe2=>new mh(_0x37cbe2));}get['checks'](){return this['_checks']['slice']();}['getCheckById'](_0x5edaac){return this['checks']['find'](_0x4a7849=>_0x4a7849['id']===_0x5edaac);}['removeCheckById'](_0x147701){this['_checks']=this['_checks']['filter'](_0xfe5a1=>_0xfe5a1['id']!==_0x147701);}},Sh=class extends mh{['_models']=[];['_defaultModel']=null;constructor(_0x509c23,_0x2c9a2a,_0x4396c7){super(_0x509c23),this['_models']=_0x2c9a2a,this['_defaultModel']=_0x4396c7;}get['models'](){return this['_models']['slice']();}get['defaultModel'](){return this['_defaultModel'];}},Rh=class extends bh{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x52f83b,_0x1226ee,_0xb73c6e){super(),this['_allModels']=_0x52f83b,this['_recommendedModels']=_0x1226ee,this['_defaultModel']=_0xb73c6e;}get['allModels'](){return this['_allModels']['slice']();}['setupChecks'](_0x3624a7){this['_checks']=_0x3624a7['map'](_0x442e6b=>!0x0===_0x442e6b['isExtra']?new Eh(_0x442e6b,this['_allModels'],this['_defaultModel']):'custom'===_0x442e6b['id']?new Sh(_0x442e6b,this['_recommendedModels'],this['_defaultModel']):new mh(_0x442e6b));}},Oh=class extends wh{static get['pluginName'](){return'AIReviewModeCheckRegistry';}['_modelsLoadError']=null;constructor(_0x5233b0){super(_0x5233b0),this['context']['config']['define']('ai.review.extraCommands',[]);}get['modelsLoadError'](){return this['_modelsLoadError'];}['getExtraChecks'](){return this['context']['config']['get']('ai.review.extraCommands')['map'](_0xd3bb44=>({'id':_0xd3bb44['id'],'commandId':_0xd3bb44['id'],'title':_0xd3bb44['label'],'description':_0xd3bb44['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0xd3bb44['prompt'],'model':_0xd3bb44['model']}));}async['_loadChecksList'](){const _0x48a15c=[...Ch,...this['getExtraChecks']()]['map'](_0x27262b=>_0x27262b['isExtra']?_0x27262b:this['_translateReviewCheck'](_0x27262b)),_0x5c95b2=await this['_getModels'](),_0x1d8531=new Rh(_0x5c95b2['all'],_0x5c95b2['recommended'],_0x5c95b2['default']);return _0x1d8531['setupChecks'](_0x48a15c),_0x1d8531;}async['_getModels'](){const _0x2efbe0=this['context']['plugins']['get']('AIConnector');try{const _0x31f6ea=new Qs({'connector':_0x2efbe0,'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']}),_0x3fe80a={'all':await _0x31f6ea['getAll'](),'recommended':await _0x31f6ea['getAvailableModels'](),'default':await _0x31f6ea['getDefault']()};return this['_modelsLoadError']=null,_0x3fe80a;}catch(_0x9a1241){return this['_modelsLoadError']=new ht('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x9a1241),this['_reporter']['logError'](this['_modelsLoadError'],{'context':{'operation':'load-review-models'}}),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x3f0d3d){const _0x5e663f='AI_REVIEW_CHECK_'+_0x3f0d3d['commandId']['toUpperCase']()['replaceAll']('-','_'),_0x51cdbb={..._0x3f0d3d,'title':this['_translate'](_0x5e663f+'_TITLE',_0x3f0d3d['title']),'description':this['_translate'](_0x5e663f+'_DESCRIPTION',_0x3f0d3d['description'])};return _0x3f0d3d['options']&&(_0x51cdbb['options']=_0x3f0d3d['options']['map'](_0x2e4e8c=>({..._0x2e4e8c,'label':this['_translate'](_0x5e663f+'_OPTIONS_LABEL',_0x2e4e8c['label']||''),'data':_0x2e4e8c['data']?_0x2e4e8c['data']['map'](_0x35033c=>({..._0x35033c,'label':this['_translate'](_0x5e663f+'_OPTIONS_DATA_'+_0x35033c['id']['toUpperCase'](),_0x35033c['label'])})):void 0x0}))),_0x51cdbb;}['_translate'](_0x3364da,_0x9d1871){const _0x3f056c=us(this['context']['locale'],_0x3364da);return _0x3f056c===_0x3364da?_0x9d1871:_0x3f056c;}},vh=class extends Ih{static get['pluginName'](){return'AIReviewModeController';}static get['requires'](){return[nn,Oh];}get['_aiSource'](){return'review';}['_isDiffOn']=!0x1;['_usesAvailableCommandsConfig'];constructor(_0xb2d5a1){super(_0xb2d5a1),this['_usesAvailableCommandsConfig']=Boolean(this['context']['config']['get']('ai.review.availableCommands')),this['context']['config']['define']('ai.review.availableCommands',Ch['map'](_0x989fb1=>_0x989fb1['id']));}['init'](){super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x94bdde,_0xee7034)=>{this['_isDiffOn']=_0xee7034['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x55f8ab,_0x400373){if(_0x55f8ab['isCustom'])return new ph(_0x55f8ab['args']['prompt'],_0x55f8ab['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x400373,this['_aiConnector']);if(_0x400373['isExtra']){const _0x426e71=_0x400373;return new Th(_0x55f8ab['args']?.['prompt']??_0x426e71['prompt'],_0x55f8ab['args']?.['model']??_0x426e71['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x400373,this['_aiConnector']);}return new Ah(this['_aiReviewCoreEditing']['getDocumentData'](),_0x400373,this['_aiConnector'],_0x55f8ab['params'],_0x55f8ab['args']);}['_onReviewCheckResultActivated'](_0x375713){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x375713['change']['id']),this['_scrollToChange'](_0x375713['change']['id']);const _0x221dcf=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x375713['change']['id']);if(!_0x221dcf)return;const _0xed82a8=this['_aiReviewCoreEditing']['getEditorForChange'](_0x375713['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x375713['change'],()=>_0x221dcf['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0xed82a8,_0x221dcf['modelRange']['root']['rootName']),_0xed82a8?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x375713['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x500030){this['_currentReviewCheckRun']&&'click'===_0x500030['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x500030['id']));}['_onDeactivateChange'](_0x534837){this['_currentReviewCheckRun']&&'balloon'===_0x534837['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x4e383c,_0x5d24e5){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5d24e5['changeId']);const _0x3d39fc=this['_currentReviewCheckRun']['getChangeById'](_0x5d24e5['changeId']);if(!_0x3d39fc)return;const _0x4d14d0=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x5d24e5['changeId']),_0x1c258b=this['_aiReviewCoreEditing']['getEditorForChange'](_0x5d24e5['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x3d39fc,_0x5d24e5['markerElement'],_0x5d24e5['domEvent'],'click',this['_getBalloonDomRoot'](_0x1c258b,_0x4d14d0?.['modelRange']['root']['rootName']),_0x1c258b?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x51ca8b,_0x1d57c4){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x4b23e7=this['_currentReviewCheckRun']['getChangeById'](_0x1d57c4['changeId']);if(!_0x4b23e7)return;const _0x375f27=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1d57c4['changeId']),_0x30962c=this['_aiReviewCoreEditing']['getEditorForChange'](_0x1d57c4['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x4b23e7,_0x1d57c4['markerElement'],_0x1d57c4['domEvent'],'hover',this['_getBalloonDomRoot'](_0x30962c,_0x375f27?.['modelRange']['root']['rootName']),_0x30962c?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']());}['_getChangeContentElement'](_0x19c0fb){const _0x52cd6d=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x19c0fb);return _0x52cd6d?_0x52cd6d['getElement']():null;}['_markChangePositionInEditorContent'](_0x3263fb,_0x21aae1){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x3263fb,_0x21aae1);}['_diffContent'](_0x293dd1,_0x37ccc6,_0x4bcc4f){return this['_aiReviewCoreEditing']['diffContent'](_0x293dd1,_0x37ccc6,_0x4bcc4f,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x29b1c3){_0x29b1c3?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0x47bbd2 of this['_aiReviewCoreEditing']['getEditors']())_0x47bbd2['editing']['view']['change'](_0x184091=>{for(const _0x2a7083 of _0x47bbd2['editing']['view']['document']['getRoots']()){for(const _0x4c9e32 of _0x2a7083['getClassNames']())_0x4c9e32['startsWith']('ck-ai_review-')&&_0x184091['removeClass'](_0x4c9e32,_0x2a7083);_0x184091['addClass'](_0x29b1c3?'ck-ai_review-diff':'ck-ai_review-highlights',_0x2a7083);}});}['_getBalloonDomRoot'](_0x4908cb,_0x14a3c8){const _0x17cbf8=_0x4908cb['editing']['view'];if(_0x14a3c8){const _0x106d46=_0x17cbf8['getDomRoot'](_0x14a3c8);if(_0x106d46)return _0x106d46;}return _0x17cbf8['getDomRoot']()??void 0x0;}async['_getReviewChecks'](){const _0x47cca5=this['context']['plugins']['get']('AIReviewModeCheckRegistry'),_0x32f76c=await _0x47cca5['getChecksList']();_0x47cca5['modelsLoadError']&&this['_logError'](_0x47cca5['modelsLoadError']);let _0x1edefe=_0x32f76c['checks'];const _0x5ebbd2=this['context']['config']['get']('ai.review.availableCommands');return this['_logWarningForNonExistentChecks'](_0x5ebbd2,_0x1edefe),this['_usesAvailableCommandsConfig']&&(_0x1edefe=_0x5ebbd2['map'](_0x24c2b6=>_0x1edefe['find'](_0x1f413a=>_0x1f413a['id']===_0x24c2b6))['filter'](_0x1e482a=>!!_0x1e482a)),this['_filterChecksWithMissingModel'](_0x1edefe);}['_logWarningForNonExistentChecks'](_0x2ee312,_0x21464d){const _0x4b0b51=_0x2ee312['filter'](_0x1bd141=>!_0x21464d['some'](_0xd5ad2b=>_0xd5ad2b['id']===_0x1bd141));_0x4b0b51['length']&&this['_reporter']['logError'](new sn({'code':'ai-review-mode-non-existent-commands-used','severity':'warning','context':{'commandIds':_0x4b0b51['join'](',\x20')}}));}['_filterChecksWithMissingModel'](_0x17dc24){const _0x2947ef=[];return _0x17dc24['forEach'](_0x5cc023=>{(_0x5cc023 instanceof Eh&&!_0x5cc023['defaultModel']||_0x5cc023 instanceof Sh&&!_0x5cc023['models']['length'])&&_0x2947ef['push'](_0x5cc023['id']);}),_0x2947ef['length']&&_0x2947ef['forEach'](_0x6447d2=>{_0x17dc24=_0x17dc24['filter'](_0x1f3c2c=>_0x1f3c2c['id']!==_0x6447d2),this['_reporter']['logError'](new sn({'code':'ai-review-mode-command-unavailable-due-to-missing-model','context':{'commandId':_0x6447d2}}));}),_0x17dc24;}};function kh(_0x4d11b5,_0x43c4de,_0x1fff12,_0x5606f9){return _0x4d11b5 instanceof ht?_0x4d11b5:new ht(_0x43c4de,_0x1fff12,_0x5606f9,_0x4d11b5);}var Nh=class extends Js{['_affectedBlocks']=[];get['affectedBlocks'](){return this['_affectedBlocks']['slice']();}set['affectedBlocks'](_0x3566da){this['_affectedBlocks']=_0x3566da;}},yh=class extends _0x5d28a2{static get['pluginName'](){return'AIReviewGateway';}static get['requires'](){return[hh,Oh,ls,Is,js];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['getAllCommands'](){return(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['map'](_0x181294=>{const _0x2d3280={'id':_0x181294['id'],'title':_0x181294['title'],'description':_0x181294['description']};return'custom'!==_0x181294['id']&&_0x181294['options']?.['length']&&(_0x2d3280['parameters']=_0x181294['options'][0x0]['data']['map'](_0x1d5081=>({..._0x1d5081}))),_0x2d3280;});}async['getAvailableModels'](){return this['context']['plugins']['get']('AIGateway')['getAvailableModels']();}async['runReview'](_0x3b3234,_0x2e558d){return await this['_runReviewCheck'](_0x3b3234,()=>this['_createReviewCheckRun'](_0x3b3234,_0x2e558d?.['parameterId']),_0x2e558d?.['signal']);}async['runCustomReview'](_0x3e1186,_0x15cc66){return await this['_runReviewCheck']('custom',()=>this['_createCustomReviewCheckRun']('custom',_0x3e1186,_0x15cc66?.['model']),_0x15cc66?.['signal']);}['applyReview'](_0x4a7da2,_0x3408a0){this['context']['plugins']['get']('AIGateway')['apply'](_0x4a7da2,{'applyMethod':_0x3408a0,'aiSource':'review'});}async['_runReviewCheck'](_0xed9578,_0xf44d75,_0x83de60){const _0x3efcf7=_s(this['context']),_0x1a2d18=new Nh({'editor':_0x3efcf7,'rootName':_0x3efcf7['model']['document']['getRootNames']()[0x0],'channelId':this['context']['config']['get']('collaboration.channelId'),'sessionId':_0x3efcf7['plugins']['get']('AIEditing')['getSessionId'](_0x3efcf7)});let _0x4a3f69,_0xc22442;if(_0x83de60){if(_0x83de60['aborted'])return _0x1a2d18['abort'](),_0x1a2d18;const _0x313bdd=()=>{_0x1a2d18['error']||(_0x1a2d18['abort'](),_0x4a3f69&&_0x4a3f69['abort']());};_0x83de60['addEventListener']('abort',_0x313bdd),_0xc22442=()=>_0x83de60['removeEventListener']('abort',_0x313bdd);}try{_0x4a3f69=await _0xf44d75(),_0x1a2d18['contentRawOld']=_0x4a3f69['documentData']['content'],_0x1a2d18['documentVersion']=Array['from'](_0x4a3f69['documentData']['elements'])['find'](([,_0x139d62])=>_0x139d62['rootName']===_0x1a2d18['rootName'])?.[0x1]['documentVersion']??0x1,_0x4a3f69['on']('reviewCheckRunUpdated',(_0x310b8d,_0x4e6f49)=>{'aborted'===_0x4e6f49['status']?_0x1a2d18['abort']():'error-general'!==_0x4e6f49['status']&&'error-chunk'!==_0x4e6f49['status']||(_0x1a2d18['error']=kh(_0x4e6f49['error'],'ai-reviewgateway-review-command-run-failed',this,{'checkId':_0xed9578}));}),'aborted'!==_0x1a2d18['status']&&await _0x4a3f69['start']();}catch(_0xd81c74){_0x1a2d18['error']=kh(_0xd81c74,'ai-reviewgateway-review-command-run-failed',this,{'checkId':_0xed9578});}finally{_0xc22442&&_0xc22442();}if(!_0x4a3f69||'aborted'===_0x1a2d18['status']||'error'===_0x1a2d18['status'])return _0x1a2d18;_0x1a2d18['affectedBlocks']=_0x4a3f69['results']['map'](_0x5b14e4=>({'id':_0x5b14e4['id'],'content':_0x5b14e4['contentNew']}));try{_0x1a2d18['contentRawNew']=ms(this['context']['plugins']['get']('AIGateway')['mergeChangesIntoContent'](_0x1a2d18['affectedBlocks'],_0x1a2d18['contentRawOld'],_0x1a2d18['editor']));}catch(_0x3330bb){_0x1a2d18['error']=kh(_0x3330bb,'ai-reviewgateway-review-command-run-failed',this,{'checkId':_0xed9578});}return _0x1a2d18;}async['_createReviewCheckRun'](_0x4993f3,_0x26fcf4){const _0x200b04=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x4c2648=>_0x4c2648['id']===_0x4993f3);if(!_0x200b04)throw new ht('ai-reviewgateway-unknown-command',this,{'checkId':_0x4993f3});if(_0x200b04 instanceof Sh)throw new ht('ai-reviewgateway-not-a-system-command',this,{'checkId':_0x4993f3});const _0x422da8=this['context']['plugins']['get']('AIReviewCoreEditing')['getDocumentData'](),_0x450aa6=this['context']['plugins']['get']('AIConnector');if(_0x200b04 instanceof Eh){if(!_0x200b04['defaultModel']?.['id'])throw new ht('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x4993f3});return new Th(_0x200b04['prompt'],_0x200b04['defaultModel']['id'],_0x422da8,_0x200b04,_0x450aa6);}return new Ah(_0x422da8,_0x200b04,_0x450aa6,_0x26fcf4?[_0x26fcf4]:void 0x0);}async['_createCustomReviewCheckRun'](_0x46a725,_0x5eb82b,_0x399d42){const _0x30c7af=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x5271eb=>_0x5271eb['id']===_0x46a725);if(!_0x30c7af)throw new ht('ai-reviewgateway-unknown-command',this,{'checkId':_0x46a725});if(!(_0x30c7af instanceof Sh))throw new ht('ai-reviewgateway-not-a-custom-command',this,{'checkId':_0x46a725});const _0x4f6a8e=_0x399d42??_0x30c7af['defaultModel']?.['id'];if(!_0x5eb82b)throw new ht('ai-reviewgateway-missing-custom-command-prompt',this,{'checkId':_0x46a725});if(!_0x4f6a8e)throw new ht('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x46a725});return new ph(_0x5eb82b,_0x4f6a8e,this['context']['plugins']['get']('AIReviewCoreEditing')['getDocumentData'](),_0x30c7af,this['context']['plugins']['get']('AIConnector'));}},xh=class extends _0x5d28a2{static get['requires'](){return[vh,nh,hh,yh];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['startReview'](_0x383f40,_0x209e47){if(this['assertStartReviewPreconditions'](_0x383f40)instanceof Sh)throw new ht('ai-reviewmode-not-a-system-command',this,{'commandId':_0x383f40});ka(this['context'],'reviewMode'),await this['context']['plugins']['get']('AIReviewModeController')['runCheck']({'id':_0x383f40,'params':_0x209e47?.['parameterId']?[_0x209e47['parameterId']]:void 0x0});}async['startCustomReview'](_0x11638d,_0x4aac04){if(!_0x11638d)throw new ht('ai-reviewmode-missing-custom-command-prompt',this);const _0xd59e1c=Ch['find'](_0x588d2d=>'custom'===_0x588d2d['commandId'])['id'],_0x2dcb46=this['assertStartReviewPreconditions'](_0xd59e1c),_0x599362=_0x4aac04?.['model']??_0x2dcb46['defaultModel']?.['id'];if(!_0x599362)throw new ht('ai-reviewmode-missing-custom-command-model',this);ka(this['context'],'reviewMode'),await this['context']['plugins']['get']('AIReviewModeController')['runCheck']({'id':_0xd59e1c,'isCustom':!0x0,'args':{'prompt':_0x11638d,'model':_0x599362}});}['getAvailableCommands'](){return this['context']['plugins']['get']('AIReviewModeController')['getAvailableChecks']()['map'](_0x2420fa=>{const _0x182f71={'id':_0x2420fa['id'],'title':_0x2420fa['title'],'description':_0x2420fa['description']};return'custom'!==_0x2420fa['id']&&_0x2420fa['options']?.['length']&&(_0x182f71['parameters']=_0x2420fa['options'][0x0]['data']['map'](_0x13cb24=>({..._0x13cb24}))),_0x182f71;});}['assertStartReviewPreconditions'](_0x6b7fb7){const _0x33d922=this['context']['plugins']['get']('AIReviewModeController');if(_0x33d922['getCurrentCheckRun']())throw new ht('ai-reviewmode-review-already-running',this);const _0x47234b=_0x33d922['getAvailableChecks']()['find'](_0x3f9396=>_0x3f9396['id']===_0x6b7fb7);if(!_0x47234b)throw new ht('ai-reviewmode-unknown-command',this,{'commandId':_0x6b7fb7});return _0x47234b;}},Lh=class extends Ah{['_title'];constructor(_0x2f0021,_0x304076,_0x586929,_0x2d8d7d,_0x197983,_0x1966bf){super(_0x2f0021,_0x304076,_0x586929,_0x197983,_0x1966bf),this['_title']=_0x2d8d7d;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}},Dh=class extends mh{get['apiId'](){return'translate';}},Ph=class extends bh{['setupChecks'](_0x26ced7){this['_checks']=_0x26ced7['map'](_0x10d833=>new Dh(_0x10d833));}};const Hh=[{'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 Mh=class extends wh{static get['pluginName'](){return'AITranslateCheckRegistry';}constructor(_0x3dc08c){super(_0x3dc08c),this['context']['config']['define']('ai.translate.languages',Hh);}async['_loadChecksList'](){const _0x279318=[],_0x1d6209=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x10fa48 of _0x1d6209)_0x279318['push']({'title':_0x10fa48['label'],'id':_0x10fa48['id'],'commandId':_0x10fa48['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x10fa48['id']}});const _0x3f3560=new Ph();return _0x3f3560['setupChecks'](this['_translateChecks'](_0x279318)),_0x3f3560;}['_translateChecks'](_0x13b9c4){const _0x1d5bbb=this['context']['locale'];return _0x13b9c4['map'](_0x41bf1a=>{const _0x2389d8='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x41bf1a['title']['toUpperCase']()['replaceAll']('-','_'),_0x44aa20=us(_0x1d5bbb,_0x2389d8);return{..._0x41bf1a,'title':_0x44aa20===_0x2389d8?_0x41bf1a['title']:_0x44aa20};});}},Vh=class extends Ih{static get['pluginName'](){return'AITranslateController';}static get['requires'](){return[nn,Mh];}get['_aiSource'](){return'translate';}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x1a5e63,_0x56efe5){return new Lh(this['_aiReviewCoreEditing']['getDocumentData'](),_0x56efe5,this['_aiConnector'],us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x1a5e63['params'],_0x1a5e63['args']);}['_onReviewCheckResultActivated'](_0xb031cb){this['_aiReviewCoreUi']['setActiveStateInResults'](_0xb031cb['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0xb031cb['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x441aa6){this['_currentReviewCheckRun']&&('hover'===_0x441aa6['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x441aa6['id'])),'click'===_0x441aa6['uiInteraction']&&this['_scrollToChange'](_0x441aa6['id']));}['_onDeactivateChange'](_0x33f0ee){this['_currentReviewCheckRun']&&'panel'===_0x33f0ee['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x34fae7,_0x543ea3){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x543ea3['changeId']),this['_scrollToChange'](_0x543ea3['changeId']));}['_onChangeMarkerHovered'](_0x5aee21,_0x176b46){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x176b46['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x176b46['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x411e48){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x411e48);}['_markChangePositionInEditorContent'](_0x183c65,_0x78832a){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x183c65,_0x78832a);}['_diffContent'](_0x1d9d09,_0xc6572b,_0x3492db){return this['_aiReviewCoreEditing']['diffContent'](_0x1d9d09,_0xc6572b,_0x3492db,!0x0);}['_onReviewCheckRun'](){for(const _0x4d0af2 of this['_aiReviewCoreEditing']['getEditors']())_0x4d0af2['editing']['view']['change'](_0x5bef56=>{for(const _0x20c9d3 of _0x4d0af2['editing']['view']['document']['getRoots']())_0x5bef56['addClass']('ck-ai-translate-mode-content',_0x20c9d3);});}async['_getReviewChecks'](){return(await this['context']['plugins']['get']('AITranslateCheckRegistry')['getChecksList']())['checks'];}},Uh=class extends Qa{constructor(_0x4c159e,_0x2b563e){super(_0x4c159e,_0x2b563e),this['on']('set:isLoading',(_0x314fc1,_0x147422,_0x2b5fcf)=>{_0x2b5fcf&&(this['headerTitle']=us(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x4ad601,_0x252585,_0x20c3ba)=>{_0x20c3ba&&(this['headerTitle']=us(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x2be11e=super['_createAcceptAllButtonView']();return _0x2be11e['set']('label',us(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x2be11e;}['_createExitReviewButtonView'](){const _0x4db9f4=super['_createExitReviewButtonView']();return _0x4db9f4['set']('label',us(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x4db9f4;}},Bh=class extends sh{['_setupTemplate'](){const _0x475618=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x475618['if']('isVisible','ck-hidden',_0x823372=>!_0x823372)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':us(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':us(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x475618['if']('isVisible','ck-hidden',_0x1f1611=>!_0x1f1611)]},'children':this['_checkViews']}]});}},Gh=class extends Wa{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x11e66c=this['context']['plugins']['get']('AITabs'),_0x5f570c=this['context']['locale'],_0x153bbb=new Ho(_0x5f570c,{'label':us(_0x5f570c,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x4dd947,'class':'ck-ai-header_review-translate','showResizeButton':_0x11e66c['showResizeButton']});_0x153bbb['delegate']('resizeTabs')['to'](_0x11e66c),_0x153bbb['bind']('isMaximized')['to'](_0x11e66c['view'],'isMaximized',_0x128453=>_0x128453);const _0x26813e=new $a(_0x5f570c,{'header':_0x153bbb,'list':new Bh(_0x5f570c),'results':new Uh(_0x5f570c,{'generalErrorText':us(_0x5f570c,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new Xa(_0x5f570c,{'headerText':us(_0x5f570c,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':us(_0x5f570c,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':us(_0x5f570c,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x26813e['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x26813e;}['registerTab'](){const _0x11818b=this['context']['plugins']['get']('AITabs');_0x11818b['view']['on']('activateTab',(_0x47f214,{newTab:_0x253fe1,oldTab:_0x375373})=>{'translate'===_0x253fe1?this['fire']('getReviewCheckList'):'translate'===_0x375373&&this['fire']('leaveReview');}),_0x11818b['view']['addTab']({'id':'translate','buttonLabel':us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x4dd947,'order':0x0,'content':this['_mainView']});}},Fh=class extends Js{['_affectedBlocks']=[];get['affectedBlocks'](){return this['_affectedBlocks'];}set['affectedBlocks'](_0x3e62e2){this['_affectedBlocks']=_0x3e62e2;}},Kh=class extends _0x5d28a2{static get['pluginName'](){return'AITranslateGateway';}static get['requires'](){return[hh,ls,Is,js];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['runTranslate'](_0x1310fb,_0x29f7a2){return await this['_runTranslateCheck'](_0x1310fb,()=>this['_createTranslateCheckRun'](_0x1310fb),_0x29f7a2?.['signal']);}['applyTranslate'](_0xca5703,_0x54fa40){this['context']['plugins']['get']('AIGateway')['apply'](_0xca5703,_0x54fa40);}async['_runTranslateCheck'](_0x2128d3,_0x375c1f,_0x49150a){const _0x42b1a9=_s(this['context']),_0x3a344e=new Fh({'editor':_0x42b1a9,'rootName':_0x42b1a9['model']['document']['getRootNames']()[0x0],'channelId':this['context']['config']['get']('collaboration.channelId'),'sessionId':_0x42b1a9['plugins']['get']('AIEditing')['getSessionId'](_0x42b1a9)});let _0x4c20bf,_0x2e7d63;if(_0x49150a){if(_0x49150a['aborted'])return _0x3a344e['abort'](),_0x3a344e;const _0x42d155=()=>{_0x3a344e['error']||(_0x3a344e['abort'](),_0x4c20bf&&_0x4c20bf['abort']());};_0x49150a['addEventListener']('abort',_0x42d155),_0x2e7d63=()=>_0x49150a['removeEventListener']('abort',_0x42d155);}try{_0x4c20bf=await _0x375c1f(),_0x3a344e['contentRawOld']=_0x4c20bf['documentData']['content'],_0x3a344e['documentVersion']=Array['from'](_0x4c20bf['documentData']['elements'])['find'](([,_0x5cd460])=>_0x5cd460['rootName']===_0x3a344e['rootName'])?.[0x1]['documentVersion']??0x1,_0x4c20bf['on']('reviewCheckRunUpdated',(_0x18d9b8,_0x14cded)=>{'aborted'===_0x14cded['status']?_0x3a344e['abort']():'error-general'!==_0x14cded['status']&&'error-chunk'!==_0x14cded['status']||(_0x3a344e['error']=kh(_0x14cded['error'],'ai-translategateway-translation-run-failed',this,{'language':_0x2128d3}));}),'aborted'!==_0x3a344e['status']&&await _0x4c20bf['start']();}catch(_0x498e0d){_0x3a344e['error']=kh(_0x498e0d,'ai-translategateway-translation-run-failed',this,{'language':_0x2128d3});}finally{_0x2e7d63&&_0x2e7d63();}if(!_0x4c20bf||'aborted'===_0x3a344e['status']||'error'===_0x3a344e['status'])return _0x3a344e;_0x3a344e['affectedBlocks']=_0x4c20bf['results']['map'](_0x57e64e=>({'id':_0x57e64e['id'],'content':_0x57e64e['contentNew']}));try{_0x3a344e['contentRawNew']=ms(this['context']['plugins']['get']('AIGateway')['mergeChangesIntoContent'](_0x3a344e['affectedBlocks'],_0x3a344e['contentRawOld'],_0x3a344e['editor']));}catch(_0x166493){_0x3a344e['error']=kh(_0x166493,'ai-translategateway-translation-run-failed',this,{'language':_0x2128d3});}return _0x3a344e;}async['_createTranslateCheckRun'](_0x2e67aa){const _0x507fd7=this['context']['plugins']['get']('AIReviewCoreEditing')['getDocumentData'](),_0x4e4656=this['context']['plugins']['get']('AIConnector');return new Lh(_0x507fd7,new Dh({'id':_0x2e67aa,'commandId':_0x2e67aa,'title':_0x2e67aa,'description':'','isParameterized':!0x1}),_0x4e4656,us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),void 0x0,{'language':_0x2e67aa});}},Wh=class extends _0x5d28a2{static get['requires'](){return[Vh,Gh,hh,Kh];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['startTranslate'](_0x54f0cc){const _0x1b4ecf=this['assertStartTranslatePreconditions'](_0x54f0cc);ka(this['context'],'translate'),await this['context']['plugins']['get']('AITranslateController')['runCheck']({'id':_0x1b4ecf['id'],'args':_0x1b4ecf['useArgs']?_0x1b4ecf['args']:void 0x0});}['getAvailableLanguages'](){return this['context']['plugins']['get']('AITranslateController')['getAvailableChecks']()['map'](_0x8ff4c0=>({'id':_0x8ff4c0['id'],'label':_0x8ff4c0['title']}));}['assertStartTranslatePreconditions'](_0x4e4ad7){const _0x145b47=this['context']['plugins']['get']('AITranslateController');if(_0x145b47['getCurrentCheckRun']())throw new ht('ai-translate-translation-already-running',this);const _0x252ce0=_0x145b47['getAvailableChecks']()['find'](_0x594c77=>_0x594c77['id']===_0x4e4ad7);if(!_0x252ce0)throw new ht('ai-translate-unknown-language',this,{'languageId':_0x4e4ad7});return _0x252ce0;}};export{Ua as AIActions,vi as AIAdapter,Ji as AIAssistant,Xi as AIAssistantUI,la as AIBalloon,ta as AIChat,kn as AIChatController,Hr as AIChatFeedCustomElementView,Zo as AIChatHistory,Jo as AIChatHistoryController,qo as AIChatHistoryUI,fn as AIChatInteraction,na as AIChatShortcuts,Bo as AIChatUI,ls as AIConnector,sn as AICoreError,tn as AIDocumentProcessingGateway,Zs as AIDocumentProcessingRunResult,Is as AIEditing,Aa as AIEditorIntegration,rn as AIErrorReporter,nn as AIErrorSink,js as AIGateway,An as AIInteraction,Ba as AIQuickActions,Oa as AIQuickActionsUI,dn as AIReply,ki as AIRequestError,mh as AIReviewCheck,lh as AIReviewCheckResult,dh as AIReviewCheckResultChange,gh as AIReviewCheckRun,yh as AIReviewGateway,xh as AIReviewMode,Ih as AIReviewModeController,hh as AIReviewModeEditing,nh as AIReviewModeUI,Nh as AIReviewRunResult,Js as AIRunResult,cs as AITabs,hs as AITabsMainView,rs as AITabsView,ts as AITextAdapter,oa as AIToggleButtonUI,Wh as AITranslate,Vh as AITranslateController,Kh as AITranslateGateway,Fh as AITranslateRunResult,Gh as AITranslateUI,is as AWSTextAdapter,es as OpenAITextAdapter,yi as ShowAIAssistantCommand,ra as ToggleAICommand,cn as createResizeButton,Zi as getDefaultAICommands,zs as markOperationsAsAI};
23
+ import{Command as _0x23b7b0,ContextPlugin as _0x898608,Editor as _0x24cd6f,Plugin as _0x622916,rootAcceptsBlocks as _0x1bd984}from'@ckeditor/ckeditor5-core';import{IconAI as _0x522884,IconAIAdjustLength as _0x55d620,IconAIAskAI as _0x2eb0d7,IconAIChangeTone as _0x173850,IconAIChat as _0x19cce7,IconAIChatCommands as _0x3bbd8f,IconAIContinueWriting as _0x123cf3,IconAIGrammarCheck as _0x37ebe4,IconAIHistory as _0x4afa16,IconAIImproveWriting as _0x448b65,IconAIOther as _0x400907,IconAIQuickActions as _0x10bb99,IconAIReview as _0x510915,IconAITranslate as _0x370c5b,IconBoxWithCheck as _0x381a45,IconBoxWithCross as _0x194390,IconBoxWithMarker as _0xf32bda,IconBrowseFiles as _0x15107d,IconBulb as _0x1e95b5,IconCancel as _0x572ba4,IconCheck as _0x48b061,IconChevronDown as _0x4e351c,IconChevronRight as _0x2fee64,IconChevronUp as _0x582ecb,IconCopy as _0xaeff50,IconDocument as _0x2d99a5,IconDocumentOutline as _0x325a2b,IconDropdownArrow as _0x1193f0,IconError as _0x309d45,IconEye as _0x112882,IconEyeCrossedOut as _0x3bafdd,IconFileUpload as _0xd6ab36,IconImage as _0x1bf77b,IconInfo as _0x41da4b,IconLink as _0x3de4d0,IconLoupe as _0x4cf30b,IconMagicWand as _0xbfdde1,IconMaximize as _0x31ef04,IconMinimize as _0x2bee5e,IconNextArrow as _0x57e767,IconOutdated as _0x157ef8,IconPaperClip as _0x3ff1a2,IconPin as _0x5b153c,IconPlus as _0x3da945,IconPreviousArrow as _0xd78e92,IconRefresh as _0x184821,IconRevisionHistory as _0x14640e,IconRobotPencil as _0x59f1b5,IconSelection as tt,IconShowChangesOff as et,IconShowChangesOn as it,IconStop as st,IconSubmit as nt,IconThreeHorizontalDots as rt,IconThumbDown as ot,IconThumbUp as at,IconWeb as ht}from'@ckeditor/ckeditor5-icons';import{CKEditorError as ct,Collection as lt,DomEmitterMixin as ut,EmitterMixin as dt,FocusTracker as _t,KeystrokeHandler as gt,ObservableMixin as At,Rect as It,ResizeObserver as pt,_isMotionReduced as Et,first as mt,getConstrainedViewportRect as Tt,global as wt,insertToPriorityArray as Ct,isVisible as ft,logError as bt,logWarning as St,scrollAncestorsToShowTarget as Rt,scrollViewportToShowTarget as Ot,toArray as vt,uid as kt,version as yt}from'@ckeditor/ckeditor5-utils';import{AutocompleteView as Nt,BalloonPanelView as xt,BalloonToolbar as Lt,BodyCollection as Pt,ButtonLabelView as Dt,ButtonLabelWithHighlightView as Ht,ButtonView as Mt,Dialog as Ut,DialogViewPosition as Vt,DropdownMenuPanelPositioningFunctions as Bt,FileDialogButtonView as Gt,FocusCycler as Ft,FormHeaderView as Kt,FormRowView as Wt,HighlightedTextView as Yt,IconView as $t,InputTextView as qt,LabeledFieldView as Qt,ListItemButtonView as Xt,ListItemGroupView as zt,ListItemView as jt,ListView as Jt,MenuBarMenuListItemButtonView as Zt,MenuBarMenuListItemView as te,MenuBarMenuListView as _0x14eb7a,MenuBarMenuView as _0x1021d4,SearchTextView as _0xdb63d9,SpinnerView as _0x14cb96,Template as _0x24e6f7,TextareaView as _0x324c99,ToolbarView as _0x54b9b5,UIModel as _0x28f92e,View as _0x56a514,ViewCollection as _0x93f04d,addListToDropdown as _0x40e721,addMenuToDropdown as _0x1ce06a,clickOutsideHandler as _0x44d1a9,createDropdown as _0x48403c,createLabeledInputText as _0x4c7fdb,createLabeledTextarea as _0x3cc43c,submitHandler as _0x2801b9}from'@ckeditor/ckeditor5-ui';import{ClipboardMarkersUtils as _0x6355f1,ClipboardPipeline as _0x5d9c9d}from'@ckeditor/ckeditor5-clipboard';import{InsertOperation as _0x52fe51,MarkerOperation as _0x5bbb57,Matcher as _0x34dbd2,ModelDocumentFragment as _0x28e306,ModelPosition as _0x4febba,ModelRange as _0x2827cc,ModelTreeWalker as _0x28cad7,ViewDataTransfer as _0x1fcb27,ViewDocumentDomEventData as _0x1b1d52,ViewDowncastWriter as _0x4ccf87,ViewUpcastWriter as _0x6705a7,_DetachOperation as _0x4f656c,_insertIntoModelNodeList as _0x3ab39d,_removeFromModelNodeList as _0x168f4f,transformOperationSets as _0x5dec67}from'@ckeditor/ckeditor5-engine';import{cloneDeep as _0xddedfa,debounce as _0x5f51ae,escape as _0x15f5d8,escapeRegExp as _0x3ff1f3,omit as _0x101a20,throttle as _0x20eb7b,unescape as _0x2d8c2d}from'es-toolkit/compat';import{createParser as _0x1314f1}from'eventsource-parser';import{CloudServices as _0x46601a}from'@ckeditor/ckeditor5-cloud-services';import{parseDocument as _0x502eab}from'htmlparser2';import{append as _0x23e0ae,appendChild as _0x380486,find as _0x370e5d,findAll as _0x4615bb,findOne as _0x228c3a,getChildren as _0x27f885,getParent as _0x12306c,isComment as _0x3e0c4f,isTag as _0x545292,prepend as ti,prependChild as _0x46b9cf,removeElement as _0x47cc1f,replaceElement as _0x452856,textContent as _0xa4b40a}from'domutils';import _0x35b927 from'dom-serializer';import{Document as _0x139fbf,Element as _0x21f244,NodeWithChildren as _0x71eb2,Text as _0xa7d61f,cloneNode as _0x2a3383,isDocument as _0x23e8cf,isText as _0x5273d9}from'domhandler';import{ConfirmMixin as _0x5a953b,DATA_ID_MODEL_ATTRIBUTE as _0x4fabc2,DATA_ID_VIEW_ATTRIBUTE as _0x322962,DocumentCompare as _0x45dea0,PillView as _0x5745ee,SuggestionsConversion as _0x34a1f4,fixElementSuggestionRange as _0x49575d,getAllMarkersDomElementsSorted as _0x42da8e,getMarkerDomElement as _0x497b83,isInvalidAttributeOperation as _0x9fd625}from'@ckeditor/ckeditor5-collaboration-core';import{MarkdownGfmMdToHtml as _0x20ae64,MarkdownGfmMdToHtmlDefaultPlugins as _0x29e337}from'@ckeditor/ckeditor5-markdown-gfm';import _0x23be32 from'rehype-sanitize';import _0x29a9e2 from'morphdom';import{diffArrays as _0x11f069}from'diff';const vi='_ungrouppedCommands';function ki(_0x1cd465,_0x41925f){const _0x314168=(0x0,_0x41925f['t'])('Other');return _0x1cd465['length']?'groupId'in _0x1cd465[0x0]?_0x1cd465:[{'groupId':vi,'groupLabel':_0x314168,'order':0x1/0x0,'commands':_0x1cd465}]:[{'groupId':vi,'groupLabel':_0x314168,'order':0x1/0x0,'commands':[]}];}const yi=globalThis['DataTransfer'],Ni='ai-ui';var xi=class extends _0x622916{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {editor:_0x1c092d}=this,_0x1bb2ca=['ck-fake-ai-selection'];_0x1c092d['config']['get']('ai.assistant.useTheme')&&_0x1bb2ca['push']('ck-ai-assistant-ui_theme'),_0x1c092d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ni,'view':{'classes':_0x1bb2ca,'priority':0xc}}),_0x1c092d['conversion']['for']('editingDowncast')['markerToElement']({'model':Ni,'view':(_0x5e0ed5,{writer:_0x226f9b})=>{if(!_0x5e0ed5['markerRange']['isCollapsed'])return null;const _0xdc7526=_0x226f9b['createUIElement']('span');return _0x226f9b['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0xdc7526),_0xdc7526;}});}afterInit(){!async function(_0xaf88be){const _0x34b69e='nA7yurgOHbZvDplRkJscdICm86oPWx92f1qF0LaSX3NGwTMK4jVtYUBQi5zheE',_0xd6831d=0x79128,_0x4b89cc=window['Date']['now'](),_0x3e0b68=_0xaf88be['editor'],_0x4a5594=new window['Promise'](_0x4ff2c0=>{_0x3e0b68['once']('ready',_0x4ff2c0);}),_0x15a13a={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x39dc42=_0x3e0b68['config']['get']('licenseKey');async function _0x55a5a3(){let _0x41f1f5,_0x55e589=null,_0x145eee=null;try{return'GPL'==_0x39dc42?'NotAllowed':(_0x41f1f5=_0x40d265(),_0x41f1f5?(_0x41f1f5['usageEndpoint']&&(_0x145eee=_0x50da19(_0x41f1f5['usageEndpoint'],_0x41f1f5['jti'])),await _0x3c1492()?_0x37218a()?_0x26adcf()?'Expired':_0x422b61()?('evaluation'==_0x41f1f5['licenseType']&&(_0x55e589=_0xdb996a('EvaluationLimit')),await _0x7e414a()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x26adcf(){const _0x1e6f64=['evaluation','trial']['includes'](_0x41f1f5['licenseType'])?_0x4b89cc/0x3e8:0xe10*_0xd6831d;return _0x41f1f5['exp']<_0x1e6f64;}function _0x37218a(){const _0xcd0f02=_0x41f1f5['features'];return!!_0xcd0f02&&(!!_0xcd0f02['includes']('*')||!!_0xcd0f02['includes']('AI'));}function _0x422b61(){const _0x2715d7=_0x41f1f5['licensedHosts'];if(!_0x2715d7||0x0==_0x2715d7['length'])return!0x0;const {hostname:_0x64795a}=new URL(window['location']['href']);if(_0x2715d7['includes'](_0x64795a))return!0x0;const _0x259467=_0x64795a['split']('.');return _0x2715d7['filter'](_0x4f777a=>_0x4f777a['includes']('*'))['map'](_0x33a7ca=>_0x33a7ca['split']('.'))['filter'](_0x4e2ec4=>_0x4e2ec4['length']<=_0x259467['length'])['map'](_0x39f29d=>Array(_0x259467['length']-_0x39f29d['length'])['fill']('*'===_0x39f29d[0x0]?'*':'')['concat'](_0x39f29d))['some'](_0x997dcb=>_0x259467['every']((_0x22591f,_0x3037d2)=>_0x997dcb[_0x3037d2]===_0x22591f||'*'===_0x997dcb[_0x3037d2]));}function _0x7e414a(){return _0x55e589&&_0x145eee?new window['Promise']((_0x5677c8,_0x40f7f7)=>{_0x55e589['then'](_0x5677c8,_0x40f7f7),_0x145eee['then'](_0x4a4f76=>{'Valid'!=_0x4a4f76&&_0x5677c8(_0x4a4f76);},_0x40f7f7);}):_0x55e589||_0x145eee||'Valid';}}function _0x50da19(_0x1f4657,_0x1e9f3b){return new window['Promise'](_0xd8c662=>{if(_0x364547())return _0xd8c662('Valid');_0x2444b8(),_0x3e0b68['decorate']('_sendUsageRequest');let _0x6a4d0=!0x1;const _0x13f6f5=kt();function _0x26895d(_0xac47b5){return!!_0xac47b5&&('object'==typeof _0xac47b5||'function'==typeof _0xac47b5)&&'function'==typeof _0xac47b5['then']&&'function'==typeof _0xac47b5['catch'];}function _0x212971(_0x1f94e9){_0xb6bb3c(_0x1f94e9)['then'](_0x2b1c35=>_0x2b1c35&&'ok'==_0x2b1c35['status']?_0x48d266(_0x23196d(_0x13f6f5+_0x1e9f3b))!=_0x2b1c35['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x6b16dd=>(_0x391b49(),_0x6b16dd),()=>{const _0x3cd458=_0x5cf84b();return null==_0x3cd458?(_0x391b49(),'Valid'):_0x4b89cc-_0x3cd458>0x240c8400?'UsageLimit':'Valid';})['then'](_0xd8c662)['catch'](()=>{_0xd8c662('UsageLimit');});const _0x3aa19e=0x36ee80;function _0x391b49(){const _0x4c0546='llct-'+_0x48d266(_0x23196d(_0x1f4657)),_0x27ead3=_0x777390(_0x48d266(window['Math']['ceil'](_0x4b89cc/_0x3aa19e)));window['localStorage']['setItem'](_0x4c0546,_0x27ead3);}function _0x5cf84b(){const _0x1a6ebe='llct-'+_0x48d266(_0x23196d(_0x1f4657)),_0x3ed269=window['localStorage']['getItem'](_0x1a6ebe);return _0x3ed269?window['parseInt'](_0x777390(_0x3ed269),0x10)*_0x3aa19e:null;}function _0xb6bb3c(_0x49a50d){return new window['Promise']((_0x2df24f,_0x53db51)=>{_0x49a50d['then'](_0x2df24f,_0x53db51),window['setTimeout'](_0x53db51,0x1d4c0);});}}_0x3e0b68['on']('_sendUsageRequest',(_0x3b7ffa,_0x431e96)=>{if(_0x431e96[0x0]!=_0x1f4657)return _0xd8c662('UsageLimit');_0x431e96[0x1]={..._0x431e96[0x1],'requestId':_0x13f6f5};},{'priority':'high'}),_0x3e0b68['on']('_sendUsageRequest',_0x2f767f=>{_0x26895d(_0x2f767f['return'])&&(_0x6a4d0=!0x0,_0x212971(_0x2f767f['return']));},{'priority':'low'}),_0x4a5594['then'](()=>{_0x6a4d0||_0xd8c662('UsageLimit');});});function _0x364547(){return'auto'==_0x3e0b68['editing']['view']['_overlayModeHint'];}function _0x2444b8(){_0x3e0b68['editing']['view']['_overlayModeHint']='auto';}}function _0xdb996a(_0x3a5957){const _0x36a1e8=[new window['Promise'](_0x46f80c=>setTimeout(_0x46f80c,0x93ecc)),_0x4a5594['then'](()=>new window['Promise'](_0x2afb0b=>{let _0x519741=0x0;_0x3e0b68['model']['on']('applyOperation',(_0x4a836c,_0x457da0)=>{_0x457da0[0x0]['isDocumentOperation']&&_0x519741++,0x5e8==_0x519741&&(_0x2afb0b(),_0x4a836c['off']());});}))];return window['Promise']['race'](_0x36a1e8)['then'](()=>_0x3a5957);}async function _0x57e89a(){await _0x4a5594,_0x3e0b68['model']['change']=_0x269bba,_0x3e0b68['model']['enqueueChange']=_0x269bba,_0x3e0b68['enableReadOnlyMode']('model');}function _0x501143(_0x3e3733){const _0x11f0a6=_0x37c2d4();_0x3e0b68[_0x11f0a6]='aiLicenseKey'+_0x3e3733,'Valid'!=_0x3e3733&&_0x57e89a();}function _0x37c2d4(){const _0xce0751=window['String'](window['performance']['now']())['replace']('.','');let _0x37d483='n';for(let _0x5bb09b=0x0;_0x5bb09b<_0xce0751['length'];_0x5bb09b+=0x2){let _0x4317c5=window['parseInt'](_0xce0751['substring'](_0x5bb09b,_0x5bb09b+0x2));_0x4317c5>=0x3e&&(_0x4317c5-=0x3e),_0x37d483+=_0x34b69e[_0x4317c5];}return _0x37d483;}function _0x40d265(){const _0x4282b9=_0x39dc42['split']('.');if(0x3!=_0x4282b9['length'])return null;return _0x4409e4(_0x4282b9[0x1]);function _0x4409e4(_0x47dfb9){const _0x3230ea=_0x3a96dd(_0x47dfb9);return _0x3230ea&&_0x3b596b()?_0x3230ea:null;function _0x3b596b(){const _0xc67928=_0x3230ea['jti'],_0x1c8dbd=window['parseInt'](_0xc67928['substring'](_0xc67928['length']-0x8),0x10),_0xab01f8={..._0x3230ea,'jti':_0xc67928['substring'](0x0,_0xc67928['length']-0x8)};return delete _0xab01f8['vc'],_0x23196d(_0xab01f8)==_0x1c8dbd;}}}async function _0x3c1492(){let _0x2977cb=!0x0;try{const [_0x7462bd,_0xdaec0a,_0x310bca]=_0x39dc42['split']('.');return _0x361865(_0x7462bd),await _0x9783b1(_0x7462bd,_0xdaec0a,_0x310bca),_0x2977cb;}catch{return!0x1;}function _0x361865(_0x207248){const _0x4567e3=_0x3a96dd(_0x207248);_0x4567e3&&'ES256'==_0x4567e3['alg']||(_0x2977cb=!0x1);}async function _0x9783b1(_0x34571f,_0x2b8f15,_0x3b346d){const _0x2c4f1a=window['Uint8Array']['from'](_0x3b8dfe(_0x3b346d),_0x281687=>_0x281687['charCodeAt'](0x0)),_0xb0fb98=new window['TextEncoder']()['encode'](_0x34571f+'.'+_0x2b8f15),_0x418f0=window['crypto']['subtle'];if(!_0x418f0)return;const _0x475f0e=await _0x418f0['importKey']('jwk',_0x15a13a,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x418f0['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x475f0e,_0x2c4f1a,_0xb0fb98)||(_0x2977cb=!0x1);}}function _0x3a96dd(_0x21c2c2){return _0x21c2c2['startsWith']('ey')?JSON['parse'](_0x3b8dfe(_0x21c2c2)):null;}function _0x3b8dfe(_0x4a381e){return window['atob'](_0x4a381e['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x23196d(_0x1134d3){let _0xaff9b8=0x1505;function _0x3fccca(_0x4d7391){for(let _0x5b7c5a=0x0;_0x5b7c5a<_0x4d7391['length'];_0x5b7c5a++){const _0x15042f=_0x4d7391['charCodeAt'](_0x5b7c5a);_0xaff9b8=(_0xaff9b8<<0x5)+_0xaff9b8+_0x15042f,_0xaff9b8&=_0xaff9b8;}}function _0x36dbd4(_0x2fced5){Array['isArray'](_0x2fced5)?_0x2fced5['forEach'](_0x36dbd4):_0x2fced5&&'object'==typeof _0x2fced5?Object['entries'](_0x2fced5)['sort']()['forEach'](([_0x576f6d,_0x2c21ca])=>{_0x3fccca(_0x576f6d),_0x36dbd4(_0x2c21ca);}):_0x3fccca(window['String'](_0x2fced5));}return _0x36dbd4(_0x1134d3),_0xaff9b8>>>0x0;}function _0x48d266(_0x2d736b){return _0x2d736b['toString'](0x10)['padStart'](0x8,'0');}function _0x777390(_0x2fca49){return _0x2fca49['split']('')['reverse']()['join']('');}function _0x269bba(){}_0x501143(await _0x55a5a3());}(this);}showFakeVisualSelection(){const _0x123c22=this['editor']['model'];_0x123c22['change'](_0x1be8f9=>{const _0x2068b8=_0x123c22['document']['selection']['getRanges']();let _0x34e66d=0x0;for(const _0x358e76 of _0x2068b8){const _0x27d2ee=Ni+':'+_0x34e66d;if(_0x123c22['markers']['has'](_0x27d2ee))_0x1be8f9['updateMarker'](_0x27d2ee,{'range':_0x358e76});else{if(_0x358e76['start']['isAtEnd']){const _0x3d4172=_0x358e76['start']['getLastMatchingPosition'](({item:_0x1c098a})=>!_0x123c22['schema']['isContent'](_0x1c098a),{'boundaries':_0x358e76});_0x1be8f9['addMarker'](_0x27d2ee,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1be8f9['createRange'](_0x3d4172,_0x358e76['end'])});}else _0x1be8f9['addMarker'](_0x27d2ee,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x358e76});}_0x34e66d++;}});}hideFakeVisualSelection(){const _0x53219c=this['editor']['model'],_0x17359a=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](Ni));_0x17359a['length']&&_0x53219c['change'](_0x270ead=>{_0x17359a['forEach'](_0x47fdd2=>{_0x270ead['removeMarker'](_0x47fdd2);});});}insertContent(_0x3dea1b,_0x2f43a8){const _0x3e355b=this['_getAISelection'](),_0x5714e1=_0x2f43a8||_0x3e355b['getFirstRange']();this['editor']['model']['canEditAt'](_0x5714e1)&&this['editor']['model']['change'](_0x1bcc82=>{this['hideFakeVisualSelection'](),_0x2f43a8||this['_resetContentOfSelectedTableCells'](_0x1bcc82,_0x3e355b),this['_pasteHTMLUsingClipboard']({'insertAt':_0x5714e1,'writer':_0x1bcc82,'html':_0x3dea1b});});}insertContentBelow(_0x4c7293){const {model:_0x84bc1b}=this['editor'],_0x530d7a=this['_getAISelection']();_0x84bc1b['change'](()=>{const _0x95a836=this['_prepareTableInsertBelowPosition'](_0x4c7293,_0x530d7a)||this['_getDefaultInsertBelowPosition'](_0x530d7a);this['insertContent'](_0x4c7293,_0x95a836);});}_getAISelection(){const _0x385db0=this['editor']['model'],_0x37bb3e=Array['from'](_0x385db0['markers']['getMarkersGroup'](Ni))['map'](_0x2354f7=>_0x2354f7['getRange']());return _0x385db0['createSelection'](_0x37bb3e);}_pasteHTMLUsingClipboard({writer:_0x4bc4d0,html:_0x16d9b7,insertAt:_0x143e6a}){const {view:_0x35b83d}=this['editor']['editing'],_0x17f20c=this['editor']['plugins']['get'](_0x5d9c9d),_0x34f9bd=new yi();_0x34f9bd['setData']('text/html',_0x16d9b7);const _0x2d3a8b=new _0x1b1d52(_0x35b83d,new ClipboardEvent('paste',{'clipboardData':_0x34f9bd}),{'dataTransfer':new _0x1fcb27(_0x34f9bd)});_0x4bc4d0['setSelection'](_0x143e6a);const _0x19f77b=(_0x25f1c6,_0x1309e6)=>{_0x1309e6['resultRange']&&_0x4bc4d0['setSelection'](_0x1309e6['resultRange']);};_0x17f20c['once']('contentInsertion',_0x19f77b,{'priority':'lowest'}),_0x35b83d['document']['fire']('paste',_0x2d3a8b),_0x17f20c['off']('contentInsertion',_0x19f77b);}_getDefaultInsertBelowPosition(_0x316959){const {model:_0x8c74db}=this['editor'],_0x4f794a=Array['from'](_0x316959['getSelectedBlocks']());return _0x4f794a['length']?_0x8c74db['createPositionAfter'](_0x4f794a['pop']()):_0x316959['getLastPosition']();}_prepareTableInsertBelowPosition(_0x3a53b4,_0x42ce17){const {model:_0x11e4f9,plugins:_0x1bc29b}=this['editor'];if(_0x1bc29b['has']('TableUtils')){const _0x413328=_0x1bc29b['get']('TableUtils')['getSelectedTableCells'](_0x42ce17);if(_0x413328['length']){const _0x53a046=this['_getTableRowCountFromContent'](_0x3a53b4),_0x1c64c3=this['_createEmptyTableRows'](_0x413328,_0x53a046);return _0x11e4f9['createPositionAt'](_0x1c64c3,0x0);}}return null;}_getTableRowCountFromContent(_0x7a02b9){const _0x49dcd1=this['editor']['plugins']['get']('TableUtils'),_0x4af66a=this['editor']['data']['parse'](_0x7a02b9,'$documentFragment'),_0x5a4a5a=Array['from'](_0x4af66a['getChildren']())['filter'](_0x4363df=>_0x4363df['is']('element','table'));let _0xd45ac1=0x0;return _0x5a4a5a['forEach'](_0x387363=>{_0xd45ac1+=_0x49dcd1['getRows'](_0x387363);}),_0xd45ac1;}_createEmptyTableRows(_0x4356ba,_0x13badc){const _0x3b3625=this['editor']['plugins']['get']('TableUtils'),_0x4aa3e8=_0x3b3625['getRowIndexes'](_0x4356ba),_0xb466d2=_0x3b3625['getColumnIndexes'](_0x4356ba),_0x1a333c=_0x4aa3e8['last']+0x1,_0x4e3391=_0xb466d2['first'],_0x2ddb7f=_0x4356ba[0x0]['findAncestor']('table');for(let _0x4f340b=0x0;_0x4f340b<_0x13badc;_0x4f340b++)_0x3b3625['insertRows'](_0x2ddb7f,{'at':_0x1a333c});return _0x2ddb7f['getChild'](_0x1a333c)['getChild'](_0x4e3391);}_resetContentOfSelectedTableCells(_0x39cadb,_0xa73fc0){const {plugins:_0xeeec50}=this['editor'],{model:_0x3b9fd5}=_0x39cadb;_0xeeec50['has']('TableUtils')&&_0xeeec50['get']('TableUtils')['getSelectedTableCells'](_0xa73fc0)['length']&&_0x3b9fd5['deleteContent'](_0xa73fc0);}},Li=class extends _0x622916{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}afterInit(){if(!this['textAdapter'])throw new ct('aiadapter-text-adapter-not-set',null);}},Pi=class extends Error{constructor(_0x38fff2){super(_0x38fff2),this['name']='AIRequestError';}};function Di(_0x4eea9f,_0x403531,_0x3ec55b){const t=_0x4eea9f['t'];switch(_0x403531){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',_0x3ec55b);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3ec55b);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'},_0x3ec55b);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 _0x403531;}}var Hi=class extends _0x23b7b0{_commandDefinitions;constructor(_0x50f2d9,_0x4b43d7){super(_0x50f2d9),this['_commandDefinitions']=_0x4b43d7,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1ee660,_0x2c82f8,_0x505fe6)=>{this['isEnabled']&&(this['enabledCommandsIds']=Mi(this['_commandDefinitions'],_0x505fe6));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xbf2e47,_0x55816b,_0x3b3254)=>{this['enabledCommandsIds']=_0x3b3254?Mi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x39531b=this['editor']['model'];this['_hasContext']=function(_0x34a53b){const _0x5df24b=_0x34a53b['document']['selection'];return _0x5df24b['isCollapsed']?0x0!==[..._0x5df24b['getSelectedBlocks']()]['length']&&![..._0x5df24b['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x34a53b['hasContent'](_0x5df24b['getFirstRange']());}(_0x39531b);const _0x8ca639=_0x39531b['document']['selection'],_0x359de4=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x1e9e3e of _0x8ca639['getRanges']())for(const _0x808fc8 of _0x1e9e3e['getItems']())if(_0x808fc8['is']('element')&&_0x359de4['includes'](_0x808fc8['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}execute(_0x32c514='',_0x37d1ec='',_0x4ecdce='custom'){this['editor']['plugins']['get'](ts)['showUI'](_0x32c514,_0x37d1ec,_0x4ecdce);}};function Mi(_0x5259d4,_0x15ff99){const _0x1b002a=new Set();for(const _0x5cf883 of _0x5259d4['values']())(_0x15ff99||!0x1===_0x5cf883['requiresContent'])&&_0x1b002a['add'](_0x5cf883['id']);return Array['from'](_0x1b002a);}const Ui=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is'),Vi=/* #__PURE__ -- @preserve */
24
+ At();var Bi=class extends Vi{editor;textAdapter;['view'];_sanitizationContainer;['_domParser'];['_xmlSerializer'];constructor(_0x48c6a5,_0x42dd7e,_0x1ca583){super(),this['editor']=_0x48c6a5,this['textAdapter']=_0x42dd7e,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x1ca583,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x26112c,_0x4fc689,_0x502ced)=>{this['view']['value']=this['_sanitizeHTML'](_0x502ced);}),this['listenTo'](this['view'],'submitPrompt',(_0x356616,_0xa6f168)=>{const _0x1aced=this['currentContext']||this['initialContext'];this['_handleQuery'](_0xa6f168,_0x1aced,'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:_0x4c22db,query:_0x43672,htmlContent:_0x1ce343,label:_0x250d4d,mainActionLabel:_0x4695c2}){this['view']['prompt']=_0x250d4d,this['view']['mainAction']=_0x4695c2,this['initialContext']=_0x1ce343,_0x43672&&(this['view']['isRendered']?this['_handleQuery'](_0x43672,_0x1ce343,_0x4c22db,_0x250d4d):this['view']['once']('render',()=>{this['_handleQuery'](_0x43672,_0x1ce343,_0x4c22db,_0x250d4d);}));}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'](_0x256f66,_0x43cc47,_0x445cdd,_0x29946d){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x43cc47,this['previousQuery']=_0x256f66,this['previousLabel']=_0x29946d||_0x256f66,this['previousActionId']=_0x445cdd,new Promise(_0x1c5bf6=>{this['textAdapter']['makeRequest']({'query':_0x256f66,'context':_0x43cc47,'onData':_0x8f23c9=>{this['currentResponse']=_0x8f23c9,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x445cdd})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x417d14=>{_0x417d14 instanceof Pi?this['view']['handleError'](_0x417d14['message']):this['view']['handleError'](),_0x1c5bf6();})['finally'](()=>{this['stopProcessing'](),_0x1c5bf6();});});}_parseAndNormalizeContent(_0x446bbe,_0xcf91c8=!0x1){const _0x273b58=Ui['exec'](_0x446bbe);_0x446bbe=_0x273b58?_0x446bbe['substring'](_0x273b58[0x1]['length']):_0x446bbe['length']<0x64&&!_0xcf91c8?'':this['_stripMarkdownSyntax'](_0x446bbe);const _0x109fc5=this['_domParser']['parseFromString'](_0x446bbe,'text/html');if(_0x273b58){const _0x22a971=Array['from'](_0x109fc5['body']['childNodes']);_0x22a971['reverse']();for(const _0xf4c7b4 of _0x22a971){if(_0xf4c7b4['nodeType']==Node['ELEMENT_NODE'])break;_0xf4c7b4['remove']();}}const _0x12ee43=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x109fc5['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x12ee43);const _0x385f0e=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x4f2cf8=this['editor']['data']['toModel'](_0x12ee43);return _0x385f0e||_0x4f2cf8['markers']['clear'](),this['editor']['data']['stringify'](_0x4f2cf8);}['_normalizeResponseHeadings'](_0x11c1f7){const _0x48b193=new _0x6705a7(this['editor']['editing']['view']['document']),_0x491b37=new _0x34dbd2({'name':/^h[1-5]$/}),_0x4e4340=[];let _0x5ef88b=!0x1;for(const _0x2f7d1b of _0x11c1f7)_0x2f7d1b['is']('element')&&_0x491b37['match'](_0x2f7d1b)&&(_0x4e4340['push'](_0x2f7d1b),'h1'==_0x2f7d1b['name']&&(_0x5ef88b=!0x0));if(_0x5ef88b){for(const _0x2f7aa2 of _0x4e4340)_0x48b193['rename']('h'+(parseInt(_0x2f7aa2['name'][0x1])+0x1),_0x2f7aa2);}}_isH1TagSupportEnabled(){const {data:_0x58b0a0,editing:_0x337585}=this['editor'],_0x5d9f1d=_0x58b0a0['htmlProcessor']['toView']('<h1></h1>'),_0x5cc3dd=_0x58b0a0['toView'](_0x58b0a0['toModel'](_0x5d9f1d));return!!_0x337585['view']['domConverter']['viewToDom'](_0x5cc3dd)['querySelector']('h1');}_sanitizeHTML(_0x38d14d){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x38d14d),this['_sanitizationContainer']['innerHTML'];}_stripMarkdownSyntax(_0x36e024){const _0x30add2=_0x36e024['trim']();return _0x30add2['startsWith']('```html')?_0x30add2['endsWith']('```')?_0x30add2['substring'](0x7,_0x30add2['length']-0x3):_0x30add2['substring'](0x7):_0x36e024;}};const Gi={'REPLACE':'replace','INSERT':'insert'};var Fi=class extends _0x54b9b5{constructor(_0x336386){super(_0x336386),this['set']('isVisible',!0x1),this['set']('mainAction',Gi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x2e5b91=>Di(_0x336386,'AI_'+_0x2e5b91['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Di(_0x336386,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Di(_0x336386,'Try\x20again')),this['stopButton']=this['_createButton'](Di(_0x336386,'Stop'));const _0x41d6db=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x41d6db['if']('isVisible','ck-hidden',_0x57d4d0=>!_0x57d4d0)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}_createButton(_0x36cd26,_0x49e9ca){const _0xb00106=new Mt(this['locale']);return _0xb00106['set']({'label':_0x36cd26,'class':_0x49e9ca||'','isVisible':!0x0,'withText':!0x0}),_0xb00106;}},Ki=class extends _0x56a514{contentFieldView;copyButtonView;constructor(_0x5101df,_0x5f2ba0=''){super(_0x5101df),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x5b374a=this['bindTemplate'];this['contentFieldView']=new Wi(_0x5101df,_0x5f2ba0),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x5b374a['if']('isVisible','ck-hidden',_0x597fe5=>!_0x597fe5)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x5b374a['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 _0x115e35=!0x1;this['on']('change:value',(_0x5b53ac,_0x426fac,_0xc14bd2)=>{const _0x3ffecb=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0xc14bd2),this['isProcessing']&&_0x3ffecb&&!_0x115e35&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1bba47,_0xa6e97,_0x1c9453)=>{_0x115e35=!0x1,_0x1c9453?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x115e35=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x115e35=!0x0;});}['focus'](){this['element']['focus']();}_createCopyButton(){const _0x5f2871=this['locale'],_0x2a0207=new Mt(this['locale']),_0x4b76f2='ck-ai-form__copy-button';return _0x2a0207['set']({'label':Di(_0x5f2871,'Copy'),'icon':_0xaeff50,'class':_0x4b76f2,'tooltip':!0x0}),_0x2a0207['bind']('isVisible')['to'](this,'value',_0x512687=>!!_0x512687),_0x2a0207['bind']('isEnabled')['to'](this,'isProcessing',_0xd7b9e0=>!_0xd7b9e0),_0x2a0207['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x2a0207['icon']=_0x48b061,_0x2a0207['class']=_0x4b76f2+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x2a0207['icon']=_0xaeff50,_0x2a0207['class']=_0x4b76f2;},0x3e8);}),_0x2a0207;}['_copyHTMLToClipboard'](_0x5e987b){const {window:_0x732931,document:_0x3bf52e}=wt;if(_0x732931['ClipboardItem']){const {Blob:_0x333312,ClipboardItem:_0x1c9124}=_0x732931,_0x40f60f=[new _0x1c9124({'text/html':new _0x333312([_0x5e987b['innerHTML']],{'type':'text/html'}),'text/plain':new _0x333312([_0x5e987b['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x40f60f);}else{const _0x43a484=_0x3bf52e['createElement']('div');_0x43a484['style']['position']='absolute',_0x43a484['style']['left']='-9999px',_0x43a484['innerHTML']='<span>[</span>'+_0x5e987b['innerHTML']+'<span>]</span>',_0x3bf52e['body']['appendChild'](_0x43a484);const _0x2fdddb=_0x3bf52e['createRange']();_0x2fdddb['setStartAfter'](_0x43a484['firstElementChild']),_0x2fdddb['setEndBefore'](_0x43a484['lastElementChild']);const _0x55a5e9=_0x732931['getSelection']();_0x55a5e9['removeAllRanges'](),_0x55a5e9['addRange'](_0x2fdddb),_0x3bf52e['execCommand']('copy'),_0x43a484['remove']();}}},Wi=class extends _0x56a514{constructor(_0x2aaae3,_0x58bd6d=''){super(_0x2aaae3),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x58bd6d,'ck-reset_all-excluded','ck-ai-form__content-field']}});}setContent(_0x194c37){this['element']['innerHTML']=_0x194c37;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}_createLoader(){const _0x100a46=new _0x56a514(),_0xf4be68=this['locale'],_0x5bd59d=new _0x14cb96();return _0x5bd59d['isVisible']=!0x0,_0x100a46['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x5bd59d,{'text':Di(_0xf4be68,'AI\x20is\x20writing...')}]}),_0x100a46['render'](),_0x100a46;}},Yi=class extends _0x56a514{constructor(_0x63dfb0,_0x4b78a8=''){super(_0x63dfb0);const _0x4c826f=new $t(),_0xc66040=this['bindTemplate'];this['set']('text',_0x4b78a8),_0x4c826f['content']=_0x309d45,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4c826f,{'text':_0xc66040['to']('text')}]});}},$i=class extends Nt{submitButtonView;showHistoryButtonView;constructor(_0xb76363,_0x22a3e3){super(_0xb76363,_0x22a3e3),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',(_0x45d53d,_0x425368)=>{_0x45d53d['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x425368());});}_createSubmitButton(){const _0x1e9bfc=new Mt(this['locale']),_0x737da2=this['locale'];return _0x1e9bfc['set']({'icon':nt,'label':Di(_0x737da2,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1e9bfc['on']('execute',()=>{this['submit']();}),_0x1e9bfc['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x481a5f,_0x35aad2)=>!_0x481a5f&&_0x35aad2),_0x1e9bfc;}_createShowHistoryButton(){const _0x100f78=new Mt(this['locale']),_0x5ccbec=this['resultsView'],_0x1792f7=this['locale'];_0x100f78['set']({'label':Di(_0x1792f7,'History'),'withText':!0x1,'icon':_0x4afa16,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x100f78['bind']('isOn')['to'](_0x5ccbec,'isVisible'),_0x100f78['bind']('isEnabled')['to'](this,'isEnabled'),_0x100f78['on']('execute',()=>{_0x5ccbec['isVisible']=!_0x5ccbec['isVisible'],_0x5ccbec['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2a43dc=()=>{wt['window']['requestAnimationFrame'](()=>{if(ft(this['element'])){const _0x42fab4=new It(this['queryView']['fieldView']['element']),_0x9e5265=_0x42fab4['width'],_0x3f243e='rtl'===_0x1792f7['uiLanguageDirection']?'left':'right';_0x42fab4['excludeScrollbarsAndBorders'](),_0x100f78['element']['style'][_0x3f243e]=_0x9e5265-_0x42fab4['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2a43dc),this['on']('render',_0x2a43dc),_0x100f78;}submit(){const _0x1feb42=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x1feb42);}['focus'](_0x4411c1){-0x1===_0x4411c1?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}},qi=class extends Jt{historyGroupView;clearHistoryButton;constructor(_0x64065d){super(_0x64065d),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new zt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Di(_0x64065d,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}filter(){let _0x27ed6e=0x0;for(const _0x34ceca of this['items'])_0x27ed6e+=_0x34ceca['items']['length'];return{'resultsCount':_0x27ed6e,'totalItemsCount':_0x27ed6e};}_createClearHistoryButton(){const _0x18f424=this['locale'],_0x4fce27=new Mt(this['locale']);return _0x4fce27['set']({'label':'('+Di(_0x18f424,'Clear')+')','withText':!0x0}),_0x4fce27['on']('execute',()=>this['fire']('clearHistory')),_0x4fce27;}},Qi=class extends jt{constructor(_0x2a8d6a){super();const _0x3a1e34=new Dt(),_0x53cb00=new Mt(this['locale'],_0x3a1e34);this['children']['add'](_0x53cb00),_0x53cb00['set']({'label':_0x2a8d6a['prompt'],'withText':!0x0}),_0x53cb00['on']('execute',()=>{this['fire']('execute',{'value':_0x2d8c2d(_0x2a8d6a['prompt'])});});}};const Xi='CKEditor/AIFormView/PromptHistory';var zi=class extends lt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x51c9df,_0x10524a)=>{const _0x23592b=ji(_0x10524a['prompt']);for(const _0x3df424 of this)if(_0x3df424!=_0x10524a&&ji(_0x3df424['prompt'])===_0x23592b){this['remove'](_0x3df424);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}_loadFromSessionStorage(){const _0x3a972f=sessionStorage['getItem'](Xi)||'[]';this['addMany'](JSON['parse'](_0x3a972f));}_saveToSessionStorage(){sessionStorage['setItem'](Xi,JSON['stringify'](this['map'](_0x317e32=>_0x317e32)));}};function ji(_0x2cf010){return _0x2cf010['toLowerCase']()['trim']();}var Ji=class extends _0x56a514{['focusTracker'];keystrokes;contentArea;toolbar;promptView;['errorView'];['_focusables'];['focusCycler'];_promptHistory;constructor(_0x5b57c7,_0x4428fa,_0x42ac1e=''){super(_0x5b57c7),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',Gi['REPLACE']),this['_promptHistory']=new zi(),this['errorView']=new Yi(_0x5b57c7),this['contentArea']=new Ki(_0x5b57c7,_0x42ac1e),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 gt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Ft({'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 _0x533760=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4428fa],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x533760['if']('isError','ck-hidden',_0x50694e=>!_0x50694e)]},'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'](_0x21ec59=0x1){-0x1===_0x21ec59?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 _0x11724c=this['locale'],_0x4af930=new $i(_0x11724c,{'queryView':{'label':Di(_0x11724c,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x3cc43c,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Di(_0x11724c,'Empty\x20history'),'secondary':Di(_0x11724c,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4af930['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x20487a,_0x2f049c)=>_0x20487a&&!_0x2f049c),this['listenTo'](_0x4af930,'submit',(_0xf72583,_0xa6d069)=>{this['prompt']=_0xa6d069;const _0x3a2160=_0x15f5d8(_0xa6d069);this['fire']('submitPrompt',_0x3a2160),_0xa6d069['trim']()&&this['_promptHistory']['add']({'prompt':_0x3a2160},0x0);},{'priority':'high'}),_0x4af930;}_createHistoryView(){const _0x154967=new qi(this['locale']);return _0x154967['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Qi),_0x154967['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x154967;}_createToolbar(){const _0x1d6a30=new Fi(this['locale']);return _0x1d6a30['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x381d1a,_0x52af40,_0x40bdff)=>_0x381d1a&&!_0x52af40&&!!_0x40bdff),_0x1d6a30['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1d6a30['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x178959,_0xee9e29,_0xacf4af)=>_0x178959&&!_0xee9e29&&!!_0xacf4af),_0x1d6a30['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1d6a30['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x111e02,_0x338eb3)=>_0x111e02&&!_0x338eb3),_0x1d6a30['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1d6a30['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1d6a30['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1d6a30;}startProcessing(){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x460af4=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Di(_0x460af4,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x99371){const _0x53dc14=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x99371||Di(_0x53dc14,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}};const Zi=globalThis['DataTransfer'];var ts=class extends _0x622916{['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[_0x6355f1,xi,Li,Ut];}constructor(_0x2d5ef6){super(_0x2d5ef6),_0x2d5ef6['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2d5ef6['config']['define']('ai.assistant.contentAreaCssClass',''),_0x2d5ef6['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2d5ef6['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}init(){const {editor:_0x277b5a}=this;this['_aiAdapter']=_0x277b5a['plugins']['get'](Li),this['_dialog']=_0x277b5a['plugins']['get'](Ut),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x244854=new Hi(_0x277b5a,Array['from'](this['_commandDefinitions']['values']()));_0x277b5a['commands']['add']('showAIAssistant',_0x244854),_0x277b5a['ui']['componentFactory']['add']('aiCommands',_0x358f45=>{const _0x155991=_0x48403c(_0x358f45);return _0x155991['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x155991['buttonView']['set']({'label':Di(_0x358f45,'AI\x20Commands'),'icon':_0xbfdde1,'tooltip':!0x0}),_0x155991['on']('execute',_0x1ef60b=>this['_onExecute'](_0x1ef60b['source']['id'])),_0x1ce06a(_0x155991,_0x277b5a['ui']['view']['body'],function(_0x5e0adc){const _0x480ed6=is(_0x5e0adc,ki(_0x5e0adc['config']['get']('ai.assistant.commands'),_0x5e0adc['locale']))['filter'](_0x57bd2b=>_0x57bd2b['commands']['length']);return 0x1===_0x480ed6['length']?is(_0x5e0adc,_0x480ed6[0x0]['commands'])['map'](_0x5a475c=>({'id':_0x5a475c['id'],'label':_0x5a475c['label']})):_0x480ed6['map'](_0x2a8156=>{const {groupId:_0x20c51d,groupLabel:_0x1e24c6,commands:_0x1de4c7}=_0x2a8156,_0x12473d=is(_0x5e0adc,_0x1de4c7)['map'](_0x1fdc0d=>({'id':_0x1fdc0d['id'],'label':_0x1fdc0d['label']}));return{'id':_0x20c51d,'menu':_0x1e24c6||_0x20c51d,'children':_0x12473d};});}(_0x277b5a),{'ariaLabel':Di(_0x358f45,'AI\x20Commands')}),_0x155991['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x244854['on']('change:enabledCommandsIds',_0x198215),_0x155991['menuView']['once']('render',_0x198215),_0x155991;function _0x198215(){_0x155991['isEnabled']=_0x244854['enabledCommandsIds']['length']>0x0;for(const _0x46d3f1 of _0x155991['menuView']['buttons'])_0x46d3f1['isEnabled']=_0x244854['enabledCommandsIds']['includes'](_0x46d3f1['id']);}}),_0x277b5a['ui']['componentFactory']['add']('menuBar:aiCommands',_0x23642a=>{const _0x31e2b9=new _0x1021d4(_0x23642a);_0x31e2b9['buttonView']['set']({'label':Di(_0x23642a,'AI\x20Commands'),'icon':_0xbfdde1}),_0x31e2b9['bind']('isEnabled')['to'](_0x244854,'enabledCommandsIds',_0x4c76e0=>_0x4c76e0['length']>0x0);const _0xf52869=ki(_0x277b5a['config']['get']('ai.assistant.commands'),_0x23642a);return this['_populateMenuBarMenu'](_0x244854,_0x31e2b9,_0xf52869,_0x11c549=>this['_onExecute'](_0x11c549)),_0x31e2b9;}),_0x277b5a['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1d31bb=this['_createAIAssistantUIButton'](Mt);return _0x1d31bb['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1d31bb;}),_0x277b5a['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x30d559=this['_createAIAssistantUIButton'](Zt);return _0x30d559['set']({'role':'menuitemcheckbox'}),_0x30d559;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x44e4cf=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x307fc4;for(const _0x441914 in _0x44e4cf){const _0x542d06=_0x441914,_0x55633e=_0x44e4cf[_0x542d06];if('aiLicenseKeyValid'==_0x55633e||'aiLicenseKeyInvalid'==_0x55633e||'aiLicenseKeyExpired'==_0x55633e||'aiLicenseKeyDomainLimit'==_0x55633e||'aiLicenseKeyNotAllowed'==_0x55633e||'aiLicenseKeyEvaluationLimit'==_0x55633e||'aiLicenseKeyUsageLimit'==_0x55633e){delete _0x44e4cf[_0x542d06],_0x307fc4=_0x55633e,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x307fc4&&_0x44e4cf['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x307fc4&&_0x44e4cf['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x307fc4&&_0x44e4cf['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x307fc4&&_0x44e4cf['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x307fc4&&_0x44e4cf['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x307fc4&&_0x44e4cf['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3a9d79='',_0x556bc5='',_0xf76049='custom'){const _0x1745cc=this['editor'],_0x7871a7=_0x1745cc['editing']['view'],_0x34fea3=_0x1745cc['plugins']['get'](xi),_0x33886d=_0x1745cc['plugins']['get'](_0x6355f1);_0x34fea3['showFakeVisualSelection']();const _0x4369b6=new Zi(),_0x3489f2=new ClipboardEvent('copy',{'clipboardData':_0x4369b6}),_0x2fc607=new _0x1fcb27(_0x4369b6),_0x3aca91=new _0x1b1d52(_0x7871a7,_0x3489f2,{'dataTransfer':_0x2fc607});_0x33886d['_forceMarkersCopy']('comment',()=>{_0x7871a7['document']['fire']('copy',_0x3aca91);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new Bi(_0x1745cc,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x2076a2=_0x2fc607['getData']('text/html');const _0x1428f5=_0x1745cc['model']['document']['selection'],_0x21d2f6=Array['from'](_0x1428f5['getRanges']());0x1===_0x21d2f6['length']&&_0x21d2f6[0x0]['isFlat']&&!_0x1428f5['getSelectedElement']()&&''!==_0x2076a2['replace'](/&nbsp;/g,'')['trim']()&&(_0x2076a2='<p>'+_0x2076a2+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0xf76049,'query':_0x3a9d79,'htmlContent':_0x2076a2,'label':_0x556bc5,'mainActionLabel':Gi[_0x1745cc['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x59f1b5,'title':Di(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Vt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x34fea3['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}_getResolvedCommandsDefinitions(){const _0x498104=new Map(),_0x11821c=ki(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x4baf2b of _0x11821c)for(const _0x35b36c of _0x4baf2b['commands'])_0x498104['set'](_0x35b36c['id'],{..._0x35b36c,'groupId':_0x4baf2b['groupId'],'groupLabel':_0x4baf2b['groupLabel']||_0x4baf2b['groupId']});return _0x498104;}_createAIAssistantUIButton(_0x26d95c){const _0x1ff665=this['editor'],_0x329ef9=_0x1ff665['commands']['get']('showAIAssistant'),_0x5507cc=new _0x26d95c(_0x1ff665['locale']);return _0x5507cc['set']({'label':Di(_0x1ff665['locale'],'AI\x20Assistant'),'icon':_0x59f1b5,'isToggleable':!0x0}),_0x5507cc['bind']('isEnabled')['to'](_0x329ef9),_0x5507cc['bind']('isOn')['to'](this['_dialog'],'id',_0x1afb8f=>'aiAssistant'===_0x1afb8f),this['listenTo'](_0x5507cc,'execute',()=>{_0x5507cc['isOn']?this['hideUI']():_0x329ef9['execute']();}),_0x5507cc;}_initView(){const _0x1a8af6=this['editor']['plugins']['get'](xi);this['_formView']=new Ji(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',()=>{_0x1a8af6['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1a8af6['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}_initAriaAiStatusChangeAnnouncements(){const {locale:_0xd7df55,ui:{ariaLiveAnnouncer:_0x57cad7}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x66121d,_0x215ea3,_0xdf0581)=>{const _0x439a3c=this['_aiAssistantController']['currentContext'];_0xdf0581?_0x57cad7['announce'](Di(_0xd7df55,'AI\x20is\x20writing')):_0x439a3c&&_0x57cad7['announce'](Di(_0xd7df55,'Generated\x20content:\x20%0',_0x439a3c),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x6ef677,_0x31d24f,_0x38bd08)=>{if(_0x38bd08){const _0x3d3676=this['_formView']['errorView']['text'];_0x57cad7['announce'](Di(_0xd7df55,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3d3676));}});}_onExecute(_0x56df7c){const _0x4ea633=this['_commandDefinitions']['get'](_0x56df7c),_0x1e3a08=this['editor'],_0x1a9bdd=_0x1e3a08['model']['document']['selection'],_0x1a655b=_0x1e3a08['commands']['get']('showAIAssistant'),_0x10faee=_0x1e3a08['plugins']['get'](xi),_0x541024=''+('_ungrouppedCommands'!==_0x4ea633['groupId']?_0x4ea633['groupLabel']+':\x20':'')+_0x4ea633['label'];if(!0x1!==_0x4ea633['requiresContent']&&_0x1a9bdd['isCollapsed']){const _0x571b2f=mt(_0x1a9bdd['getSelectedBlocks']())||_0x1e3a08['model']['schema']['getLimitElement'](_0x1a9bdd);_0x1e3a08['model']['change'](_0x1e6be0=>{_0x1e6be0['setSelection'](_0x571b2f,'in');});}_0x10faee['showFakeVisualSelection'](),_0x1a655b['execute'](_0x4ea633['prompt'],_0x541024,'command:'+_0x56df7c);}_populateMenuBarMenu(_0x17d081,_0x42a0d9,_0x5cf087,_0xbc39f){const _0x148d68=this['editor'],_0x1627ad=_0x148d68['locale'],_0x3a9112=new _0x14eb7a(_0x1627ad),_0x261025=is(_0x148d68,_0x5cf087)['filter'](_0x198c71=>_0x198c71['commands']['length']);0x1===_0x261025['length']?this['_getMenuBarGroupButtons']({'command':_0x17d081,'commands':_0x261025[0x0]['commands'],'parentMenuView':_0x42a0d9,'onExecute':_0xbc39f})['forEach'](_0xdab92=>_0x3a9112['items']['add'](_0xdab92)):_0x261025['forEach'](({groupId:_0x489ac2,groupLabel:_0x5ec660,commands:_0x3adbc6})=>{const _0x3f7219=new te(_0x1627ad,_0x42a0d9),_0x37d3db=new _0x1021d4(_0x1627ad),_0x42fc78=new _0x14eb7a(_0x1627ad),_0x478306=this['_getMenuBarGroupButtons']({'command':_0x17d081,'commands':_0x3adbc6,'parentMenuView':_0x37d3db,'onExecute':_0xbc39f});_0x37d3db['buttonView']['set']({'label':_0x5ec660||_0x489ac2}),_0x37d3db['delegate']('execute')['to'](_0x42a0d9),_0x42fc78['items']['addMany'](_0x478306),_0x37d3db['panelView']['children']['add'](_0x42fc78),_0x3f7219['children']['add'](_0x37d3db),_0x3a9112['items']['add'](_0x3f7219);}),_0x42a0d9['panelView']['children']['add'](_0x3a9112);}_getMenuBarGroupButtons({command:_0x411e75,commands:_0x4b0a49,parentMenuView:_0x5036a1,onExecute:_0x540759}){const _0xc9a926=this['editor'],_0x1ea0c4=_0xc9a926['locale'];return is(_0xc9a926,_0x4b0a49)['map'](_0x3f94e9=>{const _0x276f31=new te(_0x1ea0c4,_0x5036a1),_0x4e75f7=new Zt(_0x1ea0c4);return _0x4e75f7['set']({'label':_0x3f94e9['label']}),_0x4e75f7['delegate']('execute')['to'](_0x5036a1),_0x4e75f7['on']('execute',()=>_0x540759(_0x3f94e9['id'])),_0x4e75f7['bind']('isEnabled')['to'](_0x411e75,'enabledCommandsIds',_0x1956af=>_0x1956af['includes'](_0x3f94e9['id'])),_0x276f31['children']['add'](_0x4e75f7),_0x276f31;});}};function es(_0x4fc6dd,_0x304a9a){return void 0x0!==_0x4fc6dd['order']&&void 0x0===_0x304a9a['order']?0x1:void 0x0===_0x4fc6dd['order']&&void 0x0!==_0x304a9a['order']?-0x1:void 0x0!==_0x4fc6dd['order']&&void 0x0!==_0x304a9a['order']?_0x4fc6dd['order']-_0x304a9a['order']:0x0;}function is(_0x114844,_0x23dd36){_0x23dd36['sort'](es);const _0x3d2ad1={},_0x2e0095=[];for(const _0x3332f6 of _0x23dd36)if(void 0x0!==_0x3332f6['order']){if(_0x3332f6['order']in _0x3d2ad1)throw new ct('ai-commands-config-order-collision',_0x114844,{'conflictingDefinitions':[_0x3332f6,_0x3d2ad1[_0x3332f6['order']]]});_0x3d2ad1[_0x3332f6['order']]=_0x3332f6,_0x2e0095['splice'](_0x3332f6['order'],0x0,_0x3332f6);}else _0x2e0095['push'](_0x3332f6);return _0x2e0095;}var ss=class extends _0x622916{static get requires(){return[ts,xi];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2ba2ee){super(_0x2ba2ee);const _0x599a95=_0x2ba2ee['config'],_0xaf74e0=_0x2ba2ee['locale'];_0x599a95['define']('ai.assistant.preserveComments',!0x0),_0x599a95['define']('ai.assistant.commands',ns(_0xaf74e0)),_0x599a95['define']('ai.assistant.extraCommandGroups',[]),_0x599a95['define']('ai.assistant.removeCommands',[]);let _0x4437be=ki(_0x599a95['get']('ai.assistant.commands'),_0xaf74e0);const _0x393b5d=_0x599a95['get']('ai.assistant.extraCommandGroups'),_0xc712dd=_0x599a95['get']('ai.assistant.removeCommands');_0x393b5d['forEach'](_0x1d852f=>{const _0x1ba354=_0x4437be['find'](_0x51c901=>_0x51c901['groupId']===_0x1d852f['groupId']);_0x1ba354?_0x1ba354['commands']=_0x1ba354['commands']['concat'](_0x1d852f['commands']):_0x4437be['push'](_0x1d852f);}),_0x4437be=_0x4437be['filter'](_0x25d2c3=>!_0xc712dd['includes'](_0x25d2c3['groupId'])),_0x4437be['forEach'](_0x1bd396=>{_0x1bd396['commands']=_0x1bd396['commands']['filter'](_0xd3be7d=>!_0xc712dd['includes'](_0xd3be7d['id']));}),_0x599a95['set']('ai.assistant.commands',_0x4437be);}};function ns(_0x1d5d19){return[{'groupId':'editOrReview','groupLabel':Di(_0x1d5d19,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Di(_0x1d5d19,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Di(_0x1d5d19,'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':Di(_0x1d5d19,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Di(_0x1d5d19,'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':Di(_0x1d5d19,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Di(_0x1d5d19,'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':Di(_0x1d5d19,'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':Di(_0x1d5d19,'Change\x20tone'),'commands':[{'id':'professional','label':Di(_0x1d5d19,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Di(_0x1d5d19,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Di(_0x1d5d19,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Di(_0x1d5d19,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Di(_0x1d5d19,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Di(_0x1d5d19,'Change\x20style'),'commands':[{'id':'business','label':Di(_0x1d5d19,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Di(_0x1d5d19,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Di(_0x1d5d19,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Di(_0x1d5d19,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Di(_0x1d5d19,'Translate'),'commands':[{'id':'translateEnglish','label':Di(_0x1d5d19,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Di(_0x1d5d19,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Di(_0x1d5d19,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Di(_0x1d5d19,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Di(_0x1d5d19,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Di(_0x1d5d19,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Di(_0x1d5d19,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Di(_0x1d5d19,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}var rs=class extends _0x622916{abortController;static get requires(){return[Li];}constructor(_0x187d9f){super(_0x187d9f),this['abortController']=new AbortController();}init(){this['editor']['plugins']['get'](Li)['textAdapter']=this;}abort(){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async makeRequest(_0x511660){return this['sendRequest'](_0x511660)['catch'](_0x84b449=>{if(_0x84b449 instanceof Pi)return Promise['reject'](_0x84b449);if('AbortError'==_0x84b449['name'])return Promise['resolve']();throw console['error'](_0x84b449),new ct('aitextadapter-send-request-failed',null);});}async _prepareRequestHeaders(_0x410bfe,_0x4bd1b9){const _0x3e0ead=this['editor']['locale'],_0x17dfef={'Content-Type':'application/json'};if('object'==typeof _0x410bfe)Object['assign'](_0x17dfef,_0x410bfe);else{if(_0x410bfe)try{const _0x5a58f1=await _0x410bfe(_0x4bd1b9);Object['assign'](_0x17dfef,_0x5a58f1);}catch{return Promise['reject'](new Pi(Di(_0x3e0ead,'AI_ERROR_GET_HEADERS')));}}return _0x17dfef;}async _prepareRequestParameters(_0x31ff3b,_0x135bed){const _0x4732c6=this['editor']['locale'];if('object'==typeof _0x31ff3b)return _0x31ff3b;try{return await _0x31ff3b(_0x135bed);}catch{return Promise['reject'](new Pi(Di(_0x4732c6,'AI_ERROR_GET_PARAMETERS')));}}},os=class extends rs{['_apiUrl'];_requestHeaders;_requestParameters;static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x7e265a){super(_0x7e265a),_0x7e265a['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x7e265a['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x7e265a['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x7e265a['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x7e265a['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x7e265a['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async sendRequest({query:_0xbcb2b4,context:_0x12d72e,onData:_0x1ab670,actionId:_0x4588a7}){const _0x4bedef=this['editor']['locale'],_0x2997ca=await this['prepareMessages'](_0xbcb2b4,_0x12d72e,_0x4588a7),_0x11d985=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4588a7),_0x42b278=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4588a7),_0x44f6f6={'messages':_0x2997ca,..._0x42b278},_0x2686dc={'method':'POST','headers':_0x11d985,'body':JSON['stringify'](_0x44f6f6),'signal':this['abortController']['signal']},_0x1d2846=await fetch(this['_apiUrl'],_0x2686dc);if(_0x1d2846['ok'])return _0x42b278['stream']?await this['_readStreamableResponse'](_0x1d2846,_0x1ab670):await this['_readStaticResponse'](_0x1d2846,_0x1ab670),Promise['resolve']();{const _0x33ce59=await _0x1d2846['text']();return _0x33ce59['includes']('context_length_exceeded')?Promise['reject'](new Pi(Di(_0x4bedef,'AI_ERROR_CONTEXT_LENGTH'))):_0x33ce59['includes']('Moderation')?Promise['reject'](new Pi(Di(_0x4bedef,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x33ce59));}}async['prepareMessages'](_0x2ed1b3,_0x276f8e,_0x187940){let _0x228395,_0x4d669b;return _0x276f8e?(_0x228395='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.',_0x4d669b='Instruction:\x0a'+_0x2ed1b3+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x276f8e):(_0x228395='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.',_0x4d669b=_0x2ed1b3),[{'role':'system','content':_0x228395},{'role':'user','content':_0x4d669b}];}async _readStreamableResponse(_0x28a17d,_0x220cbe){const _0x48c8e9=_0x28a17d['body']['getReader'](),_0x5baf24=new TextDecoder();let _0x3aa9ed='',_0x103ff7='',_0x5c6af5='',_0x4b1964=!0x1;for(;!_0x4b1964;){const {done:_0x83346f,value:_0x5a5ee2}=await _0x48c8e9['read'](),_0x5841d3=_0x3aa9ed+_0x5baf24['decode'](_0x5a5ee2);let _0x2f7922;_0x4b1964=_0x83346f;try{_0x2f7922=this['_cleanUpData'](_0x5841d3),_0x3aa9ed='';}catch{_0x3aa9ed=_0x5841d3;continue;}_0x103ff7+=_0x2f7922,!_0x4b1964&&this['_isBufferIncomplete'](_0x103ff7)||_0x103ff7&&(_0x5c6af5+=_0x103ff7,_0x103ff7='',_0x220cbe(_0x5c6af5));}return Promise['resolve']();}async _readStaticResponse(_0x4dc338,_0x46f849){return _0x46f849((await _0x4dc338['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}_isBufferIncomplete(_0x9a53b0){const _0x458344=_0x9a53b0['split']('<')['length']!==_0x9a53b0['split']('>')['length'],_0xfa86e0=_0x9a53b0['length']<0x1e;return _0x458344&&_0xfa86e0;}_cleanUpData(_0x2b958f){return _0x2b958f['split'](/\n(?![^{]*\})/g)['map'](_0x172d40=>_0x172d40['replace']('data:\x20',''))['filter'](_0x4bed1c=>_0x4bed1c&&_0x4bed1c['length']>0x0&&'[DONE]'!==_0x4bed1c)['map'](_0x44e0e4=>{const {choices:_0xb5c825}=JSON['parse'](_0x44e0e4);if(_0xb5c825[0x0]?.['delta']?.['content'])return _0xb5c825[0x0]['delta']['content'];})['filter'](_0x54e123=>_0x54e123)['join']('');}},as=class extends rs{static get['pluginName'](){return'AWSTextAdapter';}init(){super['init'](),St('ai-aws-adapter-not-supported');}async sendRequest(_0x5ac51e){throw bt('ai-aws-adapter-not-supported'),new Pi(Di(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}},hs=class extends Mt{constructor(_0xba2d52,_0x52a175={}){super(_0xba2d52),this['isToggleable']=!0x0,this['set']('side',_0x52a175['side']||'top');const _0xd729b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...vt(_0x52a175['class']||[]),_0xd729b['to']('side',_0x50ba2e=>'ck-tab-button_'+_0x50ba2e),_0xd729b['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}},cs=class extends _0x56a514{['children'];constructor(_0x786fd,_0xf29f83={}){super(_0x786fd);const _0x13e12c=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...vt(_0xf29f83['class']||[]),_0x13e12c['to']('class'),_0x13e12c['if']('isVisible','ck-hidden',_0x52b618=>!_0x52b618)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}},ls=class extends _0x56a514{buttonViews=this['createCollection']();['panelViews']=this['createCollection']();_tabs=new Map();constructor(_0x2fab01,_0xd6c61={}){super(_0x2fab01),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0xd6c61['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0xd6c61['collapsible']||!0x1),this['set']('isCollapsed',!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'isCollapsed',(_0x44a734,_0x434e74)=>_0x44a734&&!_0x434e74);const _0x5dc6b2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...vt(_0xd6c61['class']||[]),_0x5dc6b2['to']('side',_0x534e87=>'ck-tabs_'+_0x534e87),_0x5dc6b2['to']('class'),_0x5dc6b2['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x5dc6b2['if']('isCollapsed','ck-ai-tabs_collapsed')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x5dc6b2['to']('side',_0x353db4=>'ck-tabs__buttons-container_'+_0x353db4)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x5dc6b2['to']('side',_0x16241d=>'ck-tabs__panels-container_'+_0x16241d)]},'children':this['panelViews']},...vt(_0xd6c61['children']||[])]});}getTabIds(){return[...this['_tabs']['keys']()];}getTab(_0x553ef3){const _0x2fd200=this['_tabs']['get'](_0x553ef3);return _0x2fd200||null;}['addTab'](_0x1d6687){const _0x2e0da2=this['_setupButton']({'id':_0x1d6687['id'],'label':_0x1d6687['buttonLabel'],'icon':_0x1d6687['buttonIcon'],'order':_0x1d6687['order']}),_0x228bf8=new cs(this['locale']);return _0x228bf8['render'](),_0x1d6687['content']&&_0x228bf8['children']['add'](_0x1d6687['content']),this['panelViews']['add'](_0x228bf8),this['_tabs']['set'](_0x1d6687['id'],{'button':_0x2e0da2,'panel':_0x228bf8,'order':void 0x0!==_0x1d6687['order']?_0x1d6687['order']:null}),this['fire']('addTab:'+_0x1d6687['id'],{'id':_0x1d6687['id'],'button':_0x2e0da2,'panel':_0x228bf8}),null===this['activeTab']?this['activateTab'](_0x1d6687['id']):this['_hidePanel'](_0x1d6687['id']),{'button':_0x2e0da2,'panel':_0x228bf8};}activateTab(_0x3320f6){if(null!==_0x3320f6&&!this['getTab'](_0x3320f6))throw new ct('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3320f6});if(this['isCollapsed']=!0x1,this['activeTab']===_0x3320f6)return;const _0x127c30=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x3320f6,_0x3320f6&&this['_showPanel'](_0x3320f6),this['fire']('activateTab:'+_0x3320f6,{'newTab':_0x3320f6,'oldTab':_0x127c30});}toggleTabPanel(_0x56c8f3){this['activeTab']===_0x56c8f3?this['collapsible']&&(this['isCollapsed']=!this['isCollapsed']):this['activateTab'](_0x56c8f3);}['showTab'](_0x4f2bdd){if(!this['getTab'](_0x4f2bdd))throw new ct('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4f2bdd});this['_showPanel'](_0x4f2bdd),this['_showButton'](_0x4f2bdd),this['fire']('show:'+_0x4f2bdd,_0x4f2bdd);}['hideTab'](_0xc0f9ae){if(!this['getTab'](_0xc0f9ae))throw new ct('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xc0f9ae});const _0x2d4cc6=this['activeTab'];this['_hidePanel'](_0xc0f9ae),this['_hideButton'](_0xc0f9ae);const _0x96b789=this['getTabIds']();_0x2d4cc6===_0xc0f9ae&&_0x96b789['length']>0x1&&this['activateTab'](_0x96b789['find'](_0x751e6f=>_0x751e6f!==_0xc0f9ae)),this['fire']('hide:'+_0xc0f9ae,_0xc0f9ae);}_getPanel(_0x3f4c90){const _0x1f9878=this['_tabs']['get'](_0x3f4c90);return _0x1f9878?_0x1f9878['panel']:null;}['_showPanel'](_0x324d0b){null!==this['activeTab']&&this['activeTab']!==_0x324d0b||this['_getPanel'](_0x324d0b)['show']();}['_hidePanel'](_0xe13c4f){const _0x346ec8=this['_getPanel'](_0xe13c4f);_0x346ec8['isVisible']&&(this['activeTab']===_0xe13c4f&&(this['activeTab']=null),_0x346ec8['hide']());}_getButton(_0x32f3ca){const _0x5b321a=this['_tabs']['get'](_0x32f3ca);return _0x5b321a?_0x5b321a['button']:null;}_showButton(_0x9e4e0a){this['_getButton'](_0x9e4e0a)['show']();}_hideButton(_0x2ae12c){this['_getButton'](_0x2ae12c)['hide']();}_setupButton(_0x2f3ef3){const _0x59f0f9=new hs(this['locale'],{'side':this['side']}),_0x483d02=this['buttonViews'];if(_0x59f0f9['set']({'label':_0x2f3ef3['label'],'icon':_0x2f3ef3['icon'],'tooltip':!0x0,'withText':!0x0}),_0x59f0f9['bind']('isOn')['to'](this,'activeTab',this,'isCollapsed',(_0x1f697a,_0x4fd928)=>_0x1f697a===_0x2f3ef3['id']&&!_0x4fd928),_0x59f0f9['bind']('side')['to'](this,'side'),_0x2f3ef3['order']){const _0x54ea1b=[...this['_tabs']]['reduce']((_0x180cdf,_0x1ab333)=>{const _0xa31bf=_0x1ab333[0x0],{order:_0x243e76}=_0x1ab333[0x1];return!_0x243e76||_0x243e76>_0x2f3ef3['order']?_0x180cdf:_0x243e76>=_0x180cdf['order']?{'id':_0xa31bf,'order':_0x243e76}:_0x180cdf;},{'id':'','order':0x0}),_0x5a5639=_0x483d02['getIndex'](this['_getButton'](_0x54ea1b['id']));_0x483d02['add'](_0x59f0f9,_0x5a5639+0x1);}else _0x483d02['add'](_0x59f0f9);return _0x59f0f9['on']('execute',()=>{this['toggleTabPanel'](_0x2f3ef3['id']);}),_0x59f0f9;}};const us=['overlay','sidebar','custom'],ds=['left','right'];var _s=class extends ls{constructor(_0x303c6f,_0x35f570={}){super(_0x303c6f,_0x35f570),this['set']('type',_0x35f570['type']||'sidebar'),this['set']('side',_0x35f570['side']||'right'),this['set']('isVisible',_0x35f570['visibleByDefault']??!0x0);const _0x49910f=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x49910f['if']('type','ck-ai-tabs__overlay',_0xb01292=>'overlay'===_0xb01292),_0x49910f['if']('type','ck-ai-tabs__sidebar',_0x15ae8c=>'sidebar'===_0x15ae8c),_0x49910f['if']('isVisible','ck-hidden',_0x1e307f=>!_0x1e307f)]}}),this['buttonViews']['on']('add',(_0x1ddd99,_0xe328a3)=>{_0xe328a3['set']('withText',!0x1);});}},gs=class extends _0x898608{['view'];container=null;showResizeButton=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2cbe50){if(super(_0x2cbe50),!this['context']['config']['get']('ai.container'))throw new ct('ai-tabs-configuration-not-found');this['context']['config']['define']('ai.container.visibleByDefault',!0x0),this['context']['config']['define']('ai.container.collapsible',!0x1);const _0x5ee929=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x5ee929['showResizeButton']&&(this['showResizeButton']=_0x5ee929['showResizeButton']),'sidebar'!==_0x5ee929['type']&&'overlay'!==_0x5ee929['type']||_0x5ee929['side']&&(this['side']=_0x5ee929['side']),'sidebar'===_0x5ee929['type']){if(this['container']=_0x5ee929['element'],this['set']('type','sidebar'),!this['container'])throw new ct('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x5ee929['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new _s(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':_0x5ee929['visibleByDefault'],'collapsible':_0x5ee929['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 _0x24cd6f&&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(_0x4d7c90){if(_0x4d7c90&&this['type']!==_0x4d7c90){if(!us['includes'](_0x4d7c90))throw new ct('ai-tabs-unsupported-ui-type');this['type']=_0x4d7c90;}}switchSide(_0x22b23b){if(_0x22b23b&&this['side']!==_0x22b23b){if(!ds['includes'](_0x22b23b))throw new ct('ai-tabs-unsupported-ui-side');this['side']=_0x22b23b;}}destroy(){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}};function As(_0x4eb4f9){return{..._0x4eb4f9,'type':'context'};}var Is=class extends _0x898608{['_apiUrl'];get['_apiUrlV11'](){return this['_apiUrl']['replace'](/\/v1$/,'/v1.1');}_token;['_decoder'];static get requires(){return[_0x46601a];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x229ea9){if(super(_0x229ea9),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 ct('ai-service-url-invalid-version',this,{'serviceUrl':this['_apiUrl']});this['_token']=null,this['_decoder']=new TextDecoder();}init(){const _0x508468=this['context']['plugins']['get'](_0x46601a);if(!_0x508468['token'])throw new ct('ai-missing-token',this);this['_token']=_0x508468['token'];}_getExtraHttpHeaders(){const _0x5d86f4=this['context']['config']['get']('ai.extraHttpHeaders'),_0x553dc5='function'==typeof _0x5d86f4?_0x5d86f4():_0x5d86f4;if(Array['isArray'](_0x553dc5)&&_0x553dc5['length'])return Object['fromEntries'](_0x553dc5['map'](({domain:_0x3bf43,headers:_0x3540f8})=>[_0x3bf43,_0x3540f8]));}startConversation(_0x4e0544,_0x15ade5){const _0x33e21e=this['_sendApiRequest']('/conversations','POST',{'id':_0x4e0544,'group':_0x15ade5});return{'getConversation':async()=>(await _0x33e21e['request'])['json'](),'abortController':_0x33e21e['abortController']};}queryAssistant({message:_0x33f89a,conversationId:_0x2596f9,parts:_0xa61e67,capabilities:_0x5ba9bd,model:_0x480c07,attributes:_0x13323c}){const _0x5e400e=this['_getExtraHttpHeaders'](),_0x168767={..._0x33f89a&&{'prompt':_0x33f89a},'content':_0xa61e67,'model':_0x480c07,..._0x5ba9bd&&{'capabilities':_0x5ba9bd},..._0x13323c&&{'attributes':_0x13323c},..._0x5e400e&&{'extraHttpHeaders':_0x5e400e}},_0xd9880f=this['_sendApiRequest']('/conversations/'+_0x2596f9+'/messages','POST',_0x168767,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x242fc9=(await _0xd9880f['request'])['body'];return this['_getStreamReader'](_0x242fc9);},'abortController':_0xd9880f['abortController']};}executeCustomAction({content:_0x15d659,message:_0x25c80c,model:_0x57605d,outputFormat:_0x6a6e91,contexts:_0x142c9a}){const _0x24b300={'content':[{'type':'text','content':_0x15d659}],..._0x25c80c&&{'prompt':_0x25c80c},'model':_0x57605d,'outputFormat':_0x6a6e91,...ps(_0x142c9a)},_0x5d047b=this['_sendApiRequest']('/actions/custom/calls','POST',_0x24b300);return{'getStream':async()=>{const _0x43895f=(await _0x5d047b['request'])['body'];return this['_getStreamReader'](_0x43895f);},'abortController':_0x5d047b['abortController']};}executeAction({actionName:_0x275347,content:_0x5c8c63,args:_0xeb1c25,contexts:_0x2775ae}){const _0xc28de8={'content':[{'type':'text','content':_0x5c8c63}],'args':_0xeb1c25,...ps(_0x2775ae)},_0x5609e4=this['_sendApiRequest']('/actions/system/'+_0x275347+'/calls','POST',_0xc28de8);return{'getStream':async()=>{const _0x4cb0da=(await _0x5609e4['request'])['body'];return this['_getStreamReader'](_0x4cb0da);},'abortController':_0x5609e4['abortController']};}['uploadFile'](_0x3e055a,_0x233a0c,_0x1454dc){const _0x151403=new FormData();_0x151403['append']('file',_0x233a0c,_0x233a0c['name']),_0x1454dc&&_0x151403['append']('attributes',JSON['stringify'](_0x1454dc));const _0x2ca5eb=this['_sendApiRequest']('/conversations/'+_0x3e055a+'/files','POST',_0x151403);return{'getId':async()=>(await _0x2ca5eb['request'])['json'](),'abortController':_0x2ca5eb['abortController']};}uploadDocuments(_0x38d68c,_0x4c1391){const _0x55a90e={'documents':_0x4c1391['map'](_0x139169=>({'content':_0x139169['content'],'attributes':{'version':_0x139169['version'],'sessionId':_0x139169['sessionId'],'channelId':_0x139169['channelId'],'rootName':_0x139169['rootName'],'selections':_0x139169['selections']},...void 0x0!==_0x139169['name']?{'name':_0x139169['name']}:{},...void 0x0!==_0x139169['description']?{'description':_0x139169['description']}:{}}))},_0x347348=this['_sendApiRequest']('/conversations/'+_0x38d68c+'/documents/batch','POST',_0x55a90e);return{'getIds':async()=>(await _0x347348['request'])['json'](),'abortController':_0x347348['abortController']};}fetchDocuments(_0x1cc8d6,_0x52ebcf){const _0x5a7c6a=new URLSearchParams();_0x5a7c6a['append']('documentIds',_0x52ebcf['join'](','));const _0x2412ff=this['_sendApiRequest']('/conversations/'+_0x1cc8d6+'/documents/batch?'+_0x5a7c6a['toString'](),'GET');return{'getDocuments':async()=>(await _0x2412ff['request'])['json'](),'abortController':_0x2412ff['abortController']};}fetchConversations(_0x50db09,_0x53f7f2={}){const _0x4c292a=new URLSearchParams();_0x4c292a['append']('group',_0x50db09),_0x4c292a['append']('excludeEmpty',!0x1!==_0x53f7f2['excludeEmpty']?'true':'false'),_0x4c292a['append']('limit',_0x53f7f2['limit']?_0x53f7f2['limit']['toString']():0x64['toString']()),_0x4c292a['append']('sortBy',_0x53f7f2['sortBy']?_0x53f7f2['sortBy']:'createdAt'),_0x4c292a['append']('order',_0x53f7f2['order']?_0x53f7f2['order']:'desc');const _0x55bcc9=this['_sendApiRequest']('/conversations?'+_0x4c292a['toString'](),'GET');return{'getConversations':async()=>(await(await _0x55bcc9['request'])['json']())['items'],'abortController':_0x55bcc9['abortController']};}deleteConversation(_0x241be0){const _0xccd1d3=this['_sendApiRequest']('/conversations/'+_0x241be0,'DELETE');return{'execute':async()=>{await _0xccd1d3['request'];},'abortController':_0xccd1d3['abortController']};}updateConversation(_0x1bbb4d,_0x1331af){const _0x36abac=this['_sendApiRequest']('/conversations/'+_0x1bbb4d,'PATCH',_0x1331af);return{'getResult':async()=>(await _0x36abac['request'],_0x1331af),'abortController':_0x36abac['abortController']};}fetchConversation(_0x48a966){const _0x1c42da=this['_sendApiRequest']('/conversations/'+_0x48a966,'GET');return{'getConversation':async()=>(await _0x1c42da['request'])['json'](),'abortController':_0x1c42da['abortController']};}fetchConversationMessages(_0x36db98){const _0x133da4=this['_sendApiRequest']('/conversations/'+_0x36db98+'/messages','GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getMessages':async()=>(await(await _0x133da4['request'])['json']())['items'],'abortController':_0x133da4['abortController']};}['uploadUrl'](_0x2aa50e,_0x2dad3f,_0x3dffa9){const _0x1af3b9=this['_sendApiRequest']('/conversations/'+_0x2aa50e+'/web-resources','POST',{'url':_0x2dad3f,'attributes':_0x3dffa9});return{'getId':async()=>(await _0x1af3b9['request'])['json'](),'abortController':_0x1af3b9['abortController']};}getModels(_0x24cb50='en'){const _0xa6189c=new URLSearchParams();_0xa6189c['append']('language',_0x24cb50);const _0x5349f4='/models/1?'+_0xa6189c['toString'](),_0x107717=this['_sendApiRequest'](_0x5349f4,'GET');return{'list':async()=>await(await _0x107717['request'])['json'](),'abortController':_0x107717['abortController']};}listContexts(_0x2de156={}){const _0xa5d6b3=new URLSearchParams();_0xa5d6b3['append']('limit',_0x2de156['limit']?_0x2de156['limit']['toString']():0x64['toString']()),_0x2de156['cursor']&&_0xa5d6b3['append']('cursor',_0x2de156['cursor']),_0x2de156['order']&&_0xa5d6b3['append']('order',_0x2de156['order']);const _0xc84ac8=this['_sendApiRequest']('/contexts?'+_0xa5d6b3['toString'](),'GET');return{'getContexts':async()=>(await(await _0xc84ac8['request'])['json']())['items'],'abortController':_0xc84ac8['abortController']};}deleteFile(_0x33b09d,_0x43f438){const _0x30e115=this['_sendApiRequest']('/conversations/'+_0x33b09d+'/files/'+_0x43f438,'DELETE');return{'execute':async()=>{await _0x30e115['request'];},'abortController':_0x30e115['abortController']};}deleteDocument(_0x55d5ba,_0x47f52e){const _0x33f80e=this['_sendApiRequest']('/conversations/'+_0x55d5ba+'/documents/'+_0x47f52e,'DELETE');return{'execute':async()=>{await _0x33f80e['request'];},'abortController':_0x33f80e['abortController']};}deleteWebResource(_0x25d536,_0x10ca05){const _0x26c4e6=this['_sendApiRequest']('/conversations/'+_0x25d536+'/web-resources/'+_0x10ca05,'DELETE');return{'execute':async()=>{await _0x26c4e6['request'];},'abortController':_0x26c4e6['abortController']};}cancelStream(_0x2f0c5f,_0x3403f8){const _0x259bf2=this['_sendApiRequest']('/conversations/'+_0x2f0c5f+'/messages/'+_0x3403f8+'/stream','DELETE',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'execute':async()=>{await _0x259bf2['request'];},'abortController':_0x259bf2['abortController']};}resumeStream(_0x36be45,_0xe098b4,_0x198747='0-0'){const _0x27363f=new URLSearchParams({'lastEventId':_0x198747}),_0x1271e8=this['_sendApiRequest']('/conversations/'+_0x36be45+'/messages/'+_0xe098b4+'/stream?'+_0x27363f['toString'](),'GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x39f62e=await _0x1271e8['request'];return this['_getStreamReader'](_0x39f62e['body']);},'abortController':_0x1271e8['abortController']};}callSystemReview({reviewName:_0x17a793,content:_0x46771a,args:_0x2d0271,contexts:_0x4f4cd9}){const _0x347cc2=this['_sendApiRequest']('/reviews/system/'+_0x17a793+'/calls','POST',{'content':[{'type':'text','content':_0x46771a}],'args':_0x2d0271,...ps(_0x4f4cd9)});return{'getStream':async()=>{const _0x3ac0b1=(await _0x347cc2['request'])['body'];return this['_getStreamReader'](_0x3ac0b1);},'abortController':_0x347cc2['abortController']};}processDocument({content:_0x1287e0,prompt:_0x29271a,model:_0x4935ed,capabilities:_0x37fc40,contexts:_0x255f47}){const _0x4570fb=this['_getExtraHttpHeaders'](),_0x2fd54a=this['_sendApiRequest']('/documents/process','POST',{'content':_0x1287e0,'prompt':_0x29271a,'model':_0x4935ed,..._0x37fc40&&{'capabilities':_0x37fc40},...ps(_0x255f47),..._0x4570fb&&{'extraHttpHeaders':_0x4570fb}});return{'getResult':async()=>(await _0x2fd54a['request'])['json'](),'abortController':_0x2fd54a['abortController']};}callCustomReview({content:_0x12893d,prompt:_0xdbba5c,model:_0x1d8e01,contexts:_0x2ab678}){const _0x1c1810=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x12893d}],..._0xdbba5c&&{'prompt':_0xdbba5c},'model':_0x1d8e01,...ps(_0x2ab678)});return{'getStream':async()=>{const _0x19a278=(await _0x1c1810['request'])['body'];return this['_getStreamReader'](_0x19a278);},'abortController':_0x1c1810['abortController']};}upsertAIChatRating(_0x4d9481,_0xef8581,_0x5467df){const _0x5460c2=this['_sendApiRequest']('/conversations/'+_0x4d9481+'/messages/'+_0xef8581+'/ratings','PUT',{'positiveCount':_0x5467df['positiveCount'],'totalCount':_0x5467df['totalCount'],'modificationId':_0x5467df['modificationId']});return{'execute':async()=>{await _0x5460c2['request'];},'abortController':_0x5460c2['abortController']};}upsertAIActionRating(_0x226a7d,_0x302948,_0x3abe64){const _0x589e46=this['_sendApiRequest']('/actions/system/'+_0x226a7d+'/calls/'+_0x302948+'/ratings','PUT',{'positiveCount':_0x3abe64['positiveCount'],'totalCount':_0x3abe64['totalCount']});return{'execute':async()=>{await _0x589e46['request'];},'abortController':_0x589e46['abortController']};}upsertCustomAIActionRating(_0xa876c6,_0x541bae){const _0x3b6f42=this['_sendApiRequest']('/actions/custom/calls/'+_0xa876c6+'/ratings','PUT',{'positiveCount':_0x541bae['positiveCount'],'totalCount':_0x541bae['totalCount']});return{'execute':async()=>{await _0x3b6f42['request'];},'abortController':_0x3b6f42['abortController']};}upsertAIReviewRating(_0xb27856,_0x31b7fc,_0x475f50,_0x3dce56){const _0x3a20dd=this['_sendApiRequest']('/reviews/system/'+_0xb27856+'/calls/'+_0x31b7fc+'/ratings','PUT',{'positiveCount':_0x475f50['positiveCount'],'totalCount':_0x475f50['totalCount'],'dataId':_0x3dce56});return{'execute':async()=>{await _0x3a20dd['request'];},'abortController':_0x3a20dd['abortController']};}upsertCustomAIReviewRating(_0x3809b8,_0x275fb1,_0x347db0){const _0x24d730=this['_sendApiRequest']('/reviews/custom/calls/'+_0x3809b8+'/ratings','PUT',{'positiveCount':_0x275fb1['positiveCount'],'totalCount':_0x275fb1['totalCount'],'dataId':_0x347db0});return{'execute':async()=>{await _0x24d730['request'];},'abortController':_0x24d730['abortController']};}_sendApiRequest(_0x54150c,_0x3f0661,_0x24b12e,_0x25acad={}){const {apiUrl:_0x3f30c2=this['_apiUrl']}=_0x25acad,_0xefd31c=new AbortController(),_0x1d95bd=_0x24b12e instanceof FormData,_0x295487={'Authorization':'Bearer\x20'+this['_token']?.['value'],'X-Editor-Version':yt};_0x24b12e&&!_0x1d95bd&&(_0x295487['Content-Type']='application/json');const _0x3b8c69={'method':_0x3f0661,'headers':_0x295487,'signal':_0xefd31c['signal']};return _0x24b12e&&(_0x3b8c69['body']=_0x1d95bd?_0x24b12e:JSON['stringify'](_0x24b12e)),{'request':fetch(''+_0x3f30c2+_0x54150c,_0x3b8c69)['catch'](_0xddc4f9=>{this['_handleError'](_0xddc4f9);})['then'](_0x2f7a0c=>_0x2f7a0c['ok']?_0x2f7a0c:_0x2f7a0c['json']()['then'](_0x57bbc7=>{throw{'url':_0x3f30c2,'path':_0x54150c,'method':_0x3f0661,'body':_0x24b12e,'status':(_0x2f7a0c||{})['status'],'statusText':(_0x2f7a0c||{})['statusText'],'code':_0x57bbc7['code'],'message':_0x57bbc7['message'],'traceId':_0x57bbc7['traceId'],'data':_0x57bbc7['data']};})),'abortController':_0xefd31c};}async *_getStreamReader(_0x2473d1){const _0x2461f0=[],_0x488396=_0x2473d1['getReader'](),_0x18cf6e=_0x1314f1({'onError':_0x202308=>{this['_handleError'](_0x202308);},'onEvent':_0x4247d1=>{_0x4247d1['data']=JSON['parse'](_0x4247d1['data']),_0x2461f0['push'](_0x4247d1);}});try{let _0x2b6913=!0x1;for(;!_0x2b6913;){const {done:_0x2ca7e2,value:_0x2267a8}=await _0x488396['read']();_0x2ca7e2&&(_0x2b6913=!0x0),_0x18cf6e['feed'](this['_decoder']['decode'](_0x2267a8,{'stream':!0x0})),yield*_0x2461f0,_0x2461f0['length']=0x0;}}catch(_0x486948){this['_handleError'](_0x486948);}finally{_0x488396['releaseLock'](),_0x18cf6e['reset']();}}['_handleError'](_0x352fb5){if(_0x352fb5 instanceof ct)throw _0x352fb5;if(_0x352fb5 instanceof Error&&'AbortError'===_0x352fb5['name'])throw new ct('ai-request-aborted',this,{'originalError':_0x352fb5});throw new ct('ai-request-failed',this,{'originalError':_0x352fb5});}};function ps(_0x31a936){return _0x31a936?.['length']?{'contexts':_0x31a936['map'](As)}:{};}function Es(_0x3e70c0,_0x1f686b,_0x1b6940){const t=_0x3e70c0['t'];switch(_0x1f686b){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'},_0x1b6940);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.'},_0x1b6940);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.'},_0x1b6940);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_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.'},_0x1b6940);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'},_0x1b6940);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x1b6940);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'},_0x1b6940);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.'},_0x1b6940);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.'},_0x1b6940);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.'},_0x1b6940);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.'},_0x1b6940);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'},_0x1b6940);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.'},_0x1b6940);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.'});default:return _0x1f686b;}}const ms=/* #__PURE__ -- @preserve */
25
+ dt();var Ts=class extends ms{_connector;['_config'];['_locale'];_modelList=[];_modelsRequest=null;constructor({connector:_0x790b0a,config:_0x295374,locale:_0x1e0cc9}){super(),this['_connector']=_0x790b0a,this['_config']=_0x295374,this['_locale']=_0x1e0cc9;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get _defaultModelId(){return this['_config']?.['defaultModelId'];}async getAllModels(){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()['catch'](_0x17ec90=>{throw this['_modelsRequest']=null,_0x17ec90;})),this['_modelsRequest'];}async getAvailableModels(){const _0x39b277=await this['getAllModels']();let _0x39e771;return _0x39e771=this['_availableModels']?this['_filterModels'](_0x39b277,this['_availableModels']):_0x39b277['filter'](_0x1f0120=>_0x1f0120['recommended']),_0x39e771;}async['resolveModel'](_0x4c7789){const _0x33700d=await this['getAllModels']();if(!_0x33700d['length'])return null;if(_0x4c7789){const _0x3627f2=this['_getModelById'](_0x33700d,_0x4c7789);if(_0x3627f2)return _0x3627f2;St('ai-chat-model-id-unrecognized',{'modelId':_0x4c7789,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async getDefault(){const _0x2fd308=await this['getAvailableModels']();if(!_0x2fd308['length'])return null;if(this['_defaultModelId']){const _0x36b070=this['_getModelById'](_0x2fd308,this['_defaultModelId']);if(_0x36b070)return _0x36b070;St('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x2fd308[0x0]['id']});}return _0x2fd308[0x0];}async['isAvailable'](_0x3eba40){return(await this['getAvailableModels']())['some'](_0x3ec966=>_0x3ec966['name']===_0x3eba40['name']&&_0x3ec966['provider']===_0x3eba40['provider']);}async getModel(_0x659ff8){const _0x93d23f=await this['getAllModels']();return this['_getModelById'](_0x93d23f,_0x659ff8)||null;}async _retrieveModels(){if(!this['_modelList']['length']){const _0x232ea9=this['_locale']['uiLanguage']||'en',_0x1124bc=await this['_connector']['getModels'](_0x232ea9)['list']();this['_modelList']=_0x1124bc['items']['map'](_0x25253d=>ws(_0x25253d)?{..._0x25253d,'name':Es(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x25253d);}return[...this['_modelList']];}_filterModels(_0x5d45c3,_0x4c630a){let _0x327493;if(_0x4c630a){_0x327493=[];const _0x3f79fc=new Set(),_0x3b1f1e='string'==typeof _0x4c630a?[_0x4c630a['toLocaleLowerCase']()]:_0x4c630a['map'](_0x1b8e96=>_0x1b8e96['toLocaleLowerCase']());for(const _0x47b547 of _0x3b1f1e)for(const _0x479e9a of _0x5d45c3)!_0x3f79fc['has'](_0x479e9a['id'])&&this['_isMatchingFilter'](_0x479e9a,_0x47b547)&&(_0x327493['push'](_0x479e9a),_0x3f79fc['add'](_0x479e9a['id']));}else _0x327493=_0x5d45c3;return _0x327493;}_isMatchingFilter(_0x3599b7,_0x5adba5){const _0x29a4c1=_0x3599b7['id']['toLocaleLowerCase'](),_0x17689f=_0x3599b7['name']['toLocaleLowerCase'](),_0x4ac97c=_0x3599b7['provider']['toLocaleLowerCase']();return _0x29a4c1===_0x5adba5||_0x17689f===_0x5adba5||ws(_0x3599b7)&&'auto'===_0x5adba5||_0x4ac97c===_0x5adba5||_0x29a4c1['startsWith'](_0x5adba5);}_getModelById(_0x22a9c5,_0xf7cf14){return _0x22a9c5['find'](_0x265949=>ws(_0x265949)&&'auto'===_0xf7cf14?_0x265949:_0x265949['id']===_0xf7cf14)||null;}};function ws(_0x36dc1b){return _0x36dc1b['id']['startsWith']('agent');}var Cs=class{_connector;_defaultContext;_contextsRequest=null;constructor({connector:_0x10cf57,defaultContext:_0x3474aa}){this['_connector']=_0x10cf57,this['_defaultContext']=_0x3474aa;}async getAllContexts(){return this['_contextsRequest']||(this['_contextsRequest']=this['_connector']['listContexts']()['getContexts']()['catch'](_0x41f7f9=>{throw this['_contextsRequest']=null,_0x41f7f9;})),[...await this['_contextsRequest']];}async getAvailableContexts(){const _0x1e34be=await this['getAllContexts'](),_0x3eb7f7=new Set((this['_defaultContext']??[])['map'](_0x244d8a=>_0x244d8a['id']));return _0x1e34be['filter'](_0x3ae0ce=>!_0x3eb7f7['has'](_0x3ae0ce['id']));}resolveContext({feature:_0x3ac522,ids:_0x47cce6=[],extraContexts:_0x4c9656=[],idScopedOnly:_0x2a26f6=!0x1,context:_0x5e93a2}){const _0x570112=this['_resolveDefaultContext'](_0x3ac522,_0x47cce6,_0x2a26f6);return _0x5e93a2['addDefaultContext']([..._0x570112,..._0x4c9656]),_0x5e93a2;}_resolveDefaultContext(_0x15ba5a,_0x637427,_0x51a5ca=!0x1){if(!this['_defaultContext'])return[];const _0x1dacbb=[];for(const _0x208f0e of this['_defaultContext'])this['_entryAppliesToFeature'](_0x208f0e['features'],_0x15ba5a,_0x637427)&&(_0x51a5ca&&this['_entryAppliesToFeature'](_0x208f0e['features'],_0x15ba5a,[])||_0x1dacbb['push'](this['_toContextRef'](_0x208f0e)));return _0x1dacbb;}_toContextRef(_0x37b93b){return'promptId'in _0x37b93b?{'id':_0x37b93b['id'],'promptId':_0x37b93b['promptId']}:'fileId'in _0x37b93b?{'id':_0x37b93b['id'],'fileId':_0x37b93b['fileId']}:{'id':_0x37b93b['id']};}_entryAppliesToFeature(_0x3eba2f,_0x26f47d,_0x2815d4){if(!_0x3eba2f)return!0x0;const _0x49428c=_0x3eba2f[_0x26f47d];return!!_0x49428c&&(!0x0===_0x49428c||_0x2815d4['some'](_0x131ea3=>_0x49428c['test'](_0x131ea3)));}},fs=class extends _0x898608{['models'];contextLibrary;static get['pluginName'](){return'AICore';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Is];}init(){const _0x5de535=this['context']['plugins']['get'](Is);this['models']=new Ts({'connector':_0x5de535,'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']}),this['contextLibrary']=new Cs({'connector':_0x5de535,'defaultContext':this['context']['config']['get']('ai.defaultContext')});}};function bs(_0x51d01b){return _0x51d01b?_0x51d01b instanceof _0x24cd6f?[_0x51d01b]:_0x51d01b['editors']&&0x0!==_0x51d01b['editors']['length']?Array['from'](_0x51d01b['editors']):[]:[];}function Ss(_0x425479){const _0x336836=bs(_0x425479);if(!_0x336836['length'])throw new ct('ai-get-editor-from-context-no-editor');if(0x1===_0x336836['length'])return _0x336836[0x0];const _0x59f870=_0x336836['find'](_0x590b7c=>_0x590b7c['ui']?.['focusTracker']?.['isFocused']);if(_0x59f870)return _0x59f870;const _0x3c803a=function(_0x4cbd6a){if(_0x4cbd6a instanceof _0x24cd6f)return;const _0x3da939=_0x4cbd6a;if(!_0x3da939['plugins']||!_0x3da939['plugins']['has']('AIEditing'))return;return _0x3da939['plugins']['get']('AIEditing')['getLastContentFocusedEditor']?.();}(_0x425479);return _0x3c803a&&_0x336836['includes'](_0x3c803a)?_0x3c803a:_0x336836[0x0];}function Rs(_0xd45bb3,_0x4bd7e4){return _0x502eab(_0xd45bb3,_0x4bd7e4);}function Os(_0x24535f,_0x19b621){return _0x35b927(_0x24535f,_0x19b621);}function vs(_0x4a2aa3,_0x2d796c,_0x1459e2){const _0xde0c63=null!==_0x2d796c?_0x171372=>_0x171372['attribs'][_0x4a2aa3]===_0x2d796c:_0x599d4a=>Boolean(_0x599d4a['attribs'][_0x4a2aa3]);return _0x228c3a(_0x5529c3=>_0x545292(_0x5529c3)&&_0xde0c63(_0x5529c3),_0x1459e2);}function ks(_0x1bd137,_0x53f075,_0x221e7c){const _0x48b2a7=null!==_0x53f075?_0x1c7815=>_0x1c7815['attribs'][_0x1bd137]===_0x53f075:_0x25ee82=>Boolean(_0x25ee82['attribs'][_0x1bd137]);return _0x4615bb(_0x2d5ad8=>_0x545292(_0x2d5ad8)&&_0x48b2a7(_0x2d5ad8),_0x221e7c);}function ys(_0x414102){return _0x4615bb(_0x1ed3d1=>_0x545292(_0x1ed3d1)&&function(_0x7851e6){const _0xb4f664=_0x7851e6['toLowerCase']();return'script'===_0xb4f664||'style'===_0xb4f664||_0xb4f664['includes']('-');}(_0x1ed3d1['name']),_0x414102);}const Ns=['comment-start','comment-end','suggestion-start','suggestion-end'];function xs(_0x12149b){return _0x545292(_0x12149b)&&Ns['includes'](_0x12149b['name']['toLowerCase']());}function Ls(_0x38a861){return _0x370e5d(_0x27b255=>_0x3e0c4f(_0x27b255),_0x38a861,!0x0,0x1/0x0);}function Ps(_0x3523b0,_0x75ef21){return _0x3523b0&&_0x545292(_0x3523b0)?_0x3523b0['attribs'][_0x75ef21]:null;}function Ds(_0x26defd,_0x5351aa,_0x337fd8){_0x545292(_0x26defd)&&(null===_0x337fd8?delete _0x26defd['attribs'][_0x5351aa]:_0x26defd['attribs'][_0x5351aa]=_0x337fd8);}function Hs(_0x4c7aae,_0x4d35a5,_0x33a99e){const _0x35232c=_0x4d35a5['cloneNode'](!0x0);'beforebegin'===_0x33a99e?ti(_0x4c7aae,_0x35232c):'afterbegin'===_0x33a99e?_0x46b9cf(_0x4c7aae,_0x35232c):'beforeend'===_0x33a99e?_0x380486(_0x4c7aae,_0x35232c):'afterend'===_0x33a99e&&_0x23e0ae(_0x4c7aae,_0x35232c);}function Ms(_0xe63906){const _0x5f2a7c=[];let _0x24ba1e=_0xe63906;for(;_0x24ba1e;)_0x24ba1e=_0x12306c(_0x24ba1e),_0x24ba1e&&_0x5f2a7c['push'](_0x24ba1e);return _0x5f2a7c;}function Us(_0x64d6b5){return _0x64d6b5['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Vs(_0x454db2){let _0x1fb746=0x0;for(;_0x454db2['parentNode'];)_0x454db2=_0x454db2['parentNode'],_0x1fb746++;return _0x1fb746;}function Bs(_0x520595){const _0x5543b8=[];let _0x4ee482=_0x520595['nextSibling'];for(;_0x4ee482;)_0x5543b8['push'](_0x4ee482),_0x4ee482=_0x4ee482['nextSibling'];_0x5543b8['forEach'](_0x2de34a=>{_0x47cc1f(_0x2de34a);});}function Gs(_0xa381b0,_0x4cd01){return!!_0xa381b0['model']['document']['getRoot'](_0x4cd01)&&!_0x1bd984(_0xa381b0,_0x4cd01);}function Fs(_0x147efd,_0x505389){return'<p\x20data-id=\x22'+_0x505389+'\x22>'+_0x147efd+'</p>';}function Ks(_0xe66854){return'p'===_0xe66854['name']['toLowerCase']()&&Boolean(_0xe66854['attribs']['data-id']);}function Ws(_0x1f1fb9){const _0x21ddc5=Rs(_0x1f1fb9)['children']['filter'](_0x545292);return 0x1===_0x21ddc5['length']&&Ks(_0x21ddc5[0x0])?_0x21ddc5[0x0]['children']['map'](_0x15500f=>Os(_0x15500f))['join'](''):_0x1f1fb9;}function Ys(_0x4659c8,_0x23d9de){const _0x462e14=function(_0x212f6d){const _0x5292d4=_0x212f6d['children']['filter'](_0x545292);return 0x1===_0x5292d4['length']&&Ks(_0x5292d4[0x0])?_0x5292d4[0x0]['children']:_0x212f6d['children'];}(_0x23d9de),{blockElements:_0x588b2c}=_0x4659c8['editing']['view']['domConverter'],_0x3c4b03=_0x25b08d=>_0x25b08d['some'](_0x43db6e=>_0x545292(_0x43db6e)&&('p'!==_0x43db6e['name']['toLowerCase']()&&_0x588b2c['includes'](_0x43db6e['name']['toLowerCase']())||_0x3c4b03(_0x43db6e['children'])));if(_0x3c4b03(_0x462e14))return!0x1;const _0x42dc66=_0x462e14['map'](_0x3b4bac=>Os(_0x3b4bac))['join'](''),_0x1b2727=_0x4659c8['data']['parse'](_0x42dc66,'$root'),{schema:_0xa0b907}=_0x4659c8['model'];let _0x2f9de7=0x0;for(const {item:_0x53e5cf}of _0x4659c8['model']['createRangeIn'](_0x1b2727))if(_0x53e5cf['is']('element')&&_0xa0b907['isBlock'](_0x53e5cf)&&(++_0x2f9de7>0x1||'paragraph'!==_0x53e5cf['name']))return!0x1;return!0x0;}function $s(_0xaf34dd,_0x2d8a39){const _0x2151a2=_0x2d8a39['filter'](_0x30bd6f=>'new'!=_0x30bd6f['type'])['map'](_0x13b3c1=>vs('data-id',_0x13b3c1['id'],_0xaf34dd))['filter'](_0x1d97ab=>null!==_0x1d97ab),_0x1101a3=_0x2d8a39['filter'](_0xf589de=>'removed'!=_0xf589de['type'])['map'](_0x5dc01c=>_0x5dc01c['node']['cloneNode'](!0x0));let _0x2f7a3d=null;if(_0x2151a2['length']){_0x2f7a3d=_0x2151a2[0x0]['previousSibling'];for(let _0x5a9559=0x0;_0x5a9559<_0x2151a2['length'];_0x5a9559++)_0x47cc1f(_0x2151a2[_0x5a9559]);}if(_0x1101a3['length']){_0x2f7a3d||(_0x2d8a39[0x0]['anchorId']?_0x2f7a3d=vs('data-id',_0x2d8a39[0x0]['anchorId'],_0xaf34dd):(_0x2f7a3d=_0x1101a3['shift'](),_0x46b9cf(_0xaf34dd,_0x2f7a3d)));for(let _0x5a129e=0x0;_0x5a129e<_0x1101a3['length'];_0x5a129e++)_0x23e0ae(_0x2f7a3d,_0x1101a3[_0x5a129e]),_0x2f7a3d=_0x1101a3[_0x5a129e];}}function qs(_0x4f57e1,_0x340ff3){const _0x3f6e3d=new Set();for(const _0x59f4c6 of _0x4f57e1){if(!_0x59f4c6['editor']||'destroyed'===_0x59f4c6['editor']['state']||!Gs(_0x59f4c6['editor'],_0x59f4c6['rootName']))continue;const _0x136e1f=_0x340ff3['get'](_0x59f4c6['documentId']);let _0x2956a0;_0x136e1f?(_0x2956a0=_0x136e1f['cloneNode'](!0x0),$s(_0x2956a0,_0x59f4c6['changes'])):_0x2956a0=new _0x139fbf(_0x59f4c6['changes']['filter'](_0x46bd7a=>'removed'!=_0x46bd7a['type'])['map'](_0x2a3dda=>_0x2a3dda['node']['cloneNode'](!0x0))),Ys(_0x59f4c6['editor'],_0x2956a0)||_0x3f6e3d['add'](_0x59f4c6['index']);}return _0x3f6e3d;}function Qs(_0x8ed199,_0x6828eb,_0x2ec0f7,_0x2edf8c){return Gs(_0x8ed199,_0x6828eb)?Ys(_0x8ed199,Rs(_0x2edf8c))?{'before':Ws(_0x2ec0f7),'after':Ws(_0x2edf8c)}:null:{'before':_0x2ec0f7,'after':_0x2edf8c};}function Xs(_0x2aacfe,_0x5b36d1){return _0x101a20(_0x2aacfe,_0x5b36d1);}function zs(_0x4a8c33,_0x3dc2b1){return _0x4a8c33['map'](_0x41c24e=>null!==_0x41c24e&&'object'==typeof _0x41c24e?Xs(_0x41c24e,_0x3dc2b1):_0x41c24e);}const js=[['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']],Js='ai-selection',Zs=['br'];var tn=class extends _0x898608{constructor(_0x49d679){super(_0x49d679),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}_outputDataProcessor;_fakeSelections=[];_sessionIdByEditor=new WeakMap();_editorsToConfigs=new WeakMap();_lastContentFocusedEditor;static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}getLastContentFocusedEditor(){return this['_lastContentFocusedEditor'];}getSessionId(_0x20b8a2){let _0x1e726d=this['_sessionIdByEditor']['get'](_0x20b8a2);return _0x1e726d||(_0x1e726d=_0x20b8a2['plugins']['has']('RealTimeCollaborationClient')&&_0x20b8a2['plugins']['get']('RealTimeCollaborationClient')['sessionId']||kt(),this['_sessionIdByEditor']['set'](_0x20b8a2,_0x1e726d)),_0x1e726d;}async getDocumentData(_0x32b485){const _0x45fe2e=bs(this['context']),_0x460477=[],_0x408173=new Set();for(const _0x1c44ca of _0x45fe2e){if(_0x32b485&&!_0x32b485['has'](_0x1c44ca['config']['get']('collaboration.channelId')))continue;const _0x2bb2e7=_0x1c44ca['config']['get']('roots')||{},_0x1e30e3=this['_getEditorSelectionSignature'](_0x1c44ca),_0x1c6b01=_0x1c44ca['config']['get']('collaboration.channelId'),_0x24bec6=this['getSessionId'](_0x1c44ca);for(const _0xb62c0a of _0x1c44ca['model']['document']['getRoots']()){if('$graveyard'===_0xb62c0a['rootName'])continue;const _0x1fd09d=await this['_getDocumentDataForEditorRoot'](_0x1c44ca,_0xb62c0a,_0x408173),_0xdfaebb=_0x2bb2e7[_0xb62c0a['rootName']],_0x52ff99=_0xb62c0a['getAttribute']('$description')??_0xdfaebb?.['description'];let _0x4e9d9e=_0xb62c0a['getAttribute']('$title')??_0xdfaebb?.['title'];_0x4e9d9e||(_0x4e9d9e=_0xb62c0a['getAttribute']('$rootEditableOptions')?.['label']??_0xdfaebb?.['label']),_0x4e9d9e||(St('ai-document-root-missing-title',{'editor':_0x1c44ca,'rootName':_0xb62c0a['rootName']}),_0x4e9d9e=_0xb62c0a['rootName']),_0x460477['push']({'editor':_0x1c44ca,'rootName':_0xb62c0a['rootName'],'content':_0x1fd09d['content'],'version':_0x1fd09d['version'],'sessionId':_0x24bec6,'channelId':_0x1c6b01,'selections':_0x1fd09d['selections'],'selectionSignature':_0x1e30e3,'editorConfig':this['_getEditorConfig'](_0x1c44ca),'name':_0x4e9d9e,'description':_0x52ff99});}}return _0x460477;}getEditorsVersions(){const _0x22b5a1=bs(this['context']),_0x4a3dbb=new Map();for(const _0x569504 of _0x22b5a1){const _0x214bbd=_0x569504['config']['get']('collaboration.channelId');_0x4a3dbb['set'](_0x214bbd,_0x569504['model']['document']['version']);}return _0x4a3dbb;}getEditorsSelections(){const _0x315898=bs(this['context']),_0x5cd052=new Map();for(const _0x44104c of _0x315898){const _0x5e226c=_0x44104c['config']['get']('collaboration.channelId'),_0x38542a=this['_getEditorSelectionSignature'](_0x44104c);_0x5cd052['set'](_0x5e226c,_0x38542a);}return _0x5cd052;}_getEditorSelectionSignature(_0x2f9442){return this['_getMarkersInDocumentOrder'](_0x2f9442)['map'](_0x2931ad=>{const _0x2d524a=_0x2931ad['getRange']();return _0x2d524a['root']['rootName']+':'+_0x2d524a['start']['path']['join']('.')+'-'+_0x2d524a['end']['path']['join']('.');})['join']('|');}async _getDocumentDataForEditorRoot(_0x19874c,_0x3cb8b4,_0x576f5e){const _0x35417b=_0x19874c['data']['toView'](_0x3cb8b4,{'convertAiChatSelectionMarker':!0x0}),_0x4ba6c3=new _0x4ccf87(_0x19874c['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x35417b,_0x4ba6c3,_0x576f5e);let _0x453bf4=await this['_getDocumentDataStringFromView'](_0x35417b,_0x19874c);Gs(_0x19874c,_0x3cb8b4['rootName'])&&(_0x453bf4=Fs(_0x453bf4,this['_nextDataId'](_0x576f5e)));const _0x26a620=this['_getMarkersInDocumentOrder'](_0x19874c,_0x3cb8b4),_0x2e4419=[];for(const _0x17d272 of _0x26a620){const _0x5a61ca='<'+_0x17d272['name']+':start></'+_0x17d272['name']+':start>',_0x1a4c38=_0x453bf4['indexOf'](_0x5a61ca);_0x453bf4=_0x453bf4['substring'](0x0,_0x1a4c38)+_0x453bf4['substring'](_0x1a4c38+_0x5a61ca['length']);const _0x3333d4='<'+_0x17d272['name']+':end></'+_0x17d272['name']+':end>',_0x30250c=_0x453bf4['indexOf'](_0x3333d4);_0x453bf4=_0x453bf4['substring'](0x0,_0x30250c)+_0x453bf4['substring'](_0x30250c+_0x3333d4['length']),_0x2e4419['push']({'markerName':_0x17d272['name'],'start':_0x1a4c38,'end':_0x30250c,'htmlFragment':_0x453bf4['substring'](_0x1a4c38,_0x30250c)});}return{'content':_0x453bf4,'version':_0x19874c['model']['document']['version'],'selections':_0x2e4419};}afterInit(){this['context']instanceof _0x24cd6f?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x1bb1f5,_0x3bf181)=>{_0x3bf181['on']('ready',()=>{this['_integrateEditor'](_0x3bf181);});});}_setOutputDataProcessor(_0x24866e){this['_outputDataProcessor']=_0x24866e;}async _getDocumentDataStringFromView(_0x2ab877,_0x3fb2f0){let _0x50fbf3;if(this['_outputDataProcessor']){const _0x3c9f7d=_0x3fb2f0['data']['processor']['domConverter']['viewToDom'](_0x2ab877),_0x569e18=await this['_outputDataProcessor'](_0x3c9f7d);_0x50fbf3=_0x3fb2f0['data']['processor']['htmlWriter']['getHtml'](_0x569e18);}else _0x50fbf3=_0x3fb2f0['data']['processor']['toData'](_0x2ab877);return _0x50fbf3;}_integrateEditor(_0x3d0bea){if(!_0x3d0bea['config']['get']('collaboration.channelId'))throw new ct('ai-missing-channel-id',_0x3d0bea);_0x3d0bea['ui']['focusTracker']['on']('change:isFocused',(_0x88ba49,_0x527a8f,_0x28ef2b)=>{_0x28ef2b&&(this['_lastContentFocusedEditor']=_0x3d0bea);}),_0x3d0bea['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x3d0bea&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x3d0bea['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Js,'view':({markerName:_0x2f104e})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x2f104e['split'](':')[0x1]],'priority':0xc})}),_0x3d0bea['conversion']['for']('dataDowncast')['markerToElement']({'model':Js+':context','view':(_0xeaf1b1,{writer:_0x252369,options:_0x13edee})=>_0x13edee['convertAiChatSelectionMarker']?_0x252369['createUIElement'](_0xeaf1b1['markerName']+':'+(_0xeaf1b1['isOpening']?'start':'end')):null});}showFakeVisualSelection(_0x40e75f){const _0x4a3172=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x40e75f);const _0x3cef77=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x4a3172,_0x3cef77);}hideFakeVisualSelection(_0x5483d6){const _0x365397=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x5483d6);const _0x157e4e=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x365397,_0x157e4e);}async modelToDataWithIds(_0x285e59,_0x12ea16,_0x15b78d){const _0x472227=_0x12ea16['data']['toView'](_0x285e59),_0xad9227=new _0x4ccf87(_0x12ea16['editing']['view']['document']),_0x215d50=new Set();this['_setDataIdsOnChildren'](_0x472227,_0xad9227,_0x215d50);const _0x25a492=await this['_getDocumentDataStringFromView'](_0x472227,_0x12ea16);return _0x15b78d&&Gs(_0x12ea16,_0x15b78d)?Fs(_0x25a492,this['_nextDataId'](_0x215d50)):_0x25a492;}_setDataIdsOnChildren(_0x5ae896,_0x1254eb,_0x55c215=new Set()){let _0x3c9a6b=!0x1;for(const _0x14a296 of _0x5ae896['getChildren']()){if(!_0x14a296['is']('view:element')||Zs['includes'](_0x14a296['name']))continue;const _0x50e2cc=_0x14a296['is']('view:containerElement'),_0x2f4320=_0x14a296['is']('view:emptyElement'),_0x2cf9be=_0x14a296['is']('view:rawElement'),_0x3811ba=this['_setDataIdsOnChildren'](_0x14a296,_0x1254eb,_0x55c215);_0x14a296['hasAttribute']('data-id')?(_0x3c9a6b=!0x0,_0x55c215['add'](_0x14a296['getAttribute']('data-id'))):(_0x50e2cc||_0x2f4320||_0x2cf9be||_0x3811ba)&&(_0x1254eb['setAttribute']('data-id',this['_nextDataId'](_0x55c215),_0x14a296),_0x3c9a6b=!0x0);}return _0x3c9a6b;}_nextDataId(_0x118339){let _0xd79087;do{_0xd79087='';for(let _0x2777c8=0x0;_0x2777c8<0x4;_0x2777c8++)_0xd79087+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x118339['has'](_0xd79087));return _0x118339['add'](_0xd79087),_0xd79087;}getSelectionText(_0x5086f2){const _0x5250b0=(_0x5086f2?_0x5086f2['model']:Ss(this['context'])['model'])['document']['selection'],_0xe9d008=[],_0x3fa6e5=Array['from'](_0x5250b0['getRanges']());_0x3fa6e5['sort']((_0x137f6b,_0x527fcc)=>_0x137f6b['start']['isBefore'](_0x527fcc['start'])?-0x1:0x1);for(const _0x5ddf56 of _0x3fa6e5)for(const _0xe04abd of _0x5ddf56['getItems']())_0xe04abd['is']('$textProxy')?_0xe9d008['push'](_0xe04abd['data']):_0xe04abd['is']('element')&&_0xe9d008['length']>0x0&&'\x20'!==_0xe9d008[_0xe9d008['length']-0x1]&&_0xe9d008['push']('\x20');return _0xe9d008['length']?'\x22'+_0xe9d008['join']('')['trim']()+'\x22':Es(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}_removeFakeSelectionById(_0x4186b6){for(let _0x15c34c=0x0;_0x15c34c<this['_fakeSelections']['length'];_0x15c34c++)if(this['_fakeSelections'][_0x15c34c]['id']==_0x4186b6)return void this['_fakeSelections']['splice'](_0x15c34c,0x1);}_addFakeSelection(_0x4c5cbf){this['_removeFakeSelectionById'](_0x4c5cbf['id']),Ct(this['_fakeSelections'],_0x4c5cbf);}_refreshFakeSelection(_0xde735f,_0x1dac2a){if(_0xde735f==_0x1dac2a)return;const _0x222ed2=_0xde735f?_0xde735f['editor']:null,_0x5ddad0=_0x1dac2a?_0x1dac2a['editor']:null,_0x7fa280=(_0x167f5c,_0xaffbed)=>{const _0x2088c0=_0xaffbed['model']['markers']['getMarkersGroup'](Js);for(const _0x3ab600 of _0x2088c0)_0x167f5c['removeMarker'](_0x3ab600);},_0x55a792=(_0x5830ca,_0x384d2d,_0xba4974)=>{const _0x264590=_0x384d2d['model'];for(let _0x449f93=0x0;_0x449f93<_0xba4974['ranges']['length'];_0x449f93++){let _0x534f70=_0xba4974['ranges'][_0x449f93];const _0x552b71=Js+':'+_0xba4974['id']+':'+_0x449f93;if(_0x534f70['start']['isAtEnd']){const _0x19dc3d=_0x534f70['start']['getLastMatchingPosition'](({item:_0x2b9a53})=>!_0x264590['schema']['isContent'](_0x2b9a53),{'boundaries':_0x534f70});_0x534f70=_0x5830ca['createRange'](_0x19dc3d,_0x534f70['end']);}_0x5830ca['addMarker'](_0x552b71,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x534f70});}};_0x222ed2&&_0x5ddad0&&_0x222ed2===_0x5ddad0&&_0x1dac2a?_0x222ed2['model']['change'](_0x219ccb=>{_0x7fa280(_0x219ccb,_0x222ed2),_0x55a792(_0x219ccb,_0x5ddad0,_0x1dac2a);}):(_0x222ed2&&_0x222ed2['model']['change'](_0x564b0f=>_0x7fa280(_0x564b0f,_0x222ed2)),_0x5ddad0&&_0x1dac2a&&_0x5ddad0['model']['change'](_0x508375=>_0x55a792(_0x508375,_0x5ddad0,_0x1dac2a)));}_getMarkersInDocumentOrder(_0x503257,_0x362bcd){const _0x458dfa=Array['from'](_0x503257['model']['markers']['getMarkersGroup'](Js+':context'));return(_0x362bcd?_0x458dfa['filter'](_0x2c0d37=>{const _0xf7e1d1=_0x2c0d37['getRange']();return _0xf7e1d1&&_0xf7e1d1['root']['rootName']===_0x362bcd['rootName'];}):_0x458dfa)['sort']((_0x5bfc42,_0x170f04)=>_0x5bfc42['getStart']()['isBefore'](_0x170f04['getStart']())?-0x1:_0x5bfc42['getStart']()['isAfter'](_0x170f04['getStart']())?0x1:0x0);}_getEditorConfig(_0x1d9a5d){let _0x15fe37=this['_editorsToConfigs']['get'](_0x1d9a5d);return _0x15fe37||(_0x15fe37=function(_0x48296d){const _0x5117cd={};if(_0x48296d['plugins']['has']('AlignmentEditing')&&(_0x5117cd['alignment']=_0x48296d['config']['get']('alignment')),_0x48296d['plugins']['has']('CodeBlockEditing')&&(_0x5117cd['codeBlock']=_0x48296d['config']['get']('codeBlock')),_0x48296d['plugins']['has']('FontBackgroundColorEditing')&&(_0x5117cd['fontBackgroundColor']=Xs(_0x48296d['config']['get']('fontBackgroundColor'),['documentColors','columns','colorPicker'])),_0x48296d['plugins']['has']('FontColorEditing')&&(_0x5117cd['fontColor']=Xs(_0x48296d['config']['get']('fontColor'),['documentColors','columns','colorPicker'])),_0x48296d['plugins']['has']('FontFamilyEditing')&&(_0x5117cd['fontFamily']=_0x48296d['config']['get']('fontFamily'),_0x5117cd['fontFamily']&&_0x5117cd['fontFamily']['options']&&(_0x5117cd['fontFamily']['options']=zs(_0x5117cd['fontFamily']['options'],['model','upcastAlso']))),_0x48296d['plugins']['has']('FontSizeEditing')&&(_0x5117cd['fontSize']=_0x48296d['config']['get']('fontSize'),_0x5117cd['fontSize']&&_0x5117cd['fontSize']['options']&&(_0x5117cd['fontSize']['options']=zs(_0x5117cd['fontSize']['options'],['upcastAlso']))),_0x48296d['plugins']['has']('FootnotesEditing')){const _0x398146=_0x48296d['config']['get']('footnotes')??{};_0x398146['footnotesProperties']&&'object'==typeof _0x398146['footnotesProperties']&&(_0x398146['footnotesProperties']=Xs(_0x398146['footnotesProperties'],['toolbar','listStyles'])),_0x5117cd['footnotes']=_0x398146;}if(_0x48296d['plugins']['has']('HeadingEditing')&&(_0x5117cd['heading']=_0x48296d['config']['get']('heading'),_0x5117cd['heading']&&_0x5117cd['heading']['options']&&(_0x5117cd['heading']['options']=zs(_0x5117cd['heading']['options'],['model','icon','class','converterPriority','upcastAlso']))),_0x48296d['plugins']['has']('HighlightEditing')&&(_0x5117cd['highlight']=_0x48296d['config']['get']('highlight'),_0x5117cd['highlight']&&_0x5117cd['highlight']['options']&&(_0x5117cd['highlight']['options']=zs(_0x5117cd['highlight']['options'],['model','color']))),_0x48296d['plugins']['has']('ImageBlockEditing')||_0x48296d['plugins']['has']('ImageInlineEditing')){const _0x360437=Xs(_0x48296d['config']['get']('image'),['toolbar','upload','insert','resizeOptions']);_0x48296d['plugins']['has']('ImageResizeEditing')||delete _0x360437['resizeUnit'],_0x48296d['plugins']['has']('ImageStyleEditing')?_0x360437['styles']?.['options']&&(_0x360437['styles']['options']=zs(_0x360437['styles']['options'],['icon'])):delete _0x360437['styles'],_0x5117cd['image']=_0x360437;}if(_0x48296d['plugins']['has']('IndentBlock')&&(_0x5117cd['indentBlock']=_0x48296d['config']['get']('indentBlock')),_0x48296d['plugins']['has']('LineHeightEditing')&&(_0x5117cd['lineHeight']=_0x48296d['config']['get']('lineHeight'),_0x5117cd['lineHeight']&&(delete _0x5117cd['lineHeight']['supportAllValues'],_0x5117cd['lineHeight']['options']&&(_0x5117cd['lineHeight']['options']=zs(_0x5117cd['lineHeight']['options'],['model'])))),_0x48296d['plugins']['has']('LinkEditing')&&(_0x5117cd['link']=Xs(_0x48296d['config']['get']('link'),['toolbar'])),_0x48296d['plugins']['has']('ListEditing')){const _0x2fbbdb=_0x48296d['config']['get']('list')??{};delete _0x2fbbdb['enableListItemMarkerFormatting'],_0x48296d['plugins']['has']('ListPropertiesEditing')?_0x2fbbdb['properties']&&_0x2fbbdb['properties']['styles']&&'object'==typeof _0x2fbbdb['properties']['styles']&&(_0x2fbbdb['properties']['styles']=Xs(_0x2fbbdb['properties']['styles'],['listStyleTypes'])):delete _0x2fbbdb['properties'],_0x5117cd['list']=_0x2fbbdb;}if(_0x48296d['plugins']['has']('MediaEmbedEditing')&&(_0x5117cd['mediaEmbed']=_0x48296d['config']['get']('mediaEmbed'),_0x5117cd['mediaEmbed']&&(delete _0x5117cd['mediaEmbed']['toolbar'],_0x48296d['plugins']['has']('MediaEmbedResizeEditing')?_0x5117cd['mediaEmbed']['resizeOptions']&&(_0x5117cd['mediaEmbed']['resizeOptions']=_0x5117cd['mediaEmbed']['resizeOptions']['map'](_0x6b6c9=>Xs(_0x6b6c9,['icon','label']))):delete _0x5117cd['mediaEmbed']['resizeOptions'],_0x48296d['plugins']['has']('MediaEmbedStyleEditing')?_0x5117cd['mediaEmbed']['styles']&&_0x5117cd['mediaEmbed']['styles']['options']&&(_0x5117cd['mediaEmbed']['styles']['options']=zs(_0x5117cd['mediaEmbed']['styles']['options'],['icon','title'])):delete _0x5117cd['mediaEmbed']['styles'])),_0x48296d['plugins']['has']('MultiLevelListEditing')&&(_0x5117cd['listMultiLevel']=_0x48296d['config']['get']('listMultiLevel')??{}),_0x48296d['plugins']['has']('MentionEditing')){const _0x40de9a=Xs(_0x48296d['config']['get']('mention'),['commitKeys','dropdownLimit']);_0x40de9a['feeds']&&(_0x40de9a['feeds']=_0x40de9a['feeds']['map'](_0x58d13e=>Xs(_0x58d13e,['minimumCharacters','itemRenderer','dropdownLimit']))),_0x5117cd['mention']=_0x40de9a;}if(_0x48296d['plugins']['has']('MergeFieldsEditing')){const _0x5b67d6=Xs(_0x48296d['config']['get']('mergeFields'),['previewModes','initialPreviewMode','previewHtmlValues','sanitizeHtml']);Array['isArray'](_0x5b67d6['definitions'])&&(_0x5b67d6['definitions']=_0x5b67d6['definitions']['map'](_0x4ccc1a=>'groupId'in _0x4ccc1a?(Array['isArray'](_0x4ccc1a['definitions'])&&(_0x4ccc1a['definitions']=_0x4ccc1a['definitions']['map'](_0x43c693=>Xs(_0x43c693,['defaultValue']))),_0x4ccc1a):Xs(_0x4ccc1a,['defaultValue']))),_0x5117cd['mergeFields']=_0x5b67d6;}if(_0x48296d['plugins']['has']('StyleEditing')&&(_0x5117cd['style']=_0x48296d['config']['get']('style')),_0x48296d['plugins']['has']('TableEditing')){const _0x871754=Xs(_0x48296d['config']['get']('table'),['contentToolbar','tableToolbar','showHiddenBorders']);_0x48296d['plugins']['has']('TablePropertiesEditing')?_0x871754['tableProperties']&&'object'==typeof _0x871754['tableProperties']&&(_0x871754['tableProperties']=Xs(_0x871754['tableProperties'],['colorPicker','borderColors','backgroundColors'])):delete _0x871754['tableProperties'],_0x48296d['plugins']['has']('TableCellPropertiesEditing')?_0x871754['tableCellProperties']&&'object'==typeof _0x871754['tableCellProperties']&&(_0x871754['tableCellProperties']=Xs(_0x871754['tableCellProperties'],['colorPicker','borderColors','backgroundColors'])):delete _0x871754['tableCellProperties'],_0x48296d['plugins']['has']('TableLayoutEditing')?_0x871754['tableLayout']||(_0x871754['tableLayout']={}):delete _0x871754['tableLayout'],_0x48296d['plugins']['has']('TableCaptionEditing')?_0x871754['tableCaption']||(_0x871754['tableCaption']={}):delete _0x871754['tableCaption'],_0x5117cd['table']=_0x871754;}_0x48296d['plugins']['has']('TextPartLanguageEditing')&&(_0x5117cd['textPartLanguage']=_0x48296d['config']['get']('language.textPartLanguage'));for(const [_0x4650ea,_0x182c08]of js)_0x48296d['plugins']['has'](_0x4650ea)&&(_0x5117cd[_0x182c08]={});return _0x5117cd;}(_0x1d9a5d),this['_editorsToConfigs']['set'](_0x1d9a5d,_0x15fe37)),_0x15fe37;}};const en=/* #__PURE__ -- @preserve */
26
+ At();var sn=class extends en{_generateUid;_uidCounter=0x0;_touchedNodesState={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null,'rescuedNewIds':new Set()};_existingDataIds=new Set();_referencedExistingIds=new Set();constructor(_0x181696){super(),this['_generateUid']=_0x181696||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x5197c7,_0x1d349b,_0x28381f){this['_uidCounter']=0x0;const _0x4653ec=_0x5197c7['cloneNode'](!0x0);on(_0x1d349b,_0x4653ec);const _0x21588d=_0x4653ec['childNodes'],_0x5bd5ad=Array['from'](_0x21588d)['filter'](_0x7d1a7f=>!(0x3===_0x7d1a7f['nodeType']&&''===Os(_0x7d1a7f)['trim']())),_0x3a0fc8=_0x5bd5ad['length'];this['_existingDataIds']=new Set(ks('data-id',null,_0x1d349b)['map'](_0x1be790=>Ps(_0x1be790,'data-id'))['filter'](_0x5e8e7f=>!!_0x5e8e7f));for(const _0x2168ea of _0x5bd5ad)_0x2168ea&&_0x545292(_0x2168ea)&&void 0x0===_0x2168ea['attribs']['data-id']&&Ds(_0x2168ea,'data-id','new-element');if(ks('data-id',null,_0x4653ec)['forEach'](_0x1f5b62=>{const _0x149abb=Ps(_0x1f5b62,'data-id');'new-element'===_0x149abb||this['_existingDataIds']['has'](_0x149abb)||Ds(_0x1f5b62,'data-id','new-element');}),0x0===_0x1d349b['childNodes']['length']){const _0x4df206=[];return ks('data-id','new-element',_0x4653ec)['forEach'](_0x2570bb=>{const _0x5173fc=this['_generateUid']();Ds(_0x2570bb,'data-id',_0x5173fc),_0x4df206['push'](_0x5173fc);}),this['_removeSpecialComments'](_0x4653ec),{'parsedContent':_0x4653ec,'newNodeIds':_0x4df206,'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 _0x2664c8=-0x1,_0x196e11=!0x1;for(let _0x3dae0a=0x0;_0x3dae0a<_0x3a0fc8;_0x3dae0a++){const _0x2e820d=_0x5bd5ad[_0x3dae0a],_0x1ec398=_0x5bd5ad[_0x3dae0a+0x1];if(this['_isNewNode'](_0x2e820d)){if(-0x1===_0x2664c8&&(_0x2664c8=_0x3dae0a),this['_markWrappedElements'](_0x2e820d),!this['_isNewNode'](_0x1ec398)){const [_0x3aaf0d,_0xe3a23e]=this['_findReferenceNode'](_0x2e820d,_0x196e11,_0x1d349b);if(_0x3aaf0d){const _0x1ea02b=Array['from'](_0x5bd5ad)['slice'](_0x2664c8,_0x3dae0a+0x1);this['_insertNodes'](_0x3aaf0d,_0x1ea02b,_0xe3a23e),_0x2664c8=-0x1;}}}else{if(this['_isExistingContentComment'](_0x2e820d))_0x196e11=!0x0;else{if(this['_isExistingNode'](_0x2e820d)){const _0x4a4cf9=Ps(_0x2e820d,'data-id');if(_0x4a4cf9&&this['_existingDataIds']['has'](_0x4a4cf9)){this['_referencedExistingIds']['add'](_0x4a4cf9);const _0x5907fb=vs('data-id',_0x4a4cf9,_0x1d349b);this['_replaceNode'](_0x5907fb,_0x2e820d);}}else{if(nn(_0x2e820d)){const _0x512371=rn(_0x2e820d);vs('data-id',_0x512371,_0x4653ec)||this['_touchedNodesState']['removedIds']['push'](_0x512371);}}}}}for(const _0x31bd2b of this['_touchedNodesState']['removedIds']){const _0x53f32e=vs('data-id',_0x31bd2b,_0x1d349b);_0x53f32e&&(this['_rescueUnwrappedElements'](_0x53f32e),this['_removeNode'](_0x53f32e,_0x31bd2b,_0x28381f));}if(ks('data-id','new-element',_0x1d349b)['forEach'](_0x56e382=>{const _0x4ce31d=this['_getUid'](_0x56e382);Ds(_0x56e382,'data-id',_0x4ce31d),this['_touchedNodesState']['newIds']['push'](_0x4ce31d);}),this['_removeSpecialComments'](_0x1d349b),_0x28381f&&_0x28381f['cutAfterUnstable']){const _0x278dcf=this['_findLastConfirmationPoint'](_0x5bd5ad),_0x1b920a=this['_getLastStableElement'](_0x1d349b,_0x278dcf);this['_markUnstableElements'](_0x1d349b,_0x1b920a);}if(this['_processWrappedElements'](_0x1d349b,_0x28381f),_0x28381f&&_0x28381f['cutAfterUnstable']&&this['_touchedNodesState']['lastTouchedId']){const _0x5b162f=ks('data-id',this['_touchedNodesState']['lastTouchedId'],_0x1d349b);let _0x290c73=_0x5b162f[_0x5b162f['length']-0x1];for(;_0x290c73;)Bs(_0x290c73),_0x290c73=_0x290c73['parentNode'];}return{'parsedContent':_0x1d349b,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}_insertNodes(_0x53eae1,_0x2fa6de,_0x211aaa){for(const _0x23f702 of _0x2fa6de){const _0x4b0315=this['_getUid'](_0x23f702);Ds(_0x23f702,'data-id',_0x4b0315),this['_touchedNodesState']['newIds']['push'](_0x4b0315),this['_touchedNodesState']['lastTouchedId']=_0x4b0315;}const _0x3207f9='afterbegin'===_0x211aaa||'afterend'===_0x211aaa?_0x2fa6de['reverse']():_0x2fa6de;for(const _0x295e07 of _0x3207f9)Hs(_0x53eae1,_0x295e07,_0x211aaa);}['_replaceNode'](_0x5cd68a,_0x1c0138){if(!_0x5cd68a)return;if(_0x20c40=_0x1c0138,Us(Os(_0x5cd68a))===Us(Os(_0x20c40)))return;var _0x20c40;const _0x19923c=Ps(_0x5cd68a,'data-id');this['_touchedNodesState']['modifiedIds']['push'](_0x19923c),this['_touchedNodesState']['lastTouchedId']=_0x19923c,_0x452856(_0x5cd68a,_0x1c0138['cloneNode'](!0x0));}['_removeNode'](_0x21cba9,_0x1cce13,_0xf56178){if(_0xf56178&&_0xf56178['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x1cce13;const _0xcf3ca1=_0xf56178['replaceRemovedWith']['cloneNode'](!0x0);Ds(_0xcf3ca1,'data-id',_0x1cce13),Ds(_0xcf3ca1,'data-removed','true'),_0x452856(_0x21cba9,_0xcf3ca1);}else _0x47cc1f(_0x21cba9);}['_findReferenceNode'](_0x11ca29,_0x1b0a1a,_0x26ac20){const _0x34d201=this['_findPrevElementWithDataId'](_0x11ca29,!0x1);if(_0x34d201){const _0x843686=rn(_0x34d201),_0x31decb=vs('data-id',_0x843686,_0x26ac20);if(_0x31decb)return[_0x31decb,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x843686);}const _0x4c0315=this['_findNextElementWithDataId'](_0x11ca29,!0x1);if(_0x4c0315){const _0x1a2115=rn(_0x4c0315),_0x52c0dc=vs('data-id',_0x1a2115,_0x26ac20);if(_0x52c0dc)return[_0x52c0dc,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x1a2115);}return _0x1b0a1a?_0x11ca29['nextSibling']?this['_findFallbackReferenceNode'](_0x11ca29,_0x26ac20):[_0x26ac20['childNodes'][_0x26ac20['childNodes']['length']-0x1],'afterend']:[_0x26ac20['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x5dcf59,_0x1e8caf){const _0x1545b0=[],_0x56ccfe=this['_findPrevElementWithDataId'](_0x5dcf59,!0x0);if(_0x56ccfe){const _0x2425ea=vs('data-id',rn(_0x56ccfe),_0x1e8caf);_0x2425ea&&_0x1545b0['push']([_0x2425ea,'afterend']);}const _0x3386ba=this['_findNextElementWithDataId'](_0x5dcf59,!0x0);if(_0x3386ba){const _0x8f639e=vs('data-id',rn(_0x3386ba),_0x1e8caf);_0x8f639e&&_0x1545b0['push']([_0x8f639e,'beforebegin']);}return _0x1545b0['length']>0x1?Vs(_0x1545b0[0x0][0x0])<=Vs(_0x1545b0[0x1][0x0])?_0x1545b0[0x0]:_0x1545b0[0x1]:0x1===_0x1545b0['length']?_0x1545b0[0x0]:[_0x1e8caf['lastChild'],'afterend'];}_findNextElementWithDataId(_0x28bcfe,_0x54206a){let _0x29067d=_0x28bcfe['nextSibling'],_0x22dffb=null,_0x57133b=!0x1;for(;_0x29067d;){if(_0x3e0c4f(_0x29067d)){if(nn(_0x29067d)&&(_0x22dffb=_0x29067d),this['_isExistingContentComment'](_0x29067d)&&_0x54206a&&!_0x57133b){_0x57133b=!0x0,_0x29067d=_0x29067d['nextSibling'];continue;}break;}const _0x5123ac=Ps(_0x29067d,'data-id');if(_0x5123ac&&'new-element'!==_0x5123ac&&this['_existingDataIds']['has'](_0x5123ac)){_0x22dffb=_0x29067d;break;}_0x29067d=_0x29067d['nextSibling'];}return _0x22dffb;}_findPrevElementWithDataId(_0x304bed,_0x2315c3){let _0x3f8c74=_0x304bed['previousSibling'],_0x53a679=null,_0x3bdf50=!0x1;for(;_0x3f8c74;){if(_0x3e0c4f(_0x3f8c74)){if(nn(_0x3f8c74)&&(_0x53a679=_0x3f8c74),this['_isExistingContentComment'](_0x3f8c74)&&_0x2315c3&&!_0x3bdf50){_0x3bdf50=!0x0,_0x3f8c74=_0x3f8c74['previousSibling'];continue;}break;}const _0x128976=Ps(_0x3f8c74,'data-id');if(_0x128976&&'new-element'!==_0x128976&&this['_existingDataIds']['has'](_0x128976)){_0x53a679=_0x3f8c74;break;}_0x3f8c74=_0x3f8c74['previousSibling'];}return _0x53a679;}_markWrappedElements(_0x26e4a9){_0x545292(_0x26e4a9)&&ks('data-id',null,_0x26e4a9)['forEach'](_0x3a6fdc=>{this['_isExistingNode'](_0x3a6fdc)&&(Ds(_0x3a6fdc,'data-wrapped-id',Ps(_0x3a6fdc,'data-id')),Ds(_0x3a6fdc,'data-id',null));});}_processWrappedElements(_0x25aae6,_0x116edb){ks('data-wrapped-id',null,_0x25aae6)['forEach'](_0x1dbb3a=>{const _0x2b749d=Ps(_0x1dbb3a,'data-wrapped-id');if(this['_hasUnstableParent'](_0x1dbb3a))return;const _0x21a8d7=vs('data-id',_0x2b749d,_0x25aae6);Ds(_0x1dbb3a,'data-id',_0x2b749d),_0x21a8d7&&(this['_removeNode'](_0x21a8d7,_0x2b749d,_0x116edb),this['_touchedNodesState']['removedIds']['push'](_0x2b749d),this['_touchedNodesState']['lastTouchedId']=_0x2b749d);});}_hasUnstableParent(_0x43a23f){let _0x5df5fe=_0x43a23f['parentNode'];for(;_0x5df5fe;){if(Ps(_0x5df5fe,'data-unstable'))return!0x0;_0x5df5fe=_0x5df5fe['parentNode'];}return!0x1;}_rescueUnwrappedElements(_0x54bd5a){const _0x2c23dc=new Set(this['_touchedNodesState']['removedIds']),_0x531263=new Set(this['_touchedNodesState']['newIds']);ks('data-id',null,_0x54bd5a)['forEach'](_0x460465=>{const _0x2d7697=Ps(_0x460465,'data-id'),_0x59fbe4=!!_0x2d7697&&this['_referencedExistingIds']['has'](_0x2d7697),_0x490d1d=!!_0x2d7697&&_0x531263['has'](_0x2d7697);if(!_0x2d7697||!_0x59fbe4&&!_0x490d1d)return;if(_0x2c23dc['has'](_0x2d7697))return;let _0xb0718d=_0x460465['parentNode'],_0x210b73=!0x1;for(;_0xb0718d;){if(_0xb0718d===_0x54bd5a){_0x210b73=!0x0;break;}const _0x3e0d40=Ps(_0xb0718d,'data-id');if(_0x3e0d40&&(this['_referencedExistingIds']['has'](_0x3e0d40)||_0x531263['has'](_0x3e0d40)))return;_0xb0718d=_0xb0718d['parentNode'];}if(_0x210b73){if(ti(_0x54bd5a,_0x460465),_0x59fbe4){const _0x23b9bb=this['_generateUid'](),_0x5c17fb=this['_touchedNodesState']['modifiedIds']['indexOf'](_0x2d7697);-0x1!==_0x5c17fb&&this['_touchedNodesState']['modifiedIds']['splice'](_0x5c17fb,0x1),Ds(_0x460465,'data-unwrapped-id',_0x2d7697),Ds(_0x460465,'data-id',_0x23b9bb),this['_touchedNodesState']['newIds']['push'](_0x23b9bb),this['_touchedNodesState']['rescuedNewIds']['add'](_0x23b9bb),this['_touchedNodesState']['lastTouchedId']=_0x23b9bb;}else this['_touchedNodesState']['rescuedNewIds']['add'](_0x2d7697),this['_touchedNodesState']['lastTouchedId']=_0x2d7697;}});}_getUid(_0x5e7c44){return this['_isExistingNode'](_0x5e7c44)?Ps(_0x5e7c44,'data-id'):this['_generateUid']();}_removeSpecialComments(_0x550478){Ls(_0x550478)['filter'](_0x539592=>nn(_0x539592)||this['_isExistingContentComment'](_0x539592))['forEach'](_0x4b8fba=>{_0x47cc1f(_0x4b8fba);});}_findLastConfirmationPoint(_0x409f86){let _0x319acc=null,_0x3e5b61=null,_0x3cb578=null,_0x36e281=null;const _0x4ce549=_0x30fd6b=>{_0x30fd6b&&(_0x319acc=_0x30fd6b),_0x3cb578=null,_0x36e281=null;};for(let _0x3fcec4=0x0;_0x3fcec4<_0x409f86['length'];_0x3fcec4++){const _0x352c72=_0x409f86[_0x3fcec4];if(this['_isExistingContentComment'](_0x352c72)){_0x4ce549(_0x3e5b61);continue;}if(_0x545292(_0x352c72)){const _0x20a181=Ps(_0x352c72,'data-id'),_0x3c8ef8=_0x3fcec4===_0x409f86['length']-0x1;if(_0x20a181&&'new-element'!==_0x20a181&&this['_touchedNodesState']['modifiedIds']['includes'](_0x20a181)&&!_0x3c8ef8){_0x4ce549(_0x20a181),_0x3e5b61=_0x20a181;continue;}}let _0x159984;const _0x285021=rn(_0x352c72);if(_0x285021&&this['_touchedNodesState']['rescuedNewIds']['has'](_0x285021))_0x3e5b61=_0x285021;else{if(_0x285021&&this['_touchedNodesState']['newIds']['includes'](_0x285021))_0x159984='N';else{if(!nn(_0x352c72))continue;_0x159984='R';}_0x159984===_0x36e281||null===_0x36e281?_0x36e281=_0x159984:null!==_0x3cb578?(_0x4ce549(_0x3e5b61),_0x36e281=_0x159984):(_0x3cb578=_0x36e281,_0x36e281=_0x159984),_0x3e5b61=_0x285021;}}const _0x24cf15=_0x409f86[_0x409f86['length']-0x1];return _0x24cf15&&!_0x545292(_0x24cf15)&&!nn(_0x24cf15)&&_0x3e5b61&&_0x4ce549(_0x3e5b61),_0x319acc;}_getLastStableElement(_0x3c11ea,_0x1b5158){if(!_0x1b5158)return null;const _0x588cc7=vs('data-id',_0x1b5158,_0x3c11ea);if(!_0x588cc7)return null;const _0x2aed6e=[_0x588cc7,...Ms(_0x588cc7)]['at'](-0x2);if(_0x2aed6e===_0x588cc7)return _0x588cc7;let _0x21dc70=_0x2aed6e['previousSibling'];for(;_0x21dc70&&!_0x545292(_0x21dc70);)_0x21dc70=_0x21dc70['previousSibling'];return _0x21dc70;}_markUnstableElements(_0x3977bd,_0x2f89fb){const _0x9b3b7c=new Set([...this['_touchedNodesState']['newIds'],...this['_touchedNodesState']['modifiedIds'],...this['_touchedNodesState']['removedIds']]);let _0x5c8273=_0x2f89fb?_0x2f89fb['nextSibling']:_0x3977bd['firstChild'];for(;_0x5c8273;)_0x545292(_0x5c8273)&&(_0x9b3b7c['has'](Ps(_0x5c8273,'data-id'))||ks('data-id',null,_0x5c8273)['some'](_0x23c45f=>_0x9b3b7c['has'](Ps(_0x23c45f,'data-id'))))&&Ds(_0x5c8273,'data-unstable','true'),_0x5c8273=_0x5c8273['nextSibling'];}['_isNewNode'](_0x33e3dc){return Boolean('new-element'===Ps(_0x33e3dc,'data-id'));}_isExistingNode(_0x2d8f91){return Boolean((Ps(_0x2d8f91,'data-id')||'')['length']>0x0&&'new-element'!==Ps(_0x2d8f91,'data-id'));}_isExistingContentComment(_0x22603a){return Boolean(_0x3e0c4f(_0x22603a)&&Os(_0x22603a)['match'](/\s*existing[\s*-](content|document)\s*/g));}};function nn(_0x1223cc){return!!_0x1223cc&&Boolean(_0x3e0c4f(_0x1223cc)&&Os(_0x1223cc)['match'](/removed[\s*-]data-id="[^"]+"/));}function rn(_0x46893b){if(!_0x46893b)return null;if(_0x545292(_0x46893b))return Ps(_0x46893b,'data-id')??null;if(_0x3e0c4f(_0x46893b)){const _0x3472d9=Os(_0x46893b)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x3472d9&&_0x3472d9[0x1])return _0x3472d9[0x1];}return null;}function on(_0x32db79,_0x415ba2){const _0x12641f=new Map();for(const _0x4d4b51 of ys(_0x32db79))xs(_0x4d4b51)||_0x12641f['set'](Ps(_0x4d4b51,'data-id'),_0x4d4b51);const _0x363438=new Set();for(const _0x1c62c7 of ys(_0x415ba2)){if(xs(_0x1c62c7))continue;const _0x241e3e=Ps(_0x1c62c7,'data-id'),_0x5c00b6=_0x241e3e?_0x12641f['get'](_0x241e3e):void 0x0;_0x5c00b6?(_0x452856(_0x1c62c7,_0x2a3383(_0x5c00b6,!0x0)),_0x363438['add'](_0x241e3e)):_0x47cc1f(_0x1c62c7);}for(const _0x35e3d1 of Ls(_0x415ba2))nn(_0x35e3d1)&&_0x12641f['has'](rn(_0x35e3d1))&&_0x47cc1f(_0x35e3d1);const _0x2fc96e=new Set(ks('data-id',null,_0x415ba2)['map'](_0x4b0375=>Ps(_0x4b0375,'data-id')));for(const [_0x491266,_0x44e37c]of _0x12641f){if(_0x363438['has'](_0x491266))continue;let _0x5c8b73=_0x44e37c['parent'],_0x262046=null;for(;_0x5c8b73&&_0x545292(_0x5c8b73);){const _0x392b78=Ps(_0x5c8b73,'data-id');if(_0x392b78&&_0x2fc96e['has'](_0x392b78)){_0x262046=_0x392b78;break;}_0x5c8b73=_0x5c8b73['parent'];}if(!_0x262046)continue;const _0x10a1aa=vs('data-id',_0x262046,_0x415ba2);_0x10a1aa&&_0x380486(_0x10a1aa,_0x2a3383(_0x44e37c,!0x0));}}const an=/* #__PURE__ -- @preserve */
27
+ At();var hn=class extends an{_m2html;constructor(){super();const _0x1bd40d=Object['entries'](_0x29e337),_0x2fe280=_0x1bd40d['findIndex'](([_0x330500])=>'rehypeDomRaw'===_0x330500);if(-0x1===_0x2fe280)throw new ct('ai-response-parser-unable-to-set-up-parser');_0x1bd40d['splice'](_0x2fe280+0x1,0x0,['rehypeSanitize',_0x23be32]),this['_m2html']=new _0x20ae64({'plugins':Object['fromEntries'](_0x1bd40d)});}convertMarkdownToHTML(_0x21991e){const _0xdeeef6=this['_m2html']['parse'](_0x21991e);return this['parseAndNormalizeHTML'](_0xdeeef6);}['parseAndNormalizeHTML'](_0x25c425){return this['_parseHTML'](_0x25c425);}['_parseHTML'](_0x2b5fb2){const _0x558ba3=Rs('<dummy>'+_0x2b5fb2['replace'](/<[^>]*?$/g,'')+'</dummy>');return cn(_0x558ba3),_0x558ba3['children']=_0x558ba3['children'][0x0]['children'],_0x558ba3;}};function cn(_0x3ca56a){for(const _0x42a28f of _0x3ca56a['children'])_0x545292(_0x42a28f)?'pre'!==_0x42a28f['name']&&cn(_0x42a28f):_0x5273d9(_0x42a28f)&&(_0x42a28f['data']=_0x42a28f['data']['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/[ \t\r\f\v]+/g,'\x20'));}function ln({changeGroups:_0x3cc61c,documentContextContent:_0x436a70,showDiff:_0x479bdf,trimUnchanged:_0x43ac77=!0x0}){const _0x22f279=qs(_0x3cc61c,_0x436a70);return _0x3cc61c['map'](_0x3787c0=>{if(!_0x3787c0['editor']||'destroyed'===_0x3787c0['editor']['state'])return null;const _0x5c70a1=Gs(_0x3787c0['editor'],_0x3787c0['rootName']),_0x5bdd53=new _0x139fbf([]),_0x5380f7=new _0x139fbf([]),_0x551a54=new Set();for(const _0x355050 of _0x3787c0['changes'])'new'==_0x355050['type']&&ks('data-id',null,_0x355050['node'])['forEach'](_0x29d8d9=>{_0x551a54['add'](Ps(_0x29d8d9,'data-id'));});for(const _0x502c68 of _0x3787c0['changes'])if('removed'!=_0x502c68['type']?_0x5380f7['children']['push'](_0x502c68['node']['cloneNode'](!0x0)):_0x479bdf||_0x551a54['has'](_0x502c68['id'])||_0x5380f7['children']['push'](_0x502c68['node']['cloneNode'](!0x0)),'new'!=_0x502c68['type']&&(_0x479bdf||'removed'!=_0x502c68['type'])){const _0x3a7bb1=_0x228c3a(_0x28c7a5=>Ps(_0x28c7a5,'data-id')==_0x502c68['id'],_0x436a70['get'](_0x3787c0['documentId']),!0x0);_0x3a7bb1&&_0x5bdd53['children']['push'](_0x3a7bb1['cloneNode'](!0x0));}if(_0x5c70a1&&_0x22f279['has'](_0x3787c0['index']))return{'type':_0x3787c0['changes'][0x0]['type'],'index':_0x3787c0['index'],'state':_0x3787c0['state'],'outdatedReason':_0x3787c0['outdatedReason'],'content':new _0x139fbf([]),'hasChanges':!0x1};let _0x2da23c,_0xc4f37,_0x5722e3;try{({content:_0x2da23c,hasChanges:_0xc4f37}=un(_0x3787c0['editor'],_0x5bdd53,_0x5380f7,_0x479bdf,_0x43ac77));}catch{return{'type':_0x3787c0['changes'][0x0]['type'],'index':_0x3787c0['index'],'state':_0x3787c0['state'],'outdatedReason':_0x3787c0['outdatedReason'],'content':new _0x139fbf([]),'hasChanges':!0x1};}if(_0x5c70a1){_0x5722e3=_0x3787c0['editor']['ui']['getEditableElement'](_0x3787c0['rootName'])?.['tagName']['toLowerCase']();const _0x533cdb=_0x2da23c['children']['filter'](_0x545292);0x1===_0x533cdb['length']&&(_0x2da23c=new _0x139fbf(_0x533cdb[0x0]['children']));}return{'type':_0x3787c0['changes'][0x0]['type'],'index':_0x3787c0['index'],'state':_0x3787c0['state'],'outdatedReason':_0x3787c0['outdatedReason'],'content':_0x2da23c,'hasChanges':_0xc4f37,'wrapperTag':_0x5722e3};})['filter'](_0x4e761a=>null!==_0x4e761a);}function un(_0x4a0c26,_0x514b6e,_0x497c40,_0x47de6d,_0x562f38=!0x0){const _0x3b450a=_0x4a0c26['plugins']['get']('DocumentCompare'),_0x1a4b69=Os(_0x514b6e),_0x54e3d4=Os(_0x497c40),_0x21be71=_0x4a0c26['data']['parse'](_0x1a4b69,'$root'),_0xe43f5e=_0x4a0c26['model']['createPositionAt'](_0x21be71,0x0),_0x3fdc25=_0x3b450a['getDiff'](_0x1a4b69,_0x54e3d4,{'anchor':_0xe43f5e,'markDeletions':_0x47de6d,'targetEditor':_0x4a0c26})['getOperations']();if(0x0==_0x3fdc25['length'])return{'content':_0x514b6e['cloneNode'](!0x0),'hasChanges':!0x1};if(_0x47de6d?function(_0x252798,_0x1992de,_0x282c7b){if(0x0==_0x252798['length'])return;const _0x5e568b=_0x282c7b['plugins']['get']('DocumentCompare'),_0x17e025=_0x282c7b['plugins']['get']('SuggestionsConversion');_0x282c7b['model']['change'](_0x370611=>{const _0x103c9c=new Set();for(let _0xa1f884=0x0;_0xa1f884<_0x252798['length'];_0xa1f884++){const _0x260c38=_0x252798[_0xa1f884];if(_0x260c38['baseVersion']=null,_0x260c38['isDocumentOperation']=!0x1,!_0x9fd625(_0x260c38)){if(_0x5e568b['isMarkedRemoveOperation'](_0x260c38)){const _0x1897ad=_0x49575d(_0x260c38['newRange'],_0x282c7b['model']),_0x528c63='suggestion:deletion:'+kt()+':$aiSuggestion';_0x1992de['markers']['set'](_0x528c63,_0x1897ad);}else switch(_0x260c38['type']){case'rename':{if(_0x260c38['oldName']==_0x260c38['newName'])break;_0x370611['batch']['addOperation'](_0x260c38),_0x282c7b['model']['applyOperation'](_0x260c38);const _0xaa4a08='$elementName',_0x1de101=_0x260c38['position'],_0x2303b6=_0x282c7b['model']['createRange'](_0x1de101,_0x282c7b['model']['createPositionAt'](_0x1de101['nodeAfter'],'end')),_0x1b5264='suggestion:attribute:'+_0xaa4a08+':'+kt()+':$aiSuggestion';_0x1992de['markers']['set'](_0x1b5264,_0x2303b6);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x260c38['oldValue']==_0x260c38['newValue'])break;_0x370611['batch']['addOperation'](_0x260c38),_0x282c7b['model']['applyOperation'](_0x260c38);const _0x236ab0=_0x260c38['key'];if(!_0x17e025['isRegisteredAttribute'](_0x236ab0))break;const _0x49c81b=_0x49575d(_0x260c38['range'],_0x282c7b['model']),_0x4299a1='suggestion:attribute:'+_0x236ab0+':'+kt()+':$aiSuggestion';_0x1992de['markers']['set'](_0x4299a1,_0x49c81b);break;}case'insert':{if(_0x370611['batch']['addOperation'](_0x260c38),_0x282c7b['model']['applyOperation'](_0x260c38),dn(_0x1992de,_0x260c38),_0x252798[_0xa1f884+0x1]&&'move'==_0x252798[_0xa1f884+0x1]['type'])break;const _0x15727f=_0x260c38['position'],_0x440302=_0x260c38['howMany'],_0xdd7dc8=_0x49575d(_0x282c7b['model']['createRange'](_0x15727f,_0x15727f['getShiftedBy'](_0x440302)),_0x282c7b['model']),_0x3c0dce='suggestion:insertion:'+kt()+':$aiSuggestion';_0x1992de['markers']['set'](_0x3c0dce,_0xdd7dc8);break;}case'split':{_0x370611['batch']['addOperation'](_0x260c38),_0x282c7b['model']['applyOperation'](_0x260c38),dn(_0x1992de,_0x260c38);const _0x5e76b2=_0x260c38['splitPosition'],_0x228101=_0x260c38['moveTargetPosition'],_0x29eb28=_0x282c7b['model']['createRange'](_0x5e76b2,_0x228101),_0x458aec='suggestion:insertion:'+kt()+':$aiSuggestion';_0x1992de['markers']['set'](_0x458aec,_0x29eb28);break;}case'move':{_0x370611['batch']['addOperation'](_0x260c38),_0x282c7b['model']['applyOperation'](_0x260c38),dn(_0x1992de,_0x260c38);const _0x53f1c1=_0x260c38['getMovedRangeStart'](),_0x2b28f6=_0x260c38['howMany'];for(let _0x45b025=0x0;_0x45b025<_0x2b28f6;_0x45b025++){const _0x2122a6=_0x53f1c1['getShiftedBy'](_0x45b025)['nodeAfter'];_0x103c9c['add'](_0x2122a6);}break;}case'remove':{const _0x7d0a7d=_0x260c38['sourcePosition'],_0x1218c0=_0x260c38['howMany'],_0x381ebc=new _0x4f656c(_0x7d0a7d,_0x1218c0);_0x370611['batch']['addOperation'](_0x381ebc),_0x282c7b['model']['applyOperation'](_0x381ebc),dn(_0x1992de,_0x260c38);break;}}}}for(const _0x4cac2d of _0x103c9c){const _0x47f5a2=_0x282c7b['model']['createRangeOn'](_0x4cac2d),_0x4aa8f7='suggestion:formatBlock:$fakeWrap:'+kt()+':$aiSuggestion';_0x1992de['markers']['set'](_0x4aa8f7,_0x49575d(_0x47f5a2,_0x282c7b['model']));}});}(_0x3fdc25,_0x21be71,_0x4a0c26):_0x4a0c26['model']['change'](_0x2f060b=>{for(const _0x43157a of _0x3fdc25)if(!_0x9fd625(_0x43157a)){if('remove'==_0x43157a['type']){const _0x72bf9d=_0x43157a['sourcePosition'],_0x8e3aed=_0x43157a['howMany'],_0x4f721a=new _0x4f656c(_0x72bf9d,_0x8e3aed);_0x2f060b['batch']['addOperation'](_0x4f721a),_0x4a0c26['model']['applyOperation'](_0x4f721a),dn(_0x21be71,_0x43157a);}else{if('marker'==_0x43157a['type']){const _0x20a6bd=_0x43157a['name'],_0x3c1711=_0x43157a['newRange'];null!==_0x3c1711?_0x21be71['markers']['set'](_0x20a6bd,_0x3c1711):_0x21be71['markers']['delete'](_0x20a6bd);}else _0x43157a['baseVersion']=null,_0x43157a['isDocumentOperation']=!0x1,_0x2f060b['batch']['addOperation'](_0x43157a),_0x4a0c26['model']['applyOperation'](_0x43157a),dn(_0x21be71,_0x43157a);}}}),_0x562f38){const _0x37dd75=_n(_0x4a0c26,_0x3fdc25,_0x21be71);An(_0x4a0c26['model'],_0x37dd75),function(_0x131cb2,_0x4c024b){const _0xbb2e6b=_0x4c024b['getFirstRange']()['start'];let _0x4a8a66=_0x4c024b['getFirstRange']()['end'];const _0x17f909=_0xbb2e6b['root'];(_0x4a8a66['textNode']||_0x4a8a66['nodeAfter']&&_0x4a8a66['nodeAfter']['is']('$text'))&&(_0x3ab39d(_0x4a8a66,'...'),En(_0x17f909,_0x4a8a66,0x3),_0x4a8a66=_0x4a8a66['getShiftedBy'](0x3)),(_0xbb2e6b['textNode']||_0xbb2e6b['nodeBefore']&&_0xbb2e6b['nodeBefore']['is']('$text'))&&(_0x3ab39d(_0xbb2e6b,'...'),En(_0x17f909,_0xbb2e6b,0x3),_0xbb2e6b['parent']==_0x4a8a66['parent']&&(_0x4a8a66=_0x4a8a66['getShiftedBy'](0x3)));const _0x3894a5=_0x131cb2['createRange'](_0x131cb2['createPositionAt'](_0x17f909,0x0),_0xbb2e6b),_0x216ec0=_0x131cb2['createRange'](_0x4a8a66,_0x131cb2['createPositionAt'](_0x17f909,'end')),_0x447dec=[..._0x3894a5['getMinimalFlatRanges'](),..._0x216ec0['getMinimalFlatRanges']()];_0x447dec['reverse']();for(const _0x4e0e3a of _0x447dec)_0x168f4f(_0x4e0e3a),pn(_0x17f909,_0x4e0e3a);}(_0x4a0c26['model'],_0x37dd75);}return{'content':Rs(_0x4a0c26['data']['stringify'](_0x21be71,{'showSuggestionHighlights':!0x0})),'hasChanges':!0x0};}function dn(_0x35d6e1,_0x461d78){for(const [_0x18c66c,_0x5c4d97]of _0x35d6e1['markers']){const _0x4c864a=_0x2827cc['_createFromRanges'](_0x5c4d97['getTransformedByOperation'](_0x461d78));_0x4c864a['root']==_0x35d6e1?_0x35d6e1['markers']['set'](_0x18c66c,_0x4c864a):_0x35d6e1['markers']['delete'](_0x18c66c);}}function _n(_0x12e206,_0xabc462,_0x4a97b5){const _0x744aa1=_0x12e206['plugins']['get']('DocumentCompare');let _0x10d31d=_0x12e206['model']['createPositionAt'](_0x4a97b5,Number['POSITIVE_INFINITY']),_0x45a39c=_0x12e206['model']['createPositionAt'](_0x4a97b5,0x0);for(const _0x5ef5d3 of _0xabc462){let _0x4f92e3,_0x2e5bb5;if(_0x744aa1['isMarkedRemoveOperation'](_0x5ef5d3))_0x4f92e3=_0x5ef5d3['newRange']['start'],_0x2e5bb5=_0x5ef5d3['newRange']['end'];else switch(_0x10d31d=gn(_0x10d31d,_0x5ef5d3),_0x45a39c=gn(_0x45a39c,_0x5ef5d3),_0x5ef5d3['type']){case'rename':_0x4f92e3=_0x5ef5d3['position'],_0x2e5bb5=_0x4f92e3['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x4f92e3=_0x5ef5d3['range']['start'],_0x2e5bb5=_0x5ef5d3['range']['end'];break;case'insert':_0x4f92e3=_0x5ef5d3['position'],_0x2e5bb5=_0x4f92e3['getShiftedBy'](_0x5ef5d3['howMany']);break;case'split':_0x4f92e3=_0x5ef5d3['splitPosition'],_0x2e5bb5=_0x5ef5d3['moveTargetPosition'];break;case'merge':{const _0x5f3c3d=_0x5ef5d3['targetPosition']['path']['slice'](0x0,-0x1);_0x4f92e3=_0x12e206['model']['createPositionFromPath'](_0x4a97b5,_0x5f3c3d),_0x2e5bb5=_0x4f92e3['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x2bb9aa=_0x5ef5d3['howMany'],_0x5aebce=_0x5ef5d3['sourcePosition']['_getTransformedByInsertion'](_0x5ef5d3['targetPosition'],_0x2bb9aa),_0x6edf14=_0x5ef5d3['getMovedRangeStart']();'remove'==_0x5ef5d3['type']?(_0x4f92e3=_0x5aebce,_0x2e5bb5=_0x5aebce):(_0x4f92e3=_0x6edf14,_0x2e5bb5=_0x6edf14['getShiftedBy'](_0x2bb9aa));break;}}_0x4f92e3&&_0x4f92e3['isBefore'](_0x10d31d)&&(_0x10d31d=_0x4f92e3['clone'](),_0x10d31d['stickiness']='toNone'),_0x2e5bb5&&_0x2e5bb5['isAfter'](_0x45a39c)&&(_0x45a39c=_0x2e5bb5['clone'](),_0x45a39c['stickiness']='toNone');}return _0x12e206['model']['createSelection'](_0x12e206['model']['createRange'](_0x10d31d,_0x45a39c));}function gn(_0x1342af,_0x34441c){return'move'!=_0x34441c['type']&&'remove'!=_0x34441c['type']||_0x34441c['sourceRange']['containsPosition'](_0x1342af)&&((_0x1342af=_0x34441c['sourcePosition']['clone']())['stickiness']='toNone'),_0x1342af['getTransformedByOperation'](_0x34441c);}function An(_0x2f9f1d,_0x558987){In(_0x2f9f1d,_0x558987,'forward');const _0x2f9ba6=_0x558987['getFirstRange']();_0x558987['setTo']([]),_0x558987['setTo'](_0x2f9ba6,{'backward':!0x0}),In(_0x2f9f1d,_0x558987,'backward');}function In(_0x47e1e7,_0x5dd06d,_0x3f98d7){let _0x3d8aaf=0x14;for(;_0x3d8aaf;){_0x47e1e7['modifySelection'](_0x5dd06d,{'unit':'word','direction':_0x3f98d7}),_0x3d8aaf--;const _0x322d12=_0x5dd06d['focus']['forward'==_0x3f98d7?'nodeBefore':'nodeAfter'];if(_0x322d12&&_0x322d12['is']('element')&&_0x47e1e7['schema']['isBlock'](_0x322d12)&&_0x47e1e7['schema']['isObject'](_0x322d12))break;}}function pn(_0x15b2a4,_0x413d2d){for(const [_0x3437fb,_0x473383]of _0x15b2a4['markers']){const _0x16f908=_0x473383['_getTransformedByDeletion'](_0x413d2d['start'],_0x413d2d['end']['offset']-_0x413d2d['start']['offset']);null!=_0x16f908?_0x15b2a4['markers']['set'](_0x3437fb,_0x16f908):_0x15b2a4['markers']['delete'](_0x3437fb);}}function En(_0x3a93cc,_0x2d4310,_0x1d53c9){for(let [_0x2202cf,_0x106ca9]of _0x3a93cc['markers'])_0x106ca9=_0x106ca9['_getTransformedByInsertion'](_0x2d4310,_0x1d53c9,!0x1)[0x0],_0x3a93cc['markers']['set'](_0x2202cf,_0x106ca9);}function mn(_0x2abdc1,_0x3bedec){for(const _0x43a735 of _0x2abdc1)'noop'!==_0x43a735['type']&&(_0x43a735['_aiSource']=_0x3bedec);}var Tn=class extends _0x898608{static get['pluginName'](){return'AIGateway';}static get requires(){return[_0x45dea0,fs];}get['models'](){return this['context']['plugins']['get'](fs)['models'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['apply'](_0x17acba,_0x55976c){const {applyMethod:_0x1adbf9,roots:_0x15a931}=_0x55976c,_0x1dd475='suggest'===_0x1adbf9;if(_0x17acba['error']||!_0x17acba['results']['length'])throw new ct('ai-gateway-apply-invalid-status',this,{'status':_0x17acba['status']});if(_0x15a931){if(0x0===_0x15a931['length'])throw new ct('ai-gateway-apply-empty-roots',this);for(const {channelId:_0x1427bf,rootName:_0xea00e1}of _0x15a931)if(!_0x17acba['results']['some'](_0x39dd95=>_0x39dd95['channelId']===_0x1427bf&&_0x39dd95['rootName']===_0xea00e1))throw new ct('ai-gateway-apply-root-not-found',this,{'channelId':_0x1427bf,'rootName':_0xea00e1});}const _0x47cd46=_0x17acba['results']['reduce']((_0x100f58,_0x3c03e5)=>{if(_0x15a931&&!_0x15a931['some'](_0x488668=>_0x488668['channelId']===_0x3c03e5['channelId']&&_0x488668['rootName']===_0x3c03e5['rootName']))return _0x100f58;if('completed'!==_0x3c03e5['status'])throw new ct('ai-gateway-apply-invalid-status',this,{'status':_0x3c03e5['status'],'channelId':_0x3c03e5['channelId'],'rootName':_0x3c03e5['rootName']});if(_0x1dd475&&!_0x3c03e5['editor']['plugins']['has']('TrackChanges'))throw new ct('ai-no-track-changes',this,{'channelId':_0x3c03e5['channelId'],'rootName':_0x3c03e5['rootName']});let _0x5bd1df=_0x100f58['get'](_0x3c03e5['editor']);return _0x5bd1df||(_0x5bd1df=[],_0x100f58['set'](_0x3c03e5['editor'],_0x5bd1df)),_0x5bd1df['push'](_0x3c03e5),_0x100f58;},new Map()),_0x5144a1=this['context']['plugins']['get'](_0x45dea0);for(const [_0x6e903c,_0x928b9e]of _0x47cd46){const _0x36b8e6=_0x928b9e['map'](_0x1d92f6=>{const _0x4d791d=_0x6e903c['model']['createPositionAt'](_0x6e903c['model']['document']['getRoot'](_0x1d92f6['rootName']),0x0),_0x274a12=Qs(_0x6e903c,_0x1d92f6['rootName'],_0x1d92f6['contentRawOld'],_0x1d92f6['contentRawNew']);if(!_0x274a12)return _0x1d92f6['droppedUnsupportedInlineChange']=!0x0,null;const _0x2c64e2=_0x5144a1['getDiff'](_0x274a12['before'],_0x274a12['after'],{'anchor':_0x4d791d,'markDeletions':_0x1dd475,'targetEditor':_0x6e903c}),_0x2b7e24=_0x6e903c['model']['document']['history']['getOperations'](_0x1d92f6['documentVersion']),_0x2ad030={'document':_0x6e903c['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x1b0202=_0x5dec67(_0x2c64e2['getOperations'](),_0x2b7e24,_0x2ad030)['operationsA'];return mn(_0x1b0202,_0x55976c['aiSource']??'api'),_0x1b0202;});_0x6e903c['model']['change'](_0x2cb144=>{for(const _0x505ab5 of _0x36b8e6)_0x505ab5&&(_0x1dd475?_0x6e903c['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x505ab5):_0x5144a1['applyOperations'](_0x2cb144,_0x505ab5));});}}mergeChangesIntoContent(_0x117148,_0x49ed10,_0x11c3b1){const _0x214f75=new hn(),_0x43956e=new sn();let _0x1f0296=_0x214f75['parseAndNormalizeHTML'](_0x49ed10);for(const _0x4174df of _0x117148)try{const _0x5e2a91=_0x214f75['parseAndNormalizeHTML'](_0x4174df['content']);_0x1f0296=_0x43956e['merge'](_0x5e2a91,_0x1f0296,{'cutAfterUnstable':!0x1,'replaceRemovedWith':void 0x0})['parsedContent'];}catch(_0x3b5ed1){throw new ct('ai-gateway-merge-failed',this,{..._0x4174df},_0x3b5ed1);}return un(_0x11c3b1,_0x214f75['parseAndNormalizeHTML'](_0x49ed10),_0x1f0296,!0x1,!0x1)['content'];}};const wn=/* #__PURE__ -- @preserve */
28
+ dt(),Cn=['capabilitiesUpdated'];var fn=class extends wn{['_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(_0x1d4827){const _0x4b3a32={};if(!_0x1d4827)return _0x4b3a32;('isWebSearchEnabled'in _0x1d4827?_0x1d4827['isWebSearchEnabled']:_0x1d4827['webSearch'])&&(_0x4b3a32['webSearch']={});const _0x34f9c1='isReasoningEnabled'in _0x1d4827?_0x1d4827['isReasoningEnabled']:_0x1d4827['reasoning'];return _0x34f9c1&&(_0x4b3a32['reasoning']='string'==typeof _0x34f9c1?{'level':_0x34f9c1}:{}),_0x4b3a32;}toggleWebSearch(){this['setWebSearch'](!this['_isWebSearchEnabled']);}toggleReasoning(){this['setReasoning'](!this['_isReasoningEnabled']);}setWebSearch(_0x4f8e23){_0x4f8e23!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x4f8e23,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}setReasoning(_0x5e62e5){_0x5e62e5!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x5e62e5,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}};function bn(_0x3a1d0b,_0x4c7c08,_0x26d796,_0x589450){if(_0x3a1d0b instanceof ct)return _0x3a1d0b;const _0x268edd=_0x3a1d0b?.['data'];return new ct(_0x4c7c08,_0x26d796,void 0x0!==_0x268edd?{..._0x589450,'backendData':_0x268edd}:_0x589450,_0x3a1d0b);}var Sn=class{_editor;_rootName;['_channelId'];['_sessionId'];_documentVersion;_contentRawOld;_contentRawNew;['_error'];_isAborted=!0x1;_droppedUnsupportedInlineChange=!0x1;constructor(_0x2b4254){this['_editor']=_0x2b4254['editor'],this['_rootName']=_0x2b4254['rootName'],this['_channelId']=_0x2b4254['channelId'],this['_sessionId']=_0x2b4254['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(_0x36cbca){this['_documentVersion']=_0x36cbca;}get contentRawOld(){return this['_contentRawOld'];}set contentRawOld(_0x3560bd){this['_contentRawOld']=_0x3560bd;}get contentRawNew(){return this['_contentRawNew'];}set contentRawNew(_0x30a663){this['_contentRawNew']=_0x30a663;}get contentOld(){return this['_dropDataIds'](this['_contentRawOld']||'');}get contentNew(){return this['_dropDataIds'](this['_contentRawNew']||'');}get['error'](){return this['_error'];}set['error'](_0x263222){this['_error']=_0x263222;}get droppedUnsupportedInlineChange(){return this['_droppedUnsupportedInlineChange'];}set droppedUnsupportedInlineChange(_0x3f2720){this['_droppedUnsupportedInlineChange']=_0x3f2720;}abort(){this['_isAborted']=!0x0;}_dropDataIds(_0xcab047){return _0xcab047['replace'](/ data-id="[a-z0-9]+"/g,'');}},Rn=class extends Sn{['_summary']='';get['summary'](){return this['_summary'];}set['summary'](_0x4f104f){this['_summary']=_0x4f104f;}},On=class{_results;constructor(_0x2bef03=[]){this['_results']=_0x2bef03;}_status='initialized';['_error'];abort(){'error'!==this['_status']&&(this['_status']='aborted');}get status(){return this['_status'];}set status(_0x51c582){this['_status']=_0x51c582;}get['error'](){return this['_error'];}set['error'](_0x1493c3){this['_status']='error',this['_error']=_0x1493c3;}get results(){return this['_results'];}addResult(..._0x36539f){this['_results']['push'](..._0x36539f);}},vn=class extends _0x898608{static get['pluginName'](){return'AIDocumentProcessingGateway';}static get requires(){return[Is,tn,Tn,fs];}get['models'](){return this['context']['plugins']['get'](fs)['models'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async processDocument(_0x181d06,_0x92dfc8){if(!_0x181d06)throw new ct('ai-documentprocessinggateway-missing-prompt',this);const _0x422936=await this['context']['plugins']['get'](tn)['getDocumentData'](),_0x24dfc5=_0x92dfc8['roots'];if(0x0===(_0x24dfc5??_0x422936)['length'])throw new ct('ai-documentprocessinggateway-empty-roots',this);if(_0x24dfc5){for(const _0x11b5ed of _0x24dfc5)if(!_0x422936['some'](_0x467c12=>_0x467c12['rootName']===_0x11b5ed['rootName']&&_0x467c12['channelId']===_0x11b5ed['channelId']))throw new ct('ai-documentprocessinggateway-root-not-found',this,{'channelId':_0x11b5ed['channelId'],'rootName':_0x11b5ed['rootName']});}const _0xef00d3=_0x24dfc5?_0x422936['filter'](_0x2c8e56=>_0x24dfc5['some'](_0xafe64=>_0xafe64['rootName']===_0x2c8e56['rootName']&&_0xafe64['channelId']===_0x2c8e56['channelId'])):_0x422936,_0x333bb1=[],_0x7f4a1c=[];for(const _0x74d35d of _0xef00d3){const _0x538401={'editor':_0x74d35d['editor'],'rootName':_0x74d35d['rootName'],'sessionId':_0x74d35d['sessionId'],'channelId':_0x74d35d['channelId'],'contentRawOld':_0x74d35d['content'],'documentVersion':_0x74d35d['version']};_0x333bb1['push'](_0x538401),_0x7f4a1c['push']({'type':'document','content':_0x538401['contentRawOld']});}const _0x2baf04=this['context']['plugins']['get']('AIConnector')['processDocument']({'content':_0x7f4a1c,'prompt':_0x181d06,'model':_0x92dfc8['model'],'capabilities':fn['getCapabilitiesRequestData'](_0x92dfc8['capabilities']),'contexts':_0x92dfc8['contexts']});let _0x9931e0;if(_0x92dfc8?.['signal']){_0x92dfc8['signal']['aborted']&&_0x2baf04['abortController']['abort']();const _0x25382b=_0x92dfc8['signal'],_0x425b37=()=>_0x2baf04['abortController']['abort']();_0x25382b['addEventListener']('abort',_0x425b37),_0x9931e0=()=>_0x25382b['removeEventListener']('abort',_0x425b37);}const _0x399ce5=new On();let _0x38900c=[];try{if(_0x38900c=(await _0x2baf04['getResult']())['documents'],!(_0x38900c&&_0x38900c['length']>0x0))throw new ct('ai-documentprocessinggateway-empty-reply',this);if(_0x38900c['length']!==_0x7f4a1c['length'])throw new ct('ai-documentprocessinggateway-reply-count-mismatch',this,{'expected':_0x7f4a1c['length'],'received':_0x38900c['length']});const _0x5d8351=_0x38900c['findIndex'](({document:_0x168642})=>!_0x168642['length']);if(-0x1!==_0x5d8351){const _0x3ea685=_0x333bb1[_0x5d8351];throw new ct('ai-documentprocessinggateway-empty-root-content',this,{'channelId':_0x3ea685['channelId'],'rootName':_0x3ea685['rootName']});}_0x399ce5['status']='completed';}catch(_0x56f7ab){_0x56f7ab instanceof Error&&_0x56f7ab['message']['includes']('ai-request-aborted')?_0x399ce5['abort']():_0x399ce5['error']=bn(_0x56f7ab,'ai-documentprocessinggateway-run-failed',this);}finally{_0x9931e0&&_0x9931e0();}if('completed'===_0x399ce5['status'])for(const [_0x3a4b20,_0xdb6339]of _0x333bb1['entries']()){const {channelId:_0x2b8e45,contentRawOld:_0x5f4cff,documentVersion:_0x214810,editor:_0x453da8,rootName:_0xee4377,sessionId:_0x87bca}=_0xdb6339,_0x2b337c=new Rn({'channelId':_0x2b8e45,'editor':_0x453da8,'rootName':_0xee4377,'sessionId':_0x87bca});_0x2b337c['contentRawOld']=_0x5f4cff,_0x2b337c['documentVersion']=_0x214810,_0x2b337c['contentRawNew']=_0x38900c[_0x3a4b20]['document'],_0x2b337c['summary']=_0x38900c[_0x3a4b20]['summary'],_0x399ce5['addResult'](_0x2b337c);}return _0x399ce5;}applyResult(_0x3bebcb,_0x47bf52){this['context']['plugins']['get']('AIGateway')['apply'](_0x3bebcb,_0x47bf52);}};function kn(_0x2e5977){return _0x2e5977 instanceof Error&&('AbortError'===_0x2e5977['name']||('AICoreError'===_0x2e5977['name']?!0x0===_0x2e5977['isAbort']:_0x2e5977['message']['startsWith']('ai-request-aborted')));}var yn=class extends Error{['code'];severity;type;context;isAbort;constructor(_0x1e3113){super(_0x1e3113['code'],_0x1e3113['cause']instanceof Error?{'cause':_0x1e3113['cause']}:void 0x0),this['name']='AICoreError',this['code']=_0x1e3113['code'],this['severity']=_0x1e3113['severity']??'error',this['type']=_0x1e3113['type']??'system',this['context']=_0x1e3113['context'],this['isAbort']=_0x1e3113['isAbort']??kn(_0x1e3113['cause']);}},Nn=class extends _0x898608{static get['pluginName'](){return'AIErrorSink';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}createReporter(_0x12aaa6){return new xn(this,_0x12aaa6);}},xn=class{['_sink'];_component;constructor(_0xf6615a,_0x3333a0){this['_sink']=_0xf6615a,this['_component']=_0x3333a0;}['logError'](_0x365767,_0x25dabc={}){this['_emit'](_0x365767,_0x25dabc),this['_defaultLog'](_0x365767);}reportError(_0x2a8c6b,_0xd05760={}){this['_emit'](_0x2a8c6b,_0xd05760);}_emit(_0x3183c0,_0x2794ee){kn(_0x3183c0)||this['_sink']['fire']('error',{'error':_0x3183c0,'component':this['_component'],'context':_0x2794ee['context']});}_defaultLog(_0x18f37c){if(!kn(_0x18f37c)){if(_0x18f37c instanceof yn){if('user'===_0x18f37c['type']||'network'===_0x18f37c['type'])return;if('warning'===_0x18f37c['severity'])return void console['warn'](this['_component'],_0x18f37c);}console['error'](this['_component'],_0x18f37c);}}};const Ln='ck-ai-button-primary',Pn='ck-ai-button-secondary',Dn='ck-ai-button-tertiary';function Hn(_0x242f1c,_0x594b01){const _0x183cb6=new Mt(_0x242f1c),_0xdaa14e=Es(_0x242f1c,'AI_TABS_LABEL_MINIMIZE'),_0x18b2c2=Es(_0x242f1c,'AI_TABS_LABEL_MAXIMIZE');return _0x183cb6['set']({'withText':!0x1,'icon':_0x31ef04,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+Dn}),_0x183cb6['bind']('label')['to'](_0x594b01,'isMaximized',_0x1ff179=>_0x1ff179?_0xdaa14e:_0x18b2c2),_0x183cb6['bind']('icon')['to'](_0x594b01,'isMaximized',_0x50c8b9=>_0x50c8b9?_0x2bee5e:_0x31ef04),_0x183cb6['bind']('isOn')['to'](_0x594b01,'isMaximized'),_0x183cb6['on']('execute',()=>{_0x594b01['fire']('resizeTabs');}),_0x183cb6;}function Mn(_0x8c8a){const _0x4d9c3e=new Pt(_0x8c8a);return _0x4d9c3e['attachToDom'](),_0x4d9c3e['bodyCollectionContainer']['classList']['add']('ck-ai-body'),_0x4d9c3e;}const Un=/* #__PURE__ -- @preserve */
29
+ At();var Vn=class extends Un{['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:_0x7c4c86,isDone:_0x46bf03=!0x1,isComplete:_0xb7b493,interactionId:_0x1305ce,areActionsDisabled:_0x35e0a2,outdatedReasonByDocumentId:_0x32184e,isFromHistory:_0x58cd9c=!0x1,documentContextContent:_0x4ad0f5,locale:_0x513948,id:_0x2b5eea,channelsToEditors:_0xe82527}){super(),this['id']=_0x2b5eea||kt(),this['interactionId']=_0x1305ce,this['type']=_0x7c4c86,this['areActionsDisabled']=!!_0x35e0a2,this['_outdatedReasonByDocumentId']=_0x32184e,this['isFromHistory']=_0x58cd9c,this['locale']=_0x513948,this['aiResponseParser']=new hn(),this['aiResponseApplier']=new sn(),this['documentContextContent']=new Map(_0x4ad0f5?.['map'](_0x396d2c=>[_0x396d2c['id'],Rs(_0x396d2c['content'])])||[]),this['_documentIdToSource']=new Map(_0x4ad0f5?.['map'](_0x20757c=>[_0x20757c['id'],{'editor':_0xe82527['get'](_0x20757c['channelId']),'rootName':_0x20757c['rootName']}])||[]),this['set']('isDone',_0x46bf03),this['set']('isComplete',_0xb7b493??_0x46bf03),'text'===this['type']&&this['content']['set']('text','');}appendContent(_0x44df14,_0x4a79c7){const _0xfeaed2='text'===this['type']?'text':_0x4a79c7;this['content']['has'](_0xfeaed2)||this['content']['set'](_0xfeaed2,''),this['content']['set'](_0xfeaed2,this['content']['get'](_0xfeaed2)+_0x44df14),this['onContentChange'](_0xfeaed2);}['done'](_0x569c04=!0x0){this['isComplete']=_0x569c04,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}destroy(){this['stopListening']();}setChangeGroupState(_0x2bdf01,_0x59eab9,_0xad1984){this['changeGroups'][_0x2bdf01]['state']=_0x59eab9,this['changeGroups'][_0x2bdf01]['outdatedReason']=_0xad1984,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x2bdf01,'state':_0x59eab9,'outdatedReason':_0xad1984});}getContentParts({showDiff:_0x524c53,groupIndex:_0x38a6d3}){const _0x76ba3b=this['_getCachedContentParts'](_0x524c53,_0x38a6d3);if(_0x76ba3b)return _0x76ba3b;let _0x436912;if(void 0x0===_0x38a6d3)_0x436912=this['changeGroups'];else{const _0xc0502c=this['changeGroups']['find'](({index:_0x4381c3})=>_0x4381c3===_0x38a6d3);if(!_0xc0502c)throw new ct('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x38a6d3});_0x436912=[_0xc0502c];}const _0x240ce9=ln({'showDiff':_0x524c53,'changeGroups':_0x436912,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x524c53,_0x240ce9),_0x240ce9;}_getCachedContentParts(_0x36cb6c,_0x3c59d9){const _0x31c39f=_0x36cb6c?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x31c39f]['length'])return null;const _0x42278a=this['cachedSuggestionContentParts'][_0x31c39f];if(void 0x0===_0x3c59d9)return _0x42278a['length']>0x0&&_0x42278a['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x36cb6c,null),null):_0xddedfa(_0x42278a);{const _0x2f18b7=_0x42278a['find'](({index:_0xffcdd5})=>_0xffcdd5===_0x3c59d9);if(_0x2f18b7)return[_0xddedfa(_0x2f18b7)];}return null;}_setCachedContentParts(_0x4e8a23,_0x10fd7a){const _0x346fc6=_0x4e8a23?'withDiff':'withoutDiff';_0x10fd7a?_0x10fd7a['forEach'](_0x3cfcb7=>{const _0x173efd=this['cachedSuggestionContentParts'][_0x346fc6],_0x235c00=_0x173efd['find'](({index:_0x24494e})=>_0x24494e===_0x3cfcb7['index']);if(_0x235c00){const _0x335a03=_0x173efd['indexOf'](_0x235c00);_0x173efd['splice'](_0x335a03,0x1,_0x3cfcb7);}else _0x173efd['push'](_0x3cfcb7);}):this['cachedSuggestionContentParts'][_0x346fc6]['length']=0x0;}onContentChange(_0x2dcb4f){if('modification'===this['type']){if(_0x2dcb4f)this['parsedContent']['set'](_0x2dcb4f,this['aiResponseParser']['parseAndNormalizeHTML'](this['content']['get'](_0x2dcb4f)));else{for(const [_0x14931c,_0x28a710]of this['content'])this['parsedContent']['set'](_0x14931c,this['aiResponseParser']['parseAndNormalizeHTML'](_0x28a710));}const _0x370a2c=this['changeGroups'];for(const _0x390521 of this['content']['keys']())this['updateChangeGroups'](_0x390521);const _0x3f2d27=this['_getDifferentChangeGroups'](_0x370a2c,this['changeGroups']);(_0x3f2d27['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x3f2d27),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']['set']('text',this['aiResponseParser']['convertMarkdownToHTML'](this['content']['get']('text'))),this['fire']('replyContentUpdated',this);}_getDifferentChangeGroups(_0x3c238e,_0x4b9f1e){const _0x408606=[];for(const _0x481f33 of _0x4b9f1e){const _0x58675e=_0x3c238e[_0x481f33['index']];_0x58675e?_0x58675e['changes']['length']!==_0x481f33['changes']['length']?_0x408606['push'](_0x481f33):_0x58675e['changes']['forEach']((_0x13262f,_0x3e2a34)=>{const _0x524434=_0x481f33['changes'][_0x3e2a34];_0x13262f['id']!==_0x524434['id']&&_0x408606['push'](_0x481f33);}):_0x408606['push'](_0x481f33);}return _0x408606;}updateChangeGroups(_0x5e0ed0){const _0x2de792=this['documentContextContent']['get'](_0x5e0ed0),_0x2a7710=this['parsedContent']['get'](_0x5e0ed0);if(!_0x2de792||!_0x2a7710)return;const _0x20fc05=new _0x21f244('p',{},[new _0x21f244('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0xa7d61f(Es(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x573755=this['aiResponseApplier']['merge'](_0x2a7710,_0x2de792['cloneNode'](!0x0),{'cutAfterUnstable':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x20fc05});this['parsedMergedContent']['set'](_0x5e0ed0,_0x573755['parsedContent']);let _0x14bd36=[];if(_0x4615bb(_0x48f1ca=>{const _0x294098=Ps(_0x48f1ca,'data-id');if(!_0x294098||!_0x47588f(_0x294098))return!0x1;const _0x98048b=[_0x48f1ca,...Ms(_0x48f1ca)]['at'](-0x2);if(_0x48f1ca!=_0x98048b){const _0x389e8e=Ps(_0x98048b,'data-id');_0x47588f(_0x389e8e)||(_0x14bd36['push']({'node':_0x98048b,'id':_0x389e8e,'type':'modified'}),_0x573755['modifiedNodeIds']['push'](_0x389e8e));}else _0x573755['modifiedNodeIds']['includes'](_0x294098)?_0x14bd36['push']({'node':_0x48f1ca,'type':'modified','id':_0x294098}):_0x573755['newNodeIds']['includes'](_0x294098)?_0x14bd36['push']({'node':_0x48f1ca,'type':'new','id':_0x294098,'anchorId':Ps(_0x48f1ca['previousSibling'],'data-id')}):_0x14bd36['push']({'node':_0x48f1ca,'type':'removed','id':_0x294098});return!0x0;},this['parsedMergedContent']['get'](_0x5e0ed0)),_0x14bd36=_0x14bd36['filter'](({node:_0x4042ad})=>[...Ms(_0x4042ad),_0x4042ad]['every'](_0x140546=>!Ps(_0x140546,'data-unstable'))),this['changeGroups']=this['changeGroups']['filter'](_0x365057=>_0x365057['documentId']!==_0x5e0ed0),0x0==_0x14bd36['length'])return;const _0x4f6f7a=[[_0x14bd36[0x0]]];for(let _0x39cb08=0x1;_0x39cb08<_0x14bd36['length'];_0x39cb08++){const _0x312cb5=_0x4f6f7a[_0x4f6f7a['length']-0x1],_0x39ce96=_0x312cb5[_0x312cb5['length']-0x1];_0x14bd36[_0x39cb08]['node']['previousSibling']==_0x39ce96['node']&&'modified'!=_0x14bd36[_0x39cb08]['type']&&'modified'!=_0x39ce96['type']?_0x312cb5['push'](_0x14bd36[_0x39cb08]):_0x4f6f7a['push']([_0x14bd36[_0x39cb08]]);}for(const _0x3be299 of _0x4f6f7a){const _0x3f1a58=_0x3be299[0x0],_0x55a5ce=_0x3be299[_0x3be299['length']-0x1],_0x2079e4=_0xe8a246(_0x3f1a58['node']['previousSibling']);_0x2079e4&&_0x3be299['unshift'](_0x2079e4);const _0x33b8ba=_0xe8a246(_0x55a5ce['node']['nextSibling']);_0x33b8ba&&_0x3be299['push'](_0x33b8ba);}ks('data-wrapped-id',null,this['parsedMergedContent']['get'](_0x5e0ed0))['forEach'](_0xf36ba8=>{Ds(_0xf36ba8,'data-wrapped-id',null);});const _0x32d231=new Map();ks('data-unwrapped-id',null,this['parsedMergedContent']['get'](_0x5e0ed0))['forEach'](_0x247f58=>{const _0x4ef4ae=Ps(_0x247f58,'data-unwrapped-id'),_0x348ac6=Ps(_0x247f58,'data-id');_0x32d231['set'](_0x348ac6,_0x4ef4ae),Ds(_0x247f58,'data-id',_0x4ef4ae),Ds(_0x247f58,'data-unwrapped-id',null);});for(const _0x32fa3c of _0x14bd36){const _0x120d59=_0x32d231['get'](_0x32fa3c['id']);_0x120d59&&(_0x32fa3c['id']=_0x120d59);}this['changeGroups']['push'](..._0x4f6f7a['map']((_0x2974db,_0x19af39)=>{const _0x51de91=this['_documentIdToSource']['get'](_0x5e0ed0),_0x44a423=this['_outdatedReasonByDocumentId']?.['get'](_0x5e0ed0),_0x17fa95=this['areActionsDisabled']||void 0x0!==_0x44a423;return{'changes':_0x2974db,'state':_0x17fa95?'outdated':'pending','outdatedReason':_0x17fa95?_0x44a423:void 0x0,'index':_0x19af39,'editor':_0x51de91['editor'],'rootName':_0x51de91['rootName'],'documentId':_0x5e0ed0};}));const _0x535d8f=Array['from'](this['documentContextContent']['keys']());function _0x47588f(_0x3c30c7){return _0x573755['modifiedNodeIds']['includes'](_0x3c30c7)||_0x573755['newNodeIds']['includes'](_0x3c30c7)||_0x573755['removedNodeIds']['includes'](_0x3c30c7);}function _0xe8a246(_0x2bd29f){if(_0x2bd29f&&Ps(_0x2bd29f,'data-id')&&!Ps(_0x2bd29f,'data-unstable')){const _0x147ba5=Ps(_0x2bd29f,'data-id');if(!_0x47588f(_0x147ba5))return{'node':_0x2bd29f,'type':'context','id':_0x147ba5};}return null;}this['changeGroups']['sort']((_0x382ba9,_0x4d1b8d)=>_0x535d8f['indexOf'](_0x382ba9['documentId'])-_0x535d8f['indexOf'](_0x4d1b8d['documentId'])),this['changeGroups']['forEach']((_0x2da6fb,_0x16188a)=>{_0x2da6fb['index']=_0x16188a;});}};const Bn=/* #__PURE__ -- @preserve */
30
+ dt(),Gn=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];var Fn=class extends Bn{['id'];['replies']=[];currentReply;['messageId'];actionCallId;currentRequest;connector;isStopped=!0x1;isDestroyed=!0x1;['locale'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;_channelsToEditors;constructor({connector:_0x5a4236,locale:_0x2b21b8,channelsToEditors:_0x3ea344}){super(),this['id']=kt(),this['connector']=_0x5a4236,this['isStopped']=!0x0,this['locale']=_0x2b21b8,this['_channelsToEditors']=_0x3ea344||new Map();}async start(){await this['_run']();}async['resume'](_0x49cbec){await this['_run'](_0x49cbec);}async['_run'](_0x5ef480){const _0x39b9dd=[];let _0x25cb86,_0x52d3db,_0x4d7255,_0x4297d1=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=_0x5ef480||this['sendRequest'](),this['fire']('interactionStarted',this);const _0xb343d1=await this['currentRequest']['getStream']();for await(const _0x43882d of _0xb343d1){if(this['isStopped'])return;if('error'==_0x43882d['event'])return void this['fire']('error',{'error':new ct('ai-chat-interaction-error',this)});switch(_0x43882d['event']){case'message-metadata':this['messageId']=_0x43882d['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x43882d['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x43882d['data']['conversationTitle'],!0x0);break;case'source':_0x39b9dd['push'](_0x43882d['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'](),_0x25cb86='modification-delta'==_0x43882d['event']?'modification':'text',_0x52d3db='modification-delta'==_0x43882d['event']?_0x43882d['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x25cb86&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x25cb86,'interactionId':this['id'],'id':_0x52d3db,'channelsToEditors':this['_channelsToEditors'],...'modification-delta'==_0x43882d['event']&&{'documentId':_0x43882d['data']['documentId']}}),'modification'==_0x25cb86&&(this['currentReply']['sources']=_0x39b9dd['splice'](0x0))),this['currentReply']['appendContent'](_0x43882d['data']['textDelta'],_0x43882d['data']['documentId']);break;case'mcp-tool-result':_0x4d7255=JSON['parse'](_0x43882d['data']['result']),this['_handleToolResultData']({'toolName':_0x43882d['data']['toolName'],'data':_0x4d7255['data'],'attributes':_0x4d7255['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x43882d['data']['toolName'],'data':_0x43882d['data']['data']});}}_0x4297d1=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x39b9dd['length']>0x0&&(this['currentReply']['sources']=_0x39b9dd['splice'](0x0)),this['_finalizeInteraction'](_0x4297d1),this['fire']('interactionFinished',this));}}stop(){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}getReply(_0x30117e){return this['replies']['find'](_0x4d703b=>_0x4d703b['id']===_0x30117e);}destroy(){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x27cc73=>_0x27cc73['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}createReply(_0x46f1df){const _0x54196b=this['getDocumentContext'](),_0x14afd6=new Vn({'locale':this['locale'],'documentContextContent':_0x54196b?.['documents'],..._0x46f1df});return this['replies']['push'](_0x14afd6),_0x14afd6['delegate'](...Gn)['to'](this),this['fire']('replyCreated',_0x14afd6),_0x14afd6;}setConversationTitle(_0x56645e,_0x53e3b2=!0x1){this['fire']('setConversationTitle',_0x56645e,_0x53e3b2);}resetWebSearchState(){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}resetReasoningState(){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}_handleToolResultData(_0x112462){this['fire']('toolDataReceived',{'type':'result','toolName':_0x112462['toolName'],'data':structuredClone(_0x112462['data']||{}),'attributes':structuredClone(_0x112462['attributes']||{})},this);}_handleToolNotificationData(_0x14f6d4){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x14f6d4['toolName'],'data':structuredClone(_0x14f6d4['data'])},this);}_finalizeInteraction(_0x3112a4=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x3112a4),this['currentRequest']=this['currentReply']=void 0x0;}};const Kn='defaultContextIds',Wn=/* #__PURE__ -- @preserve */
31
+ At();var Yn=class AIContext extends Wn{['_refs'];constructor(_0x3a2ea3=[]){super(),this['_refs']=[..._0x3a2ea3];}get['refs'](){return[...this['_refs']];}get isEmpty(){return 0x0===this['_refs']['length'];}cloneWith(..._0x5c72c5){return new AIContext([...this['_refs'],..._0x5c72c5]);}addDefaultContext(_0x218b94){this['_refs']=[...this['_refs'],..._0x218b94];}toRequestParts(_0x1fafdc=[]){return[...this['_refs']['map'](As),..._0x1fafdc];}toMessageAttributes(_0x12f2a6){return this['isEmpty']?_0x12f2a6:{..._0x12f2a6,[Kn]:[...new Set(this['_refs']['map'](_0xfd784b=>_0xfd784b['id']))]};}static getDefaultContextIds(_0x5b5156){const _0x579a05=_0x5b5156&&_0x5b5156[Kn];return new Set(Array['isArray'](_0x579a05)?_0x579a05:[]);}};const $n=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']]),qn=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];var Qn=class AIChatContext extends Yn{_connector;['_config'];['_ownerId'];constructor({connector:_0x191874,config:_0x9996be,ownerId:_0x250acd}){super(),this['_connector']=_0x191874,this['_config']=_0x9996be,this['_ownerId']=_0x250acd;}init(){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}getPendingContextItems(){return new Map(this['_pendingContextItems']);}async populateFromMessage(_0x4e0a96,_0x2cb000,_0x2ef506=new Set()){const _0x37ac9d=new Map(),{contextItem:_0x568271,unmatchedDocumentIds:_0x1ff2b4}=await this['_populateDocumentContextItem'](_0x4e0a96,_0x2cb000);_0x568271&&_0x37ac9d['set'](_0x568271['id'],_0x568271);for(const _0xcdb3b1 of _0x4e0a96){if('document'===_0xcdb3b1['type'])continue;const _0x3ef856=await this['_createContextItemFromContent'](_0xcdb3b1,_0x2ef506);'context'!==_0x3ef856['type']&&this['_addToConversationContextItem'](_0x3ef856),_0x37ac9d['set'](_0x3ef856['id'],_0x3ef856);}return{'contextItems':_0x37ac9d,'hasUnmatched':_0x1ff2b4['size']>0x0,'unmatchedDocumentIds':_0x1ff2b4};}async _populateDocumentContextItem(_0x1eee3a,_0x47ebe8){const _0x5e99eb=_0x1eee3a['filter'](_0x6ba114=>'document'===_0x6ba114['type']);if(0x0===_0x5e99eb['length'])return{'unmatchedDocumentIds':new Set()};const _0x279343=_0x5e99eb['map'](_0x1274a1=>_0x1274a1['id']),_0x17d85c=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x279343)['getDocuments'](),_0x457243=new Map(_0x17d85c['map'](_0x5ad35d=>[_0x5ad35d['id'],_0x5ad35d])),_0x3edc2b=[],_0x5eef2a=new Set();for(const _0x329973 of _0x5e99eb){const _0x1add1c=_0x457243['get'](_0x329973['id']);_0x1add1c&&(this['_matchDocumentToRoot'](_0x1add1c,_0x47ebe8)||_0x5eef2a['add'](_0x1add1c['id']),_0x3edc2b['push']({'id':_0x1add1c['id'],'content':_0x1add1c['content'],'version':_0x1add1c['attributes']?.['version']??0x0,'sessionId':_0x1add1c['attributes']?.['sessionId']??null,'selection':[],'selectionSignature':'','channelId':_0x1add1c['attributes']?.['channelId']??_0x47ebe8[0x0]?.['config']['get']('collaboration.channelId')??'','rootName':_0x1add1c['attributes']?.['rootName']??_0x47ebe8[0x0]?.['model']['document']['getRoots']()[0x0]['rootName']??'','editorConfig':_0x329973['editorConfig']}));}const _0x3f806f={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x3edc2b};return this['_addToConversationContextItem'](_0x3f806f),this['toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x3f806f,'unmatchedDocumentIds':_0x5eef2a};}_matchDocumentToRoot(_0x473db0,_0x57363c){const _0x5d76b1=_0x473db0['attributes']?.['channelId'],_0x4c2d7e=_0x473db0['attributes']?.['rootName'];if(_0x5d76b1&&_0x4c2d7e){for(const _0x188469 of _0x57363c)if(_0x188469['config']['get']('collaboration.channelId')===_0x5d76b1){for(const _0x574148 of _0x188469['model']['document']['getRoots']())if('$graveyard'!==_0x574148['rootName']&&_0x574148['rootName']===_0x4c2d7e)return{'editor':_0x188469,'rootName':_0x574148['rootName']};}}}async _createContextItemFromContent(_0x1ad126,_0x1b2476=new Set()){return'mcp-tool-context'===_0x1ad126['type']?{'id':_0x1ad126['id'],'uiId':_0x1ad126['id'],'label':_0x1ad126['data']?.['label']||_0x1ad126['id'],'type':'mcp-tool-context','mcpServerName':_0x1ad126['mcpServerName'],'toolName':_0x1ad126['toolName'],'data':_0x1ad126['data']||{}}:{'id':_0x1ad126['id'],'uiId':_0x1ad126['id'],'label':_0x1ad126['attributes']?.['label']||_0x1ad126['name']||_0x1ad126['url']||_0x1ad126['id'],'type':_0x1ad126['type'],..._0x1ad126?.['attributes']?.['resourceId']?{'resourceId':_0x1ad126['attributes']?.['resourceId']}:{},...'context'===_0x1ad126['type']&&_0x1b2476['has'](_0x1ad126['id'])?{'hidden':!0x0}:{}};}getSentContextItems(){return new Map(this['_conversationContextItems']);}removeFromContext(_0x3d3569){this['_pendingContextItems']['get'](_0x3d3569)?.['isReadOnly']||this['_removeContextItem'](_0x3d3569);}clearPendingContextItems(){if(0x0===this['_pendingContextItems']['size'])return;for(const _0xcc81eb of this['_pendingContextItems']['values']())'context'!==_0xcc81eb['type']&&this['_removeContextItem'](_0xcc81eb['uiId']);const _0x3638e2=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x3638e2&&this['_addContextItem']({..._0x3638e2,'isReadOnly':!0x0,'hidden':!0x0});}addToConversationContext(_0x541e0f){for(const _0xe55aae of _0x541e0f['values']())'context'!==_0xe55aae['type']&&this['_addToConversationContextItem'](_0xe55aae);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(_0x41f93f){return Array['from'](_0x41f93f['values']())['flatMap'](_0x1179f2=>this['_mapContextItemToRequestData'](_0x1179f2));}async addFilesToContext(_0x5b3ab1,_0x2c7626,_0x2e5b28='file'){const _0x35670f='files-'+kt();this['_startUploadOperation'](_0x35670f);try{await Promise['all'](_0x5b3ab1['map'](async _0x577e00=>{const _0x4766d4='file-'+kt(),_0x31f684=_0x15f5d8(_0x577e00['name']),_0x4616ea='file'===_0x2e5b28&&_0x577e00['type']['startsWith']('image/')?'image':_0x2e5b28;try{this['_addContextItem']({'type':_0x4616ea,'label':_0x2c7626?.['label']||_0x31f684,'uiId':_0x4766d4,'resourceId':_0x2c7626?.['resourceId']},!0x0);const _0x39900b=this['_connector']['uploadFile'](this['_ownerId'],_0x577e00,_0x2c7626);this['_ongoingUploads']['set'](_0x4766d4,_0x39900b['abortController']);const {id:_0x396be6}=await _0x39900b['getId']();this['_ongoingUploads']['delete'](_0x4766d4),this['_finishContextItemLoading']({'type':_0x4616ea,'id':_0x396be6,'label':_0x2c7626?.['label']||_0x31f684,'uiId':_0x4766d4,'resourceId':_0x2c7626?.['resourceId']},!0x1);}catch(_0x5d5751){if(this['_ongoingUploads']['delete'](_0x4766d4),!kn(_0x5d5751)){const _0x51cafc=new yn({'code':$n['get'](_0x5d5751['code'])||'ai-chat-file-upload-failed','cause':_0x5d5751,'context':{'fileName':_0x31f684}});this['fire']('error',{'error':_0x51cafc});}this['_removeContextItem'](_0x4766d4);}}));}finally{this['_finishUploadOperation'](_0x35670f);}}addCurrentDocumentToContext(_0x2b02c9){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x3e1533={'type':'document','uiId':'current-document','label':_0x2b02c9,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x3e1533);}getCurrentDocumentContext(){return this['_pendingContextItems']['get']('current-document');}async updateCurrentDocuments(_0x57a962,_0x4f5de2){const _0xcd437d=this['getCurrentDocumentContext']();if(!_0xcd437d)return;_0x57a962['length']>0x1&&_0x57a962['some'](_0x367443=>!_0x367443['description'])&&St('ai-chat-documents-missing-description');try{const _0x5f2d40=(_0xcd437d['documents']||[])['filter'](_0x3d2379=>_0x4f5de2['has'](_0x3d2379['channelId']));if(!_0x57a962['length'])return void(_0xcd437d['documents']=_0x5f2d40);const _0x1e2c37=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x57a962)['getIds']();if(_0x1e2c37['length']!==_0x57a962['length']||_0x1e2c37['some'](_0x28567b=>!_0x28567b?.['id'])){const _0x24e165=new ct('ai-chat-document-upload-reply-mismatch',null);return void this['fire']('error',{'error':_0x24e165});}const _0x122e6f=_0x57a962['map']((_0x43ae9d,_0x1b34d5)=>{return{'id':_0x1e2c37[_0x1b34d5]['id'],'content':_0x43ae9d['content'],'version':_0x43ae9d['version'],'sessionId':_0x43ae9d['sessionId'],'selection':(_0x59b8f8=_0x43ae9d['selections'],_0x59b8f8?_0x59b8f8['map'](_0x902607=>({'start':_0x902607['start'],'end':_0x902607['end']})):[]),'selectionSignature':_0x43ae9d['selectionSignature'],'channelId':_0x43ae9d['channelId'],'rootName':_0x43ae9d['rootName'],'editorConfig':_0x43ae9d['editorConfig']};var _0x59b8f8;});_0xcd437d['documents']=[..._0x5f2d40,..._0x122e6f];}catch(_0x6c7b67){throw new yn({'code':'ai-chat-document-upload-failed','type':'network','cause':_0x6c7b67});}}addSelectionToContext(_0x3c77d9){this['_addContextItem']({'type':'selection','label':_0x3c77d9,'uiId':'selection','content':_0x3c77d9});}removeSelectionFromContext(){this['_removeContextItem']('selection');}async addUrlToContext(_0x54e75a,_0x36d1f7){const _0x350c72='url-'+kt();this['_startUploadOperation'](_0x350c72);const _0x5751a0='url-'+kt();try{this['_addContextItem']({'type':'web-resource','label':_0x36d1f7?.['label']||_0x54e75a,'uiId':_0x5751a0,'resourceId':_0x36d1f7?.['resourceId']},!0x0);const _0x4b323d=this['_connector']['uploadUrl'](this['_ownerId'],_0x54e75a,_0x36d1f7);this['_ongoingUploads']['set'](_0x5751a0,_0x4b323d['abortController']);const {id:_0x17995c}=await _0x4b323d['getId']();this['_ongoingUploads']['delete'](_0x5751a0),this['_finishContextItemLoading']({'type':'web-resource','id':_0x17995c,'label':_0x36d1f7?.['label']||_0x54e75a,'uiId':_0x5751a0,'resourceId':_0x36d1f7?.['resourceId']},!0x1);}catch(_0x260348){this['_ongoingUploads']['delete'](_0x5751a0),kn(_0x260348)||this['fire']('error',{'error':new ct('ai-chat-url-upload-failed',this,{'url':_0x54e75a,'originalError':_0x260348}),'url':_0x54e75a}),this['_removeContextItem'](_0x5751a0);}finally{this['_finishUploadOperation'](_0x350c72);}}addToolItemToContext(_0x4ac5b5){_0x4ac5b5['id']=_0x4ac5b5['id']??kt()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x4ac5b5['uiId'],_0x4ac5b5),this['fire']('contextItemAdded',{'contextItem':_0x4ac5b5,'isLoading':!0x1});}async['loadSourceResources'](_0x1faaec,_0x172114,_0x32b03f){const _0x460f00=this['_addContextOptionsState']['sources']['find'](_0x1bbc23=>_0x1bbc23['id']===_0x1faaec);if(!_0x460f00)return this['fire']('error',{'error':new ct('ai-chat-source-not-found',this,{'sourceId':_0x1faaec}),'sourceId':_0x1faaec}),[];try{const _0x14b40d=(await _0x460f00['getResources'](_0x172114))['map'](_0x2ae798=>{const _0x357332=this['_isResourceInContext'](_0x2ae798['id']);return{..._0x2ae798,'isInContext':_0x357332};});return _0x460f00['resources']=_0x14b40d,this['fire']('sourceResourcesLoaded',{'sourceId':_0x1faaec,'source':_0x460f00,'resources':_0x14b40d,'uid':_0x32b03f}),_0x14b40d;}catch(_0x1e9e09){return this['fire']('error',{'error':new ct('ai-chat-source-resources-load-failed',this,{'sourceId':_0x1faaec,'originalError':_0x1e9e09}),'sourceId':_0x1faaec,'sourceLabel':_0x460f00['label']}),[];}}async addResourceToContext(_0x3b295b,_0x3b3384){if(this['_isResourceInContext'](_0x3b3384['id']))return;if('context'===_0x3b3384['type'])return void this['_addContextItem']({'type':'context','id':_0x3b3384['id'],'label':_0x3b3384['label'],'uiId':'context-'+kt(),'resourceId':_0x3b3384['id']});let _0x42075c=_0x3b3384['data'];if(!_0x42075c&&_0x3b295b['getData'])try{_0x42075c=await _0x3b295b['getData'](_0x3b3384['id']);}catch(_0x2e7996){return void this['fire']('error',{'error':new ct('ai-chat-resource-load-failed',this,{'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id'],'originalError':_0x2e7996}),'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id']});}if(_0x42075c)switch(_0x3b3384['type']){case'web-resource':if('string'!=typeof _0x42075c)return void this['fire']('error',{'error':new ct('ai-chat-context-invalid-data',this,{'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id'],'expectedType':'string','actualType':typeof _0x42075c}),'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id']});await this['addUrlToContext'](_0x42075c,{'label':_0x3b3384['label'],'resourceId':_0x3b3384['id']});break;case'file':if(!(_0x42075c instanceof File))return void this['fire']('error',{'error':new ct('ai-chat-context-invalid-data',this,{'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id'],'expectedType':'File','actualType':typeof _0x42075c}),'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id']});await this['addFilesToContext']([_0x42075c],{'label':_0x3b3384['label'],'resourceId':_0x3b3384['id']});break;case'text':if('object'!=typeof _0x42075c||!('content'in _0x42075c)||!('type'in _0x42075c))return void this['fire']('error',{'error':new ct('ai-chat-context-invalid-data',this,{'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x42075c}),'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id']});_0x42075c=AIChatContext['_convertTextResourceToFile'](_0x42075c,_0x3b3384['label']),await this['addFilesToContext']([_0x42075c],{'label':_0x3b3384['label'],'resourceId':_0x3b3384['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new ct('ai-chat-context-unsupported-type',this,{'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id'],'resourceType':_0x3b3384['type']}),'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id']});}else this['fire']('error',{'error':new ct('ai-chat-resource-no-data',this,{'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id']}),'resourceId':_0x3b3384['id'],'sourceId':_0x3b295b['id']});}addContextSource(_0x5343ab){this['_addContextOptionsState']['sources']['some'](_0x253d22=>_0x253d22['id']===_0x5343ab['id'])||(this['_addContextOptionsState']['sources']['push']({..._0x5343ab,'resources':[]}),this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']}));}toggleAddCurrentDocumentOptionVisibility(_0x1f8aa4){if(void 0x0!==_0x1f8aa4)this['_addContextOptionsState']['document']['isHidden']=!_0x1f8aa4;else{const _0x194fb0=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x194fb0;}this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}static _convertTextResourceToFile(_0x2a92fb,_0x35fa7c){switch(_0x2a92fb['type']){case'markdown':return new File([_0x2a92fb['content']],_0x35fa7c,{'type':'text/markdown'});case'html':return new File([_0x2a92fb['content']],_0x35fa7c,{'type':'text/html'});default:return new File([_0x2a92fb['content']],_0x35fa7c,{'type':'text/plain'});}}static _mapContextItemToRequestData(_0x579ce8){switch(_0x579ce8['type']){case'file':case'image':case'text':return[{'type':'file','id':_0x579ce8['id']}];case'web-resource':return[{'type':'web-resource','id':_0x579ce8['id']}];case'context':return[{'type':'context','id':_0x579ce8['id']}];case'document':return _0x579ce8['documents']?.['length']?_0x579ce8['documents']['map'](({id:_0x399f93,editorConfig:_0x4018b6,selection:_0x5f1bca})=>({'type':'document','id':_0x399f93,..._0x4018b6&&{'editorConfig':_0x4018b6},..._0x5f1bca?.['length']&&{'selection':_0x5f1bca}})):[];case'mcp-tool-context':{const _0x5ba773=_0x579ce8;return[{'type':'mcp-tool-context','mcpServerName':_0x5ba773['mcpServerName'],'toolName':_0x5ba773['toolName'],'data':{..._0x5ba773['data'],'label':_0x5ba773['label']||_0x5ba773['data']?.['label']||_0x5ba773['id']},'id':_0x5ba773['id']}];}default:return[];}}_addContextItem(_0x542e06,_0x3a3895=!0x1){if(this['_pendingContextItems']['set'](_0x542e06['uiId'],_0x542e06),_0x542e06['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x542e06,'isLoading':_0x3a3895}),'current-document'===_0x542e06['uiId']&&this['toggleAddCurrentDocumentOptionVisibility'](),_0x542e06['resourceId']){const _0x553b52=this['_findSourceIdsByResourceId'](_0x542e06['resourceId']);_0x553b52&&_0x553b52['forEach'](_0x154b3c=>{this['_updateResourceInContextState'](_0x154b3c,_0x542e06['resourceId'],!0x0);});}}_removeContextItem(_0x4fb561){const _0x2094cd=this['_pendingContextItems']['get'](_0x4fb561),_0xa63775=this['_ongoingUploads']['get'](_0x4fb561);if(_0xa63775&&(_0xa63775['abort'](),this['_ongoingUploads']['delete'](_0x4fb561)),_0x2094cd?.['resourceId']){const _0x48c394=this['_findSourceIdsByResourceId'](_0x2094cd['resourceId']);_0x48c394&&_0x48c394['forEach'](_0x5b45c0=>{this['_updateResourceInContextState'](_0x5b45c0,_0x2094cd['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x4fb561),this['fire']('contextItemRemoved',{'uiId':_0x4fb561,'type':_0x2094cd?.['type']}),'current-document'===_0x4fb561&&this['toggleAddCurrentDocumentOptionVisibility']();}_finishContextItemLoading(_0x57fce0,_0x23beff){if(this['_pendingContextItems']['has'](_0x57fce0['uiId'])&&(this['_pendingContextItems']['set'](_0x57fce0['uiId'],_0x57fce0),this['fire']('contextItemLoadingEnded',{'contextItem':_0x57fce0,'isLoading':_0x23beff}),_0x57fce0['resourceId'])){const _0xb94abf=this['_findSourceIdsByResourceId'](_0x57fce0['resourceId']);_0xb94abf&&_0xb94abf['forEach'](_0x5caea5=>{this['_updateResourceInContextState'](_0x5caea5,_0x57fce0['resourceId'],!0x0);});}}_addToConversationContextItem(_0x4bb44d){this['_conversationContextItems']['set'](_0x4bb44d['uiId'],_0x4bb44d);}_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'](_0x5853db=>({..._0x5853db,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}_getCustomSourcesInitialState(){return this['_config']?.['sources']?.['map'](_0x3a0626=>({..._0x3a0626,'resources':[]}))??[];}_isResourceInContext(_0x442e2b){for(const _0x3251c2 of this['_pendingContextItems']['values']())if(_0x3251c2['resourceId']===_0x442e2b)return!0x0;for(const _0xeb47c0 of this['_conversationContextItems']['values']())if(_0xeb47c0['resourceId']===_0x442e2b)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x3035d9){const _0x5e73cb=[];for(const _0xcfc41d of this['_addContextOptionsState']['sources'])_0xcfc41d['resources']['find'](_0x1e2eb2=>_0x1e2eb2['id']===_0x3035d9)&&_0x5e73cb['push'](_0xcfc41d['id']);return 0x0===_0x5e73cb['length']?null:_0x5e73cb;}_updateResourceInContextState(_0x73fa1a,_0x51e575,_0x3419fe){const _0x11c2ac=this['_addContextOptionsState']['sources']['find'](_0x247ad5=>_0x247ad5['id']===_0x73fa1a);if(!_0x11c2ac)return;const _0x487369=_0x11c2ac['resources']['find'](_0x46f177=>_0x46f177['id']===_0x51e575);_0x487369&&(_0x487369['isInContext']=_0x3419fe,this['fire']('resourceStateChanged',{'sourceId':_0x73fa1a,'resourceId':_0x51e575,'isInContext':_0x3419fe}));}_startUploadOperation(_0x10f10e){this['_ongoingUploadOperations']['set'](_0x10f10e,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}_finishUploadOperation(_0x49d78b){this['_ongoingUploadOperations']['delete'](_0x49d78b),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}},Xn=class extends Fn{['userMessage'];conversationId;contextItems=new Map();capabilities;['model'];attributes;context;constructor(_0x45a621){super(_0x45a621),this['conversationId']=_0x45a621['conversationId'],this['contextItems']=_0x45a621['contextItems'],this['capabilities']=_0x45a621['capabilities'],this['userMessage']=_0x45a621['userMessage'],this['model']=_0x45a621['model'],this['attributes']=_0x45a621['attributes'],this['context']=_0x45a621['context']??new Yn();}sendRequest(){const _0x54c732=Qn['mapContextItemsToRequestData'](this['contextItems']),_0x52b99d=this['context']['toRequestParts'](_0x54c732);return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':_0x52b99d,'capabilities':fn['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['context']['toMessageAttributes'](this['attributes'])});}getDocumentContext(){return this['contextItems']['get']('current-document');}};const zn=/* #__PURE__ -- @preserve */
32
+ dt();var jn=class extends zn{['id'];isStarted=!0x1;isFromHistory;interactions=[];currentInteraction;selectedModel;connector;options;_abortReject;_channelsToEditors;_getSessionId;constructor(_0x52151b){super(),this['options']=_0x52151b,this['connector']=_0x52151b['connector'],this['chatModels']=_0x52151b['chatModels'],this['id']=_0x52151b['conversationId'],this['isFromHistory']=_0x52151b['isFromHistory'],this['_channelsToEditors']=_0x52151b['channelsToEditors'],this['_getSessionId']=_0x52151b['getSessionId'];}async init(_0x3e3b84){try{this['chatContext']=new Qn({'connector':this['connector'],'config':_0x3e3b84,'ownerId':this['id']}),this['chatContext']['delegate'](...qn)['to'](this),this['chatContext']['init'](),this['options']['contextLibrary']?.['resolveContext']({'feature':'chat','extraContexts':this['options']['extraContexts'],'context':this['chatContext']}),this['chatCapabilities']=new fn(),this['chatCapabilities']['delegate'](...Cn)['to'](this),this['chatCapabilities']['init']();const _0x5b322a=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x5b322a});const _0x1a15ef=await this['chatModels']['resolveModel'](this['options']['selectedModelId']);_0x1a15ef&&await this['setModel'](_0x1a15ef);}catch(_0xbd9289){const _0x52ae2f=new yn({'code':'ai-chat-conversation-init-failed','cause':_0xbd9289,'type':'network'});this['fire']('error',{'error':_0x52ae2f});}}async start(){if(this['isStarted'])throw new ct('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new ct('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x22fe9a}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x22fe9a,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x162452){const _0x1e64ee=new yn({'code':'ai-chat-conversation-start-failed','cause':_0x162452,'type':'network','context':{'conversationId':this['id']}});throw this['fire']('error',{'error':_0x1e64ee}),_0x1e64ee;}}async['load'](_0x1e6dc9){try{const _0x379a14=await this['connector']['fetchConversation'](_0x1e6dc9)['getConversation'](),_0x39c9ef=await this['connector']['fetchConversationMessages'](_0x1e6dc9)['getMessages'](),_0x3a0477=_0x39c9ef[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x379a14['id'],'title'in _0x379a14?this['fire']('setConversationTitle',_0x379a14['title'],!this['isFromHistory']):this['fire']('setConversationTitle','',!this['isFromHistory']),this['selectedModel']=await this['chatModels']['getModel'](_0x3a0477)??void 0x0,this['fire']('modelSelected',{'selectedModel':this['selectedModel'],'isDisabled':!0x0});const {streamingMessageId:_0x27a2f5}=await this['_processMessagesToInteractions'](_0x39c9ef,_0x3a0477);return _0x27a2f5&&this['currentInteraction']?this['_resumeStream'](_0x27a2f5):this['currentInteraction']=void 0x0,this;}catch(_0x1cbf81){const _0x42a80b=new yn({'code':'ai-chat-conversation-init-from-id-failed','cause':_0x1cbf81,'type':'network','context':{'conversationId':_0x1e6dc9}});throw this['fire']('error',{'error':_0x42a80b}),_0x42a80b;}}async _processMessagesToInteractions(_0x5bbec0,_0x263de1){let _0x1a9fa0,_0x309544,_0x4433b7=new Set();for(const _0x46266d of _0x5bbec0)if('user'===_0x46266d['role']){const {contextItems:_0x3aeede,unmatchedDocumentIds:_0x4ab49c}=await this['_extractContextItems'](_0x46266d);_0x4433b7=_0x4ab49c;const _0x598212={'isReasoningEnabled':Object['hasOwn'](_0x46266d['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x46266d['capabilities'],'webSearch')};_0x1a9fa0=this['createInteraction']({'userMessage':_0x46266d['prompt'],'contextItems':_0x3aeede,'capabilities':_0x598212,'modelId':_0x263de1,'attributes':_0x46266d['attributes'],'channelsToEditors':this['_channelsToEditors']}),this['currentInteraction']=_0x1a9fa0,_0x309544=void 0x0,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x46266d['role']&&_0x1a9fa0){if('streaming'===_0x46266d['status']){_0x309544=_0x46266d['id'];continue;}if('error'===_0x46266d['status'])continue;const _0x24a0a0=[];for(const _0x4cacf0 of _0x46266d['content'])switch(_0x4cacf0['type']){case'text':case'modification':{const _0x5cd779=_0x1a9fa0['getDocumentContext'](),_0x4bdab0=this['_getOutdatedReasonsByDocumentId'](_0x5cd779,_0x4433b7),_0x2fe738=_0x5cd779?.['documents']??[],_0x155ffd=_0x2fe738['length']>0x0&&_0x2fe738['every'](_0x1690ae=>_0x4bdab0['has'](_0x1690ae['id']));_0x1a9fa0['currentReply']?.['type']!==_0x4cacf0['type']&&(_0x1a9fa0['currentReply']=_0x1a9fa0['createReply']({'type':_0x4cacf0['type'],'isDone':!0x0,'interactionId':_0x1a9fa0['id'],'areActionsDisabled':_0x155ffd,'outdatedReasonByDocumentId':_0x4bdab0,'isFromHistory':!0x0,'channelsToEditors':this['_channelsToEditors']}),_0x24a0a0['length']>0x0&&(_0x1a9fa0['currentReply']['sources']=_0x24a0a0['splice'](0x0))),_0x1a9fa0['currentReply']['appendContent'](_0x4cacf0['content'],_0x4cacf0['documentId']);break;}case'url':_0x24a0a0['push'](_0x4cacf0);break;case'mcp-tool-result':{const {data:_0x1a6451,attributes:_0x268702}=JSON['parse'](_0x4cacf0['content']);_0x1a9fa0['_handleToolResultData']({'toolName':_0x4cacf0['toolName'],'data':_0x1a6451,'attributes':_0x268702});break;}}'cancelled'===_0x46266d['status']&&this['fire']('error',{'interactionId':_0x1a9fa0['id'],'error':new ct('ai-request-aborted',this)});}}return{'streamingMessageId':_0x309544};}async _resumeStream(_0x2fa41d){if(this['currentInteraction'])try{const _0xa216ee=this['connector']['resumeStream'](this['id'],_0x2fa41d);await this['currentInteraction']['resume'](_0xa216ee);}catch(_0x389337){_0x389337 instanceof ct&&this['fire']('error',{'interactionId':this['currentInteraction']?.['id'],'error':_0x389337});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}async _extractContextItems(_0x12c9b9){return _0x12c9b9['content']?this['chatContext']['populateFromMessage'](_0x12c9b9['content'],Array['from'](this['_channelsToEditors']['values']()),Yn['getDefaultContextIds'](_0x12c9b9['attributes'])):{'contextItems':new Map(),'unmatchedDocumentIds':new Set()};}async handleUserInteraction({userMessage:_0x3116d1,attributes:_0x520ce2}){if(!this['isStarted'])throw new ct('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new ct('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x41856a=new Map(this['getPendingContextItems']()),_0x1ea16a=this['chatCapabilities']['getCapabilitiesConfig'](),_0x2835cc=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x3116d1,'contextItems':_0x41856a,'capabilities':_0x1ea16a,'modelId':_0x2835cc,'attributes':_0x520ce2,'channelsToEditors':this['_channelsToEditors']}),await this['updateCurrentDocumentsInContext'](),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x290b6b){if(_0x290b6b instanceof ct)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x290b6b});else{const _0x3e51bd=$n['get'](_0x290b6b['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ct(_0x3e51bd,null,{'error':_0x290b6b})});}}finally{this['stopProcessing']();}}stopProcessing(){this['_abortReject']&&(this['_abortReject'](),this['_abortReject']=void 0x0),this['currentInteraction']&&(this['currentInteraction']['stop'](),this['currentInteraction']=void 0x0);}createInteraction({userMessage:_0x5096b6,contextItems:_0x47d227,capabilities:_0x45f574,modelId:_0x9d3617,attributes:_0x4259c3,channelsToEditors:_0x2440b0}){const _0xea3bc5=new Xn({'userMessage':_0x5096b6,'contextItems':_0x47d227,'capabilities':_0x45f574,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x9d3617,'attributes':_0x4259c3,'channelsToEditors':_0x2440b0,'context':this['chatContext']['isEmpty']?void 0x0:new Yn(this['chatContext']['refs'])});return _0xea3bc5['delegate'](...Gn)['to'](this),this['interactions']['push'](_0xea3bc5),this['fire']('interactionCreated',_0xea3bc5),_0xea3bc5;}getInteraction(_0x238d7a){return this['interactions']['find'](_0x1ab65f=>_0x1ab65f['id']===_0x238d7a);}removeInteraction(_0x45156e){const _0x57b98c=this['getInteraction'](_0x45156e);_0x57b98c&&(_0x57b98c['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x57b98c),0x1));}get lastInteraction(){return this['interactions'][this['interactions']['length']-0x1];}cancelLastInteractionStream(){const _0x2fdc5d=this['lastInteraction'];_0x2fdc5d?.['conversationId']&&_0x2fdc5d['messageId']&&this['connector']['cancelStream'](_0x2fdc5d['conversationId'],_0x2fdc5d['messageId'])['execute']()['catch'](()=>{});}addCurrentDocumentToContext(_0x2ffb53){this['chatContext']['addCurrentDocumentToContext'](_0x2ffb53);}async updateCurrentDocumentsInContext(){if(!this['isCurrentDocumentInContext']())return;const {changedIds:_0x35cfc5,unchangedIds:_0x5ebe64}=this['_compareEditorStateWithDocumentContext'](),_0x3b316c=new Promise((_0x3df4fb,_0x477987)=>{this['_abortReject']=()=>_0x477987(new ct('ai-request-aborted',this));}),_0x1d634a=await Promise['race']([this['options']['aiEditing']['getDocumentData'](_0x35cfc5),_0x3b316c]);await Promise['race']([this['chatContext']['updateCurrentDocuments'](_0x1d634a,_0x5ebe64),_0x3b316c]);}_compareEditorStateWithDocumentContext(){const _0x288f0b=new Set(),_0xeb5383=new Set(),_0xee5f68=this['options']['aiEditing']['getEditorsVersions'](),_0x263d5f=this['options']['aiEditing']['getEditorsSelections'](),_0x572b69=this['chatContext']['getCurrentDocumentContext']()['documents']||[],_0x1cf0b4=new Map(_0x572b69['map'](({channelId:_0x588485,version:_0x55cd99})=>[_0x588485,_0x55cd99])),_0x76025a=new Map(_0x572b69['map'](({channelId:_0x58b5b9,selectionSignature:_0x46c59c})=>[_0x58b5b9,_0x46c59c]));for(const [_0xed63d4,_0x55820a]of _0xee5f68){const _0x2bdbec=_0x263d5f['get'](_0xed63d4);_0x1cf0b4['get'](_0xed63d4)!=_0x55820a||_0x76025a['get'](_0xed63d4)!=_0x2bdbec?_0x288f0b['add'](_0xed63d4):_0x1cf0b4['has'](_0xed63d4)&&_0xeb5383['add'](_0xed63d4);}return{'changedIds':_0x288f0b,'unchangedIds':_0xeb5383};}toggleAddCurrentDocumentOptionVisibility(_0x311711){this['chatContext']['toggleAddCurrentDocumentOptionVisibility'](_0x311711);}_getOutdatedReasonsByDocumentId(_0x3ac247,_0xaadc14){const _0x242a07=new Map();if(!_0x3ac247||!_0x3ac247['documents'])return _0x242a07;for(const _0x1416f1 of _0x3ac247['documents']){const _0x21c538=this['_channelsToEditors']['get'](_0x1416f1['channelId']);_0x21c538&&'destroyed'!==_0x21c538['state']?_0x1416f1['sessionId']!==this['_getSessionId'](_0x21c538)?_0x242a07['set'](_0x1416f1['id'],'session-changed'):_0xaadc14['has'](_0x1416f1['id'])&&_0x242a07['set'](_0x1416f1['id'],'content-removed'):_0x242a07['set'](_0x1416f1['id'],'editor-removed');}return _0x242a07;}addSelectionToContext(_0x7386b3){this['chatContext']['addSelectionToContext'](_0x7386b3);}removeSelectionFromContext(){this['chatContext']['removeSelectionFromContext']();}addFilesToContext(_0x460b2f){this['chatContext']['addFilesToContext'](_0x460b2f);}addUrlToContext(_0x43cd00){this['chatContext']['addUrlToContext'](_0x43cd00);}addToolItemToContext(_0x2673a5){this['chatContext']['addToolItemToContext'](_0x2673a5);}addResourceToContext(_0x59c306,_0x35e54e){this['chatContext']['addResourceToContext'](_0x59c306,_0x35e54e);}['loadSourceResources'](_0x19372f,_0x2105c5,_0x357455){return this['chatContext']['loadSourceResources'](_0x19372f,_0x2105c5,_0x357455);}removeFromContext(_0x26019c){this['chatContext']['removeFromContext'](_0x26019c);}setWebSearch(_0x1e75a6){this['chatCapabilities']['setWebSearch'](_0x1e75a6);}toggleWebSearch(){this['chatCapabilities']['toggleWebSearch']();}setReasoning(_0x134cd0){this['chatCapabilities']['setReasoning'](_0x134cd0);}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(_0x2f897e){_0x2f897e['length']&&this['chatContext']['addDefaultContext'](_0x2f897e);}async setModel(_0x618945){_0x618945?!0x1===await this['chatModels']['isAvailable'](_0x618945)&&(St('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x618945}),_0x618945=(await this['chatModels']['getAvailableModels']())[0x0]):(St('ai-chat-conversation-set-model-null',{'conversation':this}),_0x618945=(await this['chatModels']['getAvailableModels']())[0x0]),_0x618945['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x618945,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x618945}));}};function Jn({documentSuggestions:_0x5cf516,transform:_0x11a1e0,documentCompare:_0x3ebe35,documentCompareOptions:_0x1a7d2f}){const _0x1784ca=new Map();for(const [_0x82ecc2,{groups:_0x4c6dfd,documentContext:_0x3542fe,documentContent:_0x1f4733,editor:_0x436cf8}]of _0x5cf516){const _0x345bd2=_0x3542fe['content'],_0x5e5791=_0x3542fe['version'],_0x1ab539=_0x1f4733['cloneNode'](!0x0);for(const {changes:_0x2b5eae}of _0x4c6dfd)$s(_0x1ab539,_0x2b5eae);const _0x28656e=Os(_0x1ab539),_0x4f8fe4=Qs(_0x436cf8,_0x3542fe['rootName'],_0x345bd2,_0x28656e);if(!_0x4f8fe4)continue;const _0x28a523=_0x3ebe35['getDiff'](_0x4f8fe4['before'],_0x4f8fe4['after'],{'targetEditor':_0x436cf8,'anchor':_0x3542fe['rootName'],..._0x1a7d2f})['getOperations']();if(_0x11a1e0){const _0x575c89=_0x436cf8['model']['document']['history']['getOperations'](_0x5e5791),_0x57c627={'document':_0x436cf8['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};_0x1784ca['set'](_0x82ecc2,_0x5dec67(_0x28a523,_0x575c89,_0x57c627)['operationsA']);}else _0x1784ca['set'](_0x82ecc2,_0x28a523);}return _0x1784ca;}function Zn({groups:_0x119723,documentContextContent:_0x2dcc57,documents:_0x1feef1}){const _0x5e8caa=new Map();for(const _0x444173 of _0x119723){const {documentId:_0x52798e}=_0x444173,_0x398070=_0x5e8caa['get'](_0x52798e);if(_0x398070)_0x398070['groups']['push'](_0x444173),_0x398070['indexes']['push'](_0x444173['index']);else{const _0x42c375=_0x1feef1['find'](_0x290d9a=>_0x290d9a['id']===_0x52798e),_0x49552d=_0x2dcc57['get'](_0x52798e);if(!_0x42c375||!_0x49552d)continue;_0x5e8caa['set'](_0x52798e,{'groups':[_0x444173],'documentContext':_0x42c375,'documentContent':_0x49552d,'editor':_0x444173['editor'],'indexes':[_0x444173['index']]});}}return _0x5e8caa;}function tr(_0x355ec0,_0x5856a1){const _0x3407da=_0x355ec0['files']['length']>0x0&&_0x355ec0['files']['every'](_0x44f99a=>_0x44f99a['type']['startsWith']('image/')),_0x18a146=_0x355ec0['plainText']['trim']()['length']>0x0;if(_0x355ec0['files']['length']>0x0&&_0x5856a1['filesEnabled']&&(!_0x3407da||!_0x18a146)){const _0x3be054=_0x355ec0['files']['filter'](_0x190c0f=>_0x190c0f['name']);return _0x3be054['length']>0x0?{'type':'file','files':_0x3be054}:null;}if(_0x5856a1['urlsEnabled']){const _0x1fbd0b=function(_0x5a2200){const _0x1a8403=_0x5a2200['trim']();if(/\s/['test'](_0x1a8403))return null;try{const _0x5850a7=new URL(_0x1a8403);return'http:'!==_0x5850a7['protocol']&&'https:'!==_0x5850a7['protocol']?null:_0x5850a7['toString']();}catch{return null;}}(_0x355ec0['plainText']);if(_0x1fbd0b)return{'type':'url','url':_0x1fbd0b};}const _0x431d4e=_0x355ec0['forceTextAttachment']?0x1:_0x5856a1['longTextThreshold']??0x1/0x0;if(_0x355ec0['plainText']['length']>=Math['max'](_0x431d4e,0x1)&&_0x5856a1['filesEnabled']){const _0x4fc6d0=_0x5856a1['pastedTextLabel']+'.txt';return{'type':'text','files':[new File([_0x355ec0['plainText']],_0x4fc6d0,{'type':'text/plain'})]};}return null;}var er=class extends _0x898608{activeConversation;_aiEditing;_aiConnector;_aiChatUi;['_aiModels'];_aiContextLibrary;_contextLibrarySource=null;_hasAIChatBalloon=!0x1;_activeBalloon;_reporter;_batchToChanges=new Map();_currentPreviewedChangeGroup=null;_bodyCollection;_channelsToEditors=new Map();static get requires(){return[Is,Nn,_0x45dea0,fs];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['set']('isConversationReady',!0x1),this['_bodyCollection']=Mn(this['context']['locale']),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'](Nn)['createReporter']('aichat'),this['_aiModels']=this['context']['plugins']['get'](fs)['models'],this['_aiContextLibrary']=this['context']['plugins']['get'](fs)['contextLibrary'];const _0x390c1d=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x1c078a,_0x4c7ff2)=>{this['sendMessage']({'message':_0x4c7ff2});}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',()=>{this['activeConversation']?.['stopProcessing']();}),this['listenTo'](_0x390c1d['view'],'change:activeTab',(_0x3654db,_0x10d56a,_0x4be490)=>{'chat'!==_0x4be490&&this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x242695,_0x385aaa)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x385aaa));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x23e2fc,_0x36d811)=>{this['activeConversation']?.['addUrlToContext'](_0x36d811);}),this['listenTo'](this['_aiChatUi'],'promptInputPaste',(_0x2b1672,_0x595704)=>{const _0xbb2ed1=this['activeConversation'];if(!_0xbb2ed1)return;_0x595704['hasDirectory']&&(_0x595704['preventDefault'](),this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED'),'id':'folder-error-'+kt()}));const _0x38f672=tr(_0x595704,{'pastedTextLabel':Es(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')});_0x38f672&&(_0x595704['preventDefault'](),'url'===_0x38f672['type']?_0xbb2ed1['addUrlToContext'](_0x38f672['url']):_0xbb2ed1['chatContext']['addFilesToContext'](_0x38f672['files'],void 0x0,_0x38f672['type']));}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x5ec078,_0xac78b0)=>{_0xac78b0['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x17bd65,_0x5d3ccf)=>{this['activeConversation']?.['addResourceToContext'](_0x5d3ccf['source'],_0x5d3ccf['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x3f41f0,_0x145b2e)=>{this['_removeFromContext'](_0x145b2e);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x35357b,_0x248cdb)=>{this['activeConversation']?.['loadSourceResources'](_0x248cdb['sourceId'],_0x248cdb['query'],_0x248cdb['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x20e6de,_0x4030a9)=>{this['activeConversation']?.['setModel'](_0x4030a9);}),this['listenTo'](this['_aiChatUi'],'like',(_0x3f0c40,{replyId:_0x1e5064})=>{console['log']('Liked\x20response',_0x1e5064);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x2621df,{replyId:_0x199c19})=>{console['log']('Disliked\x20response',_0x199c19);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0xd615b2,_0x51e511)=>{this['_insertSuggestion'](_0x51e511);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x2da1a3,{replyId:_0x243ae5,partIndex:_0x1517f7})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x243ae5,_0x1517f7);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x3ab93a,{replyId:_0x45fe58,partIndex:_0x2955a6})=>{const _0x4fb5d0=this['_getDocumentRangeForReplyChanges'](_0x45fe58,_0x2955a6);if(!_0x4fb5d0)return;const {reply:_0x4eeaef}=this['getInteractionAndReplyById'](_0x45fe58);'$graveyard'!=_0x4fb5d0['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'editor':_0x4eeaef['changeGroups'][_0x2955a6]['editor'],'ranges':[_0x4fb5d0['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x5c0f25,_0x3e09ad)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x3e09ad);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x8403f6,{replyId:_0x5a2678,showDiff:_0x2be8b5})=>{const {interaction:_0xfec765,reply:_0x2217d9}=this['getInteractionAndReplyById'](_0x5a2678),_0x1256c8=_0x2217d9['getContentParts']({'showDiff':_0x2be8b5});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0xfec765['id']+':'+_0x2217d9['id'],'parts':_0x1256c8});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x1afdf9,{replyId:_0x2d81a9,partIndex:_0x13986f})=>{this['_rejectSuggestion']({'replyId':_0x2d81a9,'partIndex':_0x13986f}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['on']('interactionCreated',(_0x516fe5,_0x257ab0)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x257ab0);}),this['on']('replyCreated',(_0x83a8b6,_0x1e0f1a)=>{this['_addFeedItemReply'](_0x1e0f1a);});}afterInit(){this['context']instanceof _0x24cd6f?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2483b0,_0x252324)=>{_0x252324['on']('ready',()=>{this['_integrateEditor'](_0x252324);});}),this['context']['config']['get']('ai.chat.context')?.['contextLibrary']?.['enabled']&&this['_setUpContextLibrarySource'](),this['_initConversation']();}async _initConversation(){const _0x52fce7=this['context']['config']['get']('ai.chat.initialConversation');let _0x1384b4=_0x52fce7;('lastCreated'!=_0x52fce7||(_0x1384b4=await this['_getLastCreatedConversationId'](),_0x1384b4))&&('new'==_0x1384b4?await this['_startConversationSafely']():await this['loadConversation'](_0x1384b4));}async destroy(){return this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async loadConversation(_0x289994){this['_closeActiveBalloon'](),this['context']['plugins']['get'](gs)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),this['_detachFromActiveConversation'](),this['_stopLastInteraction'](),this['_aiChatUi']['toggleConversationLoading'](!0x0);try{this['_aiChatUi']['emptyConversationTitle'](),await this['_aiConnector']['fetchConversation'](_0x289994)['getConversation'](),await this['_startConversationSafely']({'id':_0x289994}),await this['activeConversation']['load'](_0x289994),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext'](),this['set']('isConversationReady',!0x0),this['activeConversation']?.['currentInteraction']?this['_aiChatUi']['enableControls']():this['_aiChatUi']['toggleConversationLoading'](!0x1);}catch(_0x3f555e){this['_aiChatUi']['resetConversationTitle'](),this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x289994}),this['_reporter']['logError'](new ct('ai-chat-conversation-not-found',this,void 0x0,_0x3f555e),{'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);}}registerToolDataCallback(_0x5959da){let _0x1d4e32=null,_0x432505=null;this['on']('toolDataReceived',(_0x1d3c28,_0x44d047,_0xfefbfb)=>{_0xfefbfb['id']!==_0x1d4e32&&(_0x1d4e32=_0xfefbfb['id'],_0x432505=this['_getAIChatFeedAPI'](_0xfefbfb)),_0x5959da(_0x44d047,_0x432505);});}addCurrentDocumentToChatContext(){bs(this['context'])['length']&&this['activeConversation']?.['addCurrentDocumentToContext'](Es(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async addSelectionToChatContext(_0x33e40c){const _0x44c443=this['_aiEditing']['getSelectionText'](_0x33e40c);this['activeConversation']?.['addSelectionToContext'](_0x44c443),this['addCurrentDocumentToChatContext']();}removeSelectionFromChatContext(){this['activeConversation']?.['removeSelectionFromContext']();}focusPromptInput(){this['_aiChatUi']['focusPromptInput']();}async startConversation(_0x258683){await this['_startConversationSafely']({'modelId':_0x258683?.['modelId'],'contexts':_0x258683?.['contexts']});}async['sendMessage']({message:_0xbcf82f,attributes:_0x1c52ea}){if(!this['activeConversation'])throw new ct('ai-chat-controller-no-active-conversation');this['activeConversation']['id']&&this['activeConversation']['isStarted']&&(this['_aiChatUi']['startInteraction'](),await this['activeConversation']['handleUserInteraction']({'userMessage':_0xbcf82f,'attributes':_0x1c52ea}));}getGroupId(){const _0x1f9c0e=this['context']['config']['get']('collaboration.channelId');if(!_0x1f9c0e)throw new ct('ai-missing-channel-id',this);return _0x1f9c0e;}_handleRemovedConversation(_0x5810fc){this['activeConversation']['id']===_0x5810fc&&this['_startConversationSafely']();}['_isGroupReadOnly'](_0x141838){return!(!_0x141838['editor']||'destroyed'===_0x141838['editor']['state']||!_0x141838['editor']['isReadOnly']);}_isGroupWriteable(_0x49661e){return!(!_0x49661e['editor']||'destroyed'===_0x49661e['editor']['state']||_0x49661e['editor']['isReadOnly']);}_computeSuggestionGating(_0x221090){const _0x5b5cc4=new Map();for(const _0x3363e9 of _0x221090['changeGroups'])_0x5b5cc4['set'](_0x3363e9['index'],this['_isGroupReadOnly'](_0x3363e9));const _0x439057=new Set(_0x221090['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']})['filter'](_0x499f95=>_0x499f95['hasChanges'])['map'](_0x35862c=>_0x35862c['index']));return{'readOnlyByIndex':_0x5b5cc4,'isAcceptAllEnabled':_0x221090['changeGroups']['some'](_0x7bb290=>'pending'===_0x7bb290['state']&&this['_isGroupWriteable'](_0x7bb290)&&_0x439057['has'](_0x7bb290['index']))};}_refreshSuggestionGating(){if(this['activeConversation']){for(const _0x29998f of this['activeConversation']['interactions'])for(const _0x2746f5 of _0x29998f['replies'])'modification'===_0x2746f5['type']&&this['_aiChatUi']['hasFeedItem'](_0x2746f5['id'])&&this['_aiChatUi']['setSuggestionGating'](_0x2746f5['id'],this['_computeSuggestionGating'](_0x2746f5));}if(this['_activeBalloon']&&this['_currentPreviewedChangeGroup']){const {reply:_0x327603}=this['getInteractionAndReplyById'](this['_currentPreviewedChangeGroup']['replyId']),_0x28518d=_0x327603['changeGroups']['find'](_0x4added=>_0x4added['index']===this['_currentPreviewedChangeGroup']['partIndex']);_0x28518d&&this['_activeBalloon']['setTargetReadOnly'](this['_isGroupReadOnly'](_0x28518d));}}_prepareDocumentSuggestions(_0x103a70){const {reply:_0x242d8b,interaction:_0x14ed69}=this['getInteractionAndReplyById'](_0x103a70['replyId']),_0x1435e2=void 0x0!==_0x103a70['partIndex']?[_0x242d8b['changeGroups'][_0x103a70['partIndex']]]:_0x242d8b['changeGroups']['filter'](_0x4f3d4d=>'pending'===_0x4f3d4d['state']&&!this['_isGroupReadOnly'](_0x4f3d4d)),_0x3e6c20=_0x1435e2['map'](_0x128d1b=>_0x242d8b['changeGroups']['indexOf'](_0x128d1b)),_0x4eabc7=qs(_0x242d8b['changeGroups'],_0x242d8b['documentContextContent']);return _0x3e6c20['forEach'](_0xea218f=>{if(_0x4eabc7['has'](_0xea218f))return;const _0x20dc16=this['_getDocumentRangeForReplyChanges'](_0x103a70['replyId'],_0xea218f);_0x20dc16&&'$graveyard'!=_0x20dc16['range']['root']['rootName']?(_0x242d8b['setChangeGroupState'](_0xea218f,'accepted'),void 0x0!==_0x103a70['partIndex']&&this['_scrollToSuggestionRange'](_0x20dc16['range'],!0x1,_0x20dc16['targetEditor'])):_0x242d8b['setChangeGroupState'](_0xea218f,'outdated',this['_getOutdatedReason'](_0x242d8b['changeGroups'][_0xea218f]));}),Zn({'groups':_0x1435e2['filter'](_0x75ba1c=>'accepted'===_0x75ba1c['state']),'documentContextContent':_0x242d8b['documentContextContent'],'documents':_0x14ed69['getDocumentContext']()?.['documents']??[]});}_insertSuggestion(_0x25edda){const _0x417a3d=this['context']['plugins']['get'](_0x45dea0),{reply:_0x5ad4d1,interaction:_0x32e087}=this['getInteractionAndReplyById'](_0x25edda['replyId']),_0x43c1b5=this['_prepareDocumentSuggestions'](_0x25edda),_0x1b47cf=Jn({'documentSuggestions':_0x43c1b5,'transform':!0x0,'documentCompare':_0x417a3d,'documentCompareOptions':{'markDeletions':!0x0}});for(const [_0x13082c,_0x53afb7]of _0x1b47cf){const {editor:_0x74ffe7,indexes:_0x5a4a60}=_0x43c1b5['get'](_0x13082c);if(!_0x74ffe7['plugins']['has']('TrackChanges')){St('ai-no-track-changes',{'editor':_0x74ffe7});continue;}let _0x133b9f;mn(_0x53afb7,'chat'),_0x74ffe7['model']['change'](_0x1e753a=>{_0x133b9f=_0x1e753a['batch'],_0x74ffe7['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x53afb7),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x133b9f,{'interactionId':_0x32e087['id'],'replyId':_0x5ad4d1['id'],'indexes':_0x5a4a60});}this['_updateRatings'](_0x5ad4d1);}_applySuggestion(_0x338ca0){const _0x2ae70e=this['context']['plugins']['get'](_0x45dea0),{reply:_0x296e06,interaction:_0x5bd006}=this['getInteractionAndReplyById'](_0x338ca0['replyId']),_0x2215da=this['_prepareDocumentSuggestions'](_0x338ca0),_0x2fa797=Jn({'documentSuggestions':_0x2215da,'transform':!0x0,'documentCompare':_0x2ae70e,'documentCompareOptions':{'markDeletions':!0x1}});for(const [_0x5e2dd2,_0x5db22d]of _0x2fa797){const {editor:_0x29524f,indexes:_0x4ba2e4}=_0x2215da['get'](_0x5e2dd2);let _0x3c0d13;mn(_0x5db22d,'chat');try{_0x29524f['model']['change'](_0x3689f3=>{_0x3c0d13=_0x3689f3['batch'],_0x2ae70e['applyOperations'](_0x3689f3,_0x5db22d);}),this['_batchToChanges']['set'](_0x3c0d13,{'interactionId':_0x5bd006['id'],'replyId':_0x296e06['id'],'indexes':_0x4ba2e4});}catch(_0x14764a){throw this['_reporter']['logError'](new yn({'code':'ai-applying-suggestion-failed','type':'runtime','cause':_0x14764a})),_0x14764a;}}this['_updateRatings'](_0x296e06);}_rejectSuggestion(_0x9b063c){const {reply:_0x12678a}=this['getInteractionAndReplyById'](_0x9b063c['replyId']);_0x12678a['setChangeGroupState'](_0x9b063c['partIndex'],'rejected');}['_openBalloonFor'](_0x55ccc,_0x425262){if(!this['_hasAIChatBalloon'])return;const {reply:_0x3dce05}=this['getInteractionAndReplyById'](_0x55ccc),_0x574563=_0x3dce05['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(!_0x574563['length'])return;let _0xd8b8a4,_0x148fc6;if(void 0x0!==_0x425262?(_0x148fc6=_0x574563['find'](_0x5277b6=>_0x5277b6['index']==_0x425262),_0xd8b8a4=_0x148fc6?.['index']):(_0x148fc6=_0x574563[0x0],_0xd8b8a4=_0x148fc6['index']),!_0x148fc6)return void _0x3dce05['setChangeGroupState'](_0x425262??0x0,'outdated','editor-removed');if(this['_currentPreviewedChangeGroup']?.['replyId']==_0x55ccc&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0xd8b8a4)return;const _0x258600=this['_getUserPresentableContentPartDocumentRange'](_0x55ccc,_0x3dce05,_0x148fc6),_0x5a52c6=_0x3dce05['changeGroups']['find'](_0x2f534a=>_0x2f534a['index']==_0xd8b8a4),_0x51d79e=_0x5a52c6['editor'],_0x3e33fd=_0x51d79e['plugins']['get']('AIChatBalloon');if(this['_activeBalloon']&&this['_activeBalloon']!==_0x3e33fd&&this['_activeBalloon']['close'](),!_0x258600)return _0x3e33fd['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x3e33fd,this['_currentPreviewedChangeGroup']={'replyId':_0x55ccc,'partIndex':_0xd8b8a4},this['_scrollToSuggestionRange'](_0x258600,!0x0,_0x51d79e);const _0x2bd328=this['_getPresentableSiblingContentPartIndex'](_0x55ccc,_0xd8b8a4,'next');_0x3e33fd['clearContent'](),_0x3e33fd['updateContent']({'part':_0x148fc6,'renderingStrategy':'static'}),_0x3e33fd['open']({'index':_0xd8b8a4,'title':Es(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0xd8b8a4+0x1)['toString']()),'showRotator':null!==_0x2bd328,'ranges':[_0x258600],'areActionsDisabled':_0x3dce05['areActionsDisabled'],'targetEditor':_0x51d79e,'isTargetReadOnly':this['_isGroupReadOnly'](_0x5a52c6)}),_0x3e33fd['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x55ccc,_0xd8b8a4),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x55ccc,'index':_0xd8b8a4,'isActive':!0x0});}_closeActiveBalloon(){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;}_getPresentableSiblingContentPartIndex(_0xff3018,_0x3443cf,_0xaf50a6){const {reply:_0x36cdd1}=this['getInteractionAndReplyById'](_0xff3018),_0x21a591=_0x36cdd1['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x21a591['length'])return null;const _0x58a799='next'==_0xaf50a6?0x1:-0x1;function _0x1b54e5(_0x24052a){const _0x39c3fc=(_0x24052a+_0x58a799+_0x21a591['length'])%_0x21a591['length'];return{'siblingIndex':_0x39c3fc,'siblingPart':_0x21a591[_0x39c3fc]};}const _0x5ce040=_0x21a591['findIndex'](_0x3fb182=>_0x3fb182['index']==_0x3443cf);let {siblingIndex:_0x1b23e8,siblingPart:_0x35d7d5}=_0x1b54e5(_0x5ce040);for(;!this['_getUserPresentableContentPartDocumentRange'](_0xff3018,_0x36cdd1,_0x35d7d5);)if({siblingIndex:_0x1b23e8,siblingPart:_0x35d7d5}=_0x1b54e5(_0x1b23e8),_0x1b23e8===_0x5ce040)return null;return _0x35d7d5['index'];}_getOutdatedReason(_0x2c714e){return _0x2c714e?.['editor']&&'destroyed'!==_0x2c714e['editor']['state']?'content-removed':'editor-removed';}_getUserPresentableContentPartDocumentRange(_0x2df3ba,_0x563a00,_0x3b4305){const _0x4658ec=_0x563a00['changeGroups'];if(!_0x3b4305['hasChanges'])return null;const _0xc0ca00=_0x4658ec['find'](_0x5e735e=>_0x5e735e['index']==_0x3b4305['index']);if('pending'!==_0xc0ca00?.['state'])return null;if(!_0xc0ca00?.['editor']||'destroyed'===_0xc0ca00['editor']['state'])return _0x563a00['setChangeGroupState'](_0x3b4305['index'],'outdated',this['_getOutdatedReason'](_0xc0ca00)),null;const _0x2a6ff2=this['_getDocumentRangeForReplyChanges'](_0x2df3ba,_0x3b4305['index']);if(!_0x2a6ff2)return _0x563a00['setChangeGroupState'](_0x3b4305['index'],'outdated',this['_getOutdatedReason'](_0xc0ca00)),null;const {range:_0x1bb23d,currentIndex:_0x3bd90d}=_0x2a6ff2;return'$graveyard'==_0x1bb23d['root']['rootName']?(_0x563a00['setChangeGroupState'](_0x3bd90d,'outdated',this['_getOutdatedReason'](_0xc0ca00)),null):_0x2a6ff2['range'];}_getDocumentRangeForReplyChanges(_0x5b8463,_0x34c77a){const {reply:_0x318106,interaction:_0xb712bb}=this['getInteractionAndReplyById'](_0x5b8463),_0x284877=_0x318106['changeGroups']['filter'](_0x56e8a7=>'pending'==_0x56e8a7['state']),_0x42c4b1=_0x284877['map'](_0x38a605=>_0x318106['changeGroups']['indexOf'](_0x38a605));void 0x0===_0x34c77a&&(_0x34c77a=_0x42c4b1[0x0]);const _0x20392d=_0x42c4b1['indexOf'](_0x34c77a);if(-0x1==_0x20392d)return null;const _0x4cb7a8=_0x284877[_0x20392d],_0x22ccc6=_0x4cb7a8['editor'];if(!_0x22ccc6||'destroyed'===_0x22ccc6['state'])return null;const _0x40c8b4=Gs(_0x22ccc6,_0x4cb7a8['rootName']),_0x502656=_0x318106['documentContextContent']['get'](_0x4cb7a8['documentId']),_0x3e2343=new _0x139fbf([]),_0x187511=new _0x139fbf([]);for(const _0x909f6b of _0x4cb7a8['changes'])if('removed'!=_0x909f6b['type']&&_0x187511['children']['push'](_0x909f6b['node']['cloneNode'](!0x0)),'new'!=_0x909f6b['type']){const _0x1eec3a=_0x228c3a(_0x3d13b0=>Ps(_0x3d13b0,'data-id')==_0x909f6b['id'],_0x502656,!0x0);_0x3e2343['children']['push'](_0x1eec3a['cloneNode'](!0x0));}if(0x0==_0x3e2343['children']['length']){if(_0x4cb7a8['changes'][0x0]['anchorId']){const _0x5ae39f=vs('data-id',_0x4cb7a8['changes'][0x0]['anchorId'],_0x502656);_0x3e2343['children']['unshift'](_0x5ae39f['cloneNode'](!0x0)),_0x187511['children']['unshift'](_0x5ae39f['cloneNode'](!0x0)),_0x5ae39f['nextSibling']&&(_0x3e2343['children']['push'](_0x5ae39f['nextSibling']['cloneNode'](!0x0)),_0x187511['children']['push'](_0x5ae39f['nextSibling']['cloneNode'](!0x0)));}else{const _0x5b419e=_0x502656['children'][0x0];if(!_0x5b419e)return null;_0x3e2343['children']['push'](_0x5b419e['cloneNode'](!0x0)),_0x187511['children']['push'](_0x5b419e['cloneNode'](!0x0));}}if(_0x40c8b4&&qs(_0x318106['changeGroups'],_0x318106['documentContextContent'])['has'](_0x4cb7a8['index']))return null;const _0x2d4323=_0xb712bb['getDocumentContext'](),_0x2aec6f=_0x2d4323['documents']['find'](_0x1a5c3c=>_0x1a5c3c['id']==_0x4cb7a8['documentId'])['content'],_0x4ba32d=_0x22ccc6['model']['document']['getRoot'](_0x4cb7a8['rootName']),_0x5def9d=_0x22ccc6['data']['parse'](_0x2aec6f,_0x4ba32d),_0x47abbe=_0x40c8b4?Ws(Os(_0x3e2343)):Os(_0x3e2343),_0x14284f=_0x22ccc6['data']['parse'](_0x47abbe,_0x4ba32d),_0x29d628=_0x22ccc6['data']['parse'](_0x47abbe,_0x4ba32d),_0x2bd9b2=_0x22ccc6['model']['createPositionAt'](_0x14284f,0x0),_0x487f94=_0x40c8b4?Ws(Os(_0x187511)):Os(_0x187511),_0x75ebb={'targetEditor':_0x22ccc6,'anchor':_0x2bd9b2,'markDeletions':!0x1};let _0x19e658;try{_0x19e658=_0x22ccc6['plugins']['get'](_0x45dea0)['getDiff'](_0x47abbe,_0x487f94,_0x75ebb)['getOperations']();}catch(_0x31d39e){return this['_reporter']['reportError'](new yn({'code':'ai-chat-suggestion-diff-failed','type':'runtime','severity':'warning','cause':_0x31d39e,'context':{'replyId':_0x5b8463,'partIndex':_0x34c77a}})),null;}if(!_0x19e658['length'])return null;_0x22ccc6['model']['change'](_0x4f778e=>{for(const _0x482a3e of _0x19e658)if(!_0x9fd625(_0x482a3e)){if('remove'==_0x482a3e['type']){const _0x409d4d=_0x482a3e['sourcePosition'],_0x2bd69b=_0x482a3e['howMany'],_0x51cc2d=new _0x4f656c(_0x409d4d,_0x2bd69b);_0x4f778e['batch']['addOperation'](_0x51cc2d),_0x22ccc6['model']['applyOperation'](_0x51cc2d);}else'marker'!==_0x482a3e['type']&&(_0x482a3e['baseVersion']=null,_0x482a3e['isDocumentOperation']=!0x1,_0x4f778e['batch']['addOperation'](_0x482a3e),_0x22ccc6['model']['applyOperation'](_0x482a3e));}});const _0x3dd35e=_n(_0x22ccc6,_0x19e658,_0x14284f);An(_0x22ccc6['model'],_0x3dd35e);const _0x1eee3e=_0x3dd35e['getFirstRange']()['start']['path']['slice'](),_0xcbdeac=_0x3dd35e['getFirstRange']()['end']['path']['slice'](),_0x57a4ee=[];let _0x415ed6=_0x14284f,_0x1daa15=_0x29d628;for(let _0x4d4a67=0x0;_0x4d4a67<_0xcbdeac['length'];_0x4d4a67++){const _0x1373e4=_0x415ed6['maxOffset']-_0xcbdeac[_0x4d4a67];_0x57a4ee[_0x4d4a67]=_0x1daa15['maxOffset']-_0x1373e4,_0x415ed6=_0x415ed6['getChildAtOffset'](_0xcbdeac[_0x4d4a67]),_0x1daa15=_0x1daa15['getChildAtOffset'](_0x57a4ee[_0x4d4a67]);}const _0x1e782c=_0x22ccc6['model']['createRange'](_0x22ccc6['model']['createPositionFromPath'](_0x29d628,_0x1eee3e),_0x22ccc6['model']['createPositionFromPath'](_0x29d628,_0x57a4ee)),_0x24c415=_0x1e782c['start']['path']['slice'](),_0x3103df=_0x1e782c['end']['path']['slice']();if(!_0x40c8b4){const _0x3299c9=_0x29d628['getChild'](0x0)['getAttribute'](_0x4fabc2),_0x535f8f=Array['from'](_0x5def9d['getChildren']())['find'](_0x36ecc5=>_0x36ecc5['getAttribute'](_0x4fabc2)==_0x3299c9)['getPath']();_0x24c415[0x0]=_0x535f8f[0x0]+_0x24c415[0x0],_0x3103df[0x0]=_0x535f8f[0x0]+_0x3103df[0x0];}let _0x5707e9=_0x22ccc6['model']['createRange'](_0x22ccc6['model']['createPositionFromPath'](_0x22ccc6['model']['document']['getRoot'](_0x4cb7a8['rootName']),_0x24c415),_0x22ccc6['model']['createPositionFromPath'](_0x22ccc6['model']['document']['getRoot'](_0x4cb7a8['rootName']),_0x3103df));const _0x34c40b=_0x2d4323['documents']['find'](_0x536fde=>_0x536fde['id']==_0x4cb7a8['documentId'])['version'],_0x5b56c1=_0x22ccc6['model']['document']['history']['getOperations'](_0x34c40b);for(const _0x4d5761 of _0x5b56c1)_0x5707e9=_0x2827cc['_createFromRanges'](_0x5707e9['getTransformedByOperation'](_0x4d5761));return{'range':_0x5707e9,'currentIndex':_0x34c77a,'targetEditor':_0x22ccc6};}_integrateEditorBalloon(_0x3dcfbb){if(!_0x3dcfbb['plugins']['has']('AIChatBalloon'))return;const _0x2caab3=_0x3dcfbb['plugins']['get']('AIChatBalloon');this['_hasAIChatBalloon']=!0x0,_0x2caab3['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x2caab3,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x520da7,partIndex:_0x9bb9dc}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x168d21}=this['getInteractionAndReplyById'](_0x520da7),_0x428c55=_0x168d21['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x9bb9dc});_0x2caab3['updateContent']({'part':_0x428c55[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x2caab3,'applySuggestion',()=>{const {replyId:_0xeddb07,partIndex:_0x2d1989}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0xeddb07,'partIndex':_0x2d1989}),_0x2caab3['setState']('accepted');}),this['listenTo'](_0x2caab3,'insertSuggestion',()=>{const {replyId:_0x39878f,partIndex:_0x3c0d3f}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x39878f,'partIndex':_0x3c0d3f}),_0x2caab3['setState']('accepted');}),this['listenTo'](_0x2caab3,'rejectSuggestion',()=>{const {replyId:_0x20443b,partIndex:_0x3c7006}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x20443b,'partIndex':_0x3c7006}),_0x2caab3['setState']('rejected');}),this['listenTo'](_0x2caab3,'showNext',()=>{const {replyId:_0xfc2b02,partIndex:_0x20c3c1}=this['_currentPreviewedChangeGroup'],_0x23e074=this['_getPresentableSiblingContentPartIndex'](_0xfc2b02,_0x20c3c1,'next');null!==_0x23e074&&this['_openBalloonFor'](_0xfc2b02,_0x23e074);}),this['listenTo'](_0x2caab3,'showPrevious',()=>{const {replyId:_0x1c8062,partIndex:_0x4de369}=this['_currentPreviewedChangeGroup'],_0x44b7c3=this['_getPresentableSiblingContentPartIndex'](_0x1c8062,_0x4de369,'previous');null!==_0x44b7c3&&this['_openBalloonFor'](_0x1c8062,_0x44b7c3);}),this['listenTo'](_0x2caab3,'dialogClosed',(_0x118ab,{id:_0x1be75b})=>{if('aiChatBalloon'!==_0x1be75b)return;const {replyId:_0x5a86a0,partIndex:_0x5078fc}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x5a86a0,'index':_0x5078fc,'isActive':!0x1}),this['_activeBalloon']===_0x2caab3&&(this['_activeBalloon']=void 0x0);});}_integrateEditor(_0x5944ef){if(this['_channelsToEditors']['set'](_0x5944ef['config']['get']('collaboration.channelId'),_0x5944ef),this['_integrateEditorBalloon'](_0x5944ef),this['addCurrentDocumentToChatContext'](),this['listenTo'](_0x5944ef,'change:isReadOnly',()=>this['_refreshSuggestionGating']()),_0x5944ef['once']('destroy',()=>{this['_checkRemoveCurrentDocumentFromChatContext']();}),_0x5944ef['plugins']['has']('Undo')){const _0x52422e=_0x5944ef['commands']['get']('undo'),_0x52e0ec=_0x5944ef['commands']['get']('redo');this['listenTo'](_0x52422e,'revert',(_0x18ce9b,_0xab2b8c,_0x2093c8)=>{const _0x3d0556=this['_batchToChanges']['get'](_0xab2b8c);if(!_0x3d0556)return;const _0x27f76a=this['activeConversation']['getInteraction'](_0x3d0556['interactionId']),_0x101e93=_0x27f76a?.['getReply'](_0x3d0556['replyId']);this['_batchToChanges']['delete'](_0xab2b8c),_0x27f76a&&_0x101e93&&(_0x3d0556['indexes']['forEach'](_0x29ebf3=>_0x101e93['setChangeGroupState'](_0x29ebf3,'pending')),this['_batchToChanges']['set'](_0x2093c8,_0x3d0556));}),this['listenTo'](_0x52e0ec,'revert',(_0x49fa21,_0x26c5ef,_0x5f2021)=>{const _0x4be27f=this['_batchToChanges']['get'](_0x26c5ef);if(!_0x4be27f)return;const _0x451526=this['activeConversation']['getInteraction'](_0x4be27f['interactionId']),_0x5e6640=_0x451526?.['getReply'](_0x4be27f['replyId']);this['_batchToChanges']['delete'](_0x26c5ef),_0x451526&&_0x5e6640&&(_0x4be27f['indexes']['forEach'](_0x1d3028=>_0x5e6640['setChangeGroupState'](_0x1d3028,'accepted')),this['_batchToChanges']['set'](_0x5f2021,_0x4be27f));});}const _0x4bdabc=_0x5944ef['config']['get']('ai.chat.context');_0x4bdabc['alwaysAddSelection']&&_0x4bdabc['document']['enabled']&&this['listenTo'](_0x5944ef['model']['document']['selection'],'change:range',(_0x3a5934,_0x3ed177)=>{_0x3ed177['directChange']&&'chat'===_0x5944ef['plugins']['get']('AITabs')['view']['activeTab']&&(_0x5944ef['model']['hasContent'](_0x5944ef['model']['document']['selection'])?this['addSelectionToChatContext'](_0x5944ef):this['removeSelectionFromChatContext']());});}async _getLastCreatedConversationId(){const _0x4fc653=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x1cf989=await _0x4fc653['getConversations']();return _0x1cf989['length']?_0x1cf989[0x0]['id']:'new';}catch(_0x265f67){return this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':kt()}),this['_reporter']['logError'](new ct('ai-chat-conversation-init-failed',this,{'error':_0x265f67})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async _startConversationSafely(_0x4707c8={}){this['set']('isConversationReady',!0x1);try{await this['_handleStartConversation'](_0x4707c8),_0x4707c8['id']||this['set']('isConversationReady',!0x0);}catch(_0x2ea3d4){this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x4707c8['id']||kt()}),this['_reporter']['logError'](_0x2ea3d4),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}_detachFromActiveConversation(){this['_aiChatUi']['setIsUploadInProgress'](!0x1),this['activeConversation']&&this['stopListening'](this['activeConversation']);}async _handleStartConversation({id:_0x5368b1,modelId:_0x3ef69b,contexts:_0x52e02f}={}){this['_detachFromActiveConversation'](),this['_closeActiveBalloon']();let _0x255f8e=_0x3ef69b;_0x255f8e||(_0x5368b1||!this['activeConversation']?_0x255f8e=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x255f8e=this['activeConversation']['selectedModel']?.['id'])),this['_stopLastInteraction']();const _0x3fc30c=this['getGroupId'](),_0x16b78e=_0x5368b1||kt(),_0x3cd90e=await this['_aiModels']['getAvailableModels']();let _0x5dacb3;this['activeConversation']=new jn({'connector':this['_aiConnector'],'chatModels':this['_aiModels'],'selectedModelId':_0x255f8e,'conversationId':_0x16b78e,'group':_0x3fc30c,'locale':this['context']['locale'],'isFromHistory':!!_0x5368b1,'channelsToEditors':this['_channelsToEditors'],'contextLibrary':this['_aiContextLibrary'],'extraContexts':_0x52e02f,'getSessionId':_0x247e7d=>this['_aiEditing']['getSessionId'](_0x247e7d),'aiEditing':this['_aiEditing']}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['listenTo'](this['activeConversation'],'conversationInitialized',()=>{this['_aiChatUi']['createConversation']({'availableModels':_0x3cd90e}),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x5368b1||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['listenTo'](this['activeConversation'],'uploadProgressChanged',(_0x19cedd,_0xf69230)=>{this['_aiChatUi']['setIsUploadInProgress'](_0xf69230['isUploadInProgress']);}),this['listenTo'](this['activeConversation'],'webSearchStarted',()=>{const _0x337786=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x337786);}),this['listenTo'](this['activeConversation'],'reasoningStarted',()=>{const _0xe21202=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0xe21202);}),this['listenTo'](this['activeConversation'],'webSearchFinished',(_0xbbc132,_0x5d4e8f)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x5d4e8f,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['listenTo'](this['activeConversation'],'reasoningFinished',(_0x33c8e6,_0x44e473)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x44e473,{'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',(_0x185692,_0xdc11a4)=>{this['_aiChatUi']['removeFeedInteraction'](_0xdc11a4['id']);}),this['listenTo'](this['activeConversation'],'setConversationTitle',(_0x5a7f62,_0x1ccf93,_0x180197)=>{this['_updateConversationTitle'](_0x1ccf93,_0x180197);}),this['listenTo'](this['activeConversation'],'replyContentUpdated',async(_0x4a5097,_0x22b68d)=>{void 0x0!==_0x5dacb3&&_0x5dacb3!==_0x22b68d['id']&&this['_updateReplyContentThrottled']['flush'](),_0x5dacb3=_0x22b68d['id'],_0x22b68d['isFromHistory']?await this['_updateReplyContent']({'reply':_0x22b68d}):await this['_updateReplyContentThrottled']({'reply':_0x22b68d});}),this['listenTo'](this['activeConversation'],'replyChangeGroupStateUpdated',(_0x22effc,{reply:_0x188927,index:_0x2168ec,state:_0x4d1163,outdatedReason:_0x325627})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x188927['id'],'index':_0x2168ec,'state':_0x4d1163,'outdatedReason':_0x325627}),this['_aiChatUi']['hasFeedItem'](_0x188927['id'])&&this['_aiChatUi']['setSuggestionGating'](_0x188927['id'],this['_computeSuggestionGating'](_0x188927)),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x188927['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x2168ec&&this['_activeBalloon']?.['setState'](_0x4d1163,_0x325627);}),this['listenTo'](this['activeConversation'],'contextItemAdded',(_0x4b407f,_0x3153ad)=>{if(this['_aiChatUi']['addContextItem'](_0x3153ad['contextItem'],_0x3153ad['isLoading']),'selection'===_0x3153ad['contextItem']['type']){const _0x5b907f=Ss(this['context']),_0x4a6d0b=[..._0x5b907f['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'editor':_0x5b907f,'ranges':_0x4a6d0b,'id':'context','priority':0x1});}}),this['listenTo'](this['activeConversation'],'contextItemRemoved',(_0xbee8e8,_0x30f979)=>{this['_aiChatUi']['removeContextItem'](_0x30f979['uiId']),'current-document'==_0x30f979['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x30f979['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['listenTo'](this['activeConversation'],'contextItemLoadingEnded',(_0x4eaf60,_0x133f72)=>{this['_aiChatUi']['setContextItemLoading'](_0x133f72['contextItem']['uiId'],_0x133f72['isLoading']);}),this['listenTo'](this['activeConversation'],'contextSent',(_0x52f418,_0x4b56ba)=>{this['_aiChatUi']['setConversationContext'](_0x4b56ba['contextItems']);}),this['listenTo'](this['activeConversation'],'addContextOptionsChanged',(_0x4e907d,_0x4e539d)=>{this['_aiChatUi']['setAddContextOptions'](_0x4e539d['options']);}),this['listenTo'](this['activeConversation'],'sourceResourcesLoaded',(_0x37df21,_0x4e7c3b)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x4e7c3b['sourceId'],_0x4e7c3b['source'],_0x4e7c3b['resources'],_0x4e7c3b['uid']);}),this['listenTo'](this['activeConversation'],'resourceStateChanged',(_0x3c114c,_0x1d1827)=>{this['_aiChatUi']['updateResourceState'](_0x1d1827['sourceId'],_0x1d1827['resourceId'],_0x1d1827['isInContext']);}),this['listenTo'](this['activeConversation'],'capabilitiesUpdated',(_0x2a2aa4,_0x2ec8b8)=>{this['_aiChatUi']['updateCapabilities'](_0x2ec8b8);}),this['listenTo'](this['activeConversation'],'modelSelected',(_0x203198,_0x31f351)=>{this['_aiChatUi']['setSelectedModel'](_0x31f351['selectedModel']??null,_0x31f351['isDisabled']);}),this['listenTo'](this['activeConversation'],'error',async(_0x111822,{error:_0x521780,interactionId:_0xd1ae7f,fileName:_0x3d50a9,url:_0x238608,sourceId:_0x5e203b,sourceLabel:_0x28ed1f})=>{let _0x49a5c9;const _0x1b6995=_0xd1ae7f?_0xd1ae7f+':'+kt():kt();this['_reporter']['reportError'](_0x521780),this['_aiChatUi']['startAutoScroll'](),_0x521780['message']['startsWith']('ai-request-aborted')?(this['_cancelProcessing'](),this['activeConversation']?.['cancelLastInteractionStream'](),_0x49a5c9=this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':Es(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x1b6995})):_0x521780['message']['startsWith']('ai-chat-conversation-init-failed')||_0x521780['message']['startsWith']('ai-chat-conversation-start-failed')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-file-upload-failed')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x3d50a9),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-url-upload-failed')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x238608),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-context-invalid-data')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-context-unsupported-type')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x5e203b&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x5e203b),_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x28ed1f||'source'),'id':_0x1b6995})):_0x521780['message']['startsWith']('ai-chat-resource-load-failed')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-invalid-request')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-context-unsupported-file-type')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-context-file-too-large')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-context-file-too-many-pages')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x1b6995}):_0x521780['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x1b6995}):(this['_cancelProcessing'](),_0x49a5c9=this['_aiChatUi']['addFeedItemError']({'errorMessage':Es(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x1b6995}));try{await Promise['race']([_0x49a5c9,this['_aiChatUi']['idleUiPromise']]);}finally{this['_aiChatUi']['isBusy']||this['_aiChatUi']['stopAutoScroll']();}}),await this['activeConversation']['init'](this['_buildConversationContextConfig']()),_0x5368b1||(await this['activeConversation']['start'](),this['_aiChatUi']['enableControls']());}_buildConversationContextConfig(){const _0x1082ff=this['context']['config']['get']('ai.chat.context');return this['_contextLibrarySource']?{..._0x1082ff,'sources':[..._0x1082ff?.['sources']??[],this['_contextLibrarySource']]}:_0x1082ff;}async _setUpContextLibrarySource(){const _0x13f048=await this['_createContextLibrarySource']();_0x13f048&&(this['_contextLibrarySource']=_0x13f048,this['activeConversation']&&this['activeConversation']['chatContext']['addContextSource'](_0x13f048));}async _createContextLibrarySource(){let _0x615578;try{_0x615578=await this['_aiContextLibrary']['getAvailableContexts']();}catch{return null;}if(!_0x615578['length'])return null;const _0x362950=_0x615578['map'](_0xa74260=>({'id':_0xa74260['id'],'type':'context','label':_0xa74260['name']||_0xa74260['id']}));return{'id':'ck-ai-context-library','label':Es(this['context']['locale'],'AI_CHAT_CONTEXT_LIBRARY_LABEL'),'useDefaultFiltering':!0x0,'getResources':()=>Promise['resolve'](_0x362950)};}_removeFromContext(_0xcd111){this['activeConversation']?.['removeFromContext'](_0xcd111);}_toggleWebSearch(){this['activeConversation']?.['toggleWebSearch']();}_toggleReasoning(){this['activeConversation']?.['toggleReasoning']();}getInteractionAndReplyById(_0x3bd05e){const [_0x146227,_0xdf96cd]=_0x3bd05e['split'](':'),_0x3511de=this['activeConversation']['getInteraction'](_0x146227);return{'interaction':_0x3511de,'reply':_0x3511de['getReply'](_0xdf96cd)};}_scrollToSuggestionRange(_0x5e22a3,_0x5ede53=!0x1,_0x33610e){const _0xe3e5b3={'target':_0x33610e['editing']['view']['domConverter']['viewRangeToDom'](_0x33610e['editing']['mapper']['toViewRange'](_0x5e22a3)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x5ede53};_0x5ede53&&(_0xe3e5b3['alignToTop']=!0x0),Ot(_0xe3e5b3);}_updateConversationTitle(_0x45226f,_0x18a40e=!0x1){this['_aiChatUi']['setConversationTitle'](_0x45226f||Es(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x18a40e);}_addFeedItemReply(_0x56e78f){'text'===_0x56e78f['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x56e78f):this['_aiChatUi']['addFeedItemAISuggestion'](_0x56e78f);}async _updateReplyContent({reply:_0x36e4d6,renderingStrategy:_0x423662}){const {id:_0x5cd4f9,interactionId:_0x238559,isDone:_0x25d06b,type:_0x1443e9,parsedContent:_0x55e12c}=_0x36e4d6,_0x3ee65f=_0x238559+':'+_0x5cd4f9;if('modification'===_0x1443e9){const _0x565f2e=_0x36e4d6['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3ee65f,'parts':_0x565f2e,'isDone':_0x25d06b,'skipLoadingEffects':_0x36e4d6['isFromHistory']}),this['_aiChatUi']['hasFeedItem'](_0x36e4d6['id'])&&this['_aiChatUi']['setSuggestionGating'](_0x36e4d6['id'],this['_computeSuggestionGating'](_0x36e4d6));}else'text'===_0x1443e9&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x3ee65f,'parsedContent':_0x55e12c['get']('text'),'renderingStrategy':_0x423662,'isDone':_0x25d06b});_0x25d06b&&_0x36e4d6['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x3ee65f,_0x36e4d6['sources']);}_updateReplyContentThrottled=_0x20eb7b(this['_updateReplyContent']['bind'](this),0xc8);_stopLastInteraction(){this['activeConversation']?.['stopProcessing'](),this['_aiChatUi']['stopInteraction'](this['activeConversation']?.['lastInteraction']),this['_updateReplyContentThrottled']['cancel']();}async _flushLastInteractionUI(){const _0x40b76c=this['activeConversation']?.['lastInteraction'];if(_0x40b76c){for await(const _0x4f6123 of _0x40b76c['replies'])this['_aiChatUi']['hasFeedItem'](_0x4f6123['id'])||this['_addFeedItemReply'](_0x4f6123),await this['_updateReplyContent']({'reply':_0x4f6123,'renderingStrategy':'static'});}}async['_cancelProcessing'](){this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}_updateRatings(_0xe7583f){const _0x56f2d3={'positiveCount':_0xe7583f['changeGroups']['filter'](_0x5a70c4=>'accepted'===_0x5a70c4['state'])['length'],'totalCount':_0xe7583f['changeGroups']['length'],'modificationId':_0xe7583f['id']},_0x357b48=this['activeConversation']['getInteraction'](_0xe7583f['interactionId'])['messageId'];_0x357b48&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x357b48,_0x56f2d3);}_getAIChatFeedAPI(_0x16cf4e){const _0xeb845d=this['_aiChatUi'],_0x9819a8=()=>{_0x16cf4e['resetWebSearchState'](),_0x16cf4e['resetReasoningState'](),_0xeb845d['clearLoadingMessage']();},_0x3671c4=()=>{_0x16cf4e['currentReply']&&(_0x16cf4e['currentReply']['done'](),_0x16cf4e['currentReply']=void 0x0);};return{'insertTextReply':(_0xe9fc7c,_0x32c49a)=>{_0x3671c4(),_0x9819a8();const _0x143ef1=_0x16cf4e['currentReply']=_0x16cf4e['createReply']({'type':'text','interactionId':_0x16cf4e['id'],'id':_0x32c49a||kt(),'channelsToEditors':this['_channelsToEditors']});return _0x143ef1['appendContent'](_0xe9fc7c),_0x3671c4(),_0x143ef1;},'insertCustomElement':async(_0x505339,_0x257902)=>(_0x3671c4(),_0x9819a8(),_0xeb845d['addFeedItemCustomElement'](_0x505339,_0x257902||kt())),'setLoadingMessage':_0x129910=>{_0xeb845d['setLoadingMessage'](_0x129910);},'clearLoadingMessage':()=>{_0xeb845d['clearLoadingMessage']();}};}_checkRemoveCurrentDocumentFromChatContext(){bs(this['context'])['find'](_0x110a7c=>'destroyed'!==_0x110a7c['state'])||(this['activeConversation']?.['removeFromContext']('current-document'),this['activeConversation']?.['toggleAddCurrentDocumentOptionVisibility'](!0x1));}};const ir=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],sr=[...ir,'startConversation','sendUserMessage','promptInputPaste','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];function nr(_0x59f52f){const _0x464e05=new AbortController();return{'promise':new Promise((_0x220c87,_0x4044ec)=>{const _0x27f822=setTimeout(_0x220c87,_0x59f52f);_0x464e05['signal']['addEventListener']('abort',()=>{clearTimeout(_0x27f822),_0x4044ec();});}),'abortController':_0x464e05};}var rr=class{options;isStreaming=!0x1;document=null;nodesList=[];currentIndex=0x0;timeoutAbortController=null;lastUpdateTime=0x0;constructor(_0x517388){this['options']={'delay':_0x517388?.['delay']??0xa,'textNodeStyle':_0x517388?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async stream({document:_0x29020d,targetElement:_0x5e849b,abortSignal:_0x48904f}){this['isStreaming']&&this['stop'](),_0x48904f?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x2a3383(_0x29020d,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x332971=0x0;_0x332971<this['currentIndex'];_0x332971++)this['nodesList'][_0x332971]['shouldBeStreamed']=!0x0;do{const _0x517263=Date['now'](),_0xdd34d6=this['nodesList'][this['currentIndex']],_0x3f1a53=_0x517263-this['lastUpdateTime'];if(_0xdd34d6){_0xdd34d6['shouldBeStreamed']=!0x0;let _0x2eb281=_0xdd34d6['parent'];for(;_0x2eb281;)_0x2eb281['shouldBeStreamed']=!0x0,_0x2eb281=_0x2eb281['parent'];}if(_0x3f1a53<this['options']['delay'])try{const {promise:_0x2bb616,abortController:_0x4a1aa5}=nr(this['options']['delay']-_0x3f1a53);this['timeoutAbortController']=_0x4a1aa5,await _0x2bb616;}catch(_0x21480b){return;}_0x29a9e2(_0x5e849b,'<'+_0x5e849b['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x5e849b['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:_0x2b1728}){Array['from'](_0x2b1728['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x36f588=>{_0x36f588['replaceWith'](_0x36f588['childNodes'][0x0]);});}stop(){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x5b54af){let _0x101036='';if(function(_0x59febc){return _0x23e8cf(_0x59febc);}(_0x5b54af)){for(const _0x4aa4cc of _0x5b54af['children'])_0x101036+=this['renderNode'](_0x4aa4cc);}else{if(hr(_0x5b54af)){if(!_0x5b54af['shouldBeStreamed'])return'';const _0x4db63a=_0x5b54af,_0x3b1d71=Object['entries'](_0x4db63a['attribs'])['map'](([_0x1c4d33,_0x5f2c67])=>_0x1c4d33+'=\x22'+_0x5f2c67+'\x22')['join']('\x20');_0x101036+='<'+_0x4db63a['tagName']+(_0x3b1d71?'\x20'+_0x3b1d71:'')+'>';for(const _0x5a7ecc of _0x27f885(_0x4db63a))_0x101036+=this['renderNode'](_0x5a7ecc);_0x101036+='</'+_0x4db63a['tagName']+'>';}else{if(!ar(_0x5b54af))return'';if(!_0x5b54af['shouldBeStreamed'])return'';!function(_0x65da16){return!(!_0x65da16['parent']||!hr(_0x65da16['parent']))&&(!!or['includes'](_0x65da16['parent']['tagName'])&&!_0xa4b40a(_0x65da16)['match'](/^\s*[<>]\s*$/));}(_0x5b54af)?_0x101036+=_0x35b927(_0x5b54af):_0x101036+=_0x35b927(new _0x21f244('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x5b54af]));}}return _0x101036;}getParsedDocumentNodeList(){const _0x4b0bbf=[];return function(_0x57b045,_0x14868a){const _0x347cff=_0x295060=>{if(_0x14868a(_0x295060),_0x295060 instanceof _0x71eb2)for(let _0x248413=0x0;_0x248413<_0x295060['children']['length'];_0x248413++){const _0x9e68a1=_0x295060['children'][_0x248413];_0x347cff(_0x9e68a1);}};for(let _0x3ee8ab=0x0;_0x3ee8ab<_0x57b045['children']['length'];_0x3ee8ab++)_0x347cff(_0x57b045['children'][_0x3ee8ab]);}(this['document'],_0xc98e0c=>{if(ar(_0xc98e0c)){const _0x1cd437=this['splitTextNodeIntoWordNodes'](_0xc98e0c);_0x1cd437['length']&&_0x4b0bbf['push'](..._0x1cd437);}_0xc98e0c['isWordSplitSource']||_0xc98e0c['isWordSplitResult']||_0x4b0bbf['push'](_0xc98e0c);}),_0x4b0bbf;}splitTextNodeIntoWordNodes(_0x1fa537){if(_0x1fa537['isWordSplitSource']||_0x1fa537['isWordSplitResult'])return[];const _0x3a6aee=_0xa4b40a(_0x1fa537)['match'](/(?:\s*\S+\s*)/g),_0x4f6957=[];if(_0x3a6aee&&_0x3a6aee['length']>0x1){for(const _0x2e322f of _0x3a6aee){const _0x38d0b9=new _0xa7d61f(_0x2e322f);_0x38d0b9['isWordSplitResult']=!0x0,ti(_0x1fa537,_0x38d0b9),_0x4f6957['push'](_0x38d0b9);}_0x1fa537['isWordSplitSource']=!0x0,_0x47cc1f(_0x1fa537);}return _0x4f6957;}};const or=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ar(_0x4ec4cb){return _0x5273d9(_0x4ec4cb);}function hr(_0x1bb94d){return _0x545292(_0x1bb94d);}function cr(_0x1712df,_0x506edd){_0x1712df['cleanUpAnimations']({'targetElement':_0x506edd}),_0x506edd['querySelectorAll']('[data-id]')['forEach'](_0x13cacb=>{_0x13cacb['removeAttribute']('data-id');});}var lr=class extends _0x56a514{options;content='';htmlStreamer;['children'];constructor(_0x1ac921){super();const _0x3cab86=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new rr(),this['options']=_0x1ac921,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x3cab86['if']('isDone','ck-ai-chat__feed__item_done'),_0x3cab86['if']('isVisible','ck-hidden',_0x5c3140=>!_0x5c3140),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){cr(this['htmlStreamer'],this['element']),this['isDone']=!0x0;}async streamIntoElement(_0xc6cfcd,_0x4813f4,_0xa0e1f2){await this['htmlStreamer']['stream']({'document':_0xc6cfcd,'targetElement':_0x4813f4,'abortSignal':_0xa0e1f2});}},ur=class extends _0x56a514{['showChangesToggleView'];constructor(_0x2ac414,_0x150d7c){super(_0x2ac414),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new dr(_0x2ac414),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+Dn,'label':Es(_0x2ac414,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x150d7c['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x43791b=>_0x43791b?it:et),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x139d71=new $t();_0x139d71['content']=_0x2d99a5,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x150d7c['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x139d71,{'tag':'span','children':[Es(_0x2ac414,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}},dr=class extends Mt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}};const _r={'accepted':_0x48b061,'rejected':_0x572ba4,'outdated':_0x14640e};var gr=class extends _0x56a514{statePillView;constructor(_0x900831){super(_0x900831);const _0x37d075=this['bindTemplate'];this['set']('state','accepted'),this['set']('outdatedReason',void 0x0),this['set']('isVisible',!0x0),this['statePillView']=new _0x5745ee(_0x900831),this['statePillView']['bind']('label')['to'](this,'state',_0x2d1c17=>function(_0x52a3b8,_0x38fbb8){return Es(_0x52a3b8,'AI_SUGGESTION_CONTENT_PART_STATE_'+_0x38fbb8['toUpperCase']());}(_0x900831,_0x2d1c17)),this['statePillView']['bind']('icon')['to'](this,'state',_0x259228=>_r[_0x259228]),this['statePillView']['bind']('class')['to'](this,'state',_0x2bd4e9=>'ck-pill_'+_0x2bd4e9),this['statePillView']['bind']('tooltip')['to'](this,'state',this,'outdatedReason',(_0x43d16f,_0x3bca71)=>function(_0x2663e5,_0x1d19d4,_0x5c77e0){if('outdated'!==_0x1d19d4)return;return Es(_0x2663e5,_0x5c77e0?Ar[_0x5c77e0]:'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_TOOLTIP');}(_0x900831,_0x43d16f,_0x3bca71)),this['statePillView']['tooltipPosition']='s',this['statePillView']['tooltipClass']='ck-tooltip_multi-line',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x37d075['if']('isVisible','ck-hidden',_0x1489c6=>!_0x1489c6)]},'children':[this['statePillView']]});}setState(_0x34240e,_0x2a444f){this['state']=_0x34240e,this['outdatedReason']='outdated'===_0x34240e?_0x2a444f:void 0x0;}};const Ar={'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 Ir=class extends _0x54b9b5{_applyButton;_suggestButton;constructor(_0x3f177b,_0x6d6273,_0x4f5719){super(_0x3f177b);const _0x4a1cda=Boolean(_0x4f5719);this['set']('isEnabled',!_0x4a1cda),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x230722=[];if(!_0x4a1cda){_0x6d6273['includes']('applySuggestion')&&(this['_applyButton']=new Mt(_0x3f177b),this['_applyButton']['set']({'label':Es(_0x3f177b,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x381a45}),this['_applyButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isTargetReadOnly',(_0x45df4a,_0x390ac7)=>_0x45df4a&&!_0x390ac7),this['_applyButton']['bind']('isVisible')['to'](this,'isTrackChangesOn',_0x320f2a=>!_0x320f2a),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x230722['push'](this['_applyButton'])),_0x6d6273['includes']('insertSuggestion')&&(this['_suggestButton']=new Mt(_0x3f177b),this['_suggestButton']['set']({'label':Es(_0x3f177b,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0xf32bda}),this['_suggestButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isTargetReadOnly',(_0x54c970,_0x2bad00)=>_0x54c970&&!_0x2bad00),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x230722['push'](this['_suggestButton']));const _0x45ab4d=new Mt(_0x3f177b);_0x45ab4d['set']({'label':Es(_0x3f177b,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x194390}),_0x45ab4d['bind']('isEnabled')['to'](this),_0x45ab4d['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x230722['push'](_0x45ab4d);}this['items']['addMany'](_0x230722);const _0x349ee3=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x349ee3['if']('isVisible','ck-hidden',_0x15783a=>!_0x15783a)]}});}setButtonsVisibility({showApplyButton:_0x29ecbe,showSuggestButton:_0x14fe69}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x29ecbe),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x14fe69);}},pr=class extends _0x56a514{toolbarView;stateView;titleLabelView;['children'];constructor(_0x3f90a5,{part:_0xe9aaf8,uiIndex:_0x33b32f,availableActions:_0x12c310,areActionsDisabled:_0x5b0f09}){super(_0x3f90a5),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1),this['toolbarView']=new Ir(_0x3f90a5,_0x12c310,_0x5b0f09),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0xe9aaf8['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0xe9aaf8['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0xe9aaf8['index']});}),this['toolbarView']['bind']('isEnabled','isTrackChangesOn','isTargetReadOnly')['to'](this),this['stateView']=new gr(_0x3f90a5),this['titleLabelView']=new Er(_0x3f90a5,_0x33b32f),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',(_0x459055,_0x3b861f,_0x1e2880,_0x5e7e56)=>{'pending'===_0x5e7e56?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x1e2880?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x1e2880,this['outdatedReason']),this['children']['add'](this['stateView']));});}},Er=class extends _0x56a514{constructor(_0x4f28ae,_0x2e9261){super(_0x4f28ae),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[Es(_0x4f28ae,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x2e9261['toString']())]});}},mr=class extends _0x56a514{htmlStreamer;constructor(_0xfae6f0){super(_0xfae6f0),this['htmlStreamer']=new rr(),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async update({part:_0x2d9a50,renderingStrategy:_0x589126,abortSignal:_0x4fa5bd}){this['_ensureHostElementTag'](_0x2d9a50['wrapperTag']||'div');const _0x460246=_0x2a3383(_0x2d9a50['content'],!0x0);for(const _0x491934 of ys(_0x460246))_0x47cc1f(_0x491934);'streaming'===_0x589126?await this['htmlStreamer']['stream']({'document':_0x460246,'targetElement':this['element'],'abortSignal':_0x4fa5bd}):_0x29a9e2(this['element'],'<'+this['element']['tagName']+'>'+Os(_0x460246)+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='',this['element']['scrollTop']=0x0;}cleanUpStreamingArtifacts(){cr(this['htmlStreamer'],this['element']);}_ensureHostElementTag(_0x3c476d){if(!this['element']||this['element']['tagName']['toLowerCase']()===_0x3c476d)return;const _0x2178ea=new _0x24e6f7({'tag':_0x3c476d,'attributes':{'class':this['element']['className']}})['render']();this['element']['replaceWith'](_0x2178ea),this['element']=_0x2178ea;}},Tr=class extends _0x56a514{['_children'];['_headerView'];_streamableContentView;constructor(_0x5d7ea8,{part:_0x5df6a5,uiIndex:_0xe771ce,areActionsDisabled:_0x1d9ed8,availableActions:_0x509541}){super(_0x5d7ea8);const _0x4cbe4d=this['bindTemplate'];this['set']('state',_0x5df6a5['state']),this['set']('outdatedReason',_0x5df6a5['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);const _0xd1df75=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x1d9ed8;};this['on']('change:state',_0xd1df75),this['on']('change:isDone',_0xd1df75),_0xd1df75(),this['_children']=this['createCollection'](),this['_headerView']=new pr(_0x5d7ea8,{'part':_0x5df6a5,'uiIndex':_0xe771ce,'availableActions':_0x509541,'areActionsDisabled':_0x1d9ed8}),this['_headerView']['bind']('isEnabled','outdatedReason','state','isTrackChangesOn','isTargetReadOnly')['to'](this),this['_headerView']['delegate'](...ir)['to'](this),this['_streamableContentView']=new mr(_0x5d7ea8),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x4cbe4d['to']('state',_0x4a29ee=>'ck-ai-suggestion__body__content-part_'+_0x4a29ee),_0x4cbe4d['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x4cbe4d['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x4cbe4d['if']('isVisible','ck-hidden',_0x5853fd=>!_0x5853fd)]},'children':this['_children'],'on':{'mouseenter':_0x4cbe4d['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x5df6a5['index']});}),'mouseleave':_0x4cbe4d['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x5df6a5['index']});}),'click':_0x4cbe4d['to'](_0x3268a2=>{const _0x2e35aa=_0x3268a2['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x2e35aa)&&this['fire']('showChangeInText',{'index':_0x5df6a5['index']});})}});}async updateContent({part:_0x18f75b,showUnchangedParts:_0xf9bd9e=!0x1,abortSignal:_0x15ed23}){this['partDefinition']=_0x18f75b,this['isVisible']=this['partDefinition']['hasChanges']||_0xf9bd9e,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x18f75b,'renderingStrategy':'static','abortSignal':_0x15ed23});}['markAsDone'](){this['isDone']=!0x0;}},wr=class extends _0x56a514{constructor(_0x4f149d,_0x3fad34){super(_0x4f149d),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x2b99a1=>!_0x2b99a1)]},'children':this['_createSkeletonItems'](_0x3fad34)});}_createSkeletonItems(_0x4251b9){const _0x33d024=['ck','ck-ai-skeleton__item'];return _0x4251b9['map'](_0x46ea1b=>{let _0x42afdb='';switch(_0x46ea1b['attributes']['align']){case'right':_0x42afdb='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x42afdb='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x42afdb='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x46ea1b['tag'],'attributes':{'class':[..._0x33d024,_0x46ea1b['attributes']['class']?_0x46ea1b['attributes']['class']:''],'style':'width:\x20'+_0x46ea1b['attributes']['width']+';\x20height:\x20'+_0x46ea1b['attributes']['height']+';'+_0x42afdb}};});}};const Cr={'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':fr(0x5,'100%','44px','right'),'aiChatResources':fr(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 fr(_0x5e14e8,_0x13bc0e,_0x287258,_0x27c54a){return new Array(_0x5e14e8)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x13bc0e,'height':_0x287258,'align':_0x27c54a}}));}const br=/* #__PURE__ -- @preserve */
33
+ dt();var Sr=class extends br{['queue']=[];['isProcessing']=!0x1;_abortController;async['enqueue'](_0xb1c40a){const _0x1e8cda=this['createTask'](_0xb1c40a);return this['queue']['push'](_0x1e8cda),this['_processQueue'](),_0x1e8cda['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(_0x4a530b=>{this['once']('_queueEmpty',()=>{_0x4a530b();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x14cbe7=this['queue']['shift']();try{await _0x14cbe7['callback'](this['_abortController']['signal']),_0x14cbe7['resolve']();}catch(_0x13fa22){_0x14cbe7['reject'](_0x13fa22);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}createTask(_0x25cd61){let _0x3e6990,_0x3ff540;const _0x294430=new Promise((_0x87f307,_0x2997eb)=>{_0x3e6990=_0x87f307,_0x3ff540=_0x2997eb;});return{'callback':_0x25cd61,'resolve':_0x3e6990,'reject':_0x3ff540,'completePromise':_0x294430};}},Rr=class extends lr{constructor(_0xe8b8a9){super(_0xe8b8a9),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0xe8b8a9['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}setContent(_0x1d3eef){this['element']['innerHTML']=_0x1d3eef;}};const Or=['applySuggestion','insertSuggestion'];var vr=class extends _0x56a514{_applyChangesButton;_insertSuggestionsButton;['children'];constructor(_0x52eb56,_0x5a1ebb=[...Or],_0x92aeb3){super(_0x52eb56);const _0x54187e=this['bindTemplate'],_0x38d426=Boolean(_0x92aeb3);this['set']('isEnabled',!_0x38d426),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x38d426||(this['_applyChangesButton']=new Mt(_0x52eb56),this['_applyChangesButton']['set']({'label':Es(_0x52eb56,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x5a1ebb['includes']('applySuggestion'),'class':Ln}),this['_insertSuggestionsButton']=new Mt(_0x52eb56),this['_insertSuggestionsButton']['set']({'label':Es(_0x52eb56,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x5a1ebb['includes']('insertSuggestion'),'class':Pn}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x391094=>{_0x391094['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',_0x54187e['if']('isVisible','ck-hidden',_0x3f04c6=>!_0x3f04c6)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}updateVisibility(_0x32e1b3){this['isVisible']=_0x32e1b3;}_switchButtonLabelsPlurality(_0x6598d3){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x6598d3?(this['_applyChangesButton']['label']=Es(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=Es(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=Es(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=Es(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}},kr=class extends _0x56a514{['children'];['balloonPanelView'];bodyCollection;constructor(_0x3c64f6,_0x5d0e0a){super(_0x3c64f6),this['bodyCollection']=_0x5d0e0a,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',_0x2cb2ee=>!_0x2cb2ee)]},'children':this['children']});const _0x5e2f07=new _0x56a514(this['locale']),_0x155695=new $t();_0x155695['content']=ht,_0x5e2f07['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x155695,{'tag':'span','children':[{'text':Es(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x5e2f07),this['_setupBalloonPanel'](_0x3c64f6);}['addSource'](_0x48fa5e){this['children']['add'](new yr(this['locale'],_0x48fa5e,this['balloonPanelView']));}_setupBalloonPanel(_0x23a8d5){this['balloonPanelView']=new xt(_0x23a8d5),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}},yr=class extends Mt{['balloonPanelView'];['source'];constructor(_0x59f3a3,_0x225973,_0x4babf3){super(_0x59f3a3),this['source']=_0x225973,this['balloonPanelView']=_0x4babf3,this['set']({'label':_0x225973['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x4db084=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x4db084['to'](()=>{window['open'](_0x225973['url'],'_blank');}),'mouseenter':_0x4db084['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x4db084['to'](()=>{this['_hideTooltip']();})}}),_0x225973['favicon']){const _0x38a720=new _0x56a514(_0x59f3a3);_0x38a720['setTemplate']({'tag':'img','attributes':{'src':_0x225973['favicon']||ht,'alt':_0x225973['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x38a720);}else this['set']('icon',ht);}_createTooltipContentView(_0x82272d,_0x401fdf){const _0x109bfd=new _0x56a514(_0x82272d),_0x890f86=[];let _0x41137a;_0x401fdf?.['favicon']?(_0x41137a=new _0x56a514(_0x82272d),_0x41137a['setTemplate']({'tag':'img','attributes':{'src':_0x401fdf['favicon'],'alt':_0x401fdf['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x41137a=new $t(),_0x41137a['content']=ht,_0x41137a['extendTemplate']({'attributes':{'alt':_0x401fdf['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x890f86['push'](_0x41137a);const _0x14cd55=new _0x56a514(_0x82272d);_0x14cd55['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x401fdf['url']},'children':[{'text':new URL(_0x401fdf['url'])?.['hostname']}]}),_0x890f86['push'](_0x14cd55);const _0x387847=new _0x56a514(_0x82272d);_0x387847['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x890f86});const _0x294168=new _0x56a514(_0x82272d);return _0x294168['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x401fdf['title']['length']>0x190?_0x401fdf['title']['substring'](0x0,0x190)+'...':_0x401fdf['title']}]}),_0x109bfd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x387847,_0x294168]}),_0x109bfd;}_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 _0x278917=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x278917);}},Nr=class extends _0x56a514{_actionsView;['_readOnlyByIndex']=new Map();['_sourcesView'];['_children'];_skeletonView;_showSkeletonDebounced=_0x5f51ae(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);_skeletonShownAt=null;_areActionsDisabled;_showUnchangedParts;_updateContentPartsPromiseQueue;_emptyPartsWarningView;_availableActions;_cachedContentParts=[];constructor(_0x3ad9e1,_0x23b448){super(_0x3ad9e1);const {areActionsDisabled:_0xcdcf3d,showUnchangedParts:_0x1968a2,availableActions:_0x40482a}=_0x23b448;this['_areActionsDisabled']=_0xcdcf3d,this['_showUnchangedParts']=_0x1968a2,this['_availableActions']=_0x40482a,this['set']('isTrackChangesOn',!0x1),this['set']('isAcceptAllEnabled',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new wr(_0x3ad9e1,Cr['aiSuggestionBody']),this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now'](),this['_children']['add'](this['_skeletonView']),this['_updateContentPartsPromiseQueue']=new Sr(),this['_emptyPartsWarningView']=new Rr({'id':'empty-parts-warning','initialContent':Es(_0x3ad9e1,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new vr(_0x3ad9e1,_0x23b448['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new kr(this['locale'],_0x23b448['bodyCollection']),_0x23b448['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'isAcceptAllEnabled'),this['_actionsView']['delegate'](...ir)['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'](_0x435552=>_0x435552 instanceof Tr);}async updateContentParts({parts:_0x2a2110,abortSignal:_0x14ec7e,skipLoadingEffects:_0x45ec19}){this['_cachedContentParts']['length']?_0x2a2110['forEach'](_0x269922=>{const _0x2a5074=this['_cachedContentParts']['findIndex'](_0x528312=>_0x528312['index']==_0x269922['index']);-0x1===_0x2a5074?this['_cachedContentParts']['push'](_0x269922):this['_cachedContentParts'][_0x2a5074]=_0x269922;}):this['_cachedContentParts']=_0x2a2110;const _0x498201=this['_showUnchangedParts']?_0x2a2110:_0x2a2110['filter'](_0x551d46=>_0x551d46['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x498201['length']>0x1),_0x45ec19&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x284a9c of _0x2a2110)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x42ac55=>{let _0x59db60=this['getPartView'](_0x284a9c['index']);if(_0x59db60||_0x284a9c['hasChanges']||this['_showUnchangedParts']){if(!_0x59db60){if(_0x59db60=new Tr(this['locale'],{'part':_0x284a9c,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x59db60['delegate'](...ir)['to'](this),_0x59db60['bind']('isTrackChangesOn')['to'](this),!_0x45ec19&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x42ac55),_0x42ac55['aborted']))return;_0x59db60['isTargetReadOnly']=this['_readOnlyByIndex']['get'](_0x284a9c['index'])??!0x1,this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x59db60,this['_children']['length']-0x1),_0x45ec19||this['_showSkeletonDebounced']();}await _0x59db60['updateContent']({'part':_0x284a9c,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x42ac55}),_0x59db60['markAsDone']();}});return _0x14ec7e?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}updatePartState(_0x5a26df,_0x1cf45d,_0x2b8c1f){const _0x2e30d1=this['getPartView'](_0x5a26df);_0x2e30d1&&(_0x2e30d1['outdatedReason']=_0x2b8c1f,_0x2e30d1['state']=_0x1cf45d);}setGating({readOnlyByIndex:_0x851ed1,isAcceptAllEnabled:_0x56e0e2}){this['_readOnlyByIndex']=_0x851ed1,this['isAcceptAllEnabled']=_0x56e0e2;for(const _0xc52118 of this['_contentPartViews'])_0xc52118['isTargetReadOnly']=_0x851ed1['get'](_0xc52118['partDefinition']['index'])??!0x1;}setPartActive(_0x267545,_0x35e9da){if(!0x1===_0x267545){for(const _0x459054 of this['_contentPartViews'])_0x459054['isActive']=!0x1;}else{const _0x394ce1=this['getPartView'](_0x267545);_0x394ce1&&(_0x394ce1['isActive']=_0x35e9da);}}updateSources(_0x2b96b6){_0x2b96b6['forEach'](_0x291b7c=>this['_sourcesView']['addSource'](_0x291b7c)),this['_sourcesView']['isVisible']=!0x0;}getPartView(_0x5114e7){return this['_contentPartViews']['find'](_0x4c670c=>_0x4c670c['partDefinition']['index']==_0x5114e7)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x37636b=!this['_cachedContentParts']['find'](({hasChanges:_0x4e3cc1})=>_0x4e3cc1),_0x5b0ec4=!!this['_cachedContentParts']['find'](({hasChanges:_0x33012b})=>!_0x33012b);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x5b0ec4,_0x37636b?this['_emptyPartsWarningView']['setContent'](Es(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](Es(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_contentPartViews']['forEach'](_0xd42159=>_0xd42159['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']&&!this['_areActionsDisabled']);}async _awaitMinimumSkeletonDisplayTime(_0xc93b6b){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x20b268=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x20b268>0x0){const {promise:_0x15fa44,abortController:_0x32fa49}=nr(_0x20b268);_0xc93b6b?.['addEventListener']('abort',()=>_0x32fa49['abort']()),await _0x15fa44['catch'](()=>{});}}get hasNonEmptyParts(){return this['_contentPartViews']['filter'](_0x50b30b=>_0x50b30b['partDefinition']['hasChanges'])['length']>0x0;}},xr=class extends _0x56a514{['bodyView'];['children'];['headerView'];constructor(_0x5f0156,_0x50dbd4,_0x4d58b8){super(_0x5f0156);const {showDiff:_0xafe860,areActionsDisabled:_0x1be6e2,showUnchangedParts:_0x3eb268,availableActions:_0x30a9de}=_0x50dbd4;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new ur(_0x5f0156,{'showDiff':_0xafe860}),this['headerView']['on']('toggleShowChanges',(_0x102f92,_0x4e8e50)=>{this['areChangesVisible']=_0x4e8e50['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x4e8e50['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new Nr(_0x5f0156,{'areActionsDisabled':_0x1be6e2,'showUnchangedParts':!!_0x3eb268,'availableActions':_0x30a9de,'bodyCollection':_0x4d58b8}),this['bodyView']['delegate'](...ir)['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(_0xe4b4bc){await this['bodyView']['updateContentParts'](_0xe4b4bc);}updateSources(_0x3c1948){this['bodyView']['updateSources'](_0x3c1948);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}},Lr=class extends lr{containerView;constructor(_0x425b4f,_0x57e10f,_0xd56a97){super(_0x57e10f),this['set']('isTrackChangesOn',!0x1),this['containerView']=new xr(_0x425b4f,{'showDiff':_0x57e10f['showDiff'],'areActionsDisabled':_0x57e10f['areActionsDisabled'],'availableActions':_0x57e10f['availableActions']},_0xd56a97),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x19c69e,_0x2c240b)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x2c240b['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',(_0x3d0a26,{index:_0x3be9e5})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x3be9e5});}),this['containerView']['on']('applySuggestion',(_0x400ff4,{index:_0x37380f}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x37380f});}),this['containerView']['on']('insertSuggestion',(_0x19505d,{index:_0x5db426}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5db426});}),this['containerView']['on']('rejectSuggestion',(_0x25ffe0,{index:_0x24b3aa})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x24b3aa});}),this['containerView']['on']('mouseOverSuggestion',(_0x300a25,{index:_0x3ae716})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3ae716});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x146182,{index:_0x34e92a})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x34e92a});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async updateContent(_0x372e85){await this['containerView']['updateContent'](_0x372e85);}updatePartState(_0x15f2c8,_0x3ac70b,_0x1b4295){this['containerView']['bodyView']['updatePartState'](_0x15f2c8,_0x3ac70b,_0x1b4295);}setPartActive(_0x968318,_0x3ca232){!0x1===_0x968318?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x968318,_0x3ca232);}updateSources(_0x1408d2){this['containerView']['updateSources'](_0x1408d2);}getPartView(_0x11e500){return this['containerView']['bodyView']['getPartView'](_0x11e500);}setGating(_0x226513){this['containerView']['bodyView']['setGating'](_0x226513);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}},Pr=class extends lr{replyContainer;_bodyCollection;constructor(_0x17ef48,_0x51e343,_0x1479c2){super(_0x51e343),this['_bodyCollection']=_0x1479c2,this['locale']=_0x17ef48,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x56a514(),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':Rs(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async updateContent({parsedContent:_0x491f2a,renderingStrategy:_0x1ec014,abortSignal:_0x30543f}){'streaming'===_0x1ec014?await this['streamIntoElement'](_0x491f2a,this['replyContainer']['element'],_0x30543f):this['replyContainer']['element']['innerHTML']=_0x35b927(_0x491f2a);}updateSources(_0x4b4799){const _0x4977bd=new kr(this['locale'],this['_bodyCollection']);_0x4977bd['children']['addMany'](_0x4b4799['map'](_0x46c4c1=>new yr(this['locale'],_0x46c4c1,_0x4977bd['balloonPanelView']))),_0x4977bd['isVisible']=!0x0,this['children']['add'](_0x4977bd);}},Dr=class extends _0x14cb96{constructor(_0x196bbe=void 0x0){super();const _0x49c9bd=_0x196bbe?'ck-ai-spinner_'+_0x196bbe:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x49c9bd]}});}};const Hr={'file':_0xd6ab36,'image':_0x1bf77b,'document':_0x2d99a5,'web-resource':_0x3de4d0,'text':_0xd6ab36,'selection':tt,'mcp-tool-context':_0x2d99a5,'context':_0x2d99a5},Mr='ck-ai-chat-context-chip',Ur='ck-ai-chat-context-chip_wide',Vr='ck-ai-chat-context-chip_document',Br='ck-ai-chat-context-chip__label',Gr='ck-ai-chat-context-chip__type-icon',Fr='ck-ai-chat-context-controls__chip-tooltip',Kr='n';var Wr=class extends Mt{constructor(_0x4402c4,_0x12ad3a,_0x35dddc,_0x48a6e4,_0x59d980=!0x1){super(_0x4402c4),this['_isAnimationOnEnterEnabled']=_0x48a6e4,this['_initializeProperties'](_0x12ad3a,_0x35dddc,_0x59d980),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(_0x1c140b,_0x302307,_0x3ebb1c){this['set']('label',_0x1c140b['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x1c140b['type']),this['set']('id',_0x1c140b['uiId']),this['set']('readonly',_0x302307),this['set']('isLoading',_0x3ebb1c);}_setupTemplate(){const _0x2dad82=this['_createIconView'](),_0x4a256d=this['_createRemoveButton'](),_0x419dd5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x419dd5),'children':this['_createTemplateChildren'](_0x2dad82,_0x4a256d,_0x419dd5)});}_createTemplateAttributes(_0x41c1bd){return{'class':[Mr,_0x41c1bd['if']('itemType',Vr,_0x4950f6=>'document'==_0x4950f6),_0x41c1bd['if']('itemType',Ur,_0x2f9ed8=>'selection'==_0x2f9ed8)],'data-cke-tooltip-text':_0x41c1bd['to']('label',Yr),'data-cke-tooltip-position':Kr,'data-cke-tooltip-class':Fr};}_createTemplateChildren(_0x6ffb81,_0x3e8347,_0x182085){const _0x28774c=this['_createLabelElement'](_0x182085),_0x290690=this['_createLoaderIcon']();return this['readonly']?[_0x6ffb81,_0x28774c]:[_0x6ffb81,_0x290690,_0x28774c,_0x3e8347];}_createLabelElement(_0x32a387){return{'tag':'span','attributes':{'class':Br},'children':[{'text':_0x32a387['to']('label')}]};}_createRemoveButton(){const _0x3653fc=new Mt(this['locale']);return _0x3653fc['set']({'label':Es(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x572ba4}),this['_setupRemoveButtonEvent'](_0x3653fc),_0x3653fc;}_setupRemoveButtonEvent(_0x2125c4){_0x2125c4['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}_createIconView(){const _0x49bc30=this['bindTemplate'],_0x49c128=new $t();return _0x49c128['content']=Hr[this['itemType']],_0x49c128['extendTemplate']({'attributes':{'class':[Gr,_0x49bc30['if']('isLoading','ck-hidden',_0xd1e37a=>_0xd1e37a)]}}),_0x49c128;}_handleAnimationEndOnce(_0x1a6ad1,_0x14b0c0){if(!_0x1a6ad1)return;const _0x5d5a38=()=>{_0x14b0c0(),_0x1a6ad1['removeEventListener']('animationend',_0x5d5a38),_0x1a6ad1['removeEventListener']('webkitAnimationEnd',_0x5d5a38);};_0x1a6ad1['addEventListener']('animationend',_0x5d5a38),_0x1a6ad1['addEventListener']('webkitAnimationEnd',_0x5d5a38);}_createLoaderIcon(){const _0x22af38=new Dr('small');return _0x22af38['bind']('isVisible')['to'](this,'isLoading',_0x58aa8b=>_0x58aa8b),_0x22af38;}};function Yr(_0x1bc1eb){if(!_0x1bc1eb)return _0x1bc1eb;if(_0x1bc1eb['length']<=0x78)return _0x1bc1eb;const _0xf9a187=_0x1bc1eb['slice'](0x0,0x78),_0x25275f=_0xf9a187['lastIndexOf']('\x20');return(_0x25275f>0x0?_0xf9a187['slice'](0x0,_0x25275f):_0xf9a187)+'…';}const $r={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},qr='300px';var Qr=class{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];_showMoreButtonView=null;['_showMoreBalloonPanelView']=null;_containerElement=null;_bodyCollection;_parentView=null;_intersectionObserver=null;_pendingCalculation=!0x1;constructor(_0x19bd19,_0x560179,_0xddd67e,_0x84d8c3,_0x1eb8d1){this['_locale']=_0x19bd19,this['_visibleChips']=_0x560179,this['_config']={...$r,..._0xddd67e,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0xddd67e['cssClasses']}},this['_overflowChips']=new lt(),this['_bodyCollection']=_0x84d8c3,this['_parentView']=_0x1eb8d1||null;}setContainerElement(_0xcc45cc){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0xcc45cc,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 _0x31d6fa=[...this['_visibleChips'],...this['_overflowChips']],_0x50eb9c=this['_createCalculationContainer'](),_0x483897=this['_calculateOverflowInContainer'](_0x50eb9c,_0x31d6fa),_0x5bd604=_0x50eb9c['_ancestorsToRestore'];_0x5bd604&&this['_restoreAncestorVisibility'](_0x5bd604),_0x50eb9c['remove'](),this['_applyOverflowResults'](_0x31d6fa,_0x483897);}_createShowMoreButton(){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x44d1a9({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}_createShowMoreButtonView(){const _0xc878c1=new Mt(this['_locale']);_0xc878c1['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x4b938a=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x4b938a['push'](this['_config']['cssClasses']['controlsButton']),_0xc878c1['extendTemplate']({'attributes':{'class':_0x4b938a}}),_0xc878c1;}_createShowMoreBalloonPanelView(){const _0x4aee5f=new xt(this['_locale']);return _0x4aee5f['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x4aee5f),_0x4aee5f;}_updateBalloonContent(){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x5d1695=>{_0x5d1695['disableAnimationOnEnter']();});const _0x5f2475=new _0x56a514(this['_locale']);_0x5f2475['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x5f2475);}}_handleShowMoreButtonClick(){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}_updateShowMoreButtonVisibility(){const _0x356c19=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x356c19?'':'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(_0x37b014){const _0x2b55d6=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x43fbc0=this['_containerElement']?.['classList'];if(_0x43fbc0){const _0xd66447=_0x43fbc0[0x0]||'',_0x483079=_0x37b014['querySelector']('.'+_0xd66447),_0x536151=_0x37b014['querySelector'](_0x2b55d6);return _0x483079||_0x536151||_0x37b014;}return _0x37b014['querySelector'](_0x2b55d6)||_0x37b014;}_calculateContainerWidth(){const _0x508f4b=this['_parentView']?.['element']||this['_containerElement'];if(!_0x508f4b)return qr;const _0x568f27=window['getComputedStyle'](_0x508f4b)['width'];if('auto'===_0x568f27||'0px'===_0x568f27||!_0x568f27){const _0x9e5067=_0x508f4b['parentElement'];if(_0x9e5067){const _0x5973c3=window['getComputedStyle'](_0x9e5067);return'auto'!==_0x5973c3['width']?_0x5973c3['width']:qr;}return qr;}return _0x568f27;}_applyCalculationStyles(_0x149199,_0x3df71e){this['_config']['cssClasses']['calculationContainer']&&_0x149199['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x149199['style']['width']=_0x3df71e,_0x149199['style']['position']='absolute',_0x149199['style']['top']='-9999px',_0x149199['style']['left']='-9999px',_0x149199['style']['opacity']='0',_0x149199['style']['pointerEvents']='none',_0x149199['style']['zIndex']='-1',_0x149199['style']['visibility']='visible\x20!important',_0x149199['style']['display']='block\x20!important',_0x149199['style']['boxSizing']='border-box';}_restoreAncestorVisibility(_0x75935b){_0x75935b['forEach'](({element:_0x59454c,originalDisplay:_0x52ea42,originalVisibility:_0x563086})=>{_0x59454c['style']['display']=_0x52ea42,_0x59454c['style']['visibility']=_0x563086;});}_makeAncestorsVisible(_0x590f28){const _0x5699fa=[];let _0x21a51c=_0x590f28;for(;_0x21a51c&&_0x21a51c!==document['body'];){const _0xf9f0ce=window['getComputedStyle'](_0x21a51c);'none'!==_0xf9f0ce['display']&&'hidden'!==_0xf9f0ce['visibility']||(_0x5699fa['push']({'element':_0x21a51c,'originalDisplay':_0x21a51c['style']['display'],'originalVisibility':_0x21a51c['style']['visibility']}),_0x21a51c['style']['display']='block',_0x21a51c['style']['visibility']='visible'),_0x21a51c=_0x21a51c['parentElement'];}return _0x5699fa;}_createContainerElements(){let _0x15c08b,_0x53bdcf;return this['_parentView']?.['element']?(_0x15c08b=this['_parentView']['element']['cloneNode'](!0x0),_0x53bdcf=this['_findTargetContainer'](_0x15c08b)):(_0x15c08b=document['createElement']('div'),_0x53bdcf=_0x15c08b),{'calculationContainer':_0x15c08b,'targetContainer':_0x53bdcf};}_createCalculationContainer(){const {calculationContainer:_0x4c7674,targetContainer:_0x13fe02}=this['_createContainerElements'](),_0x5c5b1b=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x4c7674,_0x5c5b1b);const _0x356e1b=(this['_parentView']?.['element']||this['_containerElement'])?.['parentElement'];_0x356e1b?_0x356e1b['appendChild'](_0x4c7674):document['body']['appendChild'](_0x4c7674),_0x4c7674['_targetContainer']=_0x13fe02;const _0x363450=this['_makeAncestorsVisible'](_0x356e1b||null);return _0x4c7674['offsetWidth'],_0x4c7674['_ancestorsToRestore']=_0x363450,_0x4c7674;}_calculateOverflowInContainer(_0x12d5d1,_0x16681b){const _0x1f3039=_0x12d5d1['_targetContainer']||_0x12d5d1,_0x4e5da8=[],{rowCount:_0x143fe6}=this['_renderChipsAndCountRows'](_0x1f3039,_0x16681b);if(_0x143fe6<=this['_config']['maxVisibleRows'])return _0x4e5da8;const _0x1a0398=_0x16681b['slice']();for(;_0x1a0398['length']>0x0;){if(this['_testButtonFit'](_0x12d5d1,_0x1f3039,_0x1a0398)){const _0x558bcd=_0x16681b['filter'](_0x55f889=>!_0x1a0398['includes'](_0x55f889));_0x4e5da8['push'](..._0x558bcd);break;}if(!_0x1a0398['pop']())break;}return _0x4e5da8;}_renderChipsAndCountRows(_0xba05f7,_0xed6c43){_0xba05f7['innerHTML']='',_0xed6c43['forEach'](_0x59da17=>{if(_0x59da17['element']){const _0x40ac5a=_0x59da17['element']['cloneNode'](!0x0);_0xba05f7['appendChild'](_0x40ac5a);}}),_0xba05f7['offsetWidth'];const _0x34fe31=_0xba05f7['children'],_0x1d8c67=[];return Array['from'](_0x34fe31)['forEach'](_0x5a30f4=>{const _0x3de9e6=_0x5a30f4['getBoundingClientRect']()['top'];_0x1d8c67['some'](_0x4f42ce=>Math['abs'](_0x4f42ce-_0x3de9e6)<this['_config']['rowDetectionTolerance'])||_0x1d8c67['push'](_0x3de9e6);}),{'rowCount':_0x1d8c67['length']};}_createMockButton(){const _0x990579=document['createElement']('button');return _0x990579['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x990579['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x990579['textContent']='+\x201',_0x990579;}_testButtonFit(_0x403618,_0x138fcc,_0x4a1ede){this['_renderChipsAndCountRows'](_0x138fcc,_0x4a1ede);const _0x4f4d1b=this['_createMockButton']();_0x403618['appendChild'](_0x4f4d1b),_0x403618['offsetWidth'];const _0x45e945=[..._0x138fcc['children'],_0x4f4d1b],_0x5e23d9=[];_0x45e945['forEach'](_0x57bc1e=>{const _0x5d5aad=_0x57bc1e['getBoundingClientRect']()['top'];_0x5e23d9['some'](_0x378673=>Math['abs'](_0x378673-_0x5d5aad)<this['_config']['rowDetectionTolerance'])||_0x5e23d9['push'](_0x5d5aad);});const _0x5ee42f=_0x5e23d9['length'];return _0x4f4d1b['remove'](),_0x5ee42f<=this['_config']['maxVisibleRows'];}_distributeChips(_0x14305c,_0x1ed4fd){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x14305c['forEach'](_0x522866=>{_0x1ed4fd['includes'](_0x522866)?this['_overflowChips']['add'](_0x522866):this['_visibleChips']['add'](_0x522866);});}_updateOverflowUI(_0x24d2a8){if(_0x24d2a8>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x24d2a8>0x0&&this['_showMoreButtonView']){const _0x33d682=''+this['_config']['showMoreLabelPrefix']+(_0x24d2a8<0x63?_0x24d2a8:'99');this['_showMoreButtonView']['label']=_0x33d682;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}_applyOverflowResults(_0x47fcf3,_0x2dd5a7){this['_distributeChips'](_0x47fcf3,_0x2dd5a7),this['_updateOverflowUI'](_0x2dd5a7['length']);}_setupVisibilityObserver(){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x41d946=>{_0x41d946[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 _0x43d4f5=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x43d4f5['width']||0x0===_0x43d4f5['height'])return!0x1;const _0x50d189=window['innerHeight']||document['documentElement']['clientHeight'],_0x3c397a=window['innerWidth']||document['documentElement']['clientWidth'];return _0x43d4f5['bottom']>=-0xc8&&_0x43d4f5['top']<=_0x50d189+0xc8&&_0x43d4f5['right']>=-0xc8&&_0x43d4f5['left']<=_0x3c397a+0xc8;}};const Xr='ck-ai-chat__feed__context-chips',zr='ck-ai-chat-context-chips-wrapper',jr='ck-ai-chat-context-chips-wrapper-balloon',Jr='ck-ai-chat-controls-button',Zr='ck-ai-chat-controls_context_show-more-button',to='ck-ai-chat-context-controls__show-more-balloon-panel';var eo=class extends _0x56a514{_contextChips=this['createCollection']();['_overflowManager'];_bodyCollection;constructor(_0x4bd318,_0xdeb5c3,_0x202dd2){super(_0x4bd318),this['_bodyCollection']=_0x202dd2,this['_createContextChips'](_0xdeb5c3);const _0x4f447a={'cssClasses':{'showMoreButton':Zr+'\x20'+Dn,'showMoreBalloon':to,'overflowContainer':jr,'controlsButton':Jr}};this['_overflowManager']=new Qr(_0x4bd318,this['_contextChips'],_0x4f447a,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Xr,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':zr},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x5b7429=this['element']['querySelector']('.'+zr);_0x5b7429&&(this['_overflowManager']['setContainerElement'](_0x5b7429),this['_overflowManager']['reorganizeChips']());}destroy(){super['destroy'](),this['_overflowManager']['destroy']();}_createContextChips(_0x399d82){for(const _0x4884f4 of _0x399d82){const _0x50aedd=new Wr(this['locale'],_0x4884f4,!0x0,!0x1);this['_contextChips']['add'](_0x50aedd);}}},io=class extends lr{_contextChipsView=null;['_locale'];_bodyCollection;_messageContentView;constructor(_0x54322e,_0x1f095f,_0x2e4e54){super(_0x1f095f),this['_locale']=_0x54322e,this['_bodyCollection']=_0x2e4e54,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 eo(this['_locale'],this['options']['contextItems']['filter'](_0x55af14=>!_0x55af14['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}_createMessageContentView(){this['_messageContentView']=new _0x56a514(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']=this['options']['initialContent'],this['markAsDone']();}},so=class extends lr{capabilities;constructor(_0x34e352,_0x1c9094){super(_0x1c9094);const {isWebSearchEnabled:_0x20cdc0,isReasoningEnabled:_0x2ed776}=_0x1c9094['capabilities'],_0x39d130=[];let _0x214809='';_0x20cdc0&&_0x2ed776?(_0x214809=Es(_0x34e352,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x39d130['push'](no(ht)),_0x39d130['push'](no(_0x1e95b5))):_0x20cdc0?(_0x214809=Es(_0x34e352,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x39d130['push'](no(ht))):_0x2ed776&&(_0x214809=Es(_0x34e352,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x39d130['push'](no(_0x1e95b5))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x214809?'':'ck-hidden']}});const _0x182cda=new _0x56a514();_0x182cda['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x39d130,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x214809]}]}),this['children']['add'](_0x182cda),this['capabilities']=_0x1c9094['capabilities'];}};function no(_0x439f48){const _0x1fe092=new $t();return _0x1fe092['content']=_0x439f48,_0x1fe092;}const ro=['wheel','touchstart','pointerdown','keydown'],oo=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];var ao=class{element;animationFrameId;['isRunning'];abortController;['isUserPaused'];['scrollBehavior'];constructor(_0x513390){this['element']=_0x513390,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x14335b of ro){const _0x4fe037='keydown'!==_0x14335b;this['element']['addEventListener'](_0x14335b,this['_onUserEvent']['bind'](this),{'passive':_0x4fe037,'signal':this['abortController']['signal']});}}start({smooth:_0x20c937=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x20c937?'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(_0x117a61){if(this['isRunning']){if('keydown'===_0x117a61['type']){const _0x5c077d=_0x117a61['key'];if(!oo['includes'](_0x5c077d))return;}_0x117a61 instanceof WheelEvent?_0x117a61['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}_isAtBottom(){const {scrollTop:_0x2ad35f,scrollHeight:_0xd4a991,clientHeight:_0x22bd03}=this['element'];return _0xd4a991-_0x2ad35f-_0x22bd03<=0x5;}_rafUpdate(){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':this['scrollBehavior']}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}},ho=class extends lr{constructor(_0x3eed08){super(_0x3eed08),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']);}},co=class extends _0x56a514{['children'];['scrollManager'];_bodyCollection;constructor(_0x4f4ca4,_0x34c58b){super(_0x4f4ca4),this['_bodyCollection']=_0x34c58b,this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...sr)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new ao(this['element']);}destroy(){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}addItem(_0x599082,_0x426e59){let _0x53e995;return'ai-reply'===_0x599082?_0x53e995=new Pr(this['locale'],_0x426e59,this['_bodyCollection']):'ai-suggestion-reply'===_0x599082?(_0x53e995=new Lr(this['locale'],_0x426e59,this['_bodyCollection']),_0x53e995['bind']('isTrackChangesOn')['to'](this)):_0x53e995='user-message'===_0x599082?new io(this['locale'],_0x426e59,this['_bodyCollection']):'interaction-header'===_0x599082?new so(this['locale'],_0x426e59):'custom-element'===_0x599082?new ho(_0x426e59):new Rr(_0x426e59),this['children']['add'](_0x53e995),_0x53e995;}async updateReplyItem({id:_0x57618d,parsedContent:_0x303d66,renderingStrategy:_0x51d924,abortSignal:_0x480807}){const _0x1e5e82=this['getItemById'](_0x57618d);if(!(_0x1e5e82 instanceof Pr))throw new ct('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x1e5e82,'id':_0x57618d,'parsedContent':_0x303d66});await _0x1e5e82['updateContent']({'parsedContent':_0x303d66,'renderingStrategy':_0x51d924,'abortSignal':_0x480807});}async updateWebSources(_0x243367,_0x2b3e6c){const _0x593467=this['getItemById'](_0x243367);if(_0x593467 instanceof Lr)_0x593467['updateSources'](_0x2b3e6c);else{if(!(_0x593467 instanceof Pr))throw new ct('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x593467,'id':_0x243367,'sources':_0x2b3e6c});_0x593467['updateSources'](_0x2b3e6c);}}async updateSuggestionItem({id:_0x283f8b,parts:_0x4b2c83,abortSignal:_0x4ffe7d,skipLoadingEffects:_0x4558e2}){const _0x233a11=this['getItemById'](_0x283f8b);if(!(_0x233a11 instanceof Lr))throw new ct('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x233a11,'id':_0x283f8b,'parts':_0x4b2c83});await _0x233a11['updateContent']({'parts':_0x4b2c83,'abortSignal':_0x4ffe7d,'skipLoadingEffects':_0x4558e2});}updateSuggestionPartState({id:_0xd74c05,index:_0x4965d2,state:_0x1afe2b,outdatedReason:_0x2ad15e}){const _0x252547=this['getItemById'](_0xd74c05);if(!(_0x252547 instanceof Lr))throw new ct('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0xd74c05});_0x252547['updatePartState'](_0x4965d2,_0x1afe2b,_0x2ad15e);}updateSuggestionGating(_0x2d8719,_0xcc040d){const _0x717541=this['getItemById'](_0x2d8719);if(!(_0x717541 instanceof Lr))throw new ct('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x2d8719});_0x717541['setGating'](_0xcc040d);}setSuggestionPartActive({id:_0x443f4,index:_0x451f73,isActive:_0x2c1ea5}){const _0x30662d=this['getItemById'](_0x443f4);if(!(_0x30662d instanceof Lr))throw new ct('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x443f4});this['children']['filter'](_0x3bbca7=>_0x3bbca7 instanceof Lr)['forEach'](_0x490942=>{_0x490942['setPartActive'](!0x1);}),_0x30662d['setPartActive'](_0x451f73,_0x2c1ea5);}markItemAsDone(_0x56db5a){this['getItemById'](_0x56db5a)['markAsDone']();}getItemIds(){return this['children']['map'](_0x389637=>_0x389637['options']['id']);}removeItem(_0x5b3da8){this['children']['remove'](this['getItemById'](_0x5b3da8));}hasItem(_0x3c600a){return!!this['children']['find'](_0x3c1d51=>_0x3c1d51['options']['id']['includes'](_0x3c600a));}scrollToSuggestion(_0x467b76,_0x73bc60){const _0x3969d3=this['getItemById'](_0x467b76);if(!(_0x3969d3 instanceof Lr))return void St('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x467b76,'partIndex':_0x73bc60});const _0x251c4c=_0x3969d3['getPartView'](_0x73bc60);_0x251c4c?Rt(_0x251c4c['element'],0x14,this['element']['parentElement'],!0x0,!0x0):St('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x467b76,'partIndex':_0x73bc60});}_setupTemplate(){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}_createTemplateChildren(){const _0x18f4de=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x18f4de,this['_createFeedLoader']()];}_createSkeletonLoader(){const _0x1da2f6=new wr(this['locale'],Cr['aiFeed']);return _0x1da2f6['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x1da2f6;}_createFeedItems(){const _0x1499e1=new _0x56a514(this['locale']);return _0x1499e1['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x1499e1;}_createFeedLoader(){const _0x3a689f=new _0x56a514(this['locale']);return _0x3a689f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x5a7735=>!_0x5a7735)]},'children':this['_createLoaderChildren']()}),_0x3a689f;}_createLoaderChildren(){const _0x318f5e=new Dr();return _0x318f5e['isVisible']=!0x0,[_0x318f5e,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}getItemById(_0x3379ed){const _0xfe5a6c=this['children']['find'](_0x4852f2=>_0x4852f2['options']['id']['includes'](_0x3379ed));if(!_0xfe5a6c)throw new ct('ai-chat-feed-view-item-not-found',this,{'id':_0x3379ed});return _0xfe5a6c;}setLoadingMessage(_0x3655ec){this['set']('loadingMessage',_0x3655ec);}toggleLoadingSkeleton(_0x143e9d){this['set']('isLoadingSkeletonVisible',_0x143e9d);}startAutoScroll(_0x57cf46={}){this['scrollManager']['start'](_0x57cf46);}stopAutoScroll(){this['scrollManager']['stop']();}},lo=class extends Jt{filter(){let _0x4e0dc6=0x0;for(const _0xcdfad of this['items'])_0x4e0dc6+=_0xcdfad['items']['length'];return{'resultsCount':_0x4e0dc6,'totalItemsCount':_0x4e0dc6};}};function uo(_0x5dad65){const _0x2ba70a=[];let _0x37c4e0=!0x1;for(const _0x1df48e of Array['from'](_0x5dad65['items'])){if('file'!==_0x1df48e['kind'])continue;if(_0x1df48e['webkitGetAsEntry']()?.['isDirectory']){_0x37c4e0=!0x0;continue;}const _0x545980=_0x1df48e['getAsFile']();_0x545980&&_0x2ba70a['push'](_0x545980);}return{'files':_0x2ba70a,'hasDirectory':_0x37c4e0};}const _o='ck-ai-chat__prompt-input_highlighted';var go=class AIChatPromptInputView extends Nt{submitButtonView;static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;_addContextButtonView;['_queryViewResizeObserver'];constructor(_0x2724f7,_0x5bc9e2){super(_0x2724f7,{'queryView':{'label':'','creator':_0x3cc43c,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new lo(_0x2724f7),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x5bc9e2,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',(_0x530737,_0x4be372)=>!_0x530737&&!_0x4be372),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x2f3fc7,_0x301ac9)=>{this['isUploadInProgress']||this['isEmpty']||_0x2f3fc7['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x301ac9());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();}),this['queryView']['fieldView']['element']['addEventListener']('paste',_0x130223=>this['_handlePaste'](_0x130223)),this['element']['addEventListener']('drop',_0x2601c2=>this['_handleDrop'](_0x2601c2));}_handlePaste(_0x443735){const _0x261692=_0x443735['clipboardData'];if(!_0x261692)return;const {files:_0x23ba28,hasDirectory:_0x1a9756}=uo(_0x261692),_0x165f34={'files':_0x23ba28,'plainText':_0x261692['getData']('text/plain'),'hasDirectory':_0x1a9756,'forceTextAttachment':!0x1,'preventDefault':()=>_0x443735['preventDefault']()};this['fire']('promptInputPaste',_0x165f34);}['_handleDrop'](_0x598ba0){const _0x207a2a=_0x598ba0['dataTransfer'];if(!_0x207a2a)return;const _0x56998e={'files':[],'plainText':_0x207a2a['getData']('text/uri-list')||_0x207a2a['getData']('text/plain'),'hasDirectory':!0x1,'forceTextAttachment':!0x1,'preventDefault':()=>_0x598ba0['preventDefault']()};this['fire']('promptInputPaste',_0x56998e);}destroy(){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}submit(){const _0x62d1f9=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x62d1f9)return this['queryView']['errorText']=Es(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x5c2e1f=_0x15f5d8(_0x62d1f9);this['fire']('sendUserMessage',_0x5c2e1f),this['queryView']['fieldView']['reset']();}setPlaceholderText(_0x46bcd9){this['queryView']['fieldView']['set']('placeholder',_0x46bcd9);}['focus'](_0x2debc8=!0x1){super['focus'](),_0x2debc8&&(this['element']['classList']['contains'](_o)||(this['element']['classList']['add'](_o),setTimeout(()=>{this['element']['classList']['remove'](_o);},0x320)));}_createSubmitButton(){const _0x2eb3d7=new Mt(this['locale']);return _0x2eb3d7['set']({'icon':nt,'label':Es(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+Ln,'isEnabled':!0x1}),_0x2eb3d7['on']('execute',()=>{this['submit']();}),_0x2eb3d7;}setIsUploadInProgress(_0x3e7e82){this['isUploadInProgress']=_0x3e7e82;}_setUpAddContextButtonPositioning(){const _0x2018fb=this['locale'],_0x25a760=()=>{wt['window']['requestAnimationFrame'](()=>{if(ft(this['element'])){const _0x37e2f0=new It(this['queryView']['fieldView']['element']),_0x1f8dd6=new It(this['_addContextButtonView']['element']),_0x1db57a=_0x37e2f0['width'],_0x88d991='rtl'===_0x2018fb['uiLanguageDirection']?'right':'left';_0x37e2f0['excludeScrollbarsAndBorders']();const _0x5b25f6=_0x1db57a-_0x37e2f0['width']+0x1;this['_addContextButtonView']['element']['style'][_0x88d991]='calc('+(_0x1db57a-_0x1f8dd6['width']-_0x5b25f6)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x25a760),this['on']('render',()=>{_0x25a760(),this['_queryViewResizeObserver']=new pt(this['queryView']['fieldView']['element'],()=>{_0x25a760();});});}},Ao=class extends _0x56a514{constructor(_0x15159a){super(_0x15159a),this['set']('isEnabled',!0x0);const _0x517cc6=new $t();_0x517cc6['content']=_0xd6ab36,this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls__drop-overlay']},'children':[_0x517cc6,{'tag':'span','attributes':{'class':['ck-ai-chat-controls__drop-overlay__label']},'children':[{'text':Es(_0x15159a,'AI_CHAT_DROP_ZONE_HINT')}]}]});}attach(_0x3c1ed6){let _0x3a54d1=0x0;const _0x10b4a9=()=>{_0x3c1ed6['classList']['toggle']('ck-ai-chat-controls_drag-over',this['isEnabled']&&_0x3a54d1>0x0);};this['on']('change:isEnabled',(_0x2aa8e5,_0x524c43,_0x2fb3ec)=>{_0x2fb3ec&&_0x3a54d1>0x0&&this['fire']('dragEnter'),_0x10b4a9();}),_0x3c1ed6['addEventListener']('dragenter',_0x58de53=>{_0x58de53['dataTransfer']&&(_0x3a54d1++,0x1===_0x3a54d1&&this['isEnabled']&&this['fire']('dragEnter'),_0x10b4a9());}),_0x3c1ed6['addEventListener']('dragover',_0x2bad24=>{_0x2bad24['dataTransfer']&&_0x2bad24['preventDefault']();}),_0x3c1ed6['addEventListener']('dragleave',()=>{--_0x3a54d1<0x0&&(_0x3a54d1=0x0),_0x10b4a9();}),_0x3c1ed6['addEventListener']('drop',_0x1fda22=>{_0x1fda22['preventDefault'](),_0x3a54d1=0x0,_0x10b4a9(),this['isEnabled']&&this['_handleDrop'](_0x1fda22);});}['_handleDrop'](_0x57df4a){const _0x3a98ff=_0x57df4a['dataTransfer'];if(!_0x3a98ff)return;const {files:_0x3c4254,hasDirectory:_0x296ac4}=uo(_0x3a98ff),_0x342988={'files':_0x3c4254,'plainText':_0x3a98ff['getData']('text/uri-list')||_0x3a98ff['getData']('text/plain'),'hasDirectory':_0x296ac4,'forceTextAttachment':!0x0,'preventDefault':()=>{}};this['fire']('promptInputPaste',_0x342988);}},Io=class extends _0x56a514{['dropdownView'];['nameView'];_items;['_config'];constructor(_0x20f983,_0x4e8dc7){super(_0x20f983),this['_config']=_0x4e8dc7,this['set']('modelDisplayMode','selector'),this['set']('activeModelId',null),this['set']('activeModelName',null),this['set']('isEnabled',!0x0),this['dropdownView']=this['_createDropdown'](),this['_items']=new lt(),_0x40e721(this['dropdownView'],this['_items']),this['nameView']=new po(_0x20f983,_0x4e8dc7['nameClass']),this['nameView']['bind']('text')['to'](this,'activeModelName',_0x5d94a6=>_0x5d94a6??''),this['nameView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x4968cc=>'name'===_0x4968cc),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-model-selector']},'children':[this['dropdownView'],this['nameView']]});}setModels(_0x47ac3d,_0xc08ecd){var _0xf52e18;this['set']('modelDisplayMode',(_0xf52e18=_0x47ac3d['length'],_0xc08ecd?0x1===_0xf52e18?'name':'selector':'hidden')),this['_items']['clear'](),0x1===_0x47ac3d['length']&&this['set']('activeModelName',_0x47ac3d[0x0]['name']||_0x47ac3d[0x0]['id']);for(const _0x58af36 of _0x47ac3d){const _0x5f3015=new _0x28f92e({'label':_0x58af36['name'],'withText':!0x0,'role':'menuitemradio','id':_0x58af36['id'],'model':_0x58af36});_0x5f3015['bind']('isOn')['to'](this,'activeModelId',_0x56039c=>_0x56039c===_0x58af36['id']),this['_items']['add']({'type':'button','model':_0x5f3015,'labelView':new Eo(this['locale'],_0x58af36,{'nameClass':this['_config']['itemClasses']['name'],'descriptionClass':this['_config']['itemClasses']['description'],'capabilitiesClass':this['_config']['itemClasses']['capabilities'],'extraContent':this['_config']['showCapabilities']?mo(this['locale'],_0x58af36):void 0x0})});}}setSelectedModel(_0x5d73c9){this['set']('activeModelId',_0x5d73c9?_0x5d73c9['id']:null),this['set']('activeModelName',_0x5d73c9?_0x5d73c9['name']||_0x5d73c9['id']:null);}_createDropdown(){const _0x31e2ca=_0x48403c(this['locale']);return _0x31e2ca['set']({'panelPosition':this['_config']['panelPosition'],'class':this['_config']['dropdownClass']}),_0x31e2ca['buttonView']['set']({'withText':!0x0,'tooltipPosition':this['_config']['tooltipPosition'],'class':Dn}),_0x31e2ca['buttonView']['bind']('label')['to'](this,'activeModelName',_0x224290=>_0x224290??this['_config']['defaultLabel']??''),_0x31e2ca['buttonView']['bind']('tooltip')['to'](this,'activeModelName',this,'isEnabled',(_0x3fca7c,_0x2bceab)=>!_0x2bceab&&this['_config']['disabledTooltip']?this['_config']['disabledTooltip']:_0x3fca7c??this['_config']['defaultLabel']??''),_0x31e2ca['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1154b9=>'selector'===_0x1154b9),_0x31e2ca['bind']('isEnabled')['to'](this,'isEnabled'),this['listenTo'](_0x31e2ca,'execute',_0x1a2e4c=>{this['fire']('selectModel',_0x1a2e4c['source']['model']);}),_0x31e2ca;}},po=class extends _0x56a514{constructor(_0x566e79,_0x1c7217){super(_0x566e79),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x1d51df=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck',_0x1c7217,_0x1d51df['if']('isVisible','ck-hidden',_0x2eeead=>!_0x2eeead)]},'children':[{'text':_0x1d51df['to']('text')}]});}},Eo=class extends Dt{constructor(_0x25369f,_0x24ce7e,_0x4ff091){super();const _0x103d48=this['bindTemplate'],_0x132a1f=[{'tag':'div','attributes':{'class':[_0x4ff091['nameClass']]},'children':[{'tag':'span','children':[{'text':_0x103d48['to']('text')}]}]},{'tag':'div','attributes':{'class':[_0x4ff091['descriptionClass']]},'children':[{'tag':'span','children':[_0x24ce7e['description']||'']}]}];_0x4ff091['extraContent']?.['length']&&_0x4ff091['capabilitiesClass']&&_0x132a1f['push']({'tag':'div','attributes':{'class':[_0x4ff091['capabilitiesClass']]},'children':_0x4ff091['extraContent']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x103d48['to']('style'),'id':_0x103d48['to']('id')},'children':_0x132a1f});}};function mo(_0x4a6917,_0x8d1a96){return[...To(_0x4a6917,ht,'AI_CHAT_SEARCH_WEB',_0x8d1a96['capabilities']['webSearch']?.['enabled']??!0x1),...To(_0x4a6917,_0x1e95b5,'AI_CHAT_REASONING',_0x8d1a96['capabilities']['reasoning']?.['enabled']??!0x1)];}function To(_0x318937,_0x1522c1,_0xf07d6e,_0xf9ced2){const _0x2b6fea=new $t();_0x2b6fea['content']=_0x1522c1;const _0xd1c402=new _0x56a514(_0x318937);_0xd1c402['setTemplate']({'tag':'span','children':[{'text':Es(_0x318937,_0xf07d6e)+':\x20'}]});const _0x3eb6a6=new _0x56a514(_0x318937);return _0x3eb6a6['setTemplate']({'tag':'span','children':[{'text':Es(_0x318937,_0xf9ced2?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x2b6fea,_0xd1c402,_0x3eb6a6];}const wo='ck-ai-chat__prompt-capabilities',Co='ck-ai-chat-controls-button',fo='ck-ai-chat-controls-button--commands',bo='ck-ai-chat-controls__model-selection',So='ck-ai-chat-controls__model-selection__item-name',Ro='ck-ai-chat-controls__model-selection__item-description',Oo='ck-ai-chat-controls__model-selection__item-capabilities',vo='n';var ko=class extends _0x56a514{_webSearchButton;_reasoningButton;_commandsButton;_modelSelector;constructor(_0x7a1029){super(_0x7a1029),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorEnabled',!0x0),this['_modelSelector']=function(_0x1f845e){return new Io(_0x1f845e,{'panelPosition':'ne','dropdownClass':[bo],'nameClass':'ck-ai-chat-controls__model-name','itemClasses':{'name':So,'description':Ro,'capabilities':Oo},'defaultLabel':Es(_0x1f845e,'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'disabledTooltip':Es(_0x1f845e,'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP'),'tooltipPosition':vo,'showCapabilities':!0x0});}(_0x7a1029),this['_modelSelector']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x2d6550=>_0x2d6550),this['_modelSelector']['delegate']('selectModel')['to'](this),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x572f7f=>_0x572f7f),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x271a0b=>Es(this['locale'],_0x271a0b?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x2c0bf5=>_0x2c0bf5),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x2ef4db=>Es(this['locale'],_0x2ef4db?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[wo]},'children':[this['_modelSelector'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]});}setWebSearch(_0x16e300){this['set']('webSearchActive',_0x16e300);}setReasoning(_0x291dbd){this['set']('reasoningActive',_0x291dbd);}setModelList(_0xf38e15,_0x3784bc){this['_modelSelector']['setModels'](_0xf38e15,!_0x3784bc);}setModel(_0x72108a){if(!_0x72108a)return;this['_modelSelector']['setSelectedModel'](_0x72108a);const _0x3382c2=_0x72108a['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x3382c2),this['_webSearchButton']['set']('isVisible',_0x3382c2);const _0x4bdd5=_0x72108a['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x4bdd5),this['_reasoningButton']['set']('isVisible',_0x4bdd5);}enableModelSelector(){this['set']('modelSelectorEnabled',!0x0);}disableModelSelector(_0x37bf4d){this['set']('modelSelectorEnabled',!0x1),_0x37bf4d&&(this['_modelSelector']['modelDisplayMode']='hidden');}_createWebSearchButton(){const _0x212705=new Mt();return _0x212705['set']({'label':Es(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':ht,'class':Co+'\x20'+Dn,'isToggleable':!0x0,'tooltipPosition':vo}),_0x212705['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x212705;}_createReasoningButton(){const _0xcd7242=new Mt();return _0xcd7242['set']({'label':Es(this['locale'],'AI_CHAT_REASONING'),'icon':_0x1e95b5,'class':Co+'\x20'+Dn,'isToggleable':!0x0,'tooltipPosition':vo}),_0xcd7242['on']('execute',()=>{this['fire']('toggleReasoning');}),_0xcd7242;}_createCommandsButton(){const _0x12d256=new Mt();return _0x12d256['set']({'label':Es(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x522884,'withText':!0x0,'class':Co+'\x20'+Dn,'isToggleable':!0x0,'tooltip':Es(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':vo}),_0x12d256['extendTemplate']({'attributes':{'class':[fo]}}),_0x12d256['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x12d256;}};const yo='ck-ai-chat-context-controls__url-form',No='ck-ai-chat-context-controls__url-input-section';var xo=class extends _0x56a514{['focusTracker'];keystrokes;['_focusables'];['focusCycler'];urlInputField;backButton;confirmButton;constructor(_0x187396){super(_0x187396),this['focusTracker']=new _t(),this['keystrokes']=new gt(),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 Ft({'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'](_0x218d71=>{this['focusTracker']['add'](_0x218d71['element']),this['keystrokes']['listenTo'](_0x218d71['element']);}),_0x2801b9({'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(_0x2c72f8){this['urlInputField']['errorText']=_0x2c72f8,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}_createBackButton(){const _0x18d52e=new Mt(this['locale']);return _0x18d52e['set']({'icon':_0xd78e92,'tooltip':Es(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x258919,_0x210c35,_0x4e0e86)=>{_0x18d52e['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x4e0e86?'':'\x20ck-hidden')]});}),_0x18d52e;}_createUrlInputField(){const _0x2c11ee=new Qt(this['locale'],_0x4c7fdb);return _0x2c11ee['set']({'label':Es(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x2c11ee['fieldView']['set']({'placeholder':Es(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x2c11ee;}_createConfirmButton(){const _0x1bf37a=new Mt(this['locale']);return _0x1bf37a['set']({'icon':_0x48b061,'tooltip':Es(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x1bf37a;}_setupTemplate(){const _0x43c431=new Kt(this['locale'],{'label':Es(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x43c431['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':yo,'tabindex':'-1'},'children':[_0x43c431,{'tag':'div','attributes':{'class':No},'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',_0x10fc5a=>{_0x10fc5a['stop'](),this['_handleSubmit']();});}_setupKeystrokes(){this['keystrokes']['set']('esc',(_0x59ffc0,_0x618966)=>{this['clear'](),this['fire']('cancel'),_0x618966();});}_handleSubmit(){const _0x82c04a=this['getValue']()['trim']();_0x82c04a?this['_isValidUrl'](_0x82c04a)?(this['clearError'](),this['fire']('submitUrl',_0x82c04a)):this['setError'](Es(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](Es(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}_updateConfirmButtonState(){const _0x43fced=this['getValue']()['trim'](),_0x443da9=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x43fced['length']>0x0&&!_0x443da9;}['_isValidUrl'](_0x167eee){try{return!!new URL(_0x167eee);}catch{return!0x1;}}};const Lo='ck-ai-chat-resources__item',Po='ck-ai-chat-resources__item--in-context',Do='ck-ai-chat-resources__item-title',Ho='ck-ai-chat-resources__item__icon';var Mo=class extends jt{['resource'];_titleView;['_iconView'];constructor(_0x3ca556,_0x51df3b){super(_0x3ca556),this['resource']=_0x51df3b,this['set']('isInContext',!!_0x51df3b['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}getResourceIcon(_0x419991){if(_0x419991['isInContext'])return _0x48b061;switch(_0x419991['type']){case'document':return _0x2d99a5;case'web-resource':return _0x3de4d0;case'file':case'text':return _0xd6ab36;default:return _0x325a2b;}}highlightText(_0x24964f){if(!_0x24964f||''===_0x24964f['trim']())return void this['_titleView']['highlightText'](null);const _0x288bde=new RegExp(_0x3ff1f3(_0x24964f),'gi');this['_titleView']['highlightText'](_0x288bde);}updateResourceState(_0x217428){this['resource']['isInContext']=_0x217428,this['isInContext']=_0x217428,this['_updateIcon']();}_createTitleView(){const _0x47c568=new Yt();return _0x47c568['text']=this['resource']['label'],_0x47c568['extendTemplate']({'tag':'span','attributes':{'class':[Do]}}),_0x47c568;}_createIconView(){const _0x3f33d3=new $t();return _0x3f33d3['content']=this['getResourceIcon'](this['resource']),_0x3f33d3;}_setupTemplate(){const _0x4e198d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Lo,_0x4e198d['if']('isVisible','ck-hidden',_0x2f872b=>!_0x2f872b),_0x4e198d['if']('isInContext',Po)]},'children':[{'tag':'div','attributes':{'class':[Ho]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x4e198d['to']('execute')}});}_updateIcon(){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}};const Uo='ck-ai-chat-resources__list';var Vo=class extends Jt{['_source'];constructor(_0x5d1c76,_0x18b043){super(_0x5d1c76),this['_source']=_0x18b043,this['extendTemplate']({'attributes':{'class':[Uo]}});}setResources(_0x10a5ca,_0x64a29b){this['items']['clear']();let _0x5160b5=_0x10a5ca;if(this['_source']['useDefaultFiltering']&&_0x64a29b&&''!==_0x64a29b['trim']()){const _0x2c7b4e=new RegExp(_0x64a29b['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x5160b5=_0x10a5ca['filter'](_0x374f60=>_0x2c7b4e['test'](_0x374f60['label']));}for(const _0x5d00cb of _0x5160b5){const _0x53f64a=new Mo(this['locale'],_0x5d00cb);_0x53f64a['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x5d00cb);}),this['items']['add'](_0x53f64a);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x64a29b);}highlightText(_0x32a33d){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x180701=>{_0x180701['highlightText'](_0x32a33d);});}updateResourceState(_0x2db8e2,_0x4d169f){for(const _0x215080 of this['items']){const _0x55c853=_0x215080;_0x55c853['resource']['id']===_0x2db8e2&&_0x55c853['updateResourceState'](_0x4d169f);}}_handleResourceSelection(_0x58b117,_0x3281cf){this['fire']('addResourceToContext',{'source':_0x58b117,'resource':_0x3281cf});}},Bo=class extends Qt{['iconView'];resetButtonView;['_viewConfig'];constructor(_0x2625a5){const t=_0x2625a5['t'],_0x2b886d={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x4c7fdb,'label':Es(_0x2625a5,'AI_CHAT_SEARCH_RESOURCES')};super(_0x2625a5,_0x2b886d['creator']),this['label']=_0x2b886d['label'],this['_viewConfig']=_0x2b886d,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x2625a5,t),this['_setupEventListeners']();}reset(){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x8575e2){this['fire']('search',_0x8575e2);}getQuery(){return this['fieldView']['element']?.['value']||'';}_setupSearchIcon(){this['iconView']=new $t(),this['iconView']['content']=_0x4cf30b,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}_setupResetButton(_0x2de0d4,t){this['resetButtonView']=new Mt(_0x2de0d4),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x572ba4,'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',_0x246b1c=>!_0x246b1c),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);}},Go=class extends _0x56a514{['_searchView'];_searchSection;_searchInputVisibleFrom;_resourcesListView;_skeletonLoader;['_source'];['children'];_latestLoadResourcesUid=null;constructor(_0x28575b,_0xab31f4){super(_0x28575b),this['_source']=_0xab31f4['source'],this['_searchInputVisibleFrom']=_0xab31f4['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 _0x93f04d([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}_createSearchView(){return new Bo(this['locale']);}_createSearchSection(){const _0x28b80c=new _0x56a514(this['locale']);return _0x28b80c['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x1bab9c,_0x41dfbc)=>{this['loadResources'](_0x41dfbc),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x41dfbc);}),_0x28b80c;}_createResourcesListView(){const _0x35cc75=new Vo(this['locale'],this['_source']);return _0x35cc75['delegate']('addResourceToContext')['to'](this),_0x35cc75['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x35cc75;}_createSkeletonView(){const _0x40b810=new wr(this['locale'],Cr['aiChatResources']);return _0x40b810['bind']('isVisible')['to'](this,'isLoading'),_0x40b810;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x33f08b){const _0x313d70=kt();this['_latestLoadResourcesUid']=_0x313d70,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x33f08b,'uid':_0x313d70}),this['isLoading']=!0x0;}setResources(_0x15fe34,_0x497831){if(_0x497831&&_0x497831!==this['_latestLoadResourcesUid'])return;const _0x20c4d5=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x15fe34,_0x20c4d5),_0x15fe34['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}updateResourceState(_0x5e6a5c,_0x32e65d){this['_resourcesListView']['updateResourceState'](_0x5e6a5c,_0x32e65d);}};const Fo='ck-ai-chat-context-controls__source-balloon-panel',Ko='ck-button-icon\x20ck-button-back',Wo='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';var Yo=class{['_sourceResourceBalloons']=new Map();_bodyCollection;['_locale'];['_config'];constructor(_0xbd3462,_0x34a423,_0x1fbf40){this['_locale']=_0xbd3462,this['_bodyCollection']=_0x34a423,this['_config']=_0x1fbf40;}['showSourceResourcesBalloon']({source:_0x4bc3cd,withBackButton:_0x4c0998}){let _0x6730f3=this['_sourceResourceBalloons']['get'](_0x4bc3cd['id']);_0x6730f3||(_0x6730f3=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x4bc3cd['id'],_0x6730f3),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x6730f3)),this['_addSourceResourceContent']({'balloonPanel':_0x6730f3,'source':_0x4bc3cd,'withBackButton':_0x4c0998}),_0x6730f3['show']();const _0x501b15=this['_config']['getTargetElement']();_0x501b15&&_0x6730f3['pin']({'target':_0x501b15,'limiter':this['_config']['getLimiterElement']()});}populateSourceResourceBalloon(_0xdeb68,_0x57cc46,_0x5c6bd8){const _0x3ab5ec=this['_sourceResourceBalloons']['get'](_0xdeb68);if(!_0x3ab5ec)return;const _0x401fc9=this['_getResourcesViewFromBalloon'](_0x3ab5ec);_0x401fc9&&(_0x401fc9['setResources'](_0x57cc46,_0x5c6bd8),_0x401fc9['once']('change:isLoading',()=>{_0x3ab5ec['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x5aa0db){const _0xce73e8=this['_sourceResourceBalloons']['get'](_0x5aa0db);_0xce73e8&&requestAnimationFrame(()=>{_0xce73e8['hide'](),this['_sourceResourceBalloons']['delete'](_0x5aa0db),this['_config']['onBalloonClosed']();});}['closeAll'](){for(const _0x48f3aa of Array['from'](this['_sourceResourceBalloons']['keys']()))this['closeSourceResourceBalloon'](_0x48f3aa);}['isAnyResourceBalloonVisible'](){for(const _0x443f22 of this['_sourceResourceBalloons']['values']())if(_0x443f22['isVisible'])return!0x0;return!0x1;}updateResourceState(_0xb2b097,_0x222825,_0x3d3560){const _0x27014b=this['_sourceResourceBalloons']['get'](_0xb2b097);if(!_0x27014b||!_0x27014b['isVisible'])return;const _0x6886ee=this['_config']['getTargetElement']();if(!_0x6886ee)return;_0x27014b['pin']({'target':_0x6886ee,'limiter':this['_config']['getLimiterElement']()});const _0x56a129=this['_getResourcesViewFromBalloon'](_0x27014b);_0x56a129&&_0x56a129['updateResourceState'](_0x222825,_0x3d3560);}destroy(){for(const _0x5bbb53 of this['_sourceResourceBalloons']['values']())_0x5bbb53['destroy']();this['_sourceResourceBalloons']['clear']();}_createSourceResourceBalloonPanel(){const _0x4b4c85=new xt(this['_locale']);return _0x4b4c85['extendTemplate']({'attributes':{'class':Fo}}),this['_bodyCollection']['add'](_0x4b4c85),_0x4b4c85;}_addSourceResourceContent({balloonPanel:_0x551401,source:_0x382bc3,withBackButton:_0x9ffd1f}){_0x551401['content']['clear']();const _0x42e447=this['_createBalloonHeader']({'balloonPanel':_0x551401,'source':_0x382bc3,'withBackButton':_0x9ffd1f});_0x551401['content']['add'](_0x42e447);const _0x2f69de=this['_createBalloonResourcesView'](_0x382bc3);_0x551401['content']['add'](_0x2f69de);}_createBalloonHeader({balloonPanel:_0x746446,source:_0x4d4f7f,withBackButton:_0x11d417}){const _0x875737=new Kt(this['_locale'],{'label':_0x4d4f7f['label'],'class':Wo});return _0x11d417&&_0x875737['children']['add'](this['_createBackButton'](_0x746446),0x0),_0x875737;}_createBackButton(_0xa23c7b){const _0x2f30b8=new Mt(this['_locale']);return _0x2f30b8['set']({'icon':_0xd78e92,'tooltip':Es(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Ko}),_0x2f30b8['on']('execute',()=>{_0xa23c7b['hide'](),this['_config']['onBackToContext']();}),_0x2f30b8;}_createBalloonResourcesView(_0x48572b){const _0x2d201c=new Go(this['_locale'],{'source':_0x48572b,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x2d201c['on']('loadSourceResources',(_0x3de4e8,_0x3d844e)=>{this['_config']['onLoadSourceResources'](_0x3d844e);}),_0x2d201c['on']('addResourceToContext',(_0x531316,_0x6fab8)=>{this['_config']['onResourceSelected'](_0x6fab8['source'],_0x6fab8['resource']),this['closeSourceResourceBalloon'](_0x48572b['id']);}),_0x2d201c;}_getResourcesViewFromBalloon(_0x7b3f6){const _0x4c898d=_0x7b3f6['content']['get'](0x1);return _0x4c898d instanceof Go?_0x4c898d:null;}_setupSingleResourceBalloonClickOutsideHandler(_0x1fcde9){_0x44d1a9({'emitter':_0x1fcde9,'contextElements':[_0x1fcde9['element']],'callback':()=>{_0x1fcde9['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x1fcde9['isVisible']});}};const $o=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],qo='ck-ai-chat-context-controls',Qo='ck-ai-chat-context-controls__pending-contexts',Xo='ck-ai-chat-context-controls__add-context-balloon-panel',zo='ck-ai-chat-context-controls__add-context-button',jo='ck-ai-chat-context-controls__url-balloon-panel',Jo='ck-ai-chat-context-controls__balloon-button',Zo='ck-ai-chat-context-controls__balloon-button-source',ta='ck-ai-chat-controls-button',ea='ck-ai-chat-context-chips-wrapper-balloon',ia='ck-ai-chat-controls_context_show-more-button',sa='ck-ai-chat-context-controls__show-more-balloon-panel',na='ck-ai-chat',ra=[xt['defaultPositions']['northArrowSouthWest'],xt['defaultPositions']['northArrowSouth'],xt['defaultPositions']['northArrowSouthEast'],xt['defaultPositions']['southArrowNorthWest'],xt['defaultPositions']['southArrowNorth'],xt['defaultPositions']['southArrowNorthEast']];var oa=class extends _0x56a514{addContextButtonView;_currentContextsChips=this['createCollection']();_conversationContextsChips=this['createCollection']();['_overflowManager'];_addContextBalloonPanelView;['_urlBalloonPanelView'];_urlInputView;['_resourcesBalloonView'];_addContextBalloonConfig;_hasExactlyOneSource=!0x1;bodyCollection;constructor(_0x10754b,_0xb726cc){super(_0x10754b),this['bodyCollection']=_0xb726cc['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x10754b),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x10754b),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x10754b),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x10754b,_0xb726cc);const _0x3a86bd={'cssClasses':{'showMoreButton':ia+'\x20'+Dn,'showMoreBalloon':sa,'overflowContainer':ea,'controlsButton':ta}};this['_overflowManager']=new Qr(_0x10754b,this['_currentContextsChips'],_0x3a86bd,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(_0x5592fd,_0x2254af){const _0x33dd18=this['_createContextButton'](_0x5592fd,'current',!0x0,_0x2254af);this['_addContextToCollection'](_0x33dd18,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}removeContextItem(_0x478e6e){this['_removeContextFromCollection'](_0x478e6e,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x478e6e,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}setContextItemLoading(_0x56a61b,_0x2633de){let _0x5ded39=this['_currentContextsChips']['find'](_0x47f5f7=>_0x47f5f7['id']===_0x56a61b);_0x5ded39||(_0x5ded39=this['_overflowManager']['overflowChips']['find'](_0x447b55=>_0x447b55['id']===_0x56a61b)),_0x5ded39&&(_0x5ded39['isLoading']=_0x2633de);}setConversationContext(_0x1d4eef){this['_conversationContextsChips']['clear']();for(const _0x5b7546 of _0x1d4eef){const _0x427014=this['_createContextButton'](_0x5b7546,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x427014,this['_conversationContextsChips']);}}clearCurrentContextItems(){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}clearConversationContextItems(){this['_conversationContextsChips']['clear']();}updateResourceState(_0x1c02d7,_0xa01da7,_0x1d2abf){this['_resourcesBalloonView']['updateResourceState'](_0x1c02d7,_0xa01da7,_0x1d2abf);}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:_0x38d436,withBackButton:_0x4fb4bc}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x38d436,'withBackButton':_0x4fb4bc}),this['addContextButtonView']['isOn']=!0x0;}populateSourceResourceBalloon(_0x5a2872,_0x1fe94a,_0x1ed151,_0x1b4b3a){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x5a2872,_0x1ed151,_0x1b4b3a);}['closeSourceResourceBalloon'](_0x5d52ef){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x5d52ef),this['addContextButtonView']['isOn']=!0x1;}setAddContextOptions(_0x5c34a0){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x5c34a0),this['_setAddContextButtonEnabled'](_0x5c34a0);}_setAddContextButtonEnabled(_0x55bb4b){const _0x213814=!_0x55bb4b['document']['isHidden']&&_0x55bb4b['document']['enabled'],_0x34dcfb=_0x55bb4b['urls']['enabled'],_0x56a8e2=_0x55bb4b['files']['enabled'],_0x26c596=_0x55bb4b['sources']['length']>0x0,_0x2f0482=_0x55bb4b['customItems']&&_0x55bb4b['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x213814||_0x34dcfb||_0x56a8e2||_0x26c596||_0x2f0482;}_setupTemplate(){this['setTemplate']({'tag':'div','attributes':{'class':[qo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Qo},'children':this['_currentContextsChips']}]});}_bindEventHandlers(){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}_createAddContextButtonView(_0x5d2609){const _0x185b14=new Mt(_0x5d2609);return _0x185b14['set']({'label':Es(_0x5d2609,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':ta+'\x20'+zo+'\x20'+Dn,'icon':_0x3ff1a2,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x185b14;}_createAddContextBalloonPanelView(_0x55b86f){return this['_createBaseBalloonPanel'](_0x55b86f,Xo);}_createUrlBalloonPanelView(_0x5ddbd7){const _0x3d81b8=this['_createBaseBalloonPanel'](_0x5ddbd7,jo);return this['_addUrlContent'](_0x3d81b8,_0x5ddbd7),_0x3d81b8;}_createResourcesBalloonView(_0x5d640b,_0x2118c2){const _0x59d097={'searchInputVisibleFrom':_0x2118c2['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':ra});},'onResourceSelected':(_0x23a13e,_0xbe4e23)=>{this['fire']('addResourceToContext',{'source':_0x23a13e,'resource':_0xbe4e23});},'onLoadSourceResources':_0x561e09=>{this['fire']('loadSourceResources',_0x561e09);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Yo(_0x5d640b,_0x2118c2['bodyCollection'],_0x59d097);}_getLimiterElement(){return this['element']?.['closest']('.'+na)||document['body'];}_createBaseBalloonPanel(_0x1e052f,_0x46693f){const _0xf560d0=new xt(_0x1e052f);return _0xf560d0['extendTemplate']({'attributes':{'class':_0x46693f}}),this['bodyCollection']['add'](_0xf560d0),_0xf560d0;}_setBalloonPanelContent(_0x2fa49b,_0x1fdee7,_0x47fd72){if(_0x2fa49b['content']['clear'](),!_0x47fd72['document']['isHidden']&&_0x47fd72['document']['enabled']){const _0x217c26=this['_createBalloonButton'](_0x1fdee7,{'label':Es(_0x1fdee7,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x2d99a5});_0x217c26['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x2fa49b['content']['add'](_0x217c26);}if(_0x47fd72['urls']['enabled']){const _0x194a9f=this['_createBalloonButton'](_0x1fdee7,{'label':Es(_0x1fdee7,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x3de4d0});_0x194a9f['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':ra}),this['_urlInputView']['focus']();}),_0x2fa49b['content']['add'](_0x194a9f);}if(_0x47fd72['files']['enabled']){const _0x152ca6=new Gt(_0x1fdee7);_0x152ca6['set']({'label':Es(_0x1fdee7,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x15107d,'withText':!0x0,'tooltip':!0x0,'class':Jo,'allowMultipleFiles':!0x0}),_0x152ca6['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x152ca6['on']('done',(_0x511b5d,_0xa85d6b)=>{this['fire']('addFileToContext',_0xa85d6b);}),_0x152ca6['tooltip']=!0x0,_0x2fa49b['content']['add'](_0x152ca6);}for(const _0x3b0d13 of _0x47fd72['sources']){const _0x42ddfe=this['_createBalloonButton'](_0x1fdee7,{'label':_0x3b0d13['label'],'icon':_0x3b0d13['icon']||_0x325a2b,'type':'source'});_0x2fa49b['content']['add'](_0x42ddfe),_0x42ddfe['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x3b0d13,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x466efa of _0x47fd72['customItems']||[]){const _0x5d0b2c=this['_createBalloonButton'](_0x1fdee7,{'label':_0x466efa['label'],'icon':_0x466efa['icon']||_0x325a2b,'type':'customItem'});_0x2fa49b['content']['add'](_0x5d0b2c),_0x5d0b2c['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x466efa);});}this['_hasExactlyOneSource']=0x1===_0x2fa49b['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}_addUrlContent(_0x1ae121,_0x31aea5){this['_urlInputView']=new xo(_0x31aea5),this['_urlInputView']['on']('submitUrl',(_0x1e2bd1,_0x3cf1e3)=>{this['_handleUrlSubmit'](_0x3cf1e3);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':ra}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':ra});}),_0x1ae121['content']['add'](this['_urlInputView']);}_createBalloonButton(_0x1cbcaa,_0x3e35f2){const _0x2d8c4b='source'===_0x3e35f2['type']?new aa(_0x1cbcaa):new Mt(_0x1cbcaa);return _0x2d8c4b['set']({'label':_0x3e35f2['label'],'icon':_0x3e35f2['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Jo}),_0x2d8c4b;}_setupAllBalloonClickOutsideHandlers(){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}_setupUrlBalloonClickOutsideHandler(){_0x44d1a9({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}_toggleAddContextBalloon(_0x2b89d1){const _0x2074c3=this['_addContextBalloonConfig'];_0x2074c3['buttonView']['isOn']=_0x2b89d1,_0x2b89d1?_0x2074c3['balloonView']['show']():_0x2074c3['balloonView']['hide']();}_setupAddContextBalloonClickOutsideHandler(){const {balloonView:_0x1e2207,buttonView:_0x165b84,hideMethod:_0x23e909}=this['_addContextBalloonConfig'];_0x44d1a9({'emitter':_0x1e2207,'contextElements':[_0x1e2207['element'],_0x165b84['element']],'callback':()=>{_0x23e909();},'activator':()=>_0x165b84['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}_createContextButton(_0x4728ae,_0x4c0742,_0x7548c=!0x1,_0x407cc2=!0x1){const _0x4d0528='conversation'===_0x4c0742||!0x0===_0x4728ae['isReadOnly'],_0x283459=new Wr(this['locale'],_0x4728ae,_0x4d0528,_0x7548c,_0x407cc2);return _0x4d0528||_0x283459['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x283459['id']);}),_0x283459;}_addContextToCollection(_0x5a97d8,_0x256f24){_0x256f24['add'](_0x5a97d8,0x0);}_removeContextFromCollection(_0x3a3e29,_0x1a4ba3){const _0x5c3447=_0x1a4ba3['find'](_0x34645d=>_0x34645d['id']===_0x3a3e29);_0x5c3447&&_0x1a4ba3['remove'](_0x5c3447);}_handleAddContextButtonClick(){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':ra}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}_handleUrlSubmit(_0x15c84e){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x15c84e);}},aa=class extends Mt{['arrowView'];constructor(_0x3e4b40){super(_0x3e4b40),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Zo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}_createArrowView(){const _0x2631f9=new $t();return _0x2631f9['content']=_0x1193f0,_0x2631f9['extendTemplate']({'attributes':{'class':Zo+'__arrow'}}),_0x2631f9;}},ha=class extends _0x56a514{_cancelButtonView;['_loaderView'];constructor(_0xd3e93e){super(_0xd3e93e),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 _0x520df6=new Mt(this['locale']);return _0x520df6['set']({'label':Es(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':Pn+'\x20ck-ai-button-stop-generating','icon':st}),_0x520df6['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x520df6;}_createLoaderView(){const _0x23a2c3=new _0x56a514(this['locale']);return _0x23a2c3['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':Es(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x23a2c3;}},ca=class extends _0x56a514{_contextPanelView;_promptInputView;['_dropZoneView'];_promptCapabilitiesView;['_loaderView'];['_modelUnavailableMessageView'];_shouldRestorePromptInputFocus;['_filesEnabled'];constructor(_0xaca5c9,_0xb48cc1){super(_0xaca5c9),this['_filesEnabled']=_0xb48cc1['filesEnabled'],this['_contextPanelView']=this['_createContextPanelView'](_0xaca5c9,{'bodyCollection':_0xb48cc1['bodyCollection'],'searchInputVisibleFrom':_0xb48cc1['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0xaca5c9),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0xaca5c9),this['_loaderView']=this['_createLoaderView'](_0xaca5c9),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0xaca5c9),this['_dropZoneView']=new Ao(_0xaca5c9),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage','promptInputPaste')['to'](this),this['_dropZoneView']['delegate']('promptInputPaste')['to'](this),this['_dropZoneView']['on']('dragEnter',()=>this['_contextPanelView']['hideAllBalloons']()),this['_dropZoneView']['bind']('isEnabled')['to'](this,'isLoading',_0x3ce71f=>!_0x3ce71f),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'](...$o)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x199796=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x199796['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x199796['if']('isLoading','ck-hidden',_0x4b7387=>_0x4b7387||!this['isModelAvailable']),_0x199796['if']('isModelAvailable','ck-hidden',_0x5d3b6d=>!_0x5d3b6d||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x199796['if']('isLoading','ck-hidden',_0x296412=>!_0x296412)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x199796['if']('isModelAvailable','ck-hidden',_0x3a82d7=>_0x3a82d7)]},'children':[this['_modelUnavailableMessageView']]},this['_dropZoneView']]}),_0x44d1a9({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['render'](){super['render'](),this['_filesEnabled']&&this['_dropZoneView']['attach'](this['element']);}_createContextPanelView(_0x38e256,_0x5482f0){return new oa(_0x38e256,_0x5482f0);}_createPromptInputView(_0xaaa41a){return new go(_0xaaa41a,this['_contextPanelView']['addContextButtonView']);}_createPromptCapabilitiesView(_0x3bffcf){return new ko(_0x3bffcf);}_createLoaderView(_0xaefc71){return new ha(_0xaefc71);}_createModelUnavailableMessageView(_0x6a672e){const _0x5f3d20=new la(_0x6a672e);return _0x5f3d20['delegate']('startConversation')['to'](this),_0x5f3d20;}_handlePromptInputFocus(_0x3d1e1c,_0x33fb95,_0x374de0){_0x374de0?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}addContextItem(_0x2cb9c2,_0x552e77){this['_contextPanelView']['addContextItem'](_0x2cb9c2,_0x552e77);}removeContextItem(_0x1e03a8){this['_contextPanelView']['removeContextItem'](_0x1e03a8);}setContextItemLoading(_0x586885,_0x497ce3){this['_contextPanelView']['setContextItemLoading'](_0x586885,_0x497ce3);}setIsUploadInProgress(_0x5cb961){this['_promptInputView']['setIsUploadInProgress'](_0x5cb961);}setConversationContext(_0x5d2e1a){this['_contextPanelView']['setConversationContext'](_0x5d2e1a);}clearPendingContextUI(){this['_contextPanelView']['clearCurrentContextItems']();}clearConversationContextUI(){this['_contextPanelView']['clearConversationContextItems']();}updateResourceState(_0x50f7c8,_0x2f32e5,_0x5786c4){this['_contextPanelView']['updateResourceState'](_0x50f7c8,_0x2f32e5,_0x5786c4);}setWebSearch(_0x423b56){this['_promptCapabilitiesView']['setWebSearch'](_0x423b56);}setReasoning(_0x448586){this['_promptCapabilitiesView']['setReasoning'](_0x448586);}resetMessageInput(){this['_promptInputView']['reset']();}setAddContextOptions(_0x2ad29d){this['_contextPanelView']['setAddContextOptions'](_0x2ad29d);}setInputPlaceholder(_0x6c66cd){this['_promptInputView']['setPlaceholderText'](_0x6c66cd);}setModelList(_0x542dc8,_0x27743a){this['_promptCapabilitiesView']['setModelList'](_0x542dc8,_0x27743a);}setModel(_0x5649fb){_0x5649fb?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x5649fb)):this['isModelAvailable']=!0x1;}enableModelSelector(){this['_promptCapabilitiesView']['enableModelSelector']();}disableModelSelector(_0x2069cf){this['_promptCapabilitiesView']['disableModelSelector'](_0x2069cf);}populateSourceResourceBalloon(_0x379d1b,_0x11f9f9,_0x3a86fd,_0x673b55){this['_contextPanelView']['populateSourceResourceBalloon'](_0x379d1b,_0x11f9f9,_0x3a86fd,_0x673b55);}['closeSourceResourceBalloon'](_0x42e8ee){this['_contextPanelView']['closeSourceResourceBalloon'](_0x42e8ee);}focusPromptInput(_0x21596d=!0x1){this['_promptInputView']['focus'](_0x21596d);}setPromptInputValue(_0x486a88){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x486a88;}},la=class extends _0x56a514{constructor(_0x17d719){super(_0x17d719);const _0x5fb387=new Mt(_0x17d719);_0x5fb387['set']({'label':Es(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x5fb387['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':Es(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x5fb387]}]});}},ua=class extends Kt{resizeButton;constructor(_0x4d5b5d,_0x8db98f){super(_0x4d5b5d,{'label':_0x8db98f['label'],'class':'ck-ai-header\x20'+_0x8db98f['class'],'icon':_0x8db98f['icon']}),this['set']('isMaximized',!0x1),_0x8db98f['content']&&this['children']['add'](_0x8db98f['content']),_0x8db98f['showResizeButton']&&(this['resizeButton']=Hn(_0x4d5b5d,this),this['children']['add'](this['resizeButton']));}},da=class extends _0x56a514{constructor(_0x299b9f){super(_0x299b9f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':Es(_0x299b9f,'AI_DISCLAIMER_TEXT')}]}]});}};function _a(_0x2b252f,_0x23ee97){const _0x3b7d18=new Mt(_0x2b252f);return _0x3b7d18['set']({'label':Es(_0x2b252f,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x3da945,'class':'ck-ai-chat__start-conversation\x20'+Pn}),_0x3b7d18['on']('execute',()=>{_0x23ee97['fire']('startConversation');}),_0x3b7d18;}var ga=class extends _0x56a514{chatHeader;chatFeed;chatControls;chatDisclaimer;_bodyCollection;constructor(_0x2aa254,_0x52eaae){super(_0x2aa254),this['_bodyCollection']=Mn(_0x2aa254);const _0x2dee34=_a(_0x2aa254,this);this['chatHeader']=new ua(_0x2aa254,{'label':Es(_0x2aa254,'AI_CHAT_HEADING'),'icon':_0x19cce7,'class':'ck-ai-header_chat','content':_0x2dee34,'showResizeButton':_0x52eaae['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new co(_0x2aa254,this['_bodyCollection']),this['chatFeed']['delegate'](...sr)['to'](this),this['chatControls']=new ca(_0x2aa254,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x52eaae['contextResourcesSearchInputVisibleFrom'],'filesEnabled':_0x52eaae['filesEnabled']}),this['chatControls']['delegate'](...sr)['to'](this),this['chatDisclaimer']=new da(_0x2aa254),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x2aa254['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}populateSourceResourceBalloon(_0x5d36d3,_0x107087,_0x545297,_0x47345c){this['chatControls']['populateSourceResourceBalloon'](_0x5d36d3,_0x107087,_0x545297,_0x47345c);}['closeSourceResourceBalloon'](_0x201129){this['chatControls']['closeSourceResourceBalloon'](_0x201129);}destroy(){this['_bodyCollection']['detachFromDom'](),super['destroy']();}},Aa=class extends _0x898608{static get requires(){return[gs];}['_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(_0x5c20a8){super(_0x5c20a8);const _0x5e25ba=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['set']('isChatStreaming',!0x1),this['_promiseQueue']=new Sr(),this['_view']=new ga(this['context']['locale'],{'showResizeButton':_0x5e25ba['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'](_0x5e25ba),this['_view']['delegate'](...sr)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x4efcde,{showDiff:_0x26914f})=>{this['showDiff']=_0x26914f;}),this['disableControls'](),_0x5e25ba['view']['addTab']({'id':'chat','buttonLabel':Es(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x19cce7,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x5e25ba['view'],'isMaximized',_0x49ee9b=>_0x49ee9b),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isChatStreaming',_0xc48b5e=>_0xc48b5e),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}destroy(){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}createConversation({availableModels:_0x443767}){const _0x323e97=this['context']['config']['get']('ai.chat.welcomeMessage')??Es(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x443767,!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x323e97}),this['fire']('conversationCreated');}async addFeedItemStaticMessage({id:_0xd4e613,staticMessage:_0x3fc576}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xd4e613,'initialContent':'<p>'+_0x3fc576+'</p>'});});}async addFeedItemUserMessage(_0x381290){const _0x7914f1=_0x381290['attributes']?.['displayedPrompt']||_0x381290['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x381290['contextItems']['values']()),'initialContent':'<p>'+_0x7914f1+'</p>','id':_0x381290['id']});});}async addFeedItemError({errorMessage:_0x4987e1,id:_0x389ea5}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x4987e1+'</p>','id':_0x389ea5});});}async addFeedItemAIReply(_0xbc32ea){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xbc32ea['interactionId']+':'+_0xbc32ea['id']}),this['clearLoadingMessage']();});}async addFeedItemAISuggestion(_0x333434){const _0x46658f=bs(this['context']),_0x5c911e=_0x46658f['map'](_0x57535c=>_0x57535c['config']['get']('ai.availableReplyActions')||[...Or]);let _0xb531df=_0x5c911e['reduce']((_0x1c63e5,_0x5a9b7b)=>_0x1c63e5['filter'](_0x5c4a7a=>_0x5a9b7b['includes'](_0x5c4a7a)),_0x5c911e[0x0]||[...Or]);const _0x4bedcb=_0x46658f['every'](_0x192044=>_0x192044['plugins']['has']('TrackChanges')),_0x15d2ff=_0x46658f['map'](_0x4a1b82=>_0x4a1b82['commands']['get']('trackChanges'));return _0x4bedcb?this['_isTrackChangesCommandValueBound']||(this['_isTrackChangesCommandValueBound']=!0x0,this['_view']['chatFeed']['bind']('isTrackChangesOn')['toMany'](_0x15d2ff,'value',(..._0x4b39f5)=>_0x4b39f5['some'](_0x5ac46e=>_0x5ac46e))):_0xb531df=_0xb531df['filter'](_0x126faa=>'insertSuggestion'!=_0x126faa),this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x333434['interactionId']+':'+_0x333434['id'],'areActionsDisabled':_0x333434['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0xb531df}),this['clearLoadingMessage']();});}async addFeedInteractionHeader(_0x351335,_0x1127c0){return this['_promiseQueue']['enqueue'](async()=>{const _0x5d6cdf=this['_view']['chatFeed']['children']['last'];if(_0x5d6cdf instanceof so)return this['_view']['chatFeed']['children']['remove'](_0x5d6cdf),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x351335['id'],'capabilities':{'isWebSearchEnabled':_0x5d6cdf['capabilities']['isWebSearchEnabled']||_0x1127c0['isWebSearchEnabled'],'isReasoningEnabled':_0x5d6cdf['capabilities']['isReasoningEnabled']||_0x1127c0['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x351335['id'],'capabilities':_0x1127c0});});}async addFeedItemCustomElement(_0x134d49,_0x2bb6b1){let _0x5b4456;return await this['_promiseQueue']['enqueue'](async()=>{_0x5b4456=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x134d49,'id':_0x2bb6b1});}),_0x5b4456;}removeFeedItem(_0x6f9009){this['_view']['chatFeed']['removeItem'](_0x6f9009);}hasFeedItem(_0x2d495a){return this['_view']['chatFeed']['hasItem'](_0x2d495a);}updateFeedInteractionHeader(_0x2342dc){const _0x483c95=this['_view']['chatFeed']['children']['find'](_0x54d65c=>_0x54d65c['options']['id']==_0x2342dc['id']&&_0x54d65c instanceof so);_0x483c95&&_0x483c95['set']('isVisible',_0x2342dc['isVisible']);}async updateFeedItemAIReplyContent(_0x315922){const _0x2391cd=_0x315922['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x181541=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x315922,'abortSignal':_0x181541,'renderingStrategy':_0x2391cd}),_0x315922['isDone']&&this['markFeedItemAsDone'](_0x315922['id']);});}updateFeedItemAIReplySources(_0x422003,_0x396026){this['_view']['chatFeed']['updateWebSources'](_0x422003,_0x396026);}async updateFeedItemAIReplySuggestionContent(_0x42b75d){return this['_promiseQueue']['enqueue'](async _0x210570=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x42b75d,'abortSignal':_0x210570}),_0x42b75d['isDone']&&this['markFeedItemAsDone'](_0x42b75d['id']);});}updateFeedItemAIReplySuggestionPartState(_0x4a6cd8){this['_view']['chatFeed']['updateSuggestionPartState'](_0x4a6cd8);}setSuggestionGating(_0x6a8d97,_0x25595c){this['_view']['chatFeed']['updateSuggestionGating'](_0x6a8d97,_0x25595c);}setFeedItemAIReplySuggestionPartActive(_0x14a8c4){this['_view']['chatFeed']['setSuggestionPartActive'](_0x14a8c4);}markFeedItemAsDone(_0x16efc9){this['_view']['chatFeed']['markItemAsDone'](_0x16efc9);}removeFeedInteraction(_0x39118d){this['_view']['chatFeed']['getItemIds']()['filter'](_0x58711f=>_0x58711f['startsWith'](_0x39118d))['forEach'](_0x47a69c=>this['_view']['chatFeed']['removeItem'](_0x47a69c));}startInteraction(){const _0x12b81a=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x12b81a),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['isChatStreaming']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}stopInteraction(_0x4c27ed){this['_promiseQueue']['abort'](),_0x4c27ed&&this['_view']['chatFeed']['getItemIds']()['filter'](_0x40212c=>_0x40212c['startsWith'](_0x4c27ed['id']))['forEach'](_0x35bc64=>this['markFeedItemAsDone'](_0x35bc64)),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(_0x4a5349,_0x45b2fc){this['_view']['chatControls']['addContextItem'](_0x4a5349,_0x45b2fc);}removeContextItem(_0x2bb9b2){this['_view']['chatControls']['removeContextItem'](_0x2bb9b2);}setContextItemLoading(_0x3a291b,_0x41b5e8){this['_view']['chatControls']['setContextItemLoading'](_0x3a291b,_0x41b5e8);}setIsUploadInProgress(_0x46dd43){this['_view']['chatControls']['setIsUploadInProgress'](_0x46dd43);}setConversationContext(_0xd0ce42){this['_view']['chatControls']['setConversationContext'](_0xd0ce42);}clearPendingContextUI(){this['_view']['chatControls']['clearPendingContextUI']();}clearConversationContextUI(){this['_view']['chatControls']['clearConversationContextUI']();}updateResourceState(_0x17f8ad,_0x3bebf8,_0x487038){this['_view']['chatControls']['updateResourceState'](_0x17f8ad,_0x3bebf8,_0x487038);}resetMessageInput(){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}setAddContextOptions(_0x3427c9){this['_view']['chatControls']['setAddContextOptions'](_0x3427c9);}updateCapabilities(_0x2904a3){this['_view']['chatControls']['setWebSearch'](_0x2904a3['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x2904a3['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x2904a3));}setSelectedModel(_0x3404ba,_0x460203){this['_view']['chatControls']['setModel'](_0x3404ba),_0x460203&&this['_view']['chatControls']['disableModelSelector'](!0x1);}setFeedItemRenderingStrategy(_0x21f33a){this['feedItemRenderingStrategy']=_0x21f33a;}toggleLoadingSkeleton(_0x1a9f36){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x1a9f36);}resetConversationTitle(){this['setConversationTitle'](Es(this['context']['locale'],'AI_CHAT_HEADING'));}emptyConversationTitle(){this['setConversationTitle']('');}setConversationTitle(_0x4608a6,_0x28d8fb=!0x1){if(clearInterval(this['_titleAnimationInterval']),_0x28d8fb&&!Et()&&_0x4608a6['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x4608a6);this['_view']['chatHeader']['label']=_0x4608a6;}setLoadingMessage(_0x40b3d4){this['_view']['chatFeed']['setLoadingMessage'](_0x40b3d4);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}_animateConversationTitle(_0x18af93){let _0x2e977b=0x0;this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x18af93[_0x2e977b],_0x2e977b++,_0x2e977b===_0x18af93['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x3e7664){return _0x3e7664['isWebSearchEnabled']&&_0x3e7664['isReasoningEnabled']?Es(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x3e7664['isWebSearchEnabled']?Es(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x3e7664['isReasoningEnabled']?Es(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):Es(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}_getInputPlaceholder(_0x5ee36d){return _0x5ee36d?_0x5ee36d['isWebSearchEnabled']&&_0x5ee36d['isReasoningEnabled']?Es(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x5ee36d['isWebSearchEnabled']?Es(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x5ee36d['isReasoningEnabled']?Es(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):Es(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):Es(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}populateSourceResourceBalloon(_0x2f2f84,_0x48cba4,_0x13d885,_0x3e9dc7){this['_view']['populateSourceResourceBalloon'](_0x2f2f84,_0x48cba4,_0x13d885,_0x3e9dc7);}['closeSourceResourceBalloon'](_0x489d06){this['_view']['closeSourceResourceBalloon'](_0x489d06);}setPromptInputValue(_0x3f2f99){this['_view']['chatControls']['setPromptInputValue'](_0x3f2f99);}focusPromptInput(_0x3b6456=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x3b6456);}scrollFeedToSuggestion(_0x587c48,_0x7c5c0b){this['_view']['chatFeed']['scrollToSuggestion'](_0x587c48,_0x7c5c0b);}startAutoScroll(_0x2316e7={}){this['_view']['chatFeed']['startAutoScroll'](_0x2316e7);}stopAutoScroll(){this['_view']['chatFeed']['stopAutoScroll']();}disableControls(){this['_view']['chatControls']['isDisabled']=!0x0;}enableControls(){this['_view']['chatControls']['isDisabled']=!0x1;}toggleConversationLoading(_0x34e03a){_0x34e03a?(this['isBusy']=_0x34e03a,this['disableControls']()):(this['enableControls'](),this['resetChatBusyStateToIdle']());}},Ia=class extends Jt{sections;constructor(_0x1dabf2,_0xdc5473){super(_0x1dabf2),this['sections']=_0xdc5473,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}filter(_0x57138c){let _0x1249b6=0x0,_0x44e55b=0x0;for(const _0x31ded0 of this['sections']){const {resultsCount:_0x4d1153,totalItemsCount:_0x513bb3}=_0x31ded0['filter'](_0x57138c);_0x1249b6+=_0x4d1153,_0x44e55b+=_0x513bb3;}return{'resultsCount':_0x1249b6,'totalItemsCount':_0x44e55b};}},pa=class extends jt{title;itemsViews;_itemsListView;constructor(_0x19235f,{title:_0x3b7a5c,items:_0x3d8d64}){super(_0x19235f);const _0x5ad1a8=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x3b7a5c,this['itemsViews']=_0x3d8d64;const _0x1ac70d=new _0x56a514(_0x19235f);_0x1ac70d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Jt(_0x19235f),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x5ad1a8['if']('isVisible','ck-hidden',_0x2fc25d=>!_0x2fc25d)]},'children':[_0x1ac70d,this['_itemsListView']]});}filter(_0x412147){const _0x21ea6b=this['itemsViews']['length'];let _0x1444f0=0x0;for(const _0x4b063c of this['itemsViews'])_0x412147?(_0x4b063c['isVisible']=!!_0x4b063c['isMatching'](_0x412147),_0x4b063c['highlightText'](_0x412147)):(_0x4b063c['isVisible']=!0x0,_0x4b063c['highlightText'](null)),_0x4b063c['isVisible']&&_0x1444f0++;return this['isVisible']=_0x1444f0>0x0,{'resultsCount':_0x1444f0,'totalItemsCount':_0x21ea6b};}getItem(_0x54343f){return this['itemsViews']['find'](_0x54cfca=>_0x54cfca['id']===_0x54343f);}removeItem(_0x3b5424){const _0x299cdc=this['itemsViews']['indexOf'](_0x3b5424);-0x1!==_0x299cdc&&(this['itemsViews']['splice'](_0x299cdc,0x1),this['_itemsListView']['items']['remove'](_0x3b5424));}};const Ea=/* #__PURE__ -- @preserve */
34
+ _0x5a953b(jt);var ma=class AIChatHistoryListItemView extends Ea{['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(_0x217a9d,_0x5cc329){super(_0x217a9d);const _0x2f9384=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x5cc329['pinned']),this['set']('loadingState',null),this['set']('title',_0x5cc329['title']),this['id']=_0x5cc329['id'];const {createdAt:_0x21fbe2,active:_0x101085=!0x1}=_0x5cc329;this['_titleView']=new Yt(),this['_titleView']['bind']('text')['to'](this,'title'),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x9c07a2=this['_createCheckView'](),_0x12f43a=this['_createPinButtonView'](_0x217a9d),_0x268949=this['_createMenuDropdownView'](),_0x26c7a1=this['_createEditInputView'](_0x217a9d),_0x4c5161=this['_createAcceptEditButtonView'](_0x217a9d,_0x26c7a1),_0x22ae5f=this['_createCancelEditButtonView'](_0x217a9d);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x12f43a),this['actions']['add'](_0x268949),this['on']('change:isEdit',(_0x103800,_0x5d61ea,_0x212448)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x212448?(this['actions']['add'](_0x4c5161),this['actions']['add'](_0x22ae5f),this['mainContent']['add'](_0x26c7a1),_0x26c7a1['element']['value']=this['title']||'',_0x26c7a1['element']['focus']()):(this['actions']['add'](_0x12f43a),this['actions']['add'](_0x268949),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x101085?'ck-ai-chat-history__item--active':'',_0x2f9384['if']('isVisible','ck-hidden',_0xffa49=>!_0xffa49),_0x2f9384['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',_0x2f9384['if']('loadingState','ck-hidden',_0x1bdb29=>!!_0x1bdb29)]},'children':_0x101085?[_0x9c07a2]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x2f9384['if']('loadingState','ck-hidden',_0xcb402d=>!_0xcb402d)]},'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',_0x2f9384['if']('loadingState','ck-hidden',_0x238546=>!!_0x238546)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x2f9384['if']('loadingState','ck-hidden',_0x1b9906=>!_0x1b9906)]},'children':[{'text':_0x2f9384['to']('loadingState',_0x449388=>_0x449388?Es(this['locale'],AIChatHistoryListItemView['LOADING_LABELS'][_0x449388]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x21fbe2]}]},{'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(_0x428adc){this['set']('title',_0x428adc);}updateLoadingState(_0x42f0aa,_0x46c046){this['set']('loadingState',_0x46c046?_0x42f0aa:null);}_createCheckView(){const _0x20bcba=new $t();return _0x20bcba['set']({'content':_0x48b061}),_0x20bcba;}_createPinButtonView(_0x16b5fa){const _0x45433c=new Mt(_0x16b5fa);return _0x45433c['set']({'label':Es(_0x16b5fa,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x5b153c,'withText':!0x1,'tooltip':!0x0}),_0x45433c['bind']('isOn')['to'](this,'pinned'),_0x45433c['on']('execute',()=>{const _0x67d8a8=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x67d8a8});}),_0x45433c;}_createMenuDropdownView(){const _0x7cc662=_0x48403c(this['locale']),_0x1b4627=_0x7cc662['panelView']['children'];_0x7cc662['buttonView']['set']({'label':Es(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':rt}),_0x7cc662['panelPosition']='sw';const _0x3b59fb=new Mt(this['locale']);_0x3b59fb['label']=Es(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x3b59fb['withText']=!0x0,_0x3b59fb['on']('execute',()=>{this['isEdit']=!0x0;});const _0x3ae52c=new Mt(this['locale']);_0x3ae52c['label']=Es(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x3ae52c['withText']=!0x0,_0x3ae52c['on']('execute',()=>{this['showConfirm'](Es(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x493731=new Jt(this['locale']),_0x2450bb=new jt(this['locale']);_0x2450bb['children']['add'](_0x3b59fb);const _0x519b55=new jt(this['locale']);return _0x519b55['children']['add'](_0x3ae52c),_0x493731['items']['addMany']([_0x2450bb,_0x519b55]),_0x1b4627['add'](_0x493731),_0x7cc662;}_createEditInputView(_0x166163){const _0x2b982b=new qt(_0x166163),_0x49dcb8=_0x2b982b['bindTemplate'];return _0x2b982b['extendTemplate']({'on':{'keydown':_0x49dcb8['to'](_0x44efb9=>{'Enter'==_0x44efb9['key']&&this['_commitEditInputValue'](_0x2b982b);})}}),_0x2b982b;}_createAcceptEditButtonView(_0x142d51,_0x3a4015){const _0x921d4a=new Mt(_0x142d51);return _0x921d4a['set']({'icon':_0x48b061,'withText':!0x1,'tooltip':Es(_0x142d51,'AI_CHAT_HISTORY_ACCEPT')}),_0x921d4a['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x921d4a['on']('execute',()=>{this['_commitEditInputValue'](_0x3a4015);}),_0x921d4a;}_commitEditInputValue(_0x11eb85){const _0x332940=_0x11eb85['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x332940});}_createCancelEditButtonView(_0x26fdfb){const _0x23cd65=new Mt(_0x26fdfb);return _0x23cd65['set']({'icon':_0x572ba4,'withText':!0x1,'tooltip':Es(_0x26fdfb,'AI_CHAT_HISTORY_CANCEL')}),_0x23cd65['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x23cd65['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x23cd65;}_createSpinnerView(){const _0x2fc812=new Dr('tiny');return _0x2fc812['isVisible']=!0x0,_0x2fc812;}isMatching(_0x326a62){return'string'==typeof this['title']&&this['title']['match'](_0x326a62)?{'title':!0x0}:null;}highlightText(_0x58f278){this['_titleView']['highlightText'](_0x58f278);}},Ta=class extends _0x56a514{['headerView'];['searchView'];['mainErrorView'];skeletonView;emptyView;sectionsView;constructor(_0x1ef502,_0x2a86c6){super(_0x1ef502),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x4633fe=_a(_0x1ef502,this);this['headerView']=new ua(_0x1ef502,{'label':Es(_0x1ef502,'AI_CHAT_HISTORY_HEADING'),'icon':_0x4afa16,'class':'ck-ai-header_history','content':_0x4633fe,'showResizeButton':_0x2a86c6}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new Ia(_0x1ef502,[]),this['sectionsView']['delegate'](...wa)['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',_0x3a749d=>!_0x3a749d)]}}),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 _0x226e5f=new _0xdb63d9(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':Es(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x4b8edd=>Es(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x4b8edd),'secondary':Es(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x1058f3=this['_createErrorView']();return _0x1058f3['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x19b1a6=>!_0x19b1a6)]}}),_0x226e5f['on']('render',()=>{_0x226e5f['children']['add'](_0x1058f3,0x1);}),_0x226e5f['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x5d3a7a=>!_0x5d3a7a)]}}),_0x226e5f;}_createSkeletonView(){const _0xc11ee8=new wr(this['locale'],Cr['aiHistory']);return _0xc11ee8['bind']('isVisible')['to'](this,'isLoading'),_0xc11ee8;}_createErrorView(){const _0x513c5d=new _0x56a514(this['locale']),_0x303fd3=new Mt(this['locale']);_0x303fd3['set']({'withText':!0x1,'icon':_0x572ba4,'class':'ck-ai-notification_error__dismiss-button'}),_0x303fd3['bind']('isVisible')['to'](this,'hasItems',_0x19245f=>!!_0x19245f),_0x303fd3['on']('execute',()=>{this['errorMessage']='';});const _0x36144a=this['bindTemplate'];return _0x513c5d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x36144a['to']('errorMessage')}]},_0x303fd3]}),_0x513c5d;}_createEmptyStateView(){const _0x9fcfbd=new _0x56a514(this['locale']);return _0x9fcfbd['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x295593=>!_0x295593)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[Es(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x9fcfbd;}_createListItemViews(_0x2eca43,_0x3b6c19){const _0x356dc=[];for(const _0x953a1a of _0x2eca43){const _0x40a5cf=new ma(_0x3b6c19,_0x953a1a);_0x40a5cf['delegate'](...wa)['to'](this),_0x356dc['push'](_0x40a5cf);}return _0x356dc;}updateHistoryItemsWithCategories(_0x279da7){const _0x1397c2=this['locale']||'en',_0x59c7b4=[];for(const _0x23f35e of _0x279da7){const _0x3ba54d=this['_createListItemViews'](_0x23f35e['items'],_0x1397c2);_0x59c7b4['push'](new pa(_0x1397c2,{'title':_0x23f35e['title'],'items':_0x3ba54d}));}this['sectionsView']['sections']=_0x59c7b4,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x59c7b4),this['hasItems']=_0x279da7['some'](_0x5dd84a=>_0x5dd84a['items']['length']>0x0),this['_refreshSearch']();}removeHistoryItem(_0x4640a2){for(const _0x33468a of this['sectionsView']['sections']){const _0x276ff9=_0x33468a['getItem'](_0x4640a2);if(_0x276ff9){if(_0x33468a['removeItem'](_0x276ff9),0x0===_0x33468a['itemsViews']['length']){const _0x3c5759=this['sectionsView']['sections']['indexOf'](_0x33468a);-0x1!==_0x3c5759&&(this['sectionsView']['sections']['splice'](_0x3c5759,0x1),this['sectionsView']['items']['remove'](_0x33468a));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}updateItemTitle(_0x59403d,_0x42ca2b){for(const _0x16f138 of this['sectionsView']['sections']){const _0x3e70f8=_0x16f138['getItem'](_0x59403d);if(_0x3e70f8){_0x3e70f8['updateTitle'](_0x42ca2b);break;}}}updateItemLoadingState(_0x590fbe,_0x346cb9,_0x5ae150){for(const _0x4ac78f of this['sectionsView']['sections']){const _0x4de325=_0x4ac78f['getItem'](_0x590fbe);if(_0x4de325){_0x4de325['updateLoadingState'](_0x346cb9,_0x5ae150);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x519798=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x519798);}}};const wa=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];var Ca=class extends _0x898608{static get requires(){return[gs];}_historyView;static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1fe769){super(_0x1fe769);const _0x7976a1=this['context']['plugins']['get']('AITabs');this['_historyView']=new Ta(this['context']['locale'],_0x7976a1['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x7976a1),this['_historyView']['delegate'](...wa)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x7976a1['view'],'isMaximized',_0x490e5=>_0x490e5),_0x7976a1['view']['addTab']({'id':'history','buttonLabel':Es(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x4afa16,'order':0x0,'content':this['_historyView']});}removeHistoryItem(_0x5cf98b){this['_historyView']['removeHistoryItem'](_0x5cf98b);}updateItems(_0x324192){this['_historyView']['updateHistoryItemsWithCategories'](_0x324192);}updateItemTitle(_0xd732da,_0x262969){this['_historyView']['updateItemTitle'](_0xd732da,_0x262969);}updateItemLoadingState(_0x213187,_0x9c79a2,_0x182350){this['_historyView']['updateItemLoadingState'](_0x213187,_0x9c79a2,_0x182350);}setLoadingSkeleton(_0x184277){this['_historyView']['isLoading']=_0x184277;}['showError'](_0xb6ec70){this['_historyView']['errorMessage']=_0xb6ec70;}['hideError'](){this['_historyView']['errorMessage']='';}};const fa=/* #__PURE__ -- @preserve */
35
+ At();var ba=class extends fa{['id'];createdAt;constructor({id:_0x2e9dd5,title:_0x3618fa,createdAt:_0x24d2d2,updatedAt:_0x470d11,pinned:_0xb900e6}){super(),this['id']=_0x2e9dd5,this['createdAt']=new Date(_0x24d2d2),this['set']('title',_0x3618fa),this['set']('updatedAt',_0x470d11?new Date(_0x470d11):null),this['set']('pinned',_0xb900e6||!0x1);}updateTitle(_0x515bf1){this['set']('title',_0x515bf1),this['updatedAt']=new Date();}updatePinned(_0x43bd79){this['set']('pinned',_0x43bd79),this['updatedAt']=new Date();}};const Sa=/* #__PURE__ -- @preserve */
36
+ dt();var Ra=class extends Sa{items=[];connector;['group'];constructor({connector:_0x2943d1,group:_0x369ee9}){super(),this['connector']=_0x2943d1,this['group']=_0x369ee9;}async init(){try{const _0x1c435f=await this['connector']['fetchConversations'](this['group'])['getConversations']();this['loadItems'](_0x1c435f);}catch(_0x490e77){this['fire']('error',{'error':_0x490e77,'operation':'init'});}}addItem(_0x1ef300){this['items']['push'](_0x1ef300);}async removeItem(_0x351f14){const _0x15b060=this['items']['findIndex'](_0x4e17c4=>_0x4e17c4['id']===_0x351f14);if(-0x1===_0x15b060)return!0x1;try{return await this['connector']['deleteConversation'](_0x351f14)['execute'](),this['items']['splice'](_0x15b060,0x1),this['fire']('itemRemoved',{'itemId':_0x351f14}),!0x0;}catch(_0x359fe1){return this['fire']('error',{'error':_0x359fe1,'operation':'removeItem','itemId':_0x351f14}),!0x1;}}getItem(_0x1d1d7c){return this['items']['find'](_0x476f18=>_0x476f18['id']===_0x1d1d7c);}async updateItemTitle(_0x39d0bd,_0x5f55c9){const _0x3902c0=this['getItem'](_0x39d0bd);if(!_0x3902c0)return!0x1;try{return await this['connector']['updateConversation'](_0x39d0bd,{'title':_0x5f55c9})['getResult'](),_0x3902c0['updateTitle'](_0x5f55c9),this['fire']('itemUpdated',{'itemId':_0x39d0bd,'updates':{'title':_0x5f55c9}}),!0x0;}catch(_0x283b50){return this['fire']('error',{'error':_0x283b50,'operation':'updateItemTitle','itemId':_0x39d0bd}),!0x1;}}async updateItemPinned(_0x22cf5d,_0x5afed5){const _0xb7d944=this['getItem'](_0x22cf5d);if(!_0xb7d944)return!0x1;try{return await this['connector']['updateConversation'](_0x22cf5d,{'pinned':_0x5afed5})['getResult'](),_0xb7d944['updatePinned'](_0x5afed5),this['fire']('itemUpdated',{'itemId':_0x22cf5d,'updates':{'pinned':_0x5afed5}}),!0x0;}catch(_0x5cf34d){return this['fire']('error',{'error':_0x5cf34d,'operation':'updateItemPinned','itemId':_0x22cf5d}),!0x1;}}loadItems(_0x3f5ddb){try{this['items']=[],_0x3f5ddb['map'](_0x5021f2=>{this['addItem'](new ba(_0x5021f2));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x5f2757){this['fire']('error',{'error':_0x5f2757,'operation':'loadItems'});}}getItems(_0x1d5dba={}){const _0x1eeade=void 0x0!==_0x1d5dba['pinned']&&_0x1d5dba['pinned'],_0x709e38=_0x1d5dba['from']?new Date(_0x1d5dba['from']['getFullYear'](),_0x1d5dba['from']['getMonth'](),_0x1d5dba['from']['getDate']()):null,_0x137099=_0x1d5dba['to']?new Date(_0x1d5dba['to']['getFullYear'](),_0x1d5dba['to']['getMonth'](),_0x1d5dba['to']['getDate']()):null;return this['items']['filter'](_0x4d043b=>{if(_0x4d043b['pinned']!==_0x1eeade)return!0x1;if(_0x137099){const _0x16aa0b=new Date(_0x4d043b['createdAt']['getFullYear'](),_0x4d043b['createdAt']['getMonth'](),_0x4d043b['createdAt']['getDate']());return _0x709e38?_0x709e38['getTime']()===_0x137099['getTime']()?_0x16aa0b['getTime']()===_0x709e38['getTime']():_0x16aa0b<_0x137099&&_0x16aa0b>=_0x709e38:_0x16aa0b<_0x137099;}return!0x0;});}},Oa=class extends _0x898608{_aiConnector;_reporter;_aiChatHistoryUi;_aiChatController;static get requires(){return[Is,Nn,er,Ca,gs];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_aiConnector']=this['context']['plugins']['get'](Is),this['_aiChatHistoryUi']=this['context']['plugins']['get'](Ca),this['_aiChatController']=this['context']['plugins']['get'](er),this['_reporter']=this['context']['plugins']['get'](Nn)['createReporter']('aichathistory');const _0x5b3e9f=this['context']['plugins']['get'](gs);try{const _0x5614a4=this['_aiChatController']['getGroupId']();this['history']=new Ra({'connector':this['_aiConnector'],'group':_0x5614a4}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x270da2,_0xcbaeb4)=>{this['_setItemLoading'](_0xcbaeb4['id'],'remove'),this['_handleRemove'](_0xcbaeb4['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x558267,_0x4923b9)=>{this['_setItemLoading'](_0x4923b9['id'],'rename'),this['_handleEditTitle'](_0x4923b9['id'],_0x4923b9['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x5a6dd4,_0x2f3ad9)=>{void 0x0!==_0x2f3ad9['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x2f3ad9['itemId'],_0x2f3ad9['updates']['title']),void 0x0!==_0x2f3ad9['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x2f3ad9['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x14e059,_0x492a1e)=>{this['_aiChatController']['_handleRemovedConversation'](_0x492a1e['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x492a1e['itemId']),this['_clearItemLoading'](_0x492a1e['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x198b0b,_0x757ad4)=>{this['_handleHistoryErrorUI'](_0x757ad4['error'],_0x757ad4['operation'],_0x757ad4['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x2a596b,_0x31bb3f)=>{this['_handleSelectConversation'](_0x31bb3f['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x2bbd33,_0x132091)=>{const _0x28a751=_0x132091['pinned']?'pin':'unpin';this['_setItemLoading'](_0x132091['id'],_0x28a751),this['_handleTogglePin'](_0x132091['id'],_0x132091['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x5b3e9f['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x5b3e9f['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x1723bc){this['_handleHistoryErrorUI'](_0x1723bc,'init');}}async _handleEditTitle(_0x5cefb1,_0x26af96){await this['history']['updateItemTitle'](_0x5cefb1,_0x26af96);}async['_handleTogglePin'](_0x3521e4,_0x3a98f4){await this['history']['updateItemPinned'](_0x3521e4,_0x3a98f4);}async['_handleRemove'](_0x23977a){await this['history']['removeItem'](_0x23977a);}async _handleSelectConversation(_0x39bacd){await this['_aiChatController']['loadConversation'](_0x39bacd);}async _showConversationHistory(){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}_updateHistoryItemsUI(){const _0xbf4dea=this['_aiChatController']['activeConversation']?.['id'],_0x159480=this['_getCategorizedItems']()['map'](_0x251fcf=>({'title':_0x251fcf['title'],'items':_0x251fcf['items']['map'](_0x5378c7=>({'id':_0x5378c7['id'],'title':_0x5378c7['title']||Es(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x5378c7['createdAt'])['toLocaleDateString'](),'active':_0x5378c7['id']===_0xbf4dea,'pinned':_0x5378c7['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x159480);}_setItemLoading(_0x51aad7,_0x328ad1){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x51aad7,_0x328ad1,!0x0);}_clearItemLoading(_0x46d919){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x46d919,null,!0x1);}_handleHistoryErrorUI(_0x536e19,_0x3ffa35,_0xea3463){const _0xe13562=this['_generateErrorMessage'](_0x3ffa35,_0xea3463);this['_aiChatHistoryUi']['showError'](_0xe13562),this['_reporter']['reportError'](_0x536e19,{'context':{'operation':_0x3ffa35}}),_0xea3463&&this['_clearItemLoading'](_0xea3463),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}_generateErrorMessage(_0x5a7801,_0x312576){const _0xad7f56=_0x312576?this['history']['getItem'](_0x312576):null,_0x3c568b=_0xad7f56?.['title']||Es(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x5a7801){case'updateItemTitle':return Es(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3c568b);case'updateItemPinned':{const _0x56aeb2=Es(this['context']['locale'],_0xad7f56?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return Es(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x56aeb2,_0x3c568b]);}case'removeItem':return Es(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3c568b);case'init':case'loadItems':return Es(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return Es(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}_getCategorizedItems(){const _0x45fbe8=new Date(),_0x1f20d3=new Date(_0x45fbe8['getFullYear'](),_0x45fbe8['getMonth'](),_0x45fbe8['getDate']()),_0x4501fb=new Date(_0x1f20d3);_0x4501fb['setDate'](_0x4501fb['getDate']()-0x1);const _0x9be5e6=new Date(_0x1f20d3);_0x9be5e6['setDate'](_0x9be5e6['getDate']()-0xe);const _0x5c79ec=this['history']['getItems']({'pinned':!0x0}),_0x56fee7=this['history']['getItems']({'from':_0x1f20d3,'to':_0x1f20d3}),_0x27a21b=this['history']['getItems']({'from':_0x4501fb,'to':_0x4501fb}),_0x1f4dfe=this['history']['getItems']({'from':_0x9be5e6,'to':_0x4501fb}),_0x1d9f52=this['history']['getItems']({'to':_0x9be5e6}),_0x184c27=[];return _0x5c79ec['length']>0x0&&_0x184c27['push']({'title':Es(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x5c79ec}),_0x56fee7['length']>0x0&&_0x184c27['push']({'title':Es(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x56fee7}),_0x27a21b['length']>0x0&&_0x184c27['push']({'title':Es(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x27a21b}),_0x1f4dfe['length']>0x0&&_0x184c27['push']({'title':Es(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x1f4dfe}),_0x1d9f52['length']>0x0&&_0x184c27['push']({'title':Es(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x1d9f52}),_0x184c27;}},va=class extends _0x898608{static get requires(){return[Oa,Ca];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},ka=class extends _0x898608{static get requires(){return[er,tn,Aa,va,vn];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3c4a5d){super(_0x3c4a5d),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');}},ya=class extends Mt{['id'];constructor(_0x505c26,_0x3c4921){super(_0x505c26);const {id:_0x4dea5d,type:_0x256c4a,icon:_0x268640}=_0x3c4921;this['id']=_0x4dea5d,this['set']({'label':_0x3c4921['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x3c4921['id']}}),_0x268640?this['icon']=_0x268640:'chat'===_0x256c4a?this['icon']=_0x19cce7:'review'===_0x256c4a?this['icon']=_0x510915:'translate'===_0x256c4a&&(this['icon']=_0x370c5b);}},Na=class extends _0x56a514{listView;constructor(_0x26238f,_0x5b011e){super(_0x26238f),this['set']('isEnabled',!0x0);const _0x271b23=_0x5b011e['map'](_0x5560da=>{const _0x9f60d5=new jt(this['locale']),_0x40ee97=new ya(this['locale'],_0x5560da);return _0x40ee97['bind']('isEnabled')['to'](this),_0x9f60d5['children']['add'](_0x40ee97),_0x40ee97['delegate']('execute')['to'](this),_0x9f60d5;});this['listView']=new Jt(this['locale']),this['listView']['items']['addMany'](_0x271b23),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}};const xa='chat-shortcuts';var La=class extends _0x898608{_shortcuts;_shortcutsView;_aiChatUI;_listenedConversation;static get requires(){return[Aa,fs];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_aiChatUI']=this['context']['plugins']['get'](Aa),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x23a33c=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{const _0x57075c=_0x23a33c['activeConversation'];_0x57075c['isFromHistory']||this['_injectShortcuts'](_0x57075c);}),this['listenTo'](_0x23a33c,'interactionStarted',()=>{this['_removeShortcuts']();}));}_validateShortcuts(){const _0x3c6073=['chat','review','translate'];this['_shortcuts']['forEach'](_0x434351=>{let _0x16122b=!0x0;if(_0x434351['id']&&_0x434351['label']&&_0x3c6073['includes'](_0x434351['type'])?'chat'===_0x434351['type']&&(_0x16122b='string'==typeof _0x434351['prompt']):_0x16122b=!0x1,!_0x16122b)throw new ct('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x434351});});}_injectShortcuts(_0x495202){this['_removeShortcuts'](),this['_shortcutsView']=new Na(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),this['_aiChatUI']['addFeedItemCustomElement'](this['_shortcutsView']['element'],xa),this['_shortcutsView']['on']('execute',_0x5f131e=>{const _0x5d0e05=_0x5f131e['source']['id'];this['_executeShortcut'](_0x5d0e05);}),this['_listenedConversation']=_0x495202,this['listenTo'](_0x495202,'uploadProgressChanged',(_0x468e0,_0x33aaec)=>{this['_shortcutsView']['isEnabled']=!_0x33aaec['isUploadInProgress'];});}_removeShortcuts(){const _0x435bfa=this['context']['plugins']['get'](Aa);_0x435bfa['hasFeedItem'](xa)&&_0x435bfa['removeFeedItem'](xa),this['_listenedConversation']&&(this['stopListening'](this['_listenedConversation'],'uploadProgressChanged'),this['_listenedConversation']=void 0x0),this['_shortcutsView']?.['destroy']();}_executeShortcut(_0x22c4a8){const _0x2cd41d=this['_shortcuts']['find'](_0x6b6a1f=>_0x6b6a1f['id']===_0x22c4a8),_0x2afbe1=_0x2cd41d['type'];'chat'===_0x2afbe1?this['_runChatShortcut'](_0x2cd41d):'review'===_0x2afbe1?_0x2cd41d['commandId']?this['_runReviewShortcut'](_0x2cd41d):this['_switchTab']('reviewMode'):'translate'===_0x2afbe1&&(_0x2cd41d['language']?this['_runTranslateShortcut'](_0x2cd41d):this['_switchTab']('translate'));}_switchTab(_0x48bb18){if(!this['context']['plugins']['has']('AITabs'))throw new ct('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x48bb18});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x48bb18);}async _runChatShortcut({id:_0x576c18,prompt:_0x5b8a45,draftMode:_0x37f7e5,useWebSearch:_0xea3c6c=!0x1,useReasoning:_0x22f44f=!0x1,model:_0x5b2153}){const _0x284188=this['context']['plugins']['get']('AIChatController'),_0x2352b1=_0x284188['activeConversation'],_0x58de76=this['context']['plugins']['get'](fs),_0xbeefee=await _0x58de76['models']['resolveModel'](_0x5b2153);_0xbeefee&&await _0x2352b1['setModel'](_0xbeefee),_0x2352b1['setWebSearch'](_0xea3c6c),_0x2352b1['setReasoning'](_0x22f44f);const _0x384aae=_0x58de76['contextLibrary']['resolveContext']({'feature':'chat','ids':[_0x576c18],'idScopedOnly':!0x0,'context':new Yn()});_0x2352b1['addDefaultContext'](_0x384aae['refs']),_0x284188['addCurrentDocumentToChatContext'](),_0x37f7e5?(this['_aiChatUI']['setPromptInputValue'](_0x5b8a45),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x284188['sendMessage']({'message':_0x5b8a45});}_runReviewShortcut({commandId:_0x5a4a9f,model:_0x137e51,prompt:_0x51f8d4,params:_0x337544}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ct('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x435b86={'id':_0x5a4a9f,'isCustom':'custom'===_0x5a4a9f};_0x137e51&&_0x51f8d4&&(_0x435b86['args']={'model':_0x137e51,'prompt':_0x51f8d4}),_0x337544&&(_0x435b86['params']=_0x337544),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x435b86);}_runTranslateShortcut({language:_0x5ef3c1}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new ct('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x5ef3c1,'args':{'language':_0x5ef3c1}});}},Pa=class extends _0x23b7b0{constructor(_0x2588ba){super(_0x2588ba);const _0x1b954e=_0x2588ba['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x1b954e,'isVisible'),this['isEnabled']=!0x0;}execute(){const _0x3b0ac2=this['editor']['plugins']['get']('AITabs')['view'];_0x3b0ac2['isVisible']=!_0x3b0ac2['isVisible'];}},Da=class extends _0x622916{static get requires(){return[gs];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x4efafb=this['editor'];_0x4efafb['commands']['add']('toggleAi',new Pa(_0x4efafb)),_0x4efafb['ui']['componentFactory']['add']('toggleAi',()=>{const _0x26403b=this['_createAIUIButton'](Mt);return _0x26403b['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x26403b;}),_0x4efafb['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x2016bd=this['_createAIUIButton'](Zt);return _0x2016bd['set']({'role':'menuitemcheckbox'}),_0x2016bd;});}_createAIUIButton(_0x40ba03){const _0x1213f7=this['editor'],_0x56538a=_0x1213f7['commands']['get']('toggleAi'),_0xd8a777=new _0x40ba03(_0x1213f7['locale']);return _0xd8a777['set']({'label':Es(_0x1213f7['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x2eb0d7,'isToggleable':!0x0}),_0xd8a777['bind']('isEnabled')['to'](_0x56538a),_0xd8a777['bind']('isOn')['to'](_0x56538a,'value',_0x13e317=>!!_0x13e317),this['listenTo'](_0xd8a777,'execute',()=>{_0x56538a['execute']();}),_0xd8a777;}};const Ha=['applySuggestion','insertSuggestion','showNext','showPrevious'];var Ma=class extends _0x56a514{['_errorView'];constructor(_0x2a1c45){super(_0x2a1c45),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x5788a5){this['showError'](_0x5788a5);}['showError'](_0x1fac60){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x1fac60,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}_createErrorView(){const _0x5416c4=new _0x56a514(this['locale']),_0x228254=new _0x56a514(this['locale']);return _0x228254['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x5416c4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x5be14a=>!_0x5be14a)]},'children':[_0x228254]}),_0x5416c4;}};const Ua=0xa;var Va=class extends _0x898608{static get requires(){return[tn];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;_currentConfig;_editor;_isUpdatingMarkers=!0x1;['open'](_0x14f9ac){const {id:_0x5cefff}=this['_currentConfig']??{};this['_currentConfig']=_0x14f9ac,this['_editor']=_0x14f9ac['targetEditor'];const {id:_0x5bec8d}=this['_currentConfig'];this['isOpen']&&_0x5cefff===_0x5bec8d?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x294724=this['_editor'];if(!_0x294724)return;const _0x145b25=_0x294724['plugins']['get']('Dialog');_0x145b25['isOpen']&&this['_currentConfig']&&_0x145b25['id']===this['_currentConfig']['id']&&_0x145b25['hide']();}_updateDialog(){const _0x27d32b=this['_editor']['plugins']['get']('Dialog'),{icon:_0x9cd904,title:_0x37eebb}=this['_currentConfig'];_0x27d32b['view']?.['headerView']&&(_0x27d32b['view']['headerView']['label']=_0x37eebb,_0x27d32b['view']['headerView']['iconView']&&_0x9cd904&&(_0x27d32b['view']['headerView']['iconView']['content']=_0x9cd904)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x27d32b['view']?.['updatePosition']();}_showFakeVisualSelection(){this['context']['plugins']['get'](tn)['showFakeVisualSelection']({'editor':this['_editor'],'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}_hideFakeVisualSelection(){this['context']['plugins']['get'](tn)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x5d1e9d=this['_editor']['plugins']['get']('Dialog'),{id:_0x4b7e6f,title:_0x26d45e,icon:_0x97ec2,class:_0x227d45,mainView:_0x21a5c1}=this['_currentConfig'];_0x21a5c1['delegate'](...Ha)['to'](this),_0x5d1e9d['show']({'title':_0x26d45e,'icon':_0x97ec2,'hasCloseButton':!0x0,'id':_0x4b7e6f,'position':this['_calculateDialogPosition']['bind'](this),'getRootName':this['_getCurrentDomRootName']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x227d45||''),'content':_0x21a5c1,'onShow':_0xe49561=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0xe49561['view']?.['updatePosition']();const _0x11b26d=this['_getSelectionElements']();_0x11b26d&&_0x11b26d[0x0]&&Ot({'target':_0x11b26d[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0xe49561['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x4b7e6f});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x4b7e6f}),this['isOpen']=!0x1;}});}_calculateDialogPosition(_0x179d09,_0x5c57a2,_0x9910cb){const _0x2d6314=_0x5c57a2||_0x9910cb;if(!_0x2d6314)return null;const _0x11fdfe=this['_getSelectionElements']();if(!_0x11fdfe||0x0===_0x11fdfe['length'])return{'left':Math['round'](_0x2d6314['left']+_0x2d6314['width']/0x2-_0x179d09['width']/0x2),'top':Math['round'](_0x2d6314['top']+_0x2d6314['height']/0x2-_0x179d09['height']/0x2)};const _0xdea21e=Math['round'](_0x2d6314['left']+_0x2d6314['width']/0x2-_0x179d09['width']/0x2),_0x26ee54=_0x11fdfe['map'](_0x24ffb8=>new It(_0x24ffb8)),_0x35e525=_0x179d09['height'];return{'left':_0xdea21e,'top':this['_calculateOptimalTopPosition'](_0x26ee54,_0x35e525,_0x2d6314)};}_calculateOptimalTopPosition(_0x1cd63b,_0x32ac3f,_0x900a21){const _0x1e14ad=new It(wt['window']),_0x5717a1=_0x1cd63b['map'](_0x7e1778=>_0x7e1778['getVisible']())['filter'](_0x3615bc=>_0x3615bc),_0x29d531=It['getBoundingRect'](_0x5717a1);if(!_0x29d531)return Math['round'](_0x900a21['top']+_0x900a21['height']/0x2);const _0x4168a4=_0x1e14ad['getIntersection'](_0x29d531);if(!_0x4168a4)return Math['round'](_0x900a21['top']+_0x900a21['height']/0x2);const _0x42777d=_0x900a21['getVisible'](),_0x45e9fb=_0x42777d&&_0x29d531['height']>_0x42777d['height'],_0x4030a1=_0x4168a4['top'],_0x9514f5=_0x4168a4['bottom'];if(_0x45e9fb){const _0x435eb6=_0x1e14ad['top']+_0x1e14ad['height']/0x2-_0x32ac3f/0x2,_0x2e4ae0=_0x4030a1-Ua-_0x1e14ad['top'],_0x302491=_0x1e14ad['bottom']-_0x9514f5-Ua;return _0x2e4ae0>=_0x32ac3f?Math['max'](Ua,_0x4030a1-_0x32ac3f-Ua):_0x302491>=_0x32ac3f?_0x9514f5+Ua:Math['max'](Ua,_0x435eb6);}const _0x25203e=_0x4030a1-_0x32ac3f,_0x1b0872=_0x1e14ad['bottom']-_0x9514f5-Ua,_0x2b21d1=_0x4030a1-Ua-_0x1e14ad['top'];let _0x2c7176;return _0x2c7176=_0x1b0872>=_0x32ac3f?_0x9514f5+Ua:_0x2b21d1>=_0x32ac3f?_0x25203e-Ua:_0x4030a1+_0x29d531['height']/0x2-_0x32ac3f/0x2,_0x2c7176;}_setupFakeVisualSelectionMarkerRemovalListener(){const _0x583af8=this['_editor'];this['listenTo'](_0x583af8['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x3b3d41,data:{newRange:_0x2392cd}}of _0x583af8['model']['document']['differ']['getChangedMarkers']())if(_0x3b3d41['startsWith']('ai-selection:')&&(_0x2392cd&&(_0x2392cd['start']['isEqual'](_0x2392cd['end'])||'$graveyard'==_0x2392cd['root']['rootName'])||null==_0x2392cd)){const _0x5189fa=Es(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x5189fa),this['fire']('selectionRemoved');}}});}_cleanupFakeVisualSelectionMarkerRemovalListener(){const _0xf312bf=this['_editor'];this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0xf312bf['model']['document']);}_getSelectionElements(){const _0x29f5be=this['_editor'];return _0x42da8e(_0x29f5be['editing'],[..._0x29f5be['model']['markers']['getMarkersGroup']('ai-selection'),..._0x29f5be['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}_getCurrentDomRootName(){const _0x5cd55f=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];return _0x5cd55f&&_0x5cd55f['rootName']?_0x5cd55f['rootName']:null;}},Ba=class extends _0x54b9b5{copyButton;likeButton;dislikeButton;showChangesButton;['_config'];constructor(_0x32f2ea,_0x55d59c={}){super(_0x32f2ea),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x55d59c};const _0x347699=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x347699?'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(_0x549d26){this['showChangesButton']['isEnabled']=_0x549d26;}_setupRatingButtons(){this['likeButton']=new Mt(this['locale']),this['likeButton']['set']({'icon':at,'label':Es(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':Dn,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new Mt(this['locale']),this['dislikeButton']['set']({'icon':ot,'label':Es(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':Dn,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}_setupCopyButton(){this['copyButton']=new Mt(this['locale']),this['copyButton']['set']({'icon':_0xaeff50,'label':Es(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+Dn,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x3e7cf1=new $t();_0x3e7cf1['set']({'content':_0x48b061}),_0x3e7cf1['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'+Dn,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+Dn;},0x7d0);}),this['copyButton']['children']['add'](_0x3e7cf1);}_setupShowChangesButton(){this['showChangesButton']=new Mt(this['locale']),this['showChangesButton']['set']({'icon':et,'label':Es(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':Dn}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x33e7f3=>_0x33e7f3?it:et),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}},Ga=class extends Ma{['children'];nextButtonView;previousButtonView;['focusCycler'];['_focusables'];['_focusTracker'];_keystrokes;['_config'];_streamableContentView;_toolbarContainerView;_partToolbarView;_stateView;['_miniToolbarView'];constructor(_0x4bc8c0,_0x2aba14){super(_0x4bc8c0);const _0x4d0a27=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['set']('_outdatedReason',void 0x0),this['set']('isTargetReadOnly',!0x1),this['set']('areActionsDisabled',!0x1),this['_focusTracker']=new _t(),this['_keystrokes']=new gt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ft({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x2aba14,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new mr(_0x4bc8c0),this['_partToolbarView']=new Ir(_0x4bc8c0,_0x2aba14['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_partToolbarView']['bind']('isTargetReadOnly')['to'](this),this['_partToolbarView']['bind']('isEnabled')['to'](this,'areActionsDisabled',this,'_isErrorVisible',(_0x25db62,_0xc462e9)=>!_0x25db62&&!_0xc462e9),this['_togglePartToolbarButtonsVisibility'](_0x2aba14),this['_stateView']=new gr(_0x4bc8c0),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new Ba(_0x4bc8c0,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new Fa(_0x4bc8c0,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x41cf8d,_0x419e73,_0x21cc0b,_0x261868)=>{let _0x349243,_0x17cbac;'pending'===_0x261868?(_0x349243=this['_partToolbarView'],_0x17cbac=this['_stateView']):(_0x349243=this['_stateView'],_0x17cbac=this['_partToolbarView']),this['_stateView']['setState'](_0x21cc0b,this['_outdatedReason']),_0x349243['isVisible']=!0x1,_0x17cbac['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x4d0a27['to']('_state',_0x55820e=>'ck-ai-chat-balloon-main_state_'+_0x55820e)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x2aba14);});}['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(_0xc9bdd7){_0xc9bdd7?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0xc9bdd7);}clearContent(){this['_streamableContentView']['clear']();}setState(_0x2c8805,_0x378b0f){this['_outdatedReason']=_0x378b0f,this['_state']=_0x2c8805;}['showError'](_0x2ad242){super['showError'](_0x2ad242),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}toggleRotatorButtonsVisibility(_0x7dfc64){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x7dfc64;}_togglePartToolbarButtonsVisibility({showApplyButton:_0x543d65,showSuggestButton:_0x1b29f9}){_0x543d65=_0x543d65&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x1b29f9=_0x1b29f9&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x543d65,'showSuggestButton':_0x1b29f9});}_createNextButtonView(){const _0x1fef31=new Mt(this['locale']);return _0x1fef31['set']({'icon':_0x4e351c,'label':Es(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x1fef31['on']('execute',()=>{this['fire']('showNext');}),_0x1fef31;}_createPreviousButtonView(){const _0xca25cd=new Mt(this['locale']);return _0xca25cd['set']({'icon':_0x582ecb,'label':Es(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0xca25cd['on']('execute',()=>{this['fire']('showPrevious');}),_0xca25cd;}},Fa=class extends _0x56a514{constructor(_0x2bbd57,_0x37f69c){super(_0x2bbd57),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x37f69c});}},Ka=class extends _0x622916{static get requires(){return[Ut,Va];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}_chatBalloonView;constructor(_0x24e83e){super(_0x24e83e),this['set']('showDiff',!0x1);}['open'](_0x116ab7){const _0xfb1d6=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0xfb1d6['plugins']['get']('AIBalloon')['open']({..._0x116ab7,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x116ab7['showRotator']),this['_chatBalloonView']['areActionsDisabled']=_0x116ab7['areActionsDisabled'],this['_chatBalloonView']['isTargetReadOnly']=_0x116ab7['isTargetReadOnly'],this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}updateContent(_0x432276){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x432276);}clearContent(){this['_chatBalloonView']&&this['_chatBalloonView']['clearContent']();}setState(_0x531c56,_0x4e61b3){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x531c56,_0x4e61b3);}setTargetReadOnly(_0x1be7aa){this['_chatBalloonView']&&(this['_chatBalloonView']['isTargetReadOnly']=_0x1be7aa);}_createChatBalloonView(){const _0x4ad38b=this['editor'],_0x103e6f=_0x4ad38b['plugins']['get']('AIBalloon'),_0x150669=_0x4ad38b['commands']['get']('trackChanges');let _0x4527be=_0x4ad38b['config']['get']('ai.availableReplyActions')||[...Or];_0x4ad38b['plugins']['has']('TrackChanges')||(_0x4527be=_0x4527be['filter'](_0x2909d0=>'insertSuggestion'!=_0x2909d0));const _0x40c417=new Ga(_0x4ad38b['locale'],{'availableActions':_0x4527be,'showApplyButton':!0x0,'showSuggestButton':!!_0x150669});return _0x40c417['bind']('showDiff')['to'](this),_0x40c417['delegate'](...ir)['to'](this),_0x40c417['delegate']('showPrevious','showNext')['to'](this),_0x103e6f['delegate']('dialogClosed')['to'](this),_0x40c417['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x40c417['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x40c417['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x150669&&_0x40c417['bind']('isTrackChangesOn')['to'](_0x150669,'value'),_0x40c417['render'](),_0x40c417;}_toggleRotatorButtonsInDialogHeader(_0x17194e){const _0x27cbbc=this['editor'],_0x6a5881=_0x27cbbc['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x17194e),_0x6a5881['has'](this['_chatBalloonView']['previousButtonView'])||(_0x6a5881['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x27cbbc['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x6a5881['remove'](this['_chatBalloonView']['previousButtonView']),_0x6a5881['remove'](this['_chatBalloonView']['nextButtonView']);}));}_restoreDefaultViewFocus(){this['_chatBalloonView']['focus']();}},Wa=class extends _0x622916{static get requires(){return[Da,Ka,_0x34a1f4];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};function Ya(_0x318b19){const {editor:_0x6828d1,action:_0x4eb7b9,withText:_0x2d2b3a=!0x1,withIcon:_0x35efd8=!0x0,isInDropdown:_0x26b8b5=!0x0,shouldPreventFocus:_0x169fc4=!0x1,actionButtons:_0x52ff50}=_0x318b19;return()=>{const _0x3e3497=_0x6828d1['locale'],_0x1a0cf9=new Mt(_0x3e3497),_0xd984ec=_0x1a0cf9['bindTemplate'];_0x26b8b5&&_0x1a0cf9['extendTemplate']({'on':{'mouseenter':_0xd984ec['to'](()=>{_0x169fc4&&_0x169fc4()||_0x1a0cf9['focus']();})}}),_0x52ff50['push']({'buttonView':_0x1a0cf9,'action':_0x4eb7b9});const _0x269506=_0x4eb7b9['icon']??_0x4eb7b9['parent']?.['icon'];return _0x1a0cf9['set']({'label':_0x4eb7b9['label'],'withText':_0x2d2b3a,'role':'menuitem','icon':_0x35efd8?_0x269506??_0x10bb99:void 0x0,'tooltip':!_0x2d2b3a,'class':'ck-ai-quick-actions-button','isEnabled':_0x4eb7b9['isEnabled']}),_0x1a0cf9['on']('execute',()=>{_0x6828d1['editing']['view']['focus'](),_0x6828d1['commands']['execute']('aiQuickAction',_0x4eb7b9);}),_0x1a0cf9;};}var $a=class extends Xt{['arrowView'];constructor(_0x2dec09,_0x40b703){super(_0x2dec09,_0x40b703);const _0x116ff5=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',_0x260bb4=>String(_0x260bb4)),'data-cke-tooltip-disabled':_0x116ff5['to']('isOn')},'on':{'mouseenter':_0x116ff5['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}_createArrowView(){const _0x1cdda7=new $t();return _0x1cdda7['content']=_0x1193f0,_0x1cdda7['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x1cdda7;}},qa=class extends Jt{_allListItems;_allSearchableItems;constructor(_0x3ec9a,_0x12b99c,_0x34feab){super(_0x3ec9a),this['_allListItems']=_0x12b99c,this['_allSearchableItems']=_0x34feab;}filter(_0x59aa69){if(!_0x59aa69)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x4aaa4f=_0x59aa69['source']['toLowerCase']()['trim'](),_0x2e1e8c=this['_allSearchableItems']['filter'](_0x57a88e=>(_0x57a88e['groupLabel']?_0x57a88e['label']+'\x20('+_0x57a88e['groupLabel']+')':_0x57a88e['label'])['toLowerCase']()['includes'](_0x4aaa4f));return this['items']['clear'](),this['items']['addMany'](_0x2e1e8c['sort']((_0x34ca8f,_0x344c14)=>{const _0x16fcba=_0x34ca8f['groupLabel'],_0x571167=_0x344c14['groupLabel'];return _0x16fcba||_0x571167?_0x16fcba?0x1:-0x1:0x0;})['map'](_0xc44dce=>_0xc44dce['item'])),this['_highlightQuery'](_0x4aaa4f,_0x2e1e8c),{'resultsCount':_0x2e1e8c['length'],'totalItemsCount':this['_allSearchableItems']['length']};}_highlightQuery(_0x29fdf5,_0x213062){if(!_0x29fdf5)return;const _0x5f11de=new RegExp(_0x3ff1f3(_0x29fdf5),'gi');_0x213062['forEach'](_0x11be96=>{_0x11be96['highlightViews']&&_0x11be96['highlightViews']['forEach'](_0x3342b0=>{'function'==typeof _0x3342b0['highlightText']&&_0x3342b0['highlightText'](_0x5f11de);});});}_clearHighlight(){this['_allSearchableItems']['forEach'](_0x124f98=>{_0x124f98['highlightViews']&&_0x124f98['highlightViews']['forEach'](_0x2704f0=>{'function'==typeof _0x2704f0['highlightText']&&_0x2704f0['highlightText'](null);});});}};const Qa='menu',Xa='menuitem';var za=class extends _0x56a514{_bodyCollection;optionsListView;_searchTextView=null;_allSearchableItems=[];['children'];['focusTracker'];keystrokes;['_focusables'];['focusCycler'];_openNestedPanels=new Set();['_hasSearch'];_actionButtons;constructor(_0x506bf7,_0x4cdbe7,_0x2f9cb9,_0x2915e8,_0x4b6a02=!0x1,_0x2dc90a=[]){const _0x347c15=_0x506bf7['locale'];super(_0x347c15),this['_bodyCollection']=_0x2915e8,this['_hasSearch']=_0x4b6a02,this['_actionButtons']=_0x2dc90a;const _0x129cca=this['_createListItems'](_0x506bf7,_0x4cdbe7,_0x2f9cb9);this['optionsListView']=new qa(_0x347c15,_0x129cca,this['_allSearchableItems']),this['optionsListView']['role']=Qa,this['optionsListView']['items']['addMany'](_0x129cca),this['focusTracker']=new _t(),this['keystrokes']=new gt(),_0x4b6a02&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x129cca,this['focusCycler']=new Ft({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x4b6a02&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x5ae2c6=_0x4b6a02&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x93f04d(_0x5ae2c6),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x347c15['uiLanguageDirection']},'children':this['children']});}_createSearchTextView(){return new _0xdb63d9(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':Es(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':Es(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x14442a=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x14442a);}_createListItems(_0x32ced5,_0x1c110d,_0x117f06){const _0x3068bf=new _0x93f04d();return _0x1c110d['forEach'](_0xd33a56=>{if('actions'in _0xd33a56){const {listItem:_0x9da425}=this['_createActionGroupButton'](_0x32ced5,_0xd33a56,_0x117f06);_0x3068bf['add'](_0x9da425),_0xd33a56['actions']['forEach'](_0x450dec=>{const {listItem:_0x29b622,highlightViews:_0x1d42c0}=this['_createSearchResultActionButton'](_0x32ced5,_0x450dec,_0xd33a56['label'],_0xd33a56['icon']);this['_allSearchableItems']['push']({'item':_0x29b622,'label':_0x450dec['label'],'groupLabel':_0xd33a56['label'],'highlightViews':_0x1d42c0});});}else{const {listItem:_0x42580c}=this['_createActionButton'](_0x32ced5,_0xd33a56);_0x3068bf['add'](_0x42580c);const _0x22bb76=_0x42580c['children']['first'];if(_0x22bb76){const {listItem:_0x48ad63,highlightViews:_0x508c5b}=this['_createSearchResultActionButton'](_0x32ced5,_0xd33a56);this['_allSearchableItems']['push']({'item':_0x48ad63,'label':_0x22bb76['label']||'','highlightViews':_0x508c5b});}}}),_0x3068bf;}_createActionButton(_0x2ece5a,_0x1c9f2f,_0x4efb8c,_0x5c643c){const _0x99525c=new jt(this['locale']);if(_0x4efb8c&&_0x5c643c){const _0x45ab59=new Mt(this['locale']),_0x15c72b=_0x45ab59['bindTemplate'],_0x4057b7=new Yt();_0x4057b7['text']=_0x1c9f2f['label'];const _0x26c876=new Yt();_0x26c876['text']=_0x4efb8c;const _0x1c5b8e=new $t();_0x1c5b8e['content']=_0x5c643c,_0x1c5b8e['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x3aba77=new _0x56a514(this['locale']);_0x3aba77['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x2beec2=new _0x56a514(this['locale']);return _0x2beec2['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x45ab59['set']({'label':_0x1c9f2f['label']+'\x20('+_0x4efb8c+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1,'isEnabled':_0x1c9f2f['isEnabled']}),_0x45ab59['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group',_0x15c72b['if']('isEnabled','ck-disabled',_0xae813b=>!_0xae813b)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x4057b7,_0x3aba77,_0x1c5b8e,_0x26c876,_0x2beec2],'on':{'mouseenter':_0x15c72b['to'](()=>{this['_isSearchFocused']()||_0x45ab59['focus']();}),'click':_0x15c72b['to'](()=>{_0x45ab59['fire']('execute');})}}),_0x45ab59['on']('execute',()=>{_0x45ab59['isEnabled']&&(_0x2ece5a['editing']['view']['focus'](),_0x2ece5a['commands']['execute']('aiQuickAction',_0x1c9f2f));}),_0x99525c['children']['add'](_0x45ab59),this['_actionButtons']['push']({'buttonView':_0x45ab59,'action':_0x1c9f2f}),{'listItem':_0x99525c,'highlightViews':[_0x4057b7,_0x26c876]};}{const _0x10e1cd=new Ht(),_0x2066bb=new Mt(this['locale'],_0x10e1cd),_0x2e6549=_0x2066bb['bindTemplate'],_0x188250=_0x1c9f2f['icon']??_0x1c9f2f['parent']?.['icon'],_0x183181=void 0x0!==_0x1c9f2f['icon'];return _0x2066bb['set']({'label':_0x1c9f2f['label'],'withText':!0x0,'role':'menuitem','icon':_0x183181?_0x188250??_0x10bb99:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button','isEnabled':_0x1c9f2f['isEnabled']}),_0x2066bb['extendTemplate']({'on':{'mouseenter':_0x2e6549['to'](()=>{this['_isSearchFocused']()||_0x2066bb['focus']();})}}),_0x2066bb['on']('execute',()=>{_0x2ece5a['editing']['view']['focus'](),_0x2ece5a['commands']['execute']('aiQuickAction',_0x1c9f2f);}),_0x99525c['children']['add'](_0x2066bb),this['_actionButtons']['push']({'buttonView':_0x2066bb,'action':_0x1c9f2f}),{'listItem':_0x99525c,'highlightViews':[_0x10e1cd]};}}_createSearchResultActionButton(_0x168907,_0x3023fa,_0x1bc1b3,_0x5073f2){return _0x1bc1b3&&_0x5073f2?this['_createSearchResultGroupedActionButton'](_0x168907,_0x3023fa,_0x1bc1b3,_0x5073f2):this['_createSearchResultIndividualActionButton'](_0x168907,_0x3023fa);}_createSearchResultGroupedActionButton(_0x26babf,_0xfa98f3,_0x2c78f3,_0x30c44d){const _0x2eb367=new jt(this['locale']),_0x226e4e=new Mt(this['locale']),_0x1b9b7b=_0x226e4e['bindTemplate'],{view:_0x51c4ee,highlightView:_0x81d1a}=this['_createSearchResultGroupRow'](_0x2c78f3,_0x30c44d),{view:_0x3ac22b,highlightView:_0x28608c}=this['_createSearchResultActionRow'](_0xfa98f3['label']),_0x1f4e0a=this['_createSearchResultContentView'](_0x51c4ee,_0x3ac22b);return _0x226e4e['set']({'label':_0xfa98f3['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':_0xfa98f3['isEnabled']}),_0x226e4e['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',_0x1b9b7b['if']('isEnabled','ck-disabled',_0x27a071=>!_0x27a071)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x1f4e0a],'on':{'mouseenter':_0x1b9b7b['to'](()=>{this['_isSearchFocused']()||_0x226e4e['focus']();}),'click':_0x1b9b7b['to'](()=>{this['_handleSearchResultButtonClick'](_0x226e4e);})}}),this['_setupActionButtonExecution'](_0x226e4e,_0x26babf,_0xfa98f3),_0x2eb367['children']['add'](_0x226e4e),this['_actionButtons']['push']({'buttonView':_0x226e4e,'action':_0xfa98f3}),{'listItem':_0x2eb367,'highlightViews':[_0x81d1a,_0x28608c]};}_createSearchResultIndividualActionButton(_0x59f3bf,_0x3de1cb){const _0x4e7773=new jt(this['locale']),_0x5f38c7=new Ht(),_0x745949=new Mt(this['locale'],_0x5f38c7),_0x577b4b=_0x745949['bindTemplate'];return _0x745949['set']({'label':_0x3de1cb['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button','isEnabled':_0x3de1cb['isEnabled']}),_0x745949['extendTemplate']({'on':{'mouseenter':_0x577b4b['to'](()=>{this['_isSearchFocused']()||_0x745949['focus']();})}}),this['_setupActionButtonExecution'](_0x745949,_0x59f3bf,_0x3de1cb),_0x4e7773['children']['add'](_0x745949),this['_actionButtons']['push']({'buttonView':_0x745949,'action':_0x3de1cb}),{'listItem':_0x4e7773,'highlightViews':[_0x5f38c7]};}_createSearchResultGroupRow(_0x420aa6,_0x30752a){const _0x2ff208=new _0x56a514(this['locale']),_0x5e97b3=new $t();_0x5e97b3['content']=_0x30752a,_0x5e97b3['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x5c583f=new Yt();return _0x5c583f['text']=_0x420aa6,_0x2ff208['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x5e97b3,_0x5c583f]}),{'view':_0x2ff208,'highlightView':_0x5c583f};}_createSearchResultActionRow(_0x5c9aaf){const _0x4c5d72=new _0x56a514(this['locale']),_0x1ad3d0=new Yt();return _0x1ad3d0['text']=_0x5c9aaf,_0x4c5d72['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x1ad3d0]}),{'view':_0x4c5d72,'highlightView':_0x1ad3d0};}_createSearchResultContentView(_0x146547,_0xb77c2a){const _0x55e9aa=new _0x56a514(this['locale']);return _0x55e9aa['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x146547,_0xb77c2a]}),_0x55e9aa;}_setupActionButtonExecution(_0xcb8c77,_0x3120e0,_0x4bd7fd){_0xcb8c77['on']('execute',()=>{_0xcb8c77['isEnabled']&&(_0x3120e0['editing']['view']['focus'](),_0x3120e0['commands']['execute']('aiQuickAction',_0x4bd7fd));});}_createActionGroupButton(_0x5ebcbf,_0xd93d7a,_0x2f6c3e){const _0x17d19a=new jt(this['locale']),_0x6bb792=new Ht(),_0x322530=new $a(this['locale'],_0x6bb792),_0x28024b=_0x322530['bindTemplate'],_0x77f89=this['_getPanelKeystroke'](_0x2f6c3e),_0x423678=this['_createGroupActionsList'](_0x5ebcbf,_0xd93d7a['actions'],_0x2f6c3e);_0x322530['set']({'label':_0xd93d7a['label'],'withText':!0x0,'role':Xa,'icon':_0xd93d7a['icon']??_0x10bb99,'isEnabled':_0xd93d7a['actions']['some'](_0x3dca56=>_0x3dca56['isEnabled'])}),_0x322530['extendTemplate']({'on':{'mouseenter':_0x28024b['to'](()=>{this['_isSearchFocused']()||_0x322530['focus']();})}});const _0x2fd790=new xt(this['locale']);return _0x2fd790['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x28024b['to'](_0x801451=>{this['_handlePanelKeydown'](_0x801451,_0x77f89,_0x322530,_0x2fd790);})}}),_0x322530['bind']('isOn')['to'](_0x2fd790,'isVisible'),this['_bodyCollection']['add'](_0x2fd790),_0x2fd790['content']['add'](_0x423678),this['_setupGroupMenuBehavior'](_0x322530,_0x2fd790),_0x17d19a['children']['add'](_0x322530),this['_actionButtons']['push']({'buttonView':_0x322530,'action':_0xd93d7a}),{'listItem':_0x17d19a,'highlightView':_0x6bb792};}_createGroupActionsList(_0x5bb7a9,_0x3754ed,_0x18c54a){const _0x4c7d9d=new Jt(this['locale']);return _0x4c7d9d['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x3754ed['forEach'](_0xbfca94=>{const _0x2ee0b4=new jt(this['locale']),_0x2ba851=Ya({'editor':_0x5bb7a9,'action':_0xbfca94,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused'](),'actionButtons':this['_actionButtons']})();_0x2ee0b4['children']['add'](_0x2ba851),_0x18c54a['focusTracker']['add'](_0x2ba851),_0x4c7d9d['items']['add'](_0x2ee0b4);}),_0x4c7d9d;}_setupGroupMenuBehavior(_0x15af98,_0x17829c){const _0x265ab2=_0x15af98['bindTemplate'],_0x41f2c7=this['_getButtonKeystroke'](_0x15af98);_0x15af98['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x265ab2['to'](()=>{this['_showNestedPanel'](_0x17829c,_0x15af98);}),'mouseleave':_0x265ab2['to'](_0x2e9c47=>{const _0x4995d1=_0x2e9c47['relatedTarget'];this['_isMovingToNestedMenu'](_0x4995d1,_0x17829c)||this['_hideNestedPanel'](_0x17829c);}),'keydown':_0x265ab2['to'](_0x15e2bc=>{_0x15e2bc['key']==_0x41f2c7&&(this['_showNestedPanel'](_0x17829c,_0x15af98),_0x17829c['content']['get'](0x0)['focus']());})}}),_0x17829c['on']('render',()=>{_0x17829c['element']?.['addEventListener']('mouseleave',_0x4984ad=>{const _0xda9685=_0x4984ad['relatedTarget'];_0x15af98['element']?.['contains'](_0xda9685)||this['_isMovingToNestedMenu'](_0xda9685,_0x17829c)||this['_hideNestedPanel'](_0x17829c);});});}_showNestedPanel(_0x3a1c2d,_0x13a8e3){this['_openNestedPanels']['forEach'](_0x159f28=>{_0x159f28!==_0x3a1c2d&&_0x159f28['isVisible']&&_0x159f28['hide']();}),_0x3a1c2d['show'](),_0x3a1c2d['pin']({'positions':[Bt['eastSouth']],'target':_0x13a8e3['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x3a1c2d);}_hideNestedPanel(_0xbb03c7){_0xbb03c7['hide'](),this['_openNestedPanels']['delete'](_0xbb03c7);}_hideAllNestedPanels(){this['_openNestedPanels']['forEach'](_0x572ada=>_0x572ada['hide']()),this['_openNestedPanels']['clear']();}_isMovingToNestedMenu(_0x4bb1a0,_0x415c0e){if(!_0x4bb1a0)return!0x1;if(_0x415c0e['element']?.['contains'](_0x4bb1a0))return!0x0;const _0x2f6ead=_0x4bb1a0;return _0x2f6ead['closest']&&(null!==_0x2f6ead['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x2f6ead['closest']('.ck-ai-quick-actions-group-list')||null!==_0x2f6ead['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(_0x415e42){return'rtl'===_0x415e42['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}_getButtonKeystroke(_0x4c915a){return'rtl'===_0x4c915a['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x6ebbf4,_0x33e031,_0x2a5c3d,_0x1f7d03){_0x6ebbf4['key']==_0x33e031&&(_0x2a5c3d['focus'](),this['_hideNestedPanel'](_0x1f7d03));}_handleSearchResultButtonClick(_0x493578){_0x493578['fire']('execute');}};function ja(_0x3579d3){const {editor:_0x3c4cf0,content:_0x176e84,buttonDefinition:_0x156b3e,bodyCollection:_0x220de3,hasSearch:_0xa673a5=!0x1,actionButtons:_0x56321a}=_0x3579d3;return()=>{const _0x4a6dbc=_0x3c4cf0['locale'],_0x3c6858=_0x3c4cf0['commands']['get']('aiQuickAction'),_0x11bfaf=_0x48403c(_0x4a6dbc);_0x11bfaf['bind']('isEnabled')['to'](_0x3c6858),_0x11bfaf['buttonView']['set']({'icon':_0x156b3e['icon']??_0x10bb99,'label':_0x156b3e['label'],'tooltip':!0x0}),_0x11bfaf['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x5d0968=new za(_0x3c4cf0,_0x176e84,_0x11bfaf,_0x220de3,_0xa673a5,_0x56321a);return _0x11bfaf['panelView']['children']['add'](_0x5d0968),_0xa673a5&&_0x11bfaf['on']('change:isOpen',(_0x49a005,_0x57e343,_0x95e8d8)=>{if(_0x95e8d8){if(_0x3c4cf0['plugins']['has']('AIEditing')){const _0x1630e0=_0x3c4cf0['plugins']['get'](tn),_0x228453=_0x3c4cf0['model']['document']['selection'],_0x3d7834=Array['from'](_0x228453['getRanges']());_0x3d7834['length']>0x0&&_0x1630e0['showFakeVisualSelection']({'editor':_0x3c4cf0,'ranges':_0x3d7834,'id':'quick-action','priority':0x14});}}else _0x3c4cf0['plugins']['has']('AIEditing')&&_0x3c4cf0['plugins']['get'](tn)['hideFakeVisualSelection']('quick-action'),_0x5d0968['resetSearch']();}),_0x11bfaf;};}const Ja='<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>',Za='<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>',th='<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>',eh=/* #__PURE__ -- @preserve */
37
+ ((()=>({'chat':'AIChat','action':'AIActions'}))());var ih=class AIQuickActionsUI extends _0x622916{_actionButtons=[];['_menuBarGroupViews']=[];_reporter;static get requires(){return[Lt,Is,Nn,fs];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_reporter']=this['editor']['plugins']['get'](Nn)['createReporter']('aiquickactions');const _0x4ea121=this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x4ea121),this['_initializeQuickActionsComponentsAndCommands'](),this['_initActionTypeQuickActions'](),this['_initChatTypeQuickActions']();}static getDefaultQuickActions(_0x3412d6){return function(_0x3120f5){const _0x38a275=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x3120f5['uiLanguage'])||'English';return[{'id':'ask-ai','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x3bbd8f},{'id':'chat-commands','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x3bbd8f,'actions':[{'id':'explain','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':Es(_0x3120f5,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ja['replace']('%0',_0x38a275),'type':'chat'},{'id':'summarize','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':Es(_0x3120f5,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Za['replace']('%0',_0x38a275),'type':'chat'},{'id':'highlight-key-points','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':Es(_0x3120f5,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':th['replace']('%0',_0x38a275),'type':'chat'}]},{'id':'improve-writing','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x448b65},{'id':'continue','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x123cf3},{'id':'fix-grammar','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x37ebe4},{'id':'adjust-length','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x55d620,'actions':[{'id':'make-shorter','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x173850,'actions':[{'id':'make-tone-casual','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x370c5b,'actions':[{'id':'translate-to-english','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':Es(_0x3120f5,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x400907,'actions':[]}];}(_0x3412d6);}_getDefaultAndCustomActions(){const _0x4a177a=AIQuickActionsUI['getDefaultQuickActions'](this['editor']['locale']),_0xc4d724=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x3ee4c4=>({..._0x3ee4c4,'type':'chat'===_0x3ee4c4['type']?'chat':'action','icon':void 0x0}));return _0x4a177a['find'](_0x3e7c54=>'other'===_0x3e7c54['id'])['actions']['push'](..._0xc4d724),_0x4a177a;}async _initActionTypeQuickActions(){try{const _0x51b7d4=this['editor']['plugins']['get'](fs),_0xaa284e=await _0x51b7d4['models']['getAllModels'](),_0x524d96=(await _0x51b7d4['models']['getDefault']())?.['id'];this['_assignDefaultModelToCustomActions'](_0x524d96),this['_enableButtonsByType']('action',_0x4cfde3=>!!_0xaa284e['find'](_0x5b9ef8=>_0x5b9ef8['id']===_0x4cfde3['model'])||void 0x0===_0x4cfde3['model']);}catch(_0x23e16d){const _0x14e380=new ct('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x23e16d});this['_reporter']['logError'](_0x14e380);}}_initChatTypeQuickActions(){if(!this['editor']['plugins']['has']('AIChatController'))return;const _0x44f888=this['editor']['plugins']['get']('AIChatController'),_0x428aa1=this['editor']['plugins']['has']('AIChatUI')?this['editor']['plugins']['get']('AIChatUI'):null;this['listenTo'](_0x44f888,'change:isConversationReady',(_0x34c892,_0x37385d,_0x50b109)=>{this['_enableButtonsByType']('chat',()=>_0x50b109&&!_0x428aa1?.['isBusy']);}),_0x428aa1&&this['listenTo'](_0x428aa1,'change:isBusy',(_0x56a3ba,_0x28551b,_0x55382a)=>{this['_enableButtonsByType']('chat',()=>_0x44f888['isConversationReady']&&!_0x55382a);}),this['_enableButtonsByType']('chat',()=>_0x44f888['isConversationReady']&&!_0x428aa1?.['isBusy']);}_enableButtonsByType(_0x2051f6,_0x5e368e){this['_quickActionsDefinition']['forEach'](_0x50b763=>{'actions'in _0x50b763?_0x50b763['actions']['forEach'](_0x5089da=>{_0x5089da['type']===_0x2051f6&&(_0x5089da['isEnabled']=_0x5e368e(_0x5089da));}):_0x50b763['type']===_0x2051f6&&(_0x50b763['isEnabled']=_0x5e368e(_0x50b763));}),this['_actionButtons']['forEach'](_0x363393=>{if(sh(_0x363393['action']))return;if(_0x363393['action']['type']!==_0x2051f6)return;const _0x56c10f=_0x5e368e(_0x363393['action']);if(_0x363393['action']['isEnabled']=_0x56c10f,_0x363393['buttonView']['isEnabled']=_0x56c10f,'action'===_0x2051f6&&!_0x56c10f&&_0x363393['action']['model']){const _0x1af1c9=new ct('ai-quick-actions-unavailable-model',this,{'actionId':_0x363393['action']['id'],'modelId':_0x363393['action']['model']});this['_reporter']['logError'](_0x1af1c9);}}),this['_actionButtons']['filter'](_0x2f14ce=>sh(_0x2f14ce['action']))['forEach'](_0x2fa562=>{_0x2fa562['buttonView']['isEnabled']=_0x2fa562['action']['actions']['some'](_0x5c1c45=>_0x5c1c45['isEnabled']);}),this['_menuBarGroupViews']['forEach'](({view:_0x415565,group:_0x1ab1fc})=>{_0x415565['isEnabled']=_0x1ab1fc['actions']['some'](_0x4e06ed=>_0x4e06ed['isEnabled']);});}_enableButtonById(_0x338d45,_0x2e97e8){this['_quickActionsDefinition']['forEach'](_0x27fe5c=>{'actions'in _0x27fe5c?_0x27fe5c['actions']['forEach'](_0x227786=>{_0x227786['id']===_0x338d45&&(_0x227786['isEnabled']=_0x2e97e8(_0x227786));}):_0x27fe5c['id']===_0x338d45&&(_0x27fe5c['isEnabled']=_0x2e97e8(_0x27fe5c));}),this['_actionButtons']['forEach'](_0xe8b6bb=>{if(sh(_0xe8b6bb['action']))return;if(_0xe8b6bb['action']['id']!==_0x338d45)return;const _0x232f78=_0x2e97e8(_0xe8b6bb['action']);_0xe8b6bb['action']['isEnabled']=_0x232f78,_0xe8b6bb['buttonView']['isEnabled']=_0x232f78;});}_assignDefaultModelToCustomActions(_0x6f6faa){this['_actionButtons']['forEach'](_0x4add1f=>{sh(_0x4add1f['action'])||'action'===_0x4add1f['action']['type']&&(_0x4add1f['action']['model']||(_0x4add1f['action']['model']=_0x6f6faa));});}_initializeQuickActionsComponentsAndCommands(){const _0x56655e=new Pt(this['editor']['locale']);_0x56655e['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x56655e),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x56655e);}_initializeQuickActionsDropdown(_0x85deb8){const _0x397962=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',ja({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x10bb99,'label':Es(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x85deb8,'hasSearch':_0x397962,'actionButtons':this['_actionButtons']}));}_prepareQuickActionsDefinition(_0x24925f){this['_quickActionsDefinition']=_0x24925f['map'](_0x5a5c87=>{if('actions'in _0x5a5c87){const _0x332b5f=_0x5a5c87;return{..._0x332b5f,'actions':_0x332b5f['actions']['map'](_0x3311aa=>{const {actions:_0x274718,..._0x51d49c}=_0x332b5f;return{..._0x3311aa,'isEnabled':!0x1,'parent':_0x51d49c};})['filter'](_0x15061f=>this['_shouldIncludeAction'](_0x15061f))};}return{..._0x5a5c87,'isEnabled':!0x1};})['filter'](_0x36170c=>'actions'in _0x36170c?_0x36170c['actions']['length']>0x0:this['_shouldIncludeAction'](_0x36170c));}_shouldIncludeAction(_0x45418e){const _0x2a217c=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](eh[_0x45418e['type']])&&!_0x2a217c['includes'](_0x45418e['id'])&&!('chat'===_0x45418e['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}_initializeQuickActionsComponents(_0x2f4a64){this['_quickActionsDefinition']['forEach'](_0x1e7500=>{if('actions'in _0x1e7500){const _0x47de0e=ja({'editor':this['editor'],'content':_0x1e7500['actions'],'buttonDefinition':_0x1e7500,'bodyCollection':_0x2f4a64,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x1e7500['id'],_0x47de0e),_0x1e7500['actions']['forEach'](_0x3d5b02=>{const _0x195944=Ya({'editor':this['editor'],'action':_0x3d5b02,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x3d5b02['id'],_0x195944);});}else{const _0x21fafb=Ya({'editor':this['editor'],'action':_0x1e7500,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x1e7500['id'],_0x21fafb);}});}_initializeQuickActionsMenuBar(){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x35e3e1=>{const _0x48303f=this['editor']['commands']['get']('aiQuickAction'),_0x5716ff=new _0x1021d4(_0x35e3e1),_0x1f010c=Es(_0x35e3e1,'AI_QUICK_ACTIONS_HEADING');_0x5716ff['buttonView']['set']({'label':_0x1f010c,'icon':_0x10bb99});const _0x512274=new _0x14eb7a(_0x35e3e1);return _0x512274['set']({'ariaLabel':_0x1f010c,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x2a3a2d=>{if('actions'in _0x2a3a2d){const _0x2962ee=_0x2a3a2d,_0x386eff=new te(_0x35e3e1,_0x5716ff),_0x171b3c=new _0x1021d4(_0x35e3e1),_0x1d5ced=new _0x14eb7a(_0x35e3e1);_0x171b3c['buttonView']['set']({'label':_0x2962ee['label'],'icon':_0x2962ee['icon']}),_0x2962ee['actions']['forEach'](_0xede260=>{const _0x40dcf1=new te(_0x35e3e1,_0x171b3c),_0x3b523f=new Zt(_0x35e3e1);_0x3b523f['set']({'label':_0xede260['label'],'icon':_0xede260['icon'],'role':'menuitem','isEnabled':_0xede260['isEnabled']}),_0x3b523f['on']('execute',()=>{this['_executeQuickAction'](_0xede260);}),this['_actionButtons']['push']({'buttonView':_0x3b523f,'action':_0xede260}),_0x3b523f['delegate']('execute')['to'](_0x171b3c),_0x40dcf1['children']['add'](_0x3b523f),_0x1d5ced['items']['add'](_0x40dcf1);}),_0x171b3c['isEnabled']=_0x2962ee['actions']['some'](_0x286eb2=>_0x286eb2['isEnabled']),this['_menuBarGroupViews']['push']({'view':_0x171b3c,'group':_0x2962ee}),_0x171b3c['panelView']['children']['add'](_0x1d5ced),_0x386eff['children']['add'](_0x171b3c),_0x512274['items']['add'](_0x386eff);}else{const _0x9d212c=_0x2a3a2d,_0x4ede87=new te(_0x35e3e1,_0x5716ff),_0x3d5977=new Zt(_0x35e3e1);_0x3d5977['set']({'label':_0x9d212c['label'],'icon':_0x9d212c['icon'],'role':'menuitem','isEnabled':_0x9d212c['isEnabled']}),this['_actionButtons']['push']({'buttonView':_0x3d5977,'action':_0x9d212c}),_0x3d5977['on']('execute',()=>{this['_executeQuickAction'](_0x9d212c);}),_0x3d5977['delegate']('execute')['to'](_0x5716ff),_0x4ede87['children']['add'](_0x3d5977),_0x512274['items']['add'](_0x4ede87);}}),Object['values'](eh)['some'](_0x5452fa=>this['editor']['plugins']['has'](_0x5452fa))?_0x5716ff['bind']('isEnabled')['to'](_0x48303f):_0x5716ff['set']({'isEnabled':!0x1}),_0x5716ff['panelView']['children']['add'](_0x512274),_0x5716ff;});}_executeQuickAction(_0x46e9e4){const _0x2f904c=this['editor'];_0x2f904c['editing']['view']['focus'](),_0x2f904c['commands']['execute']('aiQuickAction',_0x46e9e4);const _0x51f20f=_0x2f904c['ui']['view']['menuBarView'];_0x51f20f&&_0x51f20f['close']&&_0x51f20f['close']();}};function sh(_0x4b875b){return'actions'in _0x4b875b;}function nh(_0x20d778,_0x36902b){const _0x2b5a4a=_0x20d778['plugins']['get']('AITabs')['view'];_0x2b5a4a['isVisible']=!0x0,_0x2b5a4a['activateTab'](_0x36902b);}var rh=class extends _0x23b7b0{execute(_0x5997a8){switch(this['_expandSelectionIfCollapsed'](),_0x5997a8['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x3446c3=Es(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ct('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x3446c3});}this['_handleAIChatAction'](_0x5997a8);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x2d2fd6=Es(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ct('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2d2fd6});}this['_handleAIActionsAction'](_0x5997a8);}}async _handleAIChatAction(_0x14ac08){const _0x4f27ad=this['editor']['plugins']['get']('AIChatController');if(nh(this['editor'],'chat'),'ask-ai'===_0x14ac08['id'])_0x4f27ad['removeSelectionFromChatContext'](),_0x4f27ad['addSelectionToChatContext'](this['editor']),_0x4f27ad['focusPromptInput']();else await _0x4f27ad['startConversation']({'modelId':_0x14ac08['model'],'contexts':this['_resolveActionContexts'](_0x14ac08)}),_0x4f27ad['removeSelectionFromChatContext'](),_0x4f27ad['addSelectionToChatContext'](this['editor']),_0x4f27ad['focusPromptInput'](),await _0x4f27ad['sendMessage']({'message':_0x14ac08['prompt']||_0x14ac08['displayedPrompt']||_0x14ac08['label'],'attributes':{'quickActionData':{'id':_0x14ac08['id']},'displayedPrompt':_0x14ac08['displayedPrompt']}});}_expandSelectionIfCollapsed(){const _0x3a08ba=this['editor'],_0x5aff8c=_0x3a08ba['model']['document']['selection'];if(!_0x5aff8c['isCollapsed'])return;const _0x15ed9a=mt(_0x5aff8c['getSelectedBlocks']())||_0x3a08ba['model']['schema']['getLimitElement'](_0x5aff8c);_0x3a08ba['model']['change'](_0x4c759c=>{_0x4c759c['setSelection'](_0x15ed9a,'in');});}_handleAIActionsActionLabel(_0x16ad50){return _0x16ad50['parent']?.['label']&&'other'!==_0x16ad50['parent']?.['id']?_0x16ad50['parent']['label']+':\x20'+_0x16ad50['label']:_0x16ad50['label'];}async _handleAIActionsAction(_0x5ab438){const _0x553d30=this['editor']['plugins']['get']('AIActions'),_0x3c3ff3=this['_resolveActionContexts'](_0x5ab438);let _0x24bd25;_0x24bd25=_0x5ab438['prompt']?{'userMessage':_0x5ab438['prompt'],'model':_0x5ab438['model'],'contexts':_0x3c3ff3}:_0x5ab438['context']?{'model':_0x5ab438['model'],'contexts':_0x3c3ff3}:{'actionName':_0x5ab438['actionName']||_0x5ab438['id'],'args':_0x5ab438['args'],'contexts':_0x3c3ff3};const _0x84589f=this['_handleAIActionsActionLabel'](_0x5ab438);await _0x553d30['executeAction'](_0x24bd25,_0x84589f,_0x5ab438['icon']);}_resolveActionContexts(_0x517f49){const _0x2f6c5e=_0x517f49['parent']?.['id']?[_0x517f49['id'],_0x517f49['parent']['id']]:[_0x517f49['id']];return this['editor']['plugins']['get'](fs)['contextLibrary']['resolveContext']({'feature':'quickActions','ids':_0x2f6c5e,'extraContexts':_0x517f49['context']?[_0x517f49['context']]:[],'context':new Yn()})['refs'];}},oh=class extends _0x622916{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x5e72ff=this['editor'],_0xe57c98=new rh(this['editor']);if(_0x5e72ff['commands']['add']('aiQuickAction',_0xe57c98),_0x5e72ff['plugins']['has']('AIChat')){const _0x4c9777=this['editor']['plugins']['get']('AIChatController');_0x5e72ff['model']['document']['selection']['on']('change:range',(_0x4940e7,_0x32c933)=>{_0x32c933['directChange']&&_0x4c9777['removeSelectionFromChatContext']();});}}},ah=class extends Vn{appendContent(_0x55ac55,_0xba8aad='text'){'modification'===this['type']&&'text'===_0xba8aad&&(_0xba8aad=this['documentContextContent']['keys']()['next']()['value']),super['appendContent'](_0x55ac55,_0xba8aad);}updateChangeGroups(_0x4d6874){const _0x42c505=this['parsedContent']['get'](_0x4d6874)['cloneNode'](!0x0);if(this['parsedMergedContent']['set'](_0x4d6874,_0x42c505),this['changeGroups']=[],0x0==_0x42c505['childNodes']['length'])return;on(this['documentContextContent']['get'](_0x4d6874),this['parsedMergedContent']['get'](_0x4d6874));const _0x468541=_0x11f069(this['documentContextContent']['get'](_0x4d6874)['children']['map'](_0x2674e1=>({'node':_0x2674e1,'id':Ps(_0x2674e1,'data-id')})),_0x42c505['children']['map'](_0x48d21e=>({'node':_0x48d21e,'id':Ps(_0x48d21e,'data-id')||kt()})),{'comparator':(_0x52a1b8,_0x11c41c)=>_0x52a1b8['id']==_0x11c41c['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x468541['length']&&_0x468541[_0x468541['length']-0x1]['removed'];)_0x468541['pop']();}const _0x29d600=_0x468541['map'](_0x16f2cd=>{const _0x24db9b=_0x16f2cd['added']?'new':_0x16f2cd['removed']?'removed':'modified';return{'node':_0x16f2cd['value'][0x0]['node'],'type':_0x24db9b,'id':_0x16f2cd['value'][0x0]['id']};}),_0x5317f3=this['_documentIdToSource']['get'](_0x4d6874);this['changeGroups']['push']({'changes':_0x29d600,'state':'pending','index':this['changeGroups']['length'],'editor':_0x5317f3['editor'],'rootName':_0x5317f3['rootName'],'documentId':_0x4d6874});}_getDifferentChangeGroups(_0x4da7c2,_0x5ddb81){return _0x5ddb81;}},hh=class extends Fn{content;['version'];editor;rootName;actionName;['args'];['userMessage'];['model'];contexts;['hasError']=!0x1;stoppedExplicitly=!0x1;constructor(_0x3d2723){super(_0x3d2723),this['content']=_0x3d2723['content'],this['version']=_0x3d2723['version'],this['editor']=_0x3d2723['editor'],this['rootName']=_0x3d2723['rootName'],this['actionName']=_0x3d2723['actionName'],this['args']=_0x3d2723['args'],this['userMessage']=_0x3d2723['userMessage'],this['model']=_0x3d2723['model'],this['contexts']=_0x3d2723['contexts'],this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}sendRequest(){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args'],'contexts':this['contexts']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html','contexts':this['contexts']});}getDocumentContext(){return{'type':'document','documents':[{'id':this['id'],'content':this['content'],'version':this['version'],'rootName':this['rootName'],'sessionId':kt(),'channelId':this['editor']['config']['get']('collaboration.channelId'),'selectionSignature':''}],'label':'Current\x20document','uiId':'current-document'};}createReply(_0x39ef90){const _0x1bf7eb=this['editor']['config']['get']('collaboration.channelId'),_0x25a6a4=new ah({..._0x39ef90,'locale':this['locale'],'documentContextContent':[{'id':this['id'],'content':this['content'],'channelId':_0x1bf7eb,'rootName':this['rootName']}],'channelsToEditors':new Map([[_0x1bf7eb,this['editor']]])});return this['replies']['push'](_0x25a6a4),_0x25a6a4['delegate'](...Gn)['to'](this),this['fire']('replyCreated',_0x25a6a4),_0x25a6a4;}},ch=class extends _0x54b9b5{constructor(_0x5baacd,_0x5d48b9=!0x0,_0x1cebb1=!0x0){super(_0x5baacd),this['set']('isEnabled',!0x1),_0x5d48b9&&(this['applyButton']=this['_createButton'](Es(_0x5baacd,'AI_BALLOON_APPLY_BUTTON'),Ln),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x1cebb1&&(this['suggestButton']=this['_createButton'](Es(_0x5baacd,'AI_BALLOON_SUGGEST_BUTTON'),_0x5d48b9?Pn:Ln),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x5d48b9,'showSuggestButton':_0x1cebb1}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}setButtonsVisibility({showApplyButton:_0x31ceff,showSuggestButton:_0x319095}){this['applyButton']&&(this['applyButton']['isVisible']=_0x31ceff),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x319095);}_createButton(_0x398e6c,_0x2125e6){const _0xf1eac4=new Mt(this['locale']);return _0xf1eac4['set']({'label':_0x398e6c,'class':_0x2125e6,'isVisible':!0x0,'withText':!0x0}),_0xf1eac4;}},lh=class extends _0x56a514{constructor(_0x27c1b4){super(_0x27c1b4),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':Es(_0x27c1b4,'AI_DISCLAIMER_TEXT')}]}]});}},uh=class extends _0x56a514{constructor(_0x17ae46){super(_0x17ae46),this['set']('isVisible',!0x0);const _0x10ad56=new Dr('small');_0x10ad56['isVisible']=!0x0;const _0x190335=new _0x56a514(this['locale']);_0x190335['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[Es(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x4935a1=>!_0x4935a1)]},'children':[_0x10ad56,_0x190335]});}},dh=class extends Ma{['focusCycler'];['_config'];_contentWrapper;_streamableContentView;_toolbarView;['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];_keystrokes;_dialogContent;['_focusables'];['_scrollManager'];['_miniToolbarResizeObserver'];_navigationPreviousButton;_navigationNextButton;_navigationTryAgainButton;_navigationCounter;constructor(_0x29f4b4,_0x4809c5){super(_0x29f4b4),this['set']('isBusy',!0x1),this['set']('isTargetReadOnly',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x4809c5,this['_focusTracker']=new _t(),this['_keystrokes']=new gt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ft({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x93f04d(),this['_addContentWrapper'](_0x4809c5),this['_addDisclaimerView'](),this['_addToolbar'](_0x4809c5),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'](_0x4809c5);}),this['on']('render',()=>{this['_setupMiniToolbarPositioning']();});}['render'](){super['render']();for(const _0x25529b of this['_focusables'])this['_focusTracker']['add'](_0x25529b['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}destroy(){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy'](),this['_miniToolbarResizeObserver']&&this['_miniToolbarResizeObserver']['destroy']();}['focus'](_0x3e9ec1){-0x1===_0x3e9ec1?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}setIsLoading(_0x3b33b5){this['_isLoading']=_0x3b33b5;}setErrorState(){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}clearErrorState(){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x4a8538){super['showError'](_0x4a8538),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x3c7777){super['showBlockingError'](_0x3c7777),this['setErrorState']();}addMiniToolbarItem(_0x151333){this['_miniToolbarView']['items']['has'](_0x151333)||this['_miniToolbarView']['items']['add'](_0x151333);}removeMiniToolbarItem(_0x37d1fb){this['_miniToolbarView']['items']['has'](_0x37d1fb)&&this['_miniToolbarView']['items']['remove'](_0x37d1fb);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}_toggleToolbarButtonsVisibility({showApplyButton:_0x226a74,showSuggestButton:_0x162504}){_0x226a74=_0x226a74&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x162504=_0x162504&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x226a74,'showSuggestButton':_0x162504});}async updateContent(_0x245b25){await this['_streamableContentView']['update'](_0x245b25);}finalizeContent(){this['_streamableContentView']['cleanUpStreamingArtifacts']();}clearContent(){this['_streamableContentView']['clear']();}_addContentWrapper(_0x56e833){this['_contentWrapper']=new _0x56a514(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content',this['bindTemplate']['if']('_isErrorVisible','ck-hidden')]},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x56e833['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new lh(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x46b71f,showSuggestButton:_0x226e4f}){this['_toolbarView']=new ch(this['locale'],_0x46b71f,_0x226e4f),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',this,'isTargetReadOnly',(_0x514aeb,_0x58bbce,_0x5cc2ca,_0x145ce5)=>!(_0x514aeb||_0x58bbce||_0x5cc2ca||_0x145ce5)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x46b71f,'showSuggestButton':_0x226e4f}),this['_dialogContent']['add'](this['_toolbarView']);}_createMiniToolbar(_0x561f1b){return this['_miniToolbarView']=new Ba(this['locale'],_0x561f1b),this['_miniToolbarView']['delegate'](...ir)['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',(_0x34e9e8,_0x155a04)=>!(_0x34e9e8||_0x155a04)),this['_miniToolbarView'];}_createLoaderView(){return this['_loaderView']=new uh(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}_createStreamableContentView(){return this['_streamableContentView']=new mr(this['locale']),this['_streamableContentView'];}_setupMiniToolbarButtons(){const _0x5e5609=new Mt(this['locale']),_0x13fc22=new Mt(this['locale']),_0x3f8535=new _h(this['locale']),_0x332e1e=new Mt(this['locale']);_0x5e5609['set']({'icon':_0x184821,'label':Es(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+Dn}),_0x13fc22['set']({'icon':_0xd78e92,'tooltip':Es(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+Dn}),_0x332e1e['set']({'icon':_0x57e767,'tooltip':Es(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+Dn}),_0x5e5609['bind']('isEnabled')['to'](this,'isBusy',_0x5f1cd1=>!_0x5f1cd1),_0x5e5609['on']('execute',()=>{this['fire']('tryAgain');}),_0x13fc22['bind']('isEnabled')['to'](this,'isBusy',_0x5e4d03=>!_0x5e4d03),_0x13fc22['on']('execute',()=>{this['fire']('showPrevious');}),_0x332e1e['bind']('isEnabled')['to'](this,'isBusy',_0xa554e2=>!_0xa554e2),_0x332e1e['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x13fc22,this['_navigationCounter']=_0x3f8535,this['_navigationNextButton']=_0x332e1e,this['_navigationTryAgainButton']=_0x5e5609;}updateMiniToolbarButtons(_0x1a1ecc,_0x1f4a32){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x5ce479=_0x1a1ecc>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x5ce479){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x14f9ae=_0x1a1ecc-_0x1f4a32;this['_navigationCounter']['setInteractionCount'](_0x14f9ae+'/'+_0x1a1ecc),this['_navigationPreviousButton']['isEnabled']=_0x1f4a32<_0x1a1ecc-0x1,this['_navigationNextButton']['isEnabled']=_0x1f4a32>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(_0x31a424){this['_isLoading']=_0x31a424;}resetShowChangesButton(){this['_miniToolbarView']['isShowChangesOn']=!0x1;}_setupMiniToolbarPositioning(){const _0x2fa425=this['_streamableContentView']['element'],_0x495a6a=this['_miniToolbarView']['element'],_0x1dd73f=()=>{wt['window']['requestAnimationFrame'](()=>{const _0x4e9c24=_0x2fa425['offsetWidth']-_0x2fa425['clientWidth'];_0x495a6a['style']['right']='calc('+_0x4e9c24+'px\x20+\x20var(--ck-spacing-large))';});};_0x1dd73f(),this['_miniToolbarResizeObserver']=new pt(_0x2fa425,()=>{_0x1dd73f();});}_initializeScrollManager(){const _0x5ed185=this['_getScrollableElement']();_0x5ed185&&!this['_scrollManager']&&(this['_scrollManager']=new ao(_0x5ed185));}_getScrollableElement(){return this['_streamableContentView']['element'];}},_h=class extends _0x56a514{constructor(_0x4ea744){super(_0x4ea744);const _0x4ff7db=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x4ff7db['to']('interactionCount')}]});}setInteractionCount(_0x1cd175){this['set']('interactionCount',_0x1cd175);}},gh=class extends _0x622916{static get requires(){return[Is,Nn,Ut,tn,Va,_0x45dea0];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}_aiConnector;_interactions=[];_currentInteractionIndex=0x0;_interactionParams;['_balloonShowDiff']=!0x1;['_promiseQueue'];get _interaction(){return this['_interactions'][this['_interactions']['length']-0x1];}_actionsBalloonView;_reporter;constructor(_0x38f0b7){super(_0x38f0b7),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['_reporter']=this['editor']['plugins']['get'](Nn)['createReporter']('aiactions'),this['set']('isBusy',!0x1),this['_promiseQueue']=new Sr();}stopInteraction(){this['_stopInteraction']();}async executeAction(_0x3d0ea0,_0x15ce3c,_0x282296){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')&&this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x219dfc,anchorData:_0x1503f5,root:_0x57ea0c}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x3d0ea0,_0x219dfc,_0x1503f5,_0x57ea0c,_0x15ce3c,_0x282296);}const {modelFragment:_0x32168b,anchorData:_0x2dd88e,root:_0x3fe69d}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x3d0ea0,_0x32168b,_0x2dd88e,_0x3fe69d,_0x15ce3c,_0x282296);}async destroy(){return this['_stopInteraction'](),super['destroy']();}_createActionsBalloonView(){const _0x4372a4=this['editor']['plugins']['has']('TrackChanges');let _0x44fb79=this['editor']['config']['get']('ai.availableReplyActions')||[...Or];_0x4372a4||(_0x44fb79=_0x44fb79['filter'](_0x1ced20=>'insertSuggestion'!=_0x1ced20));const _0x537a99=this['editor']['commands']['get']('trackChanges'),_0x56e6ef=new dh(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x4372a4,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x44fb79});return _0x56e6ef['bind']('isBusy')['to'](this),_0x56e6ef['bind']('isTargetReadOnly')['to'](this['editor'],'isReadOnly'),_0x537a99&&_0x56e6ef['bind']('isTrackChangesOn')['to'](_0x537a99,'value'),_0x56e6ef['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x56e6ef['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x56e6ef['on']('showNext',()=>{this['_navigateToNext']();}),_0x56e6ef;}_normalizeSelectionStart(){const _0x3c6c1c=this['editor']['model'],_0x2cd6ee=_0x3c6c1c['document']['selection'],_0x331cc7=_0x2cd6ee['getFirstRange']();if(!_0x331cc7||_0x331cc7['isCollapsed'])return;const _0x36a804=mt(_0x2cd6ee['getSelectedBlocks']());if(!_0x36a804)return;const _0x5a83f7=_0x3c6c1c['createPositionAt'](_0x36a804,0x0);_0x5a83f7['isAfter'](_0x331cc7['start'])&&_0x3c6c1c['change'](_0x898da2=>{_0x898da2['setSelection'](_0x898da2['createRange'](_0x5a83f7,_0x331cc7['end']));});}_getExecuteDataRegular(){const _0x233489=this['editor']['model']['document']['selection'],_0x46637e=_0x233489['getFirstRange']()['start']['root'];if(_0x233489['isCollapsed']){const _0x2dd185=mt(_0x233489['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x233489);this['editor']['model']['change'](_0x2e5151=>{_0x2e5151['setSelection'](_0x2dd185,'in');});}this['_normalizeSelectionStart']();const _0x34f2c9=_0x233489['getFirstRange'](),_0x366101=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x233489),_0x34f2c9['start'],_0x34f2c9['end']);this['_copyMarkersToFragment'](_0x366101,_0x233489,{'isTableSelection':!0x1});const _0x2660c6=_0x233489['getFirstRange']()['start'],_0x169669=new Map();let _0x339b72=_0x366101;for(let _0x92ba67=0x0;_0x92ba67<_0x2660c6['path']['length'];_0x92ba67++)_0x169669['set'](_0x339b72,_0x2660c6['path'][_0x92ba67]),_0x339b72=_0x339b72['getChild'](0x0);return{'modelFragment':_0x366101,'anchorData':_0x169669,'root':_0x46637e};}_getExecuteDataInTable(){const _0x4c6d59=this['editor']['model']['document']['selection'],_0x2a8ff9=this['editor']['plugins']['get']('TableSelection'),_0x204bd0=_0x4c6d59['getFirstRange']()['start']['root'],_0x2a2827=_0x2a8ff9['getSelectionAsFragment'](),_0x2d37a1=_0x4c6d59['getFirstRange']()['start']['parent']['parent'],_0x14f430=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x2d37a1),this['editor']['model']['createPositionAfter'](_0x2d37a1)),_0x4ce7cb=this['_wrapWithCommonAncestors'](_0x2a2827,_0x14f430['start'],_0x14f430['end']);this['_copyMarkersToFragment'](_0x4ce7cb,_0x4c6d59,{'isTableSelection':!0x0});const _0x2a5271=_0x4c6d59['getFirstRange']()['start'],_0x3df788=new Map();let _0x5e0a88=_0x4ce7cb;for(let _0x298073=0x0;_0x298073<_0x2a5271['path']['length'];_0x298073++)if(_0x3df788['set'](_0x5e0a88,_0x2a5271['path'][_0x298073]),_0x298073<_0x2a5271['path']['length']-0x1)_0x5e0a88=_0x5e0a88['getChild'](0x0);else{let _0x35a89d=_0x5e0a88['nextSibling'];for(;_0x35a89d;)_0x3df788['set'](_0x35a89d,_0x2a5271['path'][_0x298073]),_0x35a89d=_0x35a89d['nextSibling'];}return{'modelFragment':_0x4ce7cb,'anchorData':_0x3df788,'root':_0x204bd0};}async _executeAction(_0x56058d,_0x185282,_0x5b5fd9,_0x4bfd87,_0x3da008,_0x187ca7){const _0x379ac2=this['editor']['plugins']['get'](tn),_0xbd967d=this['editor']['plugins']['get'](Va),_0x149c2f=this['editor']['model']['document']['selection'],_0x4a1f09=await _0x379ac2['modelToDataWithIds'](_0x185282,this['editor'],_0x4bfd87['rootName']),_0x291186=this['editor']['model']['document']['version'],_0x4176fe=[..._0x149c2f['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0xbd967d['open']({'targetEditor':this['editor'],'index':0x3e8*Math['random']()%0x3e8,'title':_0x3da008,'icon':_0x187ca7||_0x10bb99,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x4176fe,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xbd967d),this['_interactionParams']={'action':_0x56058d,'content':_0x4a1f09,'version':_0x291186,'aiBalloon':_0xbd967d,'modelFragment':_0x185282,'anchorData':_0x5b5fd9,'root':_0x4bfd87},this['_setupApplyListeners'](),this['listenTo'](_0xbd967d,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0xbd967d,'dialogClosed',(_0x67eab2,{id:_0x3c8fa3})=>{if('aiActionsBalloon'===_0x3c8fa3){for(const _0x482d8f of this['_interactions']){if(0x0===_0x482d8f['replies']['length']||_0x482d8f['stoppedExplicitly'])continue;const _0x3bf97c=_0x482d8f['replies'][_0x482d8f['replies']['length']-0x1],_0xa5bcf6=_0x3bf97c['changeGroups'][0x0];_0xa5bcf6&&'pending'===_0xa5bcf6['state']&&_0x3bf97c['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xbd967d);}}),this['_createInteraction'](_0x4a1f09,_0x291186,_0xbd967d,_0x56058d);}_setupApplyListeners(){if(!this['_interactionParams'])return;const {modelFragment:_0x541465,anchorData:_0x3cf601,root:_0x3b8c72}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x541465,_0x3cf601,_0x3b8c72,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x541465,_0x3cf601,_0x3b8c72,!0x0);});}_wrapWithCommonAncestors(_0x453833,_0x51eff8,_0x30fd03){const _0x56c380=this['editor']['model']['createRange'](_0x51eff8,_0x30fd03)['getCommonAncestor'](),_0x4cfd86=_0x56c380['is']('documentFragment')?[]:_0x56c380['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x4cfd86['length']){const _0x2b3bc1=_0x4cfd86['map'](_0x2ef266=>_0x2ef266['_clone'](!0x1));for(let _0x5d9e76=0x1;_0x5d9e76<_0x2b3bc1['length'];_0x5d9e76++)_0x2b3bc1[_0x5d9e76-0x1]['_appendChild'](_0x2b3bc1[_0x5d9e76]);return _0x2b3bc1[_0x2b3bc1['length']-0x1]['_appendChild'](_0x453833),new _0x28e306(_0x2b3bc1[0x0]);}return _0x453833;}_copyMarkersToFragment(_0x5f410c,_0x249db8,_0x619476={'isTableSelection':!0x1}){const _0x50f325=this['editor']['model'],_0x1a82c5=Array['from'](_0x249db8['getRanges']()),_0x2ad917=_0x249db8['getFirstRange']()['start'];for(const _0x56cb83 of _0x50f325['markers']){if(_0x56cb83['name']['startsWith']('ai-selection')||!_0x56cb83['affectsData'])continue;const _0x36b961=_0x56cb83['getRange']();if(!_0x1a82c5['some'](_0x447767=>_0x447767['containsRange'](_0x36b961,!0x0)))continue;const _0x8bc5f5=this['_regularCalculateMarkerPath'](_0x36b961['start'],_0x2ad917,_0x619476['isTableSelection']),_0x3befe6=this['_regularCalculateMarkerPath'](_0x36b961['end'],_0x2ad917,_0x619476['isTableSelection']),_0x1da471=_0x50f325['createPositionFromPath'](_0x5f410c,_0x8bc5f5),_0x1169ac=_0x50f325['createPositionFromPath'](_0x5f410c,_0x3befe6);if(!_0x1da471['isEqual'](_0x1169ac)){const _0x47189=_0x50f325['createRange'](_0x1da471,_0x1169ac);_0x5f410c['markers']['set'](_0x56cb83['name'],_0x47189);}}}_regularCalculateMarkerPath(_0xa6c6c5,_0x485b15,_0x1c2dce=!0x1){const _0x443676=[..._0xa6c6c5['path']['slice']()];for(let _0x54d2e2=0x0;_0x54d2e2<Math['max'](_0x485b15['path']['length'],_0xa6c6c5['path']['length']);_0x54d2e2++){const _0x3304b4=_0x485b15['path'][_0x54d2e2]||0x0,_0x522f5c=(_0xa6c6c5['path'][_0x54d2e2]||0x0)-_0x3304b4;if(_0x443676[_0x54d2e2]=_0x522f5c,0x0!==_0x522f5c&&!_0x1c2dce)break;}return _0x443676;}async _createInteraction(_0x2f0fda,_0x3d4302,_0x49fee9,_0x343cc3){const _0x52b1f1=this['editor'],_0x42abea=_0x52b1f1['model']['document']['selection']['getFirstRange']()['start']['root'];this['_interactionParams']||(this['_interactionParams']={'action':_0x343cc3,'content':_0x2f0fda,'version':_0x3d4302,'aiBalloon':_0x49fee9,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':_0x42abea});const _0x300a11=new hh({'connector':this['_aiConnector'],'locale':_0x52b1f1['locale'],'content':_0x2f0fda,'version':_0x3d4302,'editor':_0x52b1f1,'rootName':_0x42abea['rootName'],..._0x343cc3});this['_interactions']['push'](_0x300a11);const _0x230401=(_0x5bb23c,_0x37da5d=!0x1,_0x316c72='streaming')=>{const {isDone:_0x343209}=_0x5bb23c;return this['_promiseQueue']['enqueue'](async _0x1f34ef=>{try{if(this['_isUnsupportedInlineRootChange'](_0x5bb23c,_0x42abea))return this['_actionsBalloonView']['showBlockingError'](Es(_0x52b1f1['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')),void(_0x343209&&this['_actionsBalloonView']['finalizeContent']());const _0x492aac=ln({'changeGroups':_0x5bb23c['changeGroups'],'documentContextContent':_0x5bb23c['documentContextContent'],'showDiff':_0x37da5d,'trimUnchanged':!0x1});_0x492aac['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x492aac[0x0],'renderingStrategy':_0x316c72,'abortSignal':_0x1f34ef}),_0x343209&&this['_actionsBalloonView']['finalizeContent']();}catch(_0x4181b1){if(kn(_0x4181b1))return;throw _0x4181b1;}});};_0x300a11['on']('replyCreated',(_0x343200,_0x4886bf)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x230401(_0x4886bf)['catch'](_0x27ae4d=>{this['_reporter']['logError'](_0x27ae4d,{'context':{'operation':'reply-create'}}),this['_setErrorState'](_0x300a11,_0x27ae4d);});}),_0x300a11['on']('replyContentUpdated',(_0x1fb402,_0x372151)=>{_0x230401(_0x372151)['catch'](_0x410400=>{this['_reporter']['logError'](_0x410400,{'context':{'operation':'reply-update'}}),this['_setErrorState'](_0x300a11,_0x410400);});}),_0x300a11['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x5b7c47){this['_reporter']['logError'](_0x5b7c47,{'context':{'operation':'interaction-finish'}}),this['_setErrorState'](_0x300a11,_0x5b7c47);}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x1bb6d3,{showDiff:_0x342d1a})=>{try{this['_balloonShowDiff']=_0x342d1a;const _0x379a68=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x379a68&&await _0x230401(_0x379a68,_0x342d1a,'static');}catch(_0x8b874e){this['_reporter']['logError'](_0x8b874e,{'context':{'operation':'toggle-suggestion-display'}}),this['_setErrorState'](_0x300a11,_0x8b874e);}}),_0x300a11['on']('replyChangeGroupStateUpdated',()=>{const _0x653281={'positiveCount':_0x300a11['replies']['reduce']((_0xf681c2,_0x2c3641)=>_0xf681c2+_0x2c3641['changeGroups']['filter'](_0x498c37=>'accepted'===_0x498c37['state'])['length'],0x0),'totalCount':_0x300a11['replies']['reduce']((_0x2845f3,_0x26a966)=>_0x2845f3+_0x26a966['changeGroups']['length'],0x0)},_0x3c3606=_0x300a11['actionCallId'],_0x261969=_0x300a11['actionName'];_0x261969?this['_aiConnector']['upsertAIActionRating'](_0x261969,_0x3c3606,_0x653281):this['_aiConnector']['upsertCustomAIActionRating'](_0x3c3606,_0x653281);}),this['_setLoadingState']();try{const _0x3585b5=await _0x300a11['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x3585b5;}catch(_0x4f7d08){kn(_0x4f7d08)||this['_actionsBalloonView']['hideLoader'](),this['_reporter']['logError'](_0x4f7d08,{'context':{'operation':'create-interaction'}}),this['_setErrorState'](_0x300a11,_0x4f7d08);}}_isUnsupportedInlineRootChange(_0xf48f2e,_0x346a0b){const _0x47e0f8=this['editor'];return!!Gs(_0x47e0f8,_0x346a0b['rootName'])&&!Ys(_0x47e0f8,new _0x139fbf((_0xf48f2e['changeGroups'][0x0]?.['changes']??[])['filter'](_0x965914=>'removed'!==_0x965914['type'])['map'](_0x305736=>_0x305736['node']['cloneNode'](!0x0))));}['_applyChanges'](_0x5d74b1,_0x392ee1,_0x1643ba,_0x4185dd){const _0x50a17c=this['editor'];if(_0x4185dd&&!_0x50a17c['plugins']['has']('TrackChanges'))throw new ct('ai-no-track-changes',null);const _0x5f48e8=this['editor']['plugins']['get'](_0x45dea0),_0x11ed77=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x11ed77||!_0x11ed77['replies']['length'])return;const _0x13a8ca=_0x11ed77['replies'][_0x11ed77['replies']['length']-0x1];if(this['_isUnsupportedInlineRootChange'](_0x13a8ca,_0x1643ba))return void this['_actionsBalloonView']['showBlockingError'](Es(_0x50a17c['locale'],'AI_SUGGESTION_NO_PARTS_WARNING'));_0x13a8ca['setChangeGroupState'](0x0,'accepted');const _0x7dd903=Jn({'documentSuggestions':Zn({'groups':[_0x13a8ca['changeGroups'][0x0]],'documentContextContent':_0x13a8ca['documentContextContent'],'documents':_0x11ed77['getDocumentContext']()['documents']}),'transform':!0x1,'documentCompare':_0x5f48e8,'documentCompareOptions':{'anchor':_0x50a17c['model']['createPositionAt'](_0x5d74b1,0x0),'markDeletions':_0x4185dd}})['values']()['next']()['value']??[],_0x278a69=this['_filterOperationsOutsideRange'](_0x7dd903,_0x392ee1);for(const _0x5c6879 of _0x278a69)this['_anchorOperation'](_0x392ee1,_0x5c6879,_0x1643ba);const _0x344c42=_0x11ed77['getDocumentContext']()['documents'][0x0]['version'],_0x1aa9af=_0x5dec67(_0x278a69,_0x50a17c['model']['document']['history']['getOperations'](_0x344c42),{'document':_0x50a17c['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1})['operationsA'];mn(_0x1aa9af,'quickActions');try{_0x50a17c['model']['change'](_0xe5e99b=>{_0xe5e99b['setSelection'](_0x50a17c['model']['document']['selection']['focus']),_0x4185dd?_0x50a17c['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x1aa9af):_0x5f48e8['applyOperations'](_0xe5e99b,_0x1aa9af);});}catch(_0x2dec8c){throw this['_reporter']['logError'](new yn({'code':'ai-applying-suggestion-failed','type':'runtime','cause':_0x2dec8c})),_0x2dec8c;}this['editor']['plugins']['get']('AIBalloon')['close']();}_filterOperationsOutsideRange(_0x3e3b34,_0x213e47){return _0x3e3b34['filter'](_0x37dd6e=>{if('rename'==_0x37dd6e['type']){const _0x4c6a95=_0x37dd6e['position']['nodeAfter'];return!_0x213e47['has'](_0x4c6a95);}if(_0x37dd6e['type']['indexOf']('Attribute')>-0x1){const _0x5d48c6=_0x37dd6e['range']['start']['nodeAfter'];return!_0x213e47['has'](_0x5d48c6);}return!0x0;});}_anchorOperation(_0x1b2256,_0x22c22b,_0x234e05){const _0x153896=_0x22c22b['clone']();for(const _0x1671a0 in _0x22c22b){const _0x20c415=_0x22c22b[_0x1671a0];_0x20c415 instanceof _0x2827cc?_0x22c22b[_0x1671a0]=new _0x2827cc(_0x2bada3(_0x20c415['start']),_0x2bada3(_0x20c415['end'])):_0x20c415 instanceof _0x4febba&&(_0x22c22b[_0x1671a0]=_0x2bada3(_0x20c415));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x153896['type'])){if(_0x153896['isDocumentOperation']=!0x1,_0x153896['baseVersion']=null,'remove'==_0x153896['type']){const _0x194db2=_0x153896['sourcePosition'],_0xa0a6f1=_0x153896['howMany'];new _0x4f656c(_0x194db2,_0xa0a6f1)['_execute']();}else _0x153896['_execute']();}function _0x2bada3(_0x5557dd){if('$graveyard'==_0x5557dd['root']['rootName'])return _0x5557dd;const _0x12c476=[];let _0x163011=_0x5557dd['root'];for(let _0x471f8a=0x0;_0x471f8a<_0x5557dd['path']['length'];_0x471f8a++){const _0x17cd1f=_0x1b2256['get'](_0x163011)||0x0;_0x12c476[_0x471f8a]=_0x5557dd['path'][_0x471f8a]+_0x17cd1f,_0x163011=_0x163011['getChildAtOffset'](_0x5557dd['path'][_0x471f8a]);}return new _0x4febba(_0x234e05,_0x12c476,_0x5557dd['stickiness']);}}_refreshInteraction(){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x4bc6b3,content:_0xb777a6,version:_0x14100e,aiBalloon:_0x176404}=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'](_0xb777a6,_0x14100e,_0x176404,_0x4bc6b3)['catch'](_0x6855c2=>{this['_reporter']['logError'](_0x6855c2,{'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['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}_navigateToPrevious(){const _0x5c5353=this['_interactions']['length'];this['_currentInteractionIndex']<_0x5c5353-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}_navigateToNext(){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async _displayInteractionAtIndex(_0x4d101a){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x4d101a;const _0x111c43=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x111c43)return;if(_0x111c43['hasError'])return this['_setErrorState'](_0x111c43),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x111c43['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x29cf18=_0x111c43['replies'][_0x111c43['replies']['length']-0x1];if(_0x29cf18)try{const _0x4f7790=ln({'changeGroups':_0x29cf18['changeGroups'],'documentContextContent':_0x29cf18['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x12969f=>setTimeout(_0x12969f,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x4f7790[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0xfaaba3){this['_reporter']['logError'](_0xfaaba3,{'context':{'operation':'navigation-update'}});}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}_setLoadingState(){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async _setErrorState(_0x382408,_0x5369b2){if(void 0x0!==_0x5369b2&&kn(_0x5369b2))return;const _0x5ad12f=Es(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x5ad12f),_0x382408['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);}},Ah=class extends _0x622916{static get requires(){return[ih,oh,gh];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x51fd4e){super(_0x51fd4e),_0x51fd4e['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}},Ih=class extends _0x56a514{resultResponseView;acceptButtonView;dismissButtonView;infoButtonView;outdatedButtonView;constructor(_0x1e1332,_0x490eb9){super(_0x1e1332),this['id']=_0x490eb9,this['set']('status','pending'),this['set']('changeId',_0x490eb9),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',(_0x48a289,_0xb2df2c)=>{_0xb2df2c&&_0xb2df2c['target']&&'A'===_0xb2df2c['target']['tagName']&&_0xb2df2c['preventDefault'](),this['fire']('activateChange',{'id':_0x490eb9,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x490eb9,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x490eb9,'source':this});}),this['on']('change:showDiff',()=>this['_syncResponseVisibility']());}['render'](){super['render'](),this['_syncResponseVisibility']();}setItemAsActive(){this['isActive']=!0x0;}setItemAsInactive(){this['isActive']=!0x1;}_createResultResponseView(){const _0x540861=new _0x56a514(this['locale']);return _0x540861['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response']}}),_0x540861;}updateResponseContent(_0x631d8b,_0x527b34){const _0x55d626=_0x527b34||'div',_0x8b30f7=this['resultResponseView']['element'];if(_0x8b30f7['tagName']['toLowerCase']()!==_0x55d626){const _0x252077=new _0x24e6f7({'tag':_0x55d626,'attributes':{'class':_0x8b30f7['className']}})['render']();_0x8b30f7['replaceWith'](_0x252077),this['resultResponseView']['element']=_0x252077,this['_syncResponseVisibility']();}this['resultResponseView']['element']['innerHTML']=_0x631d8b;}_syncResponseVisibility(){this['resultResponseView']['element']?.['classList']['toggle']('ck-hidden',!this['showDiff']);}_createAcceptButtonView(){const _0x335fda=new Mt(this['locale']);return _0x335fda['set']({'label':Es(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x335fda['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1d38aa=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x1d38aa['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x155cae=>'pending'!==_0x155cae&&'accepted'!==_0x155cae),this['bindTemplate']['if']('status',Pn,_0x4f449b=>'pending'===_0x4f449b),this['bindTemplate']['if']('status',Dn,_0x47c749=>'pending'!==_0x47c749),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x2b85a3=>'accepted'===_0x2b85a3)]}}),this['on']('change:status',(_0x9c6e29,_0x3dfb5d,_0x4860a1)=>{_0x335fda['isEnabled']='pending'===_0x4860a1,'accepted'===_0x4860a1&&(_0x335fda['label']=Es(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x335fda['icon']=_0x48b061);}),_0x335fda;}_createDismissButtonView(){const _0x570a77=new Mt(this['locale']);return _0x570a77['set']({'label':Es(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x570a77['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x30fd5b=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x30fd5b['stopPropagation']();})},'attributes':{'class':[Dn,this['bindTemplate']['if']('status','ck-hidden',_0x4b18cd=>'pending'!==_0x4b18cd&&'rejected'!==_0x4b18cd),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x225e90=>'pending'===_0x225e90),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x3b0566=>'rejected'===_0x3b0566)]}}),this['on']('change:status',(_0xd7f7cd,_0x450b92,_0x219d6f)=>{_0x570a77['isEnabled']='pending'===_0x219d6f,'rejected'===_0x219d6f&&(_0x570a77['label']=Es(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x570a77['icon']=_0x572ba4);}),_0x570a77;}_createInfoButtonView(){const _0x1a4300=new Mt(this['locale']);return _0x1a4300['set']({'label':Es(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x41da4b,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':Dn+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x1a4300['bind']('isOn')['to'](this,'isInfoToggleOn',_0x5618bf=>_0x5618bf),_0x1a4300['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x1a4300;}_createOutdatedButtonView(){const _0x341d91=new Mt(this['locale']);return _0x341d91['set']({'label':Es(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x157ef8,'withText':!0x0,'isEnabled':!0x1}),_0x341d91['extendTemplate']({'attributes':{'class':[Dn,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x5e4550=>'outdated'!==_0x5e4550)],'disabled':'disabled'}}),_0x341d91;}},ph=class extends xt{resultItemView;_pinnedRectIndex=void 0x0;_pinnedTargetElement=void 0x0;_pinnedTargetChangeId=void 0x0;constructor(_0x217f22,_0xc43cb){super(_0x217f22),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']()),_0xc43cb['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}updateContent(_0x2415f8){this['resultItemView']['changeId']=_0x2415f8['id'],this['resultItemView']['updateResponseContent'](_0x2415f8['contentDiffed'],_0x2415f8['wrapperTag']);}['showBalloon'](_0x233e21,_0x18e4aa,_0x1cf4c5,_0x498074,_0xd92c7f,_0x2cff36){const _0x384420=_0x18e4aa();if(!_0x384420)return;this['updateContent'](_0x233e21),this['show']();const _0x47ba34=Array['from'](_0x384420['getClientRects']())['reverse'](),_0xba1a41=this['_getPointedRectIndexFromEvent'](_0x1cf4c5,_0x47ba34),_0xcdbf6e=_0x47ba34[_0xba1a41??0x0];'click'===_0x498074?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x18e4aa(),_0xba1a41,_0x233e21['id'],_0xd92c7f,_0x2cff36)||_0xcdbf6e})):'hover'===_0x498074&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x18e4aa(),_0xba1a41,_0x233e21['id'])||_0xcdbf6e}));}['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(){_0x44d1a9({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x4be4e2=[this['element']];return this['_pinnedTargetElement']&&_0x4be4e2['push'](this['_pinnedTargetElement']),_0x4be4e2;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}_createContentView(){const _0x3690bf=new _0x56a514();return this['resultItemView']=new Ih(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x3690bf['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']]}]}),_0x3690bf;}_getBestRectPositionOnClick(_0x3cdf61,_0x5a4468,_0x4e5657,_0x46c4ff,_0x11d6ff){if(!_0x3cdf61)return null;const _0x312d09=this['position']['replace']('arrow_',''),_0x398b2c=Array['from'](_0x3cdf61['getClientRects']());let _0x2ab069,_0x3b5143=_0x398b2c['reverse']();return void 0x0!==_0x5a4468&&this['_isPinnedRectVisible'](_0x3b5143[_0x5a4468],_0x46c4ff,_0x11d6ff)?(_0x2ab069=_0x3b5143[_0x5a4468],this['_pinnedRectIndex']=_0x5a4468):this['_isPinnedRectVisible'](_0x3b5143[0x0],_0x46c4ff,_0x11d6ff)&&void 0x0===_0x5a4468?_0x2ab069=_0x3b5143[0x0]:(_0x3b5143='s'==_0x312d09[0x0]?[..._0x398b2c]['reverse']():_0x398b2c,_0x3b5143['forEach'](_0x5b089e=>{this['_isPinnedRectVisible'](_0x5b089e,_0x46c4ff,_0x11d6ff)&&(_0x2ab069=_0x5b089e);})),this['_pinnedTargetChangeId']=_0x4e5657,this['_pinnedTargetElement']=_0x3cdf61,_0x2ab069||_0x3cdf61['getBoundingClientRect']();}_getBestRectPositionOnHover(_0x2a95ca,_0x6be707,_0x590645){if(!_0x2a95ca)return null;const _0x34cee5=Array['from'](_0x2a95ca['getClientRects']())['reverse']();return void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x6be707&&this['_pinnedTargetChangeId']!==_0x590645?(this['_pinnedRectIndex']=_0x6be707,this['_pinnedTargetElement']=_0x2a95ca,this['_pinnedTargetChangeId']=_0x590645,_0x34cee5[_0x6be707]):void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x590645?_0x2a95ca!==this['_pinnedTargetElement']?Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']]:_0x34cee5[this['_pinnedRectIndex']]:void 0x0!==_0x6be707&&this['_pinnedTargetChangeId']!==_0x590645?(this['_pinnedRectIndex']=_0x6be707,this['_pinnedTargetElement']=_0x2a95ca,this['_pinnedTargetChangeId']=_0x590645,_0x34cee5[_0x6be707]):_0x2a95ca['getBoundingClientRect']();}_getPointedRectIndexFromEvent(_0x3abf0c,_0x289dd7){if(_0x3abf0c)for(let _0x4bc3ab=0x0;_0x4bc3ab<_0x289dd7['length'];_0x4bc3ab++){const _0x2b0d7d=_0x289dd7[_0x4bc3ab];if(_0x3abf0c['clientX']>=_0x2b0d7d['left']-0x3&&_0x3abf0c['clientX']<=_0x2b0d7d['right']+0x3&&_0x3abf0c['clientY']>=_0x2b0d7d['top']-0x3&&_0x3abf0c['clientY']<=_0x2b0d7d['bottom']+0x3)return _0x4bc3ab;}}_isPinnedRectVisible(_0x125715,_0x3a5ea5,_0x109b57){const _0x3282c5=new It(_0x125715),_0x5a8005=_0x3a5ea5||document['documentElement'],_0x536282=_0x3282c5['getIntersection'](Tt(_0x109b57)),_0x3b89b8=new It(_0x5a8005)['getIntersection'](_0x3282c5);return!!(_0x536282&&_0x3b89b8&&_0x3282c5['width']>0x0);}};const Eh=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];var mh=class extends _0x898608{['_mainView'];_balloonSuggestionView;_bodyCollection;static get requires(){return[gs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2c9410){super(_0x2c9410),this['_bodyCollection']=Mn(this['context']['locale']),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...Eh)['to'](this),this['_balloonSuggestionView']=new ph(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}init(){const _0x5ebd8a=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x5ebd8a);}destroy(){this['_bodyCollection']['detachFromDom'](),super['destroy']();}setAvailableChecks(_0x1e9e44){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x22c4be=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x1e9e44,_0x22c4be);}this['_mainView']['showReviewCheckListView']();}showReviewCheckList(){this['fire']('getReviewCheckList');}showCheckRunResults(_0x40a946){_0x40a946&&('error-general'!==_0x40a946['status']?'error-chunk'!==_0x40a946['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}showCheckRunResult(_0x565705){this['_mainView']['addCheckRunResult'](_0x565705);}showGeneralResultsErrorView(){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0xd138cd){this['_mainView']['showGeneralReviewCoreErrorView'](_0xd138cd??Es(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}showUnsupportedInlineChangeView(){this['_mainView']['showUnsupportedInlineChangeView']();}setCheckResultTitle(_0x352996,_0x22159e){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x352996,_0x22159e);}setAcceptAllEnabled(_0x406c33){this['_mainView']['reviewCheckResultsView']['setAcceptAllEnabled'](_0x406c33);}setActiveStateInResults(_0x384004){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x55d8b5=>{_0x55d8b5['id']===_0x384004&&_0x55d8b5['setItemAsActive']();});}resetActiveStateInResults(){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x424e0c=>_0x424e0c['setItemAsInactive']());}updateChangeState(_0x1cdd7c,_0xa7e789){'accepted'===_0xa7e789||'rejected'===_0xa7e789||'outdated'===_0xa7e789?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x1cdd7c,_0xa7e789):this['_mainView']['reviewCheckResultsView']['showResult'](_0x1cdd7c,_0xa7e789);}showReviewCompletedView(){this['_mainView']['showReviewCompletedView']();}showActionsWhenResultIsReady(){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}hideActionsWhenResultIsReady(){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x26b31f,_0x2a1ea7,_0x2d21fb,_0x26d567,_0x2b19c0,_0x1a8a87){this['_balloonSuggestionView']['showBalloon'](_0x26b31f,_0x2a1ea7,_0x2d21fb,_0x26d567,_0x2b19c0,_0x1a8a87);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}getChangeElement(_0x220851){const _0x3aefc9=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x441fc1=>_0x441fc1['id']===_0x220851);return _0x3aefc9?_0x3aefc9['element']:null;}deactivateChange(){this['_balloonSuggestionView']['deactivateChange']();}},Th=class extends _0x56a514{constructor(_0x24e47f){super(_0x24e47f),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x33d84f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x33d84f['if']('isVisible','ck-hidden',_0x5cd6d1=>!_0x5cd6d1)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x33d84f['to']('errorMessage')}]}]});}},wh=class extends _0x56a514{['reviewCoreHeader'];['generalErrorView'];reviewCheckListView;reviewCheckResultsView;reviewCompletedView;constructor(_0x58628d,_0xd5e6c6){super(_0x58628d),this['reviewCoreHeader']=_0xd5e6c6['header'],this['generalErrorView']=new Th(_0x58628d),this['reviewCheckListView']=_0xd5e6c6['list'],this['reviewCheckListView']['delegate'](...Eh)['to'](this),this['reviewCheckResultsView']=_0xd5e6c6['results'],this['reviewCheckResultsView']['delegate'](...Eh)['to'](this),this['reviewCompletedView']=_0xd5e6c6['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(_0xb9f256){this['reviewCheckResultsView']['addResult'](_0xb9f256),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'](_0x58d038){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x58d038;}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']();}},Ch=class extends Mt{constructor(_0x164483,_0x2a542d){super(_0x2a542d),this['set']({'label':_0x164483,'withText':!0x0,'class':Ln}),this['on']('execute',()=>{this['fire']('finishReview');});}},fh=class extends jt{_resultViews;_resultsHeader;_resultsBody;['reviewDisclaimer'];_cancelButtonView;_acceptAllButtonView;_exitReviewButtonView;_toggleDiffButtonView;['_errorMessageView'];_finishReviewButtonView;_contents;constructor(_0x1bbce9,_0x2f8c50){super(_0x1bbce9),this['_contents']=_0x2f8c50,this['_resultViews']=new _0x93f04d(),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 da(_0x1bbce9),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),this['set']('isAcceptAllEnabled',!0x1),this['_acceptAllButtonView']['bind']('isEnabled')['to'](this,'isAcceptAllEnabled',this,'isError',(_0x13fc47,_0x240c7a)=>_0x13fc47&&!_0x240c7a);const _0x317085=this['_createCombinedSkeletonLoader'](),_0x564e6b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x564e6b['if']('isLoading','ck-ai_review__check-run_loading',_0x20e0ee=>_0x20e0ee),_0x564e6b['if']('isResultReady','ck-ai_review__check-run_ready',_0xb8be7e=>_0xb8be7e),_0x564e6b['if']('isVisible','ck-hidden',_0x8d6218=>!_0x8d6218)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x317085,this['reviewDisclaimer']]});}clearResults(){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}getResults(){return this['_resultViews'];}addResult(_0x2771c8){const _0x245473=new Ih(this['locale'],_0x2771c8['id']);_0x245473['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x245473),_0x245473['updateResponseContent'](_0x2771c8['contentDiffed'],_0x2771c8['wrapperTag']);}hideResult(_0x1a6425,_0x5e161c){if('pending'===_0x5e161c)return;const _0x260750=this['_resultViews']['find'](_0x28fddd=>_0x28fddd['id']===_0x1a6425);_0x260750&&(_0x260750['status']=_0x5e161c,_0x260750['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}showResult(_0x3bfe10,_0x190921){if('pending'!==_0x190921)return;const _0x318885=this['_resultViews']['find'](_0x2c07d3=>_0x2c07d3['id']===_0x3bfe10);_0x318885&&(_0x318885['status']=_0x190921,_0x318885['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}setTitle(_0x36630b,_0x2516c1){this['headerTitle']=_0x36630b,this['headerSubtitle']=_0x2516c1||'';}['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;}setAcceptAllEnabled(_0x12f736){this['isAcceptAllEnabled']=_0x12f736;}_createSkeletonLoader(){return new wr(this['locale'],Cr['aiReviewChecks']);}_createCombinedSkeletonLoader(){const _0x1d26a3=new _0x56a514(this['locale']),_0x1edeb7=[];for(let _0x4b3d03=0x0;_0x4b3d03<0x10;_0x4b3d03++){const _0x37ad21=this['_createSkeletonLoader']();_0x37ad21['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x1edeb7['push'](_0x37ad21);}return _0x1d26a3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x60dd1a=>!_0x60dd1a)]},'children':_0x1edeb7}),_0x1d26a3;}_createResultsBodyView(){const _0x4f57e8=new _0x56a514(this['locale']);return _0x4f57e8['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x3960e1=>_0x3960e1)]},'children':this['_resultViews']}),_0x4f57e8;}_createErrorView(){const _0x3bf517=new _0x56a514(this['locale']),_0x5c5299=new Mt(this['locale']),t=this['locale']['t'];return _0x3bf517['delegate']('retryReview')['to'](this),_0x5c5299['set']({'label':t('Try\x20again'),'withText':!0x0,'class':Pn+'\x20ck-ai_review__check-run-error-retry-button'}),_0x5c5299['on']('execute',()=>{this['fire']('retryReview');}),_0x3bf517['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x42826c=>!_0x42826c),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x38e492=>'chunk'===_0x38e492)]},'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',_0xe82d3b=>'chunk'===_0xe82d3b||'unsupported-inline'===_0xe82d3b)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x224b26=>'general'!==_0x224b26)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2f68cd=>'chunk'!==_0x2f68cd)]},'children':[{'text':Es(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x202ae3=>'unsupported-inline'!==_0x202ae3)]},'children':[{'text':Es(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')}]}]},_0x5c5299]}),_0x3bf517;}_createCancelButtonView(){const _0x4281d6=new Mt(this['locale']);return _0x4281d6['set']({'label':Es(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[Pn+'\x20ck-ai-button-stop-generating'],'icon':st}),_0x4281d6['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4760c4=>_0x4760c4),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x791c08=>_0x791c08)]}}),_0x4281d6['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x4281d6;}_createToggleDiffButtonView(){const _0x4d7349=new Mt(this['locale']);_0x4d7349['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x4d7349['bind']('isEnabled')['to'](this,'isError',_0x5993a7=>!_0x5993a7),_0x4d7349['extendTemplate']({'attributes':{'class':[Pn,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x1758df=>!_0x1758df),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5c127f=>_0x5c127f)]}});const _0x16c0f7=Es(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x4169c4=Es(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x4d7349['bind']('isOn')['to'](this,'isToggleDiffOn',_0x422f6c=>_0x422f6c),_0x4d7349['bind']('icon')['to'](this,'isToggleDiffOn',_0x277099=>_0x277099?_0x112882:_0x3bafdd),_0x4d7349['bind']('label')['to'](this,'isToggleDiffOn',_0x409b95=>_0x409b95?_0x16c0f7:_0x4169c4),_0x4d7349['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x4d7349;}_createAcceptAllButtonView(){const _0x2ac570=new Mt(this['locale']);return _0x2ac570['set']({'label':Es(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x2ac570['extendTemplate']({'attributes':{'class':[Ln,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x273fe5=>!_0x273fe5),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5f4c14=>_0x5f4c14)]}}),_0x2ac570['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x2ac570;}_createExitReviewButtonView(){const _0x41a673=new Mt(this['locale']);return _0x41a673['set']({'label':Es(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x41a673['extendTemplate']({'attributes':{'class':[Dn,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x326eaf=>!_0x326eaf),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5bd87c=>_0x5bd87c)]}}),_0x41a673['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x41a673;}_createResultHeaderView(){const _0x417ef5=new _0x56a514(this['locale']),_0x4de76f=this['_createTitleView']();return _0x417ef5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x5f16ef=>_0x5f16ef)]},'children':[_0x4de76f,{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5c3ec0=>!_0x5c3ec0)],'title':Es(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')},'children':[{'text':Es(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x417ef5;}_createTitleView(){const _0x9863ce=new _0x56a514(this['locale']),_0x5373d4=new Dr();return _0x5373d4['bind']('isVisible')['to'](this,'isResultReady',_0x266e11=>!_0x266e11),_0x9863ce['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1cf89e=>_0x1cf89e)]},'children':[_0x5373d4,{'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']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]}]}),_0x9863ce;}_createFinishReviewButtonView(){const _0x1eca77=new Ch(Es(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x1eca77['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1ea5d2=>!_0x1ea5d2)]}}),_0x1eca77['delegate']('finishReview')['to'](this),_0x1eca77;}},bh=class extends jt{_resultsHeader;_finishReviewButtonView;constructor(_0x1c6b7f,_0x40a390){super(_0x1c6b7f),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x40a390['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x40a390['headerText']);const _0x412ca1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x412ca1['if']('isVisible','ck-hidden',_0x10e766=>!_0x10e766)]},'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':_0x40a390['emptyResultsText']}]}]}]});}_createFinishReviewButtonView(_0x1b3075){const _0xf667e2=new Ch(_0x1b3075,this['locale']);return _0xf667e2['delegate']('finishReview')['to'](this),_0xf667e2;}_createResultHeaderView(_0x3302f4){const _0x3c2c3f=new _0x56a514(this['locale']);return _0x3c2c3f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title'],'title':_0x3302f4},'children':[{'text':_0x3302f4}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x3c2c3f;}},Sh=class extends _0x56a514{['_dropdownView'];_defaultValue;_defaultLabel;constructor(_0x4853ac,_0x71d70d){super(_0x4853ac),this['_defaultValue']=_0x71d70d['default']||(_0x71d70d['data']['length']>0x0?_0x71d70d['data'][0x0]['id']:''),this['_defaultLabel']=_0x71d70d['data']['find'](_0x26b4a1=>_0x26b4a1['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x48403c(this['locale']);const _0x49dfc1=this['_prepareListOptions'](_0x71d70d['data']);_0x40e721(this['_dropdownView'],_0x49dfc1,{'role':'menu','ariaLabel':_0x71d70d['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x13efc6=>{_0x13efc6['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x5dd753=>{this['formValue']=_0x5dd753['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x5dd753['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(_0x469510=[]){const _0x129787=new lt();this['resetToDefault']();for(const _0x532c8a of _0x469510){const _0x2772c6=new _0x28f92e({'label':_0x532c8a['label'],'withText':!0x0,'role':'menuitemradio','id':_0x532c8a['id'],'model':_0x532c8a});_0x2772c6['bind']('isOn')['to'](this,'formValue',_0x24db0f=>_0x24db0f===_0x2772c6['id']);const _0x24bab9={'type':'button','model':_0x2772c6};_0x129787['add'](_0x24bab9);}return _0x129787;}},Rh=class extends jt{_formItem=null;constructor(_0x4b34bd,_0x43d31d,_0xa02c31){if(super(_0x4b34bd),this['argsKey']=_0x43d31d?.['argsKey'],'dropdown'===_0x43d31d['formType'])this['_formItem']=new Sh(this['locale'],_0x43d31d);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x447b78=new Wt(this['locale'],{'children':[this['_formItem']],'class':[_0xa02c31?'ck-form__row_with-submit':'']});_0xa02c31&&_0x447b78['children']['add'](_0xa02c31),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x447b78]});}resetToDefault(){this['_formItem']['resetToDefault']();}},Oh=class AIReviewCorePromptInputView extends _0x324c99{keystrokes;static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0xa5e722){super(_0xa5e722),this['set']('isEmpty',!0x0),this['keystrokes']=new gt(),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']);}},vh=class extends _0x56a514{['focusTracker']=new _t();keystrokes=new gt();['focusCycler'];['_focusables']=new _0x93f04d();submitButtonView;cancelButtonView;promptInputView;actionsFooterView;_modelSelector;['_check'];constructor(_0x498718,_0xe45d19,_0x5e4f99=!0x1){super(_0x498718),this['_check']=_0xe45d19,this['set']('prompt',''),this['set']('modelId',''),this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new Qt(this['locale'],()=>new Oh(_0x498718)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelector']=new Io(_0x498718,{'panelPosition':'se','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',(_0x467697,_0x3b4c55)=>{this['modelId']=_0x3b4c55['id'],this['_modelSelector']['setSelectedModel'](_0x3b4c55);}),this['_setModelList'](_0x5e4f99),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new Wt(this['locale'],{'children':[this['promptInputView']]}),new Wt(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x111596,_0x318e89)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x318e89()):_0x318e89();}),this['focusCycler']=new Ft({'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'](_0x3451c2=>{this['_focusables']['add'](_0x3451c2),this['focusTracker']['add'](_0x3451c2['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 _0x19c2a2 of this['_getFormValidators']()){const _0xe7faae=_0x19c2a2();if(_0xe7faae)return this['promptInputView']['errorText']=_0xe7faae,!0x1;}return!0x0;}_getFormValidators(){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return Es(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}_createSubmitButtonView(){const _0x3727c9=new Mt(this['locale']),t=this['locale']['t'];return _0x3727c9['set']({'label':t('Submit'),'withText':!0x0,'class':Ln}),_0x3727c9['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x3727c9;}_createCancelButtonView(){const _0x8040ca=new Mt(this['locale']),t=this['locale']['t'];return _0x8040ca['set']({'label':t('Cancel'),'withText':!0x0,'class':Dn}),_0x8040ca['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x820065=>{_0x820065['stopPropagation']();})}}),_0x8040ca['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x8040ca;}_setModelList(_0x4b09dc){this['_modelSelector']['setModels'](this['_check']['models'],!_0x4b09dc),this['resetToDefault']();}_createActionsFooterView(){const _0x5a6980=new _0x56a514(this['locale']);return _0x5a6980['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']]}]}),_0x5a6980;}},kh=class extends jt{_formItemsCollection=new _0x93f04d();_customCheckView=null;['_hideModels']=!0x1;constructor(_0x20c85c,_0x37dc6d,_0x3111d0,_0x39dc46=!0x1){super(_0x20c85c),this['_hideModels']=_0x39dc46,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x37dc6d['isParameterized']);const _0x3f6c80=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',_0x18e0d6=>_0x18e0d6),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x439ec3=>_0x439ec3)],'style':{'--ck-ai-review-check-list-item-index':_0x3111d0}},'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':_0x37dc6d['title']}]},_0x3f6c80]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x37dc6d['description']?[{'text':_0x37dc6d['description']}]:[]}]}]},..._0x37dc6d['isParameterized']?[this['_createParameterizedView'](_0x37dc6d)]:[],...'custom'===_0x37dc6d['id']?[this['_createCustomView'](_0x37dc6d,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x37dc6d['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x37dc6d['id'],'args':_0x37dc6d['useArgs']?_0x37dc6d['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x44d1a9({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}resetToDefault(){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x2f902c=>{_0x2f902c['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}_createIconView(){const _0x9e129f=new $t();return _0x9e129f['content']=_0x2fee64,_0x9e129f['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x9e129f;}_createParameterizedView(_0x29cca5){const _0x56bc9b=new _0x56a514(),_0x4ed031=this['_createFormView'](_0x29cca5);return _0x56bc9b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x3eb7b0=>!_0x3eb7b0)]},'children':[_0x4ed031]}),_0x56bc9b;}_createFormView(_0x426214){const _0x1a530b=new _0x56a514(),_0x8dd717=Array['isArray'](_0x426214['options'])?_0x426214['options']:[],_0x2fa37e=new Mt(this['locale']),t=this['locale']['t'];_0x2fa37e['set']({'label':t('Submit'),'withText':!0x0,'class':Ln}),_0x2fa37e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4d3992=>{_0x4d3992['stopPropagation']();})}}),_0x2fa37e['on']('execute',()=>{const _0x2a5d63=[],_0x1d6919={};this['_formItemsCollection']['forEach'](_0x4c3e8c=>{_0x2a5d63['push'](_0x4c3e8c['value']),_0x426214['useArgs']&&_0x426214['options']&&(_0x1d6919[_0x4c3e8c['argsKey']]=_0x4c3e8c['value']);}),this['fire']('runReviewCheck',{'id':_0x426214['id'],'params':_0x2a5d63['length']?_0x2a5d63:void 0x0,'args':Object['keys'](_0x1d6919)['length']?_0x1d6919:void 0x0});});const _0xfdf8f1=_0x8dd717['length'];return _0x8dd717['forEach']((_0x26fdb5,_0x5b1539)=>{const _0x1e8466=_0x5b1539===_0xfdf8f1-0x1;this['_formItemsCollection']['add'](new Rh(this['locale'],_0x26fdb5,_0x1e8466?_0x2fa37e:null));}),_0x1a530b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x1a530b;}_createCustomView(_0x338f93,_0x4be595=!0x1){return this['_customCheckView']=new vh(this['locale'],_0x338f93,_0x4be595),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',_0x2e5ec7=>!_0x2e5ec7)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x12e5fc,_0x3d53e2,_0x2b9a95)=>{_0x2b9a95||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}},yh=class extends jt{['_checkViews'];constructor(_0x3119cf){super(_0x3119cf),this['_checkViews']=new _0x93f04d(),this['_setupTemplate']();}setChecks(_0x5764c5,_0xe115fc=!0x1){this['_checkViews']['clear']();for(const [_0xe91387,_0x48c34a]of _0x5764c5['entries']()){const _0x166078=new kh(this['locale'],_0x48c34a,_0xe91387,_0xe115fc);_0x166078['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x166078);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}resetAllParameterizedChecks(){for(const _0x1022af of this['_checkViews'])_0x1022af instanceof kh&&_0x1022af['resetToDefault']();}_setupTemplate(){const _0x56f363=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x56f363['if']('isVisible','ck-hidden',_0x288e6f=>!_0x288e6f)]},'children':this['_checkViews']});}},Nh=class extends mh{static get['pluginName'](){return'AIReviewModeUI';}createMainView(){const _0x2db8f6=this['context']['plugins']['get']('AITabs'),_0x182e8b=this['context']['locale'],_0x1facdf=new ua(_0x182e8b,{'label':Es(_0x182e8b,'AI_REVIEW_MODE'),'icon':_0x510915,'class':'ck-ai-header_review','showResizeButton':_0x2db8f6['showResizeButton']});return _0x1facdf['delegate']('resizeTabs')['to'](_0x2db8f6),_0x1facdf['bind']('isMaximized')['to'](_0x2db8f6['view'],'isMaximized',_0x33f97c=>_0x33f97c),new wh(this['context']['locale'],{'header':_0x1facdf,'list':new yh(_0x182e8b),'results':new fh(_0x182e8b,{'generalErrorText':Es(_0x182e8b,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new bh(_0x182e8b,{'headerText':Es(_0x182e8b,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':Es(_0x182e8b,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':Es(_0x182e8b,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}registerTab(){const _0x2fd9d5=this['context']['plugins']['get']('AITabs');_0x2fd9d5['view']['on']('activateTab',(_0x59ccb7,{newTab:_0x45d745,oldTab:_0x5ee703})=>{'reviewMode'===_0x45d745?this['fire']('getReviewCheckList'):'reviewMode'===_0x5ee703&&this['fire']('leaveReview');}),_0x2fd9d5['view']['addTab']({'id':'reviewMode','buttonLabel':Es(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x510915,'order':0x0,'content':this['_mainView']});}},xh=class extends Sn{_affectedBlocks=[];get affectedBlocks(){return this['_affectedBlocks']['slice']();}set affectedBlocks(_0x1904f6){this['_affectedBlocks']=_0x1904f6;}};const Lh='review-',Ph=['softBreak'],Dh=['htmlScript','htmlStyle','htmlCustomElement'];var Hh=class extends _0x898608{static get requires(){return[_0x45dea0,tn];}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();_inlineRootDataIds=new WeakMap();constructor(_0x295ffd){super(_0x295ffd),this['_domEmitter']=new(ut())(),this['_eventEmitter']=new(dt())();}get emitter(){return this['_eventEmitter'];}afterInit(){const _0x1e28c3=_0x5b6197=>this['_scheduleAttachReviewEditingToEditor'](_0x5b6197);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x24cd6f)return void _0x1e28c3(this['context']);const _0x36aa6c=this['context'];for(const _0x451029 of _0x36aa6c['editors'])_0x1e28c3(_0x451029);this['listenTo'](_0x36aa6c['editors'],'add',(_0x36e063,_0x1e94a0)=>{_0x1e28c3(_0x1e94a0);}),this['listenTo'](_0x36aa6c['editors'],'remove',(_0x26d1b6,_0x17bb7b)=>{for(const [_0x52a60b,_0x1a0716]of this['_markers'])_0x1a0716['editor']===_0x17bb7b&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x52a60b,'changeId':_0x1a0716['groupId']}),this['_markers']['delete'](_0x52a60b));});}_scheduleAttachReviewEditingToEditor(_0x1176b7){const _0x250851=()=>{'destroyed'!==_0x1176b7['state']&&_0x1176b7['conversion']&&this['_attachReviewEditingToEditor'](_0x1176b7);};if('ready'===_0x1176b7['state'])return void _0x250851();const _0x56b2fa=()=>{this['stopListening'](_0x1176b7,'ready',_0x56b2fa),_0x250851();};this['listenTo'](_0x1176b7,'ready',_0x56b2fa);}_attachReviewEditingToEditor(_0x3d468b){this['_reviewEditingAttachedEditors']['has'](_0x3d468b)||(_0x3d468b['conversion']['for']('editingDowncast')['markerToElement']({'model':Lh+'insert','view':(_0x5b5e54,{writer:_0x249de6})=>{const _0x18a721=this['_markers']['get'](_0x5b5e54['markerName']),_0xe4ee6e={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x18a721?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x5b5e54['markerName']};return _0x249de6['createUIElement']('span',_0xe4ee6e,function(_0x4a6d31){const _0x3c62ac=this['toDomElement'](_0x4a6d31);return _0x3c62ac['innerHTML']=_0x18a721?.['content']?.['asString']||'',_0x3c62ac;});}}),_0x3d468b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Lh+'remove-only','view':_0xea6103=>{const _0x56837b=this['_markers']['get'](_0xea6103['markerName']),_0x1542ac=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x56837b?.['id']||'')&&_0x1542ac['push']('ck-ai_review__change_active'),{'classes':_0x1542ac,'attributes':{'data-marker-id':_0xea6103['markerName']}};}}),_0x3d468b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Lh+'remove-context','view':_0x144cc7=>{const _0x41fe36=this['_markers']['get'](_0x144cc7['markerName']),_0xa19c2f=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x41fe36?.['id']||'')&&_0xa19c2f['push']('ck-ai_review__change_active'),{'classes':_0xa19c2f,'attributes':{'data-marker-id':_0x144cc7['markerName']}};}}),_0x3d468b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Lh+'remove-text','view':_0x3d39b9=>{const _0x58830e=this['_markers']['get'](_0x3d39b9['markerName']),_0x23dd86=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x58830e?.['id']||'')&&_0x23dd86['push']('ck-ai_review__change_active'),{'classes':_0x23dd86,'attributes':{'data-marker-id':_0x3d39b9['markerName']}};}}),_0x3d468b['conversion']['for']('dataDowncast')['markerToElement']({'model':Lh+'suggestion-context','view':(_0x1b64e1,{writer:_0x39a022})=>_0x39a022['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x1b64e1['isOpening']?'start':'end')})}),_0x3d468b['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x4fabc2,'view':_0x322962}),this['_updateMouseMarkerInteractionListeners'](_0x3d468b),this['listenTo'](_0x3d468b,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x3d468b),{'priority':'lowest'}),this['listenTo'](_0x3d468b,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x3d468b),{'priority':'lowest'}),_0x3d468b['model']['document']['registerPostFixer'](_0x4853a6=>this['_validateMarkers'](_0x3d468b,_0x4853a6)),_0x3d468b['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x3d468b)),this['_reviewEditingAttachedEditors']['add'](_0x3d468b));}_updateMouseMarkerInteractionListeners(_0x141573){let _0x5d14b5=this['_boundEditables']['get'](_0x141573);_0x5d14b5||(_0x5d14b5=new Map(),this['_boundEditables']['set'](_0x141573,_0x5d14b5));const _0x13da6f=new Set(_0x141573['ui']['getEditableElementsNames']());for(const _0x24bb7c of _0x13da6f){if(_0x5d14b5['has'](_0x24bb7c))continue;const _0xdcee18=_0x141573['ui']['getEditableElement'](_0x24bb7c);_0x5d14b5['set'](_0x24bb7c,_0xdcee18),this['_attachMouseMarkerInteractionListeners'](_0xdcee18);}for(const [_0x16f8fe,_0x3f8f95]of _0x5d14b5)_0x13da6f['has'](_0x16f8fe)||(_0x5d14b5['delete'](_0x16f8fe),this['_domEmitter']['stopListening'](_0x3f8f95));}_attachMouseMarkerInteractionListeners(_0x2dd0ac){this['_domEmitter']['listenTo'](_0x2dd0ac,'mouseup',(_0x117801,_0x23bcf3)=>{const _0x1d4b5c=_0x23bcf3['target'],_0x5db2ee=this['_findMarkerElement'](_0x1d4b5c);if(!_0x5db2ee)return;const _0xc055fd=_0x5db2ee['getAttribute']('data-marker-id'),_0xbfaab6=_0xc055fd['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0xc055fd,'changeId':_0xbfaab6,'markerElement':()=>this['_findMarkerElementById'](_0xc055fd),'domEvent':_0x23bcf3});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x2dd0ac,'mouseover',(_0x316f80,_0x598950)=>{const _0x2f5c01=_0x598950['target'],_0x20101f=_0x598950['relatedTarget'];let _0x1f7f82=this['_findMarkerElement'](_0x2f5c01);if(!_0x1f7f82&&_0x20101f&&(_0x1f7f82=this['_findMarkerElement'](_0x20101f)),!_0x1f7f82)return;const _0x3fbaa0=_0x1f7f82['getAttribute']('data-marker-id'),_0x4a957b=_0x3fbaa0['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x4a957b,'markerElement':()=>this['_findMarkerElementById'](_0x3fbaa0),'domEvent':_0x598950});});}_registerGlobalBalloonBlurHandler(){this['_domEmitter']['listenTo'](document,'mouseover',_0x5f51ae((_0x3f248a,_0x3402d4)=>{const _0x1244ab=_0x3402d4['target'];this['_findMarkerElement'](_0x1244ab)||_0x1244ab['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}getDocumentData(_0x414296){const _0x514e10=this['context']['plugins']['get']('AIEditing'),_0x2d1699=bs(this['context']);if(!_0x2d1699['length'])throw new ct('ai-get-editor-from-context-no-editor',this);const _0x25ca58=_0x414296?.['roots'];if(_0x25ca58&&0x0===_0x25ca58['length'])throw new ct('ai-reviewcoreediting-empty-roots',this);const _0x2be759=_0x25ca58?new Set(_0x25ca58['map'](_0x4f54c8=>_0x4f54c8['channelId']+'\x00'+_0x4f54c8['rootName'])):null,_0x1ed305=_0x2be759?new Set():null,_0x5b4a41=new Set(),_0xd52994=[],_0x4226d7=new Map(),_0x3bbc47=[];for(const _0x123d89 of _0x2d1699){const _0x176383=_0x123d89['config']['get']('collaboration.channelId');for(const _0x213a8b of _0x123d89['model']['document']['getRoots']()){const _0x39d0db=_0x176383+'\x00'+_0x213a8b['rootName'];if(_0x2be759&&!_0x2be759['has'](_0x39d0db))continue;const _0x396847=this['_buildDocumentDataSliceForRoot'](_0x123d89,_0x213a8b,_0x514e10,_0x5b4a41);_0xd52994['push'](_0x396847['content']);for(const [_0x45a066,_0x2a9cff]of _0x396847['elements'])_0x4226d7['set'](_0x45a066,_0x2a9cff);_0x3bbc47['push']({'channelId':_0x176383,'rootName':_0x213a8b['rootName']}),_0x1ed305?.['add'](_0x39d0db);}}if(_0x25ca58&&_0x1ed305['size']!==_0x2be759['size']){const _0x17e796=_0x25ca58['find'](_0xb53c1a=>!_0x1ed305['has'](_0xb53c1a['channelId']+'\x00'+_0xb53c1a['rootName']));throw new ct('ai-reviewcoreediting-root-not-found',this,{'channelId':_0x17e796['channelId'],'rootName':_0x17e796['rootName']});}return{'elements':_0x4226d7,'content':_0xd52994['join'](''),'roots':_0x3bbc47};}async['runCheck'](_0x49d059,_0x5e66c5){const _0x6f9778=new On(),_0x121ab2=_0x5e66c5?.['signal'];let _0x249edc;const _0x13ad4b=()=>{_0x6f9778['abort'](),_0x49d059['abort']();};if(_0x121ab2){if(_0x121ab2['aborted'])return _0x13ad4b(),_0x6f9778;_0x121ab2['addEventListener']('abort',_0x13ad4b),_0x249edc=()=>_0x121ab2['removeEventListener']('abort',_0x13ad4b);}const _0x5e84a0={'apiId':_0x49d059['sourceCheck']['apiId']};try{_0x49d059['on']('reviewCheckRunUpdated',(_0x9451aa,_0x22081a)=>{'aborted'===_0x22081a['status']?_0x6f9778['abort']():'error-general'!==_0x22081a['status']&&'error-chunk'!==_0x22081a['status']||(_0x6f9778['error']=bn(_0x22081a['error'],'ai-reviewcoreediting-check-run-failed',this,_0x5e84a0));}),'aborted'!==_0x6f9778['status']&&await _0x49d059['start']();}catch(_0x31ec41){_0x6f9778['error']=bn(_0x31ec41,'ai-reviewcoreediting-check-run-failed',this,_0x5e84a0);}finally{_0x249edc&&_0x249edc();}return'error'===_0x6f9778['status']||'aborted'===_0x6f9778['status']||(_0x6f9778['addResult'](...this['_buildPerRootResults'](_0x49d059)),_0x6f9778['status']='completed'),_0x6f9778;}buildErrorContext(_0x12e799){return{'apiId':_0x12e799['sourceCheck']['apiId']};}_buildPerRootResults(_0x14e9e5){const _0x3ee6ce=this['buildErrorContext'](_0x14e9e5),_0x4bbba0=this['context']['plugins']['get']('AIEditing'),_0x334b3c=this['context']['plugins']['get']('AIGateway'),_0x4bfc36=this['_groupElementsByRoot'](_0x14e9e5['documentData']['elements']),_0xff9701=new Map();for(const _0x239f2a of bs(this['context']))_0xff9701['set'](_0x239f2a['config']['get']('collaboration.channelId'),_0x239f2a);return _0x14e9e5['documentData']['roots']['map'](({channelId:_0xa4a52c,rootName:_0x3438e0})=>{const _0x3b10b5=_0xff9701['get'](_0xa4a52c),_0xd255f0=new xh({'editor':_0x3b10b5,'rootName':_0x3438e0,'channelId':_0xa4a52c,'sessionId':_0x4bbba0['getSessionId'](_0x3b10b5)}),_0xd3bbf9=_0x4bfc36['get'](_0xd255f0['editor'])?.['get'](_0xd255f0['rootName'])??[];_0xd255f0['contentRawOld']=_0xd3bbf9['map'](_0x2853c7=>_0x2853c7['getContent']())['join'](''),_0xd255f0['documentVersion']=_0xd3bbf9[0x0]?.['documentVersion']??0x1;const _0x2ab101=this['_collectResultAffectedBlocks'](_0xd255f0,_0x14e9e5['results'],_0x14e9e5['documentData']['elements']);_0xd255f0['affectedBlocks']=_0x2ab101;try{_0xd255f0['contentRawNew']=Os(_0x334b3c['mergeChangesIntoContent'](_0x2ab101,_0xd255f0['contentRawOld'],_0xd255f0['editor']));}catch(_0x59fed0){_0xd255f0['error']=bn(_0x59fed0,'ai-reviewcoreediting-check-run-failed',this,_0x3ee6ce);}return _0xd255f0;});}_collectResultAffectedBlocks(_0x5cd49a,_0x1ab86c,_0x4238ca){return _0x1ab86c['filter'](_0x175565=>{const _0x25eb30=_0x4238ca['get'](_0x175565['id']);return!!_0x25eb30&&_0x25eb30['editor']===_0x5cd49a['editor']&&_0x25eb30['rootName']===_0x5cd49a['rootName'];})['map'](_0x5baf72=>({'id':_0x5baf72['id'],'content':_0x5baf72['contentNew']}));}_groupElementsByRoot(_0xae9f93){const _0x323408=new Map();for(const _0x410f99 of _0xae9f93['values']()){let _0x23d53c=_0x323408['get'](_0x410f99['editor']);_0x23d53c||(_0x23d53c=new Map(),_0x323408['set'](_0x410f99['editor'],_0x23d53c));let _0x17ef5d=_0x23d53c['get'](_0x410f99['rootName']);_0x17ef5d||(_0x17ef5d=[],_0x23d53c['set'](_0x410f99['rootName'],_0x17ef5d)),_0x17ef5d['push'](_0x410f99);}return _0x323408;}_buildDocumentDataSliceForRoot(_0x558944,_0x1e8299,_0x46deb6,_0x2f7469){const _0x5f47d1=_0x558944['model'],_0x2fab6f=new _0x28e306();for(const _0xafbc4c of _0x1e8299['getChildren']())_0x2fab6f['_appendChild'](_0xafbc4c['_clone'](!0x0));for(const _0x17394c of _0x5f47d1['markers']){const _0x6236aa=_0x17394c['getRange']();_0x6236aa&&_0x6236aa['root']['rootName']===_0x1e8299['rootName']&&_0x2fab6f['markers']['set'](_0x17394c['name'],this['_changeRangeOwnerDocument'](_0x6236aa['clone'](),_0x2fab6f));}const _0x3d046f=new Map(),_0x53d088=_0x5f47d1['document']['version'];if(Gs(_0x558944,_0x1e8299['rootName'])){let _0x4acb8b=this['_inlineRootDataIds']['get'](_0x1e8299);_0x4acb8b?_0x2f7469['add'](_0x4acb8b):(_0x4acb8b=_0x46deb6['_nextDataId'](_0x2f7469),this['_inlineRootDataIds']['set'](_0x1e8299,_0x4acb8b));const _0x36b874=Fs(_0x558944['data']['processor']['toData'](_0x558944['data']['toView'](_0x2fab6f)),_0x4acb8b);return _0x3d046f['set'](_0x4acb8b,{'editor':_0x558944,'rootName':_0x1e8299['rootName'],'path':[],'documentVersion':_0x53d088,'getContent':()=>_0x36b874}),{'content':_0x36b874,'elements':_0x3d046f};}const _0x3d9ea1=new _0x28cad7({'ignoreElementEnd':!0x0,'startPosition':_0x5f47d1['createPositionAt'](_0x2fab6f,0x0)});for(const {item:_0x2ab3bf}of _0x3d9ea1){if(_0x2ab3bf['is']('element')&&_0x2ab3bf['name']&&Dh['includes'](_0x2ab3bf['name'])){const _0x562cb5=this['_upsertDataId'](_0x2ab3bf,()=>_0x46deb6['_nextDataId'](_0x2f7469));_0x2f7469['add'](_0x562cb5);}if(!_0x2ab3bf['is']('$textProxy'))continue;const _0x2c8cfd=_0x2ab3bf['parent'];if(!_0x2c8cfd||!_0x2c8cfd['is']('element'))continue;const _0x4d0064=this['_upsertDataId'](_0x2c8cfd,()=>_0x46deb6['_nextDataId'](_0x2f7469));_0x2f7469['add'](_0x4d0064);for(const _0x47a4a5 of _0x2c8cfd['getChildren']())_0x47a4a5['is']('element')&&(_0x47a4a5['name']&&Ph['includes'](_0x47a4a5['name'])||_0x2f7469['add'](this['_upsertDataId'](_0x47a4a5,()=>_0x46deb6['_nextDataId'](_0x2f7469))));let _0x42e545=_0x2c8cfd;for(;_0x42e545['parent']&&!_0x42e545['parent']['is']('documentFragment');)_0x42e545=_0x42e545['parent'],_0x42e545['hasAttribute'](_0x4fabc2)&&_0x42e545['_removeAttribute'](_0x4fabc2);_0x3d046f['set'](_0x4d0064,{'editor':_0x558944,'rootName':_0x1e8299['rootName'],'path':_0x2c8cfd['getPath'](),'documentVersion':_0x53d088,'getContent':this['_createGetContentUsingDataIdFn'](_0x42e545['_clone'](!0x0),_0x4d0064,_0x558944['data'])}),_0x3d9ea1['jumpTo'](_0x5f47d1['createPositionAfter'](_0x2c8cfd));}return{'content':_0x558944['data']['processor']['toData'](_0x558944['data']['toView'](_0x2fab6f)),'elements':_0x3d046f};}diffContent(_0x1d5d92,_0x3f4647,_0x37f8cf,_0x52b6c2=!0x1){const {contentInitial:_0x5442b1,contentNew:_0x310764}=this['_neutralizeChangesOnUnsupportedElements'](_0x3f4647,_0x37f8cf),_0x30806d=[],_0x3a98b3=_0x1d5d92['data']['parse'](_0x310764,'$documentFragment'),_0x135d85=_0x1d5d92['data']['parse'](_0x5442b1,'$documentFragment'),_0x54fcd2=_0x1d5d92['model']['createPositionAt'](_0x135d85,0x0);if(this['_haveSingleTopLevelElement'](_0x3a98b3)){if(!this['_hasSameTopLevelElement'](_0x135d85,_0x3a98b3))return _0x30806d;}else{const _0x5ab81d=_0x1d5d92['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x135d85,_0x5ab81d)||!this['_haveOnlyInlineContent'](_0x3a98b3,_0x5ab81d))return _0x30806d;}const _0x148106=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x5442b1,_0x310764,{'targetEditor':_0x1d5d92,'anchor':_0x54fcd2,'markDeletions':!0x0})['getOperations']()['filter'](_0x410acd=>'insert'===_0x410acd['type']||'marker'===_0x410acd['type']&&_0x410acd['name']['startsWith']('$markedRemove')),_0x3bea8b=this['_groupAdjacentOperations'](_0x148106),_0x39f03e=[];if(_0x52b6c2){if(_0x3bea8b['length']){const _0x4c15a9=_0x3bea8b[0x0]['operations'][0x0],_0xacea27='insert'===_0x4c15a9['type']?_0x4c15a9['position']:_0x4c15a9['newRange']['start'],_0x3ae813=this['_getPositionLimitingRange'](_0xacea27,_0x1d5d92,'inside'),_0x3238b2=_0x3ae813?_0x3a98b3['getChild'](0x0)['getChildren']():_0x3a98b3['getChildren'](),_0x1ffbbb=_0x3ae813||_0x1d5d92['model']['createRangeIn'](_0x135d85),_0x6414b2=[new _0x5bbb57('$markedRemove:synthetic'+kt(),null,_0x1ffbbb,_0x1d5d92['model']['document']['model']['markers'],!0x0,_0x1d5d92['model']['document']['version']+0x1),new _0x52fe51(_0x1ffbbb['end'],_0x3238b2,_0x1d5d92['model']['document']['version']+0x2)];_0x39f03e['push']({'operations':_0x6414b2,'operationsIsolated':_0x6414b2,'groupOffset':0x0});}}else _0x39f03e['push'](..._0x3bea8b);let _0x2a58f4=0x0;return _0x1d5d92['model']['change'](_0x54e7e1=>{for(let _0x3ebb29=0x0;_0x3ebb29<_0x39f03e['length'];_0x3ebb29++){const _0x2ff100=_0x39f03e[_0x3ebb29],_0xcf0337=_0x54e7e1['createDocumentFragment']();for(const _0x5e3530 of _0x135d85['getChildren']())_0x54e7e1['append'](_0x5e3530['_clone'](!0x0),_0xcf0337);for(const _0x4c067b of _0x2ff100['operationsIsolated'])if('insert'===_0x4c067b['type']){const _0x4e793c=_0x4c067b;_0x4e793c['baseVersion']=null,_0x4e793c['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x4e793c,_0xcf0337),_0x54e7e1['batch']['addOperation'](_0x4c067b),_0x1d5d92['model']['applyOperation'](_0x4c067b);const _0x559b66='suggestion:insertion:id:authorId:'+_0x2a58f4++,_0x13108a=_0x1d5d92['model']['createRange'](_0x4e793c['position'],_0x4e793c['position']['getShiftedBy'](_0x4e793c['howMany']));_0xcf0337['markers']['set'](_0x559b66,_0x13108a);}else{if('marker'===_0x4c067b['type']&&_0x4c067b['name']['startsWith']('$markedRemove')){const _0x11ba22=_0x4c067b,_0x317f81='suggestion:deletion:id:authorId:'+_0x2a58f4++;this['_changeOperationOwnerDocument'](_0x11ba22,_0xcf0337),_0xcf0337['markers']['set'](_0x317f81,_0x11ba22['newRange']);}}if(_0x52b6c2)_0x30806d['push']({..._0x2ff100,'context':this['_createGetContentFn'](_0x135d85,_0x1d5d92['data']),'content':this['_createGetContentFn'](_0x135d85,_0x1d5d92['data'])});else{const _0x1c7af1=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x2ff100['operationsIsolated'][0x0]),_0xcf0337),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x2ff100['operationsIsolated'][_0x2ff100['operationsIsolated']['length']-0x1]),_0xcf0337),_0x1d5d92);_0xcf0337['markers']['set'](Lh+'suggestion-context',new _0x2827cc(_0x1c7af1['start'],_0x1c7af1['end'])),_0x30806d['push']({..._0x2ff100,'context':this['_createGetContextFn'](_0xcf0337,_0x1d5d92['data'],{'ellipsisBefore':_0x1c7af1['hasContentBefore'],'ellipsisAfter':_0x1c7af1['hasContentAfter']}),'content':this['_createGetContentFn'](_0xcf0337,_0x1d5d92['data'])});}}}),_0x30806d;}markChangePositionInEditorContent(_0x5c8096,_0x183b06){if(!_0x5c8096['length'])return;const _0x27d38f=_0x5c8096[0x0]['parent']['id'],_0x1dcf00=_0x183b06['elements']['get'](_0x27d38f);if(!_0x1dcf00)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x27d38f);const _0x545a3f=_0x1dcf00['path'],_0x2f5c3=_0x1dcf00['editor'],_0x152bf6=_0x2f5c3['model']['document']['getRoot'](_0x1dcf00['rootName']);if(!_0x152bf6)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x1dcf00['rootName']);const _0x1cedd3=_0x2f5c3['model']['document']['history']['getOperations'](_0x1dcf00['documentVersion']),_0x1b5e1a=[];for(const _0x39df91 of _0x5c8096){const _0x4c04f5=_0x39df91['operationsIsolated']['map'](_0x4d3450=>this['_translateOperationToEditorContent'](_0x4d3450,_0x545a3f,_0x152bf6));if(!_0x4c04f5||!_0x4c04f5['length'])continue;const _0x1ea0f7=_0x4c04f5['every'](_0x29bfb6=>'marker'===_0x29bfb6['type']&&_0x29bfb6['name']['startsWith']('$markedRemove')),_0x855527=_0x5dec67(_0x4c04f5,_0x1cedd3,{'document':_0x2f5c3['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1})['operationsA'];for(const _0x3971d8 of _0x855527)if('insert'===_0x3971d8['type']){const _0xb02df=_0x3971d8,_0x5d1c1c=_0xb02df['nodes'];_0x2f5c3['model']['change'](_0x1db63c=>{const _0x3ece7a=_0x1db63c['createDocumentFragment']();for(const _0x11cd0e of _0x5d1c1c)_0x1db63c['append'](_0x11cd0e['_clone'](!0x0),_0x3ece7a);_0x1b5e1a['push']({'start':_0xb02df['position'],'end':_0xb02df['position'],'type':'insert','groupId':_0x39df91['id'],'content':{'asString':this['_createGetContentFn'](_0x3ece7a,_0x2f5c3['data'])(),'asFragment':_0x3ece7a}});});}else{if('marker'===_0x3971d8['type']&&_0x3971d8['name']['startsWith']('$markedRemove')){const _0x3ea4b8=_0x3971d8;let _0x58b3df='remove-text';if(_0x1ea0f7){const _0x10b2c4=this['_findAdjacentContextDistance'](_0x3ea4b8['newRange']['start'],'backward',_0x2f5c3['model']['schema']),_0xdfa102=this['_findAdjacentContextDistance'](_0x3ea4b8['newRange']['end'],'forward',_0x2f5c3['model']['schema']);if(_0x10b2c4||_0xdfa102){const _0x338368=_0x3ea4b8['newRange']['start']['getShiftedBy'](-_0x10b2c4),_0x1496e4=_0x3ea4b8['newRange']['end']['getShiftedBy'](_0xdfa102);_0x1b5e1a['push']({'start':_0x338368,'end':_0x1496e4,'groupId':_0x39df91['id'],'type':'remove-context'});}else _0x58b3df='remove-only';}_0x1b5e1a['push']({'start':_0x3ea4b8['newRange']['start'],'end':_0x3ea4b8['newRange']['end'],'groupId':_0x39df91['id'],'type':_0x58b3df});}}}this['_insertMarkers'](_0x1b5e1a,_0x2f5c3);}['clearAllMarkers'](){const _0x4bfd74=new Map();for(const _0x2edffc of this['_markers']['keys']()){const _0x16f5d8=this['_markers']['get'](_0x2edffc);_0x16f5d8?.['editor']&&(_0x4bfd74['has'](_0x16f5d8['editor'])||_0x4bfd74['set'](_0x16f5d8['editor'],[]),_0x4bfd74['get'](_0x16f5d8['editor'])['push'](_0x2edffc));}for(const [_0x23a71e,_0x9b9e18]of _0x4bfd74)_0x23a71e['model']['change'](_0x33f003=>{for(const _0x264643 of _0x9b9e18)_0x23a71e['model']['markers']['get'](_0x264643)&&_0x33f003['removeMarker'](_0x264643);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}switchToReadOnly(){for(const _0x42ff8d of this['getEditors']())_0x42ff8d['enableReadOnlyMode']('ai-review');}switchToEdit(){for(const _0x2895a5 of this['getEditors']())_0x2895a5['disableReadOnlyMode']('ai-review');}['applyChange'](_0xac6d78,_0x3f2e5a=null){const _0xe73413=_0xac6d78['map'](_0x429aed=>this['_getMarkersDataForGroup'](_0x429aed))['flat'](),_0x1cb81e=new Map();for(const _0x540230 of _0xe73413)_0x1cb81e['has'](_0x540230['editor'])||_0x1cb81e['set'](_0x540230['editor'],[]),_0x1cb81e['get'](_0x540230['editor'])['push'](_0x540230);for(const [_0x45c821,_0x2980b9]of _0x1cb81e){const _0x52eecd=_0x45c821['model'],_0x44b43e=_0x45c821['plugins']['has']('TrackChangesEditing')?_0x45c821['plugins']['get']('TrackChangesEditing'):null,_0x550835=_0x3f2e5a&&_0x44b43e?new Set(_0x44b43e['getSuggestions']()['map'](_0x1344fb=>_0x1344fb['id'])):null;_0x52eecd['change'](_0x20fbb7=>{const _0x1b309f=_0x20fbb7['batch']['operations']['length'];for(const _0x3d1226 of _0x2980b9){const _0x30ccb3=_0x45c821['model']['markers']['get'](_0x3d1226['id']);if(_0x30ccb3){if('insert'===_0x3d1226['type']){if(!_0x3d1226['content'])continue;_0x52eecd['insertContent'](_0x3d1226['content']['asFragment']||null,_0x30ccb3['getRange']()['start']);}else'remove-text'!==_0x3d1226['type']&&'remove-only'!==_0x3d1226['type']||_0x52eecd['deleteContent'](_0x52eecd['createSelection'](_0x30ccb3['getRange']()));_0x20fbb7['removeMarker'](_0x3d1226['id']),this['_markers']['delete'](_0x3d1226['id']);}}if(_0x3f2e5a&&(mn(_0x20fbb7['batch']['operations']['slice'](_0x1b309f),_0x3f2e5a),_0x44b43e)){for(const _0x362eba of _0x44b43e['getSuggestions']())_0x550835['has'](_0x362eba['id'])||_0x362eba['setAttribute']('@ai',{'type':_0x3f2e5a});}});}}rejectChange(_0x5dd2fc){const _0x8925b4=this['_getMarkersDataForGroup'](_0x5dd2fc),_0x3a9a4f=new Map();for(const _0x2712ca of _0x8925b4)_0x3a9a4f['has'](_0x2712ca['editor'])||_0x3a9a4f['set'](_0x2712ca['editor'],[]),_0x3a9a4f['get'](_0x2712ca['editor'])['push'](_0x2712ca);for(const [_0x675db8,_0x3f9013]of _0x3a9a4f)_0x675db8['model']['change'](_0xe83c65=>{for(const _0x155af4 of _0x3f9013)_0xe83c65['removeMarker'](_0x155af4['id']),this['_markers']['delete'](_0x155af4['id']);});}getEditor(){return Ss(this['context']);}getEditors(){return bs(this['context']);}getEditorForChange(_0x24008a){return this['_getMarkersDataForGroup'](_0x24008a)[0x0]?.['editor'];}getMarkerElementForChange(_0x2d3ede){const _0x2fbc17=Array['from'](this['_markers']['values']())['filter'](_0x321da3=>_0x321da3['groupId']===_0x2d3ede);if(!_0x2fbc17['length'])return null;const _0x3423de=0x1===_0x2fbc17['length']?_0x2fbc17[0x0]:this['_sortMarkers'](_0x2fbc17)[0x0],_0x15ef64=_0x3423de['editor']['model']['markers']['get'](_0x3423de['id']);return _0x15ef64?{'modelRange':_0x15ef64['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x3423de['id'])}:null;}getContentElementForChange(_0x5c3693){const _0x334e8c=Array['from'](this['_markers']['values']())['filter'](_0xf929f8=>_0xf929f8['groupId']===_0x5c3693);if(!_0x334e8c['length'])return null;const _0x49a961=0x1===_0x334e8c['length']?_0x334e8c[0x0]:this['_sortMarkers'](_0x334e8c)[0x0],_0x2e11da=_0x49a961['editor'],_0x7619c2=_0x2e11da['model']['markers']['get'](_0x49a961['id']);if(!_0x7619c2)return null;const _0x142d0d=_0x7619c2['getRange'](),_0x4c12f5=_0x2e11da['editing']['view']['getDomRoot'](_0x142d0d['root']['rootName'])||_0x2e11da['editing']['view']['getDomRoot']();if(!_0x4c12f5||!_0x142d0d)return null;let _0x18e834=_0x142d0d['start']['parent'];for(;_0x18e834['parent']&&!_0x18e834['parent']['is']('rootElement');)_0x18e834=_0x18e834['parent'];if(!_0x18e834||!_0x18e834['name'])return null;const _0x5119f0=_0x4c12f5['querySelector']('[data-marker-id=\x22'+_0x49a961['id']+'\x22]');if(!_0x5119f0)return null;if(_0x18e834['is']('rootElement'))return _0x5119f0;let _0x2cd1f6=null;_0x2e11da['model']['change'](_0x532ae9=>{_0x2cd1f6=_0x532ae9['createDocumentFragment'](),_0x532ae9['append'](_0x18e834['_clone'](!0x0),_0x2cd1f6);});const _0x533a54=_0x2e11da['data']['toView'](_0x2cd1f6)['getChild'](0x0);return _0x5119f0['closest'](_0x533a54['name']);}reactivateMarkers(_0x17de9e){const _0x5783d7=this['_getMarkersDataForGroup'](_0x17de9e);if(!_0x5783d7['length'])return;const _0x6d53d1=Array['from'](this['_activeMarkers'])['sort'](),_0x45cb8e=Array['from'](new Set(_0x5783d7['map'](_0x4172d7=>_0x4172d7['id'])))['sort']();_0x6d53d1['join']('|')!==_0x45cb8e['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x17de9e));}setMarkersInElementAsActive(_0x19727e){const _0xcfd7a2=this['_getMarkersDataForGroup'](_0x19727e);if(!_0xcfd7a2['length'])return;const _0x1dd802=_0xcfd7a2[0x0]['editor'],_0x14223e=new Set(_0xcfd7a2['map'](_0x2fb314=>_0x2fb314['id'])),_0x9ae0e8=Array['from'](_0x14223e['values']())['map'](_0x59e4b1=>_0x1dd802['model']['markers']['get'](_0x59e4b1))['filter'](_0x4c0fb0=>!!_0x4c0fb0);_0x14223e['forEach'](_0x522832=>{this['_activeMarkers']['add'](_0x522832);}),_0x1dd802['model']['change'](()=>{_0x9ae0e8['forEach'](_0x2af4a4=>{_0x1dd802['editing']['reconvertMarker'](_0x2af4a4);});});}setAllMarkersAsInactive(){const _0x432c99=Array['from'](this['_activeMarkers']);if(!_0x432c99['length'])return;this['_activeMarkers']['clear']();const _0x334dd8=new Map();for(const _0x2d3930 of _0x432c99){const _0x17a0bd=this['_markers']['get'](_0x2d3930);if(!_0x17a0bd)continue;const _0x42c05a=_0x17a0bd['editor'],_0x4f0280=_0x42c05a['model']['markers']['get'](_0x2d3930);_0x4f0280&&(_0x334dd8['has'](_0x42c05a)||_0x334dd8['set'](_0x42c05a,[]),_0x334dd8['get'](_0x42c05a)['push'](_0x4f0280));}for(const [_0x7e4fe2,_0xbc25f9]of _0x334dd8)_0x7e4fe2['model']['change'](()=>{_0xbc25f9['forEach'](_0x45060a=>{_0x7e4fe2['editing']['reconvertMarker'](_0x45060a);});});}_getPositionLimitingRange(_0x48408f,_0x5a4369,_0x5611bf='outside'){if(!_0x48408f)return null;let _0x13b71f=_0x48408f['parent'];for(;_0x13b71f&&_0x13b71f['parent']&&!_0x13b71f['parent']['is']('rootElement')&&!_0x5a4369['model']['schema']['isLimit'](_0x13b71f)&&!_0x5a4369['model']['schema']['isBlock'](_0x13b71f);)_0x13b71f=_0x13b71f['parent'];if(!_0x13b71f||!_0x13b71f['name']||_0x13b71f['is']('rootElement'))return null;let _0x49ea63=null;return _0x5a4369['model']['change'](_0x2c1057=>{_0x49ea63='inside'===_0x5611bf?_0x2c1057['createRangeIn'](_0x13b71f):_0x2c1057['createRangeOn'](_0x13b71f);}),_0x49ea63;}_validateMarkers(_0x3a91ed,_0x462231){const _0x1cd737=Array['from'](this['_markers']['keys']()),_0x2a2fa9=new Map();for(const _0x29d976 of _0x1cd737){const _0x3a4aa2=_0x3a91ed['model']['markers']['get'](_0x29d976);if(!_0x3a4aa2)continue;const _0x17d422=_0x3a4aa2['getStart']()['root']['rootName']+':'+_0x3a4aa2['getStart']()['path'][0x0];_0x2a2fa9['has'](_0x17d422)||_0x2a2fa9['set'](_0x17d422,[]),_0x2a2fa9['get'](_0x17d422)['push'](_0x3a4aa2);}const _0x456e91=new Set();for(const _0x23ebaa of _0x3a91ed['model']['document']['differ']['getChanges']()){let _0x13b199,_0x3416a7;if('insert'===_0x23ebaa['type'])_0x3416a7=new _0x2827cc(_0x23ebaa['position'],_0x23ebaa['position']['getShiftedBy'](_0x23ebaa['length'])),_0x13b199=_0x23ebaa['position']['root']['rootName']+':'+_0x23ebaa['position']['path'][0x0];else{if('remove'!==_0x23ebaa['type'])continue;_0x3416a7=new _0x2827cc(_0x23ebaa['position']),_0x13b199=_0x23ebaa['position']['root']['rootName']+':'+_0x23ebaa['position']['path'][0x0];}const _0x4f41f9=_0x2a2fa9['get'](_0x13b199)||[];if(_0x4f41f9['length']){for(const _0xe828c4 of _0x4f41f9)if(_0x3416a7['root']['rootName']===_0xe828c4['getRange']()['root']['rootName']&&('insert'!==_0x23ebaa['type']||!_0x3416a7['containsRange'](_0xe828c4['getRange']()))&&(_0x3416a7['isIntersecting'](_0xe828c4['getRange']())||_0x3416a7['start']['isTouching'](_0xe828c4['getRange']()['end'])||_0x3416a7['end']['isTouching'](_0xe828c4['getRange']()['start']))){const _0xa833c3=this['_parseMarkerName'](_0xe828c4['name']);Array['from'](this['_markers']['values']())['filter'](_0x5898ea=>_0x5898ea['groupId']===_0xa833c3['groupId'])['forEach'](_0x29a483=>_0x456e91['add'](_0x29a483['id']));}}}if(_0x456e91['size']){for(const _0x5de87d of _0x456e91)_0x462231['removeMarker'](_0x5de87d);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0xe50ce5){for(const {name:_0x21ce95,data:_0x291be5}of _0xe50ce5['model']['document']['differ']['getChangedMarkers']()){if(!_0x21ce95['startsWith'](Lh))continue;const _0x21dce2=_0x291be5['oldRange'],_0x1e869b=_0x291be5['newRange'],_0x516d64=_0x21dce2&&'$graveyard'===_0x21dce2['root']['rootName'],_0x4a9127=_0x1e869b&&'$graveyard'===_0x1e869b['root']['rootName'];if(_0x516d64&&_0x4a9127)continue;const _0xa32d81=this['_parseMarkerName'](_0x21ce95);this['_markers']['get'](_0x21ce95)&&(_0x4a9127||!_0x1e869b?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x21ce95,'changeId':_0xa32d81['groupId']}):_0x516d64&&_0x1e869b&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x21ce95,'changeId':_0xa32d81['groupId']}));}}['_parseMarkerName'](_0x11a6fb){const _0x527999=_0x11a6fb['split'](':'),_0x45c9a1=(_0x527999[0x1]||'')['split']('_');return{'prefix':_0x527999[0x0],'groupId':_0x45c9a1[0x0],'suffix':_0x45c9a1[0x1]};}_translateOperationToEditorContent(_0x2a9caa,_0x1bd43e,_0x4019a5){if('insert'===_0x2a9caa['type']){const _0x1bd7c8=_0x2a9caa;return new _0x52fe51(this['_changePosition'](_0x1bd43e['concat'](_0x1bd7c8['position']['offset']),_0x4019a5),_0x1bd7c8['nodes'],_0x1bd7c8['baseVersion']);}if('marker'===_0x2a9caa['type']&&_0x2a9caa['name']['startsWith']('$markedRemove')){const _0x1b76a9=_0x2a9caa;return new _0x5bbb57(_0x1b76a9['name'],_0x1b76a9['oldRange'],this['_changeRange'](_0x1b76a9['newRange'],_0x1bd43e['concat'](_0x1b76a9['newRange']['start']['offset']),_0x1bd43e['concat'](_0x1b76a9['newRange']['end']['offset']),_0x4019a5),_0x1b76a9['_markers'],_0x1b76a9['affectsData'],_0x1b76a9['baseVersion']);}return _0x2a9caa;}_groupAdjacentOperations(_0x268ffa){if(!_0x268ffa['length'])return[];const _0x4eb614=[];let _0x494c82=0x0,_0x53f24a=0x0,_0x6afa40=[];for(let _0x593df9=0x0;_0x593df9<=_0x268ffa['length'];_0x593df9++){const _0x2c9292=_0x268ffa[_0x593df9],_0x3e3a24=_0x268ffa[_0x593df9-0x1];!_0x2c9292||_0x3e3a24&&!this['_getOperationEnd'](_0x3e3a24)['isTouching'](this['_getOperationStart'](_0x2c9292))?(_0x4eb614['push']({'operations':_0x6afa40,'operationsIsolated':_0x6afa40['map'](_0x54a9fc=>this['_shiftOperation'](_0x54a9fc['clone'](),-_0x53f24a)),'groupOffset':_0x494c82}),_0x6afa40=_0x2c9292?[_0x2c9292]:[],_0x53f24a+=_0x494c82,_0x494c82=0x0):_0x6afa40['push'](_0x2c9292),_0x2c9292&&'insert'===_0x2c9292['type']&&(_0x494c82+=_0x2c9292['howMany']);}return _0x4eb614;}_findAdjacentContextDistance(_0x3127f5,_0x3940c4,_0x10a388,_0x499b5e=0x1){const _0x2e2cc6=new _0x28cad7({'startPosition':_0x3127f5,'direction':_0x3940c4});let _0x5466e4=0x0;for(let _0x38042c=0x0;_0x38042c<_0x499b5e;_0x38042c++){let _0x4fbdd3=0x0,_0x4be4e0=!0x1,_0x52de4d='forward'===_0x3940c4?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x41e1bb}of _0x2e2cc6)if(_0x41e1bb['is']('$textProxy')){const _0xcf11bb=_0x52de4d['exec'](_0x41e1bb['data']);if(_0xcf11bb&&_0xcf11bb['length']){if(_0x4fbdd3+='forward'===_0x3940c4?_0xcf11bb['index']+_0xcf11bb[0x0]['length']:_0x41e1bb['data']['length']-_0xcf11bb['index'],_0xcf11bb[0x0]['length']!==_0x41e1bb['data']['length'])break;_0x4be4e0=!0x0,_0x52de4d='forward'===_0x3940c4?/^\w+/:/\w+$/;}else{if(_0x4be4e0)break;_0x4fbdd3+=_0x41e1bb['offsetSize'];}}else{if(_0x41e1bb['is']('element')){_0x10a388['isInline'](_0x41e1bb)&&!_0x4be4e0&&(_0x4fbdd3+=0x1);break;}}_0x5466e4+=_0x4fbdd3,_0x2e2cc6['jumpTo'](_0x3127f5['getShiftedBy']('forward'===_0x3940c4?_0x5466e4:-_0x5466e4));}return _0x5466e4;}_getChangeContext(_0x31bbdb,_0x220132,_0x1b0544){const _0x3815a5=_0x1b0544['model']['schema'],_0x575f88=this['_findAdjacentContextDistance'](_0x31bbdb,'backward',_0x3815a5,0x6),_0x4b1bbf=this['_findAdjacentContextDistance'](_0x220132,'forward',_0x3815a5,0x6),_0x361e74=_0x31bbdb['getShiftedBy'](-_0x575f88),_0x1067e9=_0x220132['getShiftedBy'](_0x4b1bbf);return{'start':_0x361e74,'end':_0x1067e9,'hasContentBefore':!_0x361e74['isAtStart'],'hasContentAfter':!_0x1067e9['isAtEnd']};}_insertMarkers(_0x34f630,_0x3afcd0){const _0x42deb0=this['context']['plugins']['get']('AIEditing'),_0x2f5821=new Set();_0x3afcd0['model']['change'](_0x30f92f=>{for(const _0x12e633 of _0x34f630){const _0x1ed4fe=''+Lh+_0x12e633['type']+':'+_0x12e633['groupId']+'_'+_0x42deb0['_nextDataId'](_0x2f5821);this['_markers']['set'](_0x1ed4fe,{'id':_0x1ed4fe,'groupId':_0x12e633['groupId'],'type':_0x12e633['type'],'content':_0x12e633['content'],'editor':_0x3afcd0}),_0x30f92f['addMarker'](_0x1ed4fe,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x30f92f['createRange'](_0x12e633['start'],_0x12e633['end'])});}});}_createGetContextFn(_0x23b288,_0x45634e,_0x174d0e){let _0x75dc01='';return()=>{if(!_0x75dc01){const _0x129ac8=_0x45634e['toView'](_0x23b288,{'showSuggestionHighlights':!0x0});let _0x4ef6a2=_0x129ac8['getChild'](0x0);if(_0x4ef6a2['is']('containerElement')||(_0x4ef6a2=_0x129ac8),!_0x4ef6a2)return'';let _0xfd1421=!0x1;const _0x447cef=[];for(const _0x22eed6 of _0x4ef6a2['getChildren']())_0x22eed6['is']('element','span')&&_0x22eed6['hasClass']('ck-ai_review-marker_context-end')&&(_0xfd1421=!0x1),_0xfd1421&&_0x447cef['push'](_0x22eed6),_0x22eed6['is']('element','span')&&_0x22eed6['hasClass']('ck-ai_review-marker_context-start')&&(_0xfd1421=!0x0);_0x4ef6a2['_removeChildren'](0x0,_0x4ef6a2['childCount']),_0x174d0e?.['ellipsisBefore']&&_0x4ef6a2['_appendChild']('…'),_0x4ef6a2['_appendChild'](_0x447cef),_0x174d0e?.['ellipsisAfter']&&_0x4ef6a2['_appendChild']('…');const _0x59c90a=_0x45634e['htmlProcessor']['domConverter']['viewToDom'](_0x129ac8),_0x557112=_0x45634e['htmlProcessor']['htmlWriter']['getHtml'](_0x59c90a);_0x75dc01=this['_removeUnsupportedElements'](_0x557112);}return _0x75dc01;};}_createGetContentFn(_0x1db6c5,_0x4e59ad){let _0x398498='';return()=>(_0x398498||(_0x398498=this['_removeUnsupportedElements'](_0x4e59ad['stringify'](_0x1db6c5,{'showSuggestionHighlights':!0x0}))),_0x398498);}_createGetContentUsingDataIdFn(_0x5e5f3b,_0x24300a,_0x273242){let _0x4e36a9='';return()=>{if(!_0x4e36a9){const _0x259759=_0x273242['toView'](new _0x28e306(_0x5e5f3b));_0x4e36a9=_0x273242['htmlProcessor']['domConverter']['viewToDom'](_0x259759)['querySelector']('[data-id=\x22'+_0x24300a+'\x22]')?.['outerHTML']||'';}return _0x4e36a9;};}_removeUnsupportedElements(_0x33ea51){if(!_0x33ea51)return'';const _0x263889=Rs(_0x33ea51,{'decodeEntities':!0x1}),_0x2aba53=ys(_0x263889);if(!_0x2aba53['length'])return _0x33ea51;for(const _0x22d881 of _0x2aba53)_0x47cc1f(_0x22d881);return Os(_0x263889,{'encodeEntities':!0x1});}_neutralizeChangesOnUnsupportedElements(_0x3ed590,_0x14e9e1){const _0xe86d9f=Rs(_0x3ed590,{'decodeEntities':!0x1}),_0x19d233=Rs(_0x14e9e1,{'decodeEntities':!0x1}),_0x38e518=ys(_0xe86d9f),_0x4209a9=ys(_0x19d233);if(!_0x38e518['length']&&!_0x4209a9['length'])return{'contentInitial':_0x3ed590,'contentNew':_0x14e9e1};const _0x382bb2=new Map(),_0x11b084=new Map();for(const _0x2bb952 of _0x38e518){const _0x2f14b5=Ps(_0x2bb952,'data-id');if(_0x2f14b5)_0x382bb2['set'](_0x2f14b5,_0x2bb952);else{const _0x317b7f=Os(_0x2bb952,{'encodeEntities':!0x1}),_0x2e77d7=_0x11b084['get'](_0x317b7f);_0x2e77d7?_0x2e77d7['push'](_0x2bb952):_0x11b084['set'](_0x317b7f,[_0x2bb952]);}}for(const _0x29ade7 of _0x4209a9){const _0x49f85c=Ps(_0x29ade7,'data-id');let _0x40b3ba;if(_0x49f85c)_0x40b3ba=_0x382bb2['get'](_0x49f85c);else{const _0x39001b=_0x11b084['get'](Os(_0x29ade7,{'encodeEntities':!0x1}));_0x40b3ba=_0x39001b&&_0x39001b['length']?_0x39001b['shift']():void 0x0;}_0x40b3ba?_0x452856(_0x29ade7,_0x2a3383(_0x40b3ba,!0x0)):_0x47cc1f(_0x29ade7);}return{'contentInitial':Os(_0xe86d9f,{'encodeEntities':!0x1}),'contentNew':Os(_0x19d233,{'encodeEntities':!0x1})};}_findMarkerElement(_0x4f4154,_0x4997e9=0x5){let _0x519067=_0x4f4154,_0x47d026=null;for(let _0x34224d=0x0;_0x34224d<_0x4997e9&&_0x519067;_0x34224d++)if(_0x519067['className']){if((''+_0x519067['className'])['includes']('ck-ai_review-marker_')){if(!_0x519067['getAttribute']('data-marker-id'))break;_0x47d026=_0x519067;break;}_0x519067=_0x519067['parentElement'];}else _0x519067=_0x519067['parentElement'];return _0x47d026;}_findMarkerElementById(_0x2361b9){const _0x1855fc=this['_markers']['get'](_0x2361b9);if(!_0x1855fc)return null;const _0x948901=_0x1855fc['editor']['model']['markers']['get'](_0x2361b9);return _0x948901?_0x497b83(_0x1855fc['editor']['editing'],_0x948901):null;}_getMarkersDataForGroup(_0x12f406){return Array['from'](this['_markers']['values']())['filter'](_0x2b7a44=>_0x2b7a44['groupId']===_0x12f406);}_getOperationStart(_0xa2f6ee){return'insert'===_0xa2f6ee['type']?_0xa2f6ee['position']:_0xa2f6ee['newRange']['start'];}_getOperationEnd(_0x545f76,_0xb17176=!0x1){return'insert'===_0x545f76['type']?_0xb17176?_0x545f76['position']:_0x545f76['position']['getShiftedBy'](_0x545f76['howMany']):_0x545f76['newRange']['end'];}_shiftOperation(_0x349814,_0x5cc590){return'insert'===_0x349814['type']?_0x349814['position']=_0x349814['position']['getShiftedBy'](_0x5cc590):'marker'===_0x349814['type']&&_0x349814['newRange']&&(_0x349814['newRange']=new _0x2827cc(_0x349814['newRange']['start']['getShiftedBy'](_0x5cc590),_0x349814['newRange']['end']['getShiftedBy'](_0x5cc590))),_0x349814;}_changeOperationOwnerDocument(_0x216df3,_0xd647f7){'insert'===_0x216df3['type']?_0x216df3['position']=this['_changePositionOwnerDocument'](_0x216df3['position'],_0xd647f7):'marker'===_0x216df3['type']&&_0x216df3['newRange']&&(_0x216df3['newRange']=this['_changeRangeOwnerDocument'](_0x216df3['newRange'],_0xd647f7));}_changePositionOwnerDocument(_0x4a19de,_0x5babf6){return new _0x4febba(_0x5babf6,_0x4a19de['path']);}_changeRangeOwnerDocument(_0x1c144d,_0x443c8b){return new _0x2827cc(this['_changePositionOwnerDocument'](_0x1c144d['start'],_0x443c8b),this['_changePositionOwnerDocument'](_0x1c144d['end'],_0x443c8b));}_changePosition(_0x45bb72,_0x337b01){return new _0x4febba(_0x337b01,[..._0x45bb72]);}['_changeRange'](_0x278dd5,_0x4dece2,_0x4413e5,_0x45f110){return new _0x2827cc(this['_changePosition'](_0x4dece2,_0x45f110),this['_changePosition'](_0x4413e5,_0x45f110));}_sortMarkers(_0x96f6f0){const _0x1b2fe3=_0x47d387=>{switch(_0x47d387){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x96f6f0['sort']((_0x3d7421,_0x15ef03)=>_0x1b2fe3(_0x3d7421['type'])-_0x1b2fe3(_0x15ef03['type']));}_hasSameTopLevelElement(_0x263d92,_0x4735d6){const _0x3099fb=_0x263d92['getChild'](0x0),_0x59f756=_0x4735d6['getChild'](0x0);return!(!_0x3099fb||!_0x59f756)&&((!_0x3099fb['is']('element')||!_0x59f756['is']('element')||_0x3099fb['name']===_0x59f756['name'])&&!(_0x3099fb['is']('element')&&!_0x59f756['is']('element')||!_0x3099fb['is']('element')&&_0x59f756['is']('element')));}_haveSingleTopLevelElement(_0x2305ed){return 0x1===_0x2305ed['childCount'];}_haveOnlyInlineContent(_0x1166c4,_0x3abd5b){for(const _0x4146da of _0x1166c4['getChildren']())if(_0x4146da['is']('element')&&!_0x3abd5b['isInline'](_0x4146da))return!0x1;return!0x0;}_upsertDataId(_0x37eb35,_0x13d4db){let _0x2a4c2c=_0x37eb35['getAttribute'](_0x4fabc2);return _0x2a4c2c||(_0x2a4c2c=_0x13d4db(),_0x37eb35['_setAttribute'](_0x4fabc2,_0x2a4c2c)),_0x2a4c2c;}};const Mh=/* #__PURE__ -- @preserve */
38
+ dt();var Uh=class extends Mh{['id'];contentNew;contentInitial;documentVersion;constructor({id:_0xc306a0,contentNew:_0x4bf95b,contentInitial:_0x424161,documentVersion:_0x5d97a2}){super(),this['id']=_0xc306a0,this['contentNew']=_0x4bf95b,this['contentInitial']=_0x424161,this['documentVersion']=_0x5d97a2;}};const Vh=/* #__PURE__ -- @preserve */
39
+ At();var Bh=class extends Vh{['id'];parent;editor;_data;_editorOperations=[];constructor(_0xcf1aca,_0x500d41,_0x282bff,_0x416d73){super(),this['id']=_0xcf1aca,this['parent']=_0x282bff,this['editor']=_0x416d73,this['_data']=_0x500d41,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(_0x118063){const _0x1796ef=Rs(_0x118063)['children']['filter'](_0x545292);return 0x1!==_0x1796ef['length']?_0x118063:_0x1796ef[0x0]['children']['map'](_0xde8499=>Os(_0xde8499))['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 Gh=/* #__PURE__ -- @preserve */
40
+ At();var Fh=class extends Gh{['id']=kt();['callId'];_results=new Map();['_changes']=[];_hasUnsupportedInlineChange=!0x1;['_sourceCheck'];_documentData;_aiConnector;['_reviewParams'];['_reviewArgs'];_contexts;_activeRequest=null;_currentError;_wasAborted=!0x1;constructor(_0x68a329,_0x415056,_0x2b2509,_0x31a9cd,_0x50f356,_0x3c0e3f){super(),this['_sourceCheck']=_0x415056,this['_documentData']=_0x68a329,this['_aiConnector']=_0x2b2509,this['_reviewParams']=_0x31a9cd,this['_reviewArgs']=_0x50f356,this['_contexts']=_0x3c0e3f,this['on']('change:status',(_0x427587,_0x368e21,_0x4c40a4)=>{'aborted'==_0x4c40a4&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x4c40a4,'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'](_0x2f412f=>'pending'===_0x2f412f['status']);}get currentError(){return this['_currentError'];}get results(){return Array['from'](this['_results']['values']());}updateDocumentData(_0x5c9755){this['_documentData']=_0x5c9755;}async start(){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x47f426=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x2a716c of _0x47f426)'unmodified'!==_0x2a716c['data']['operation']&&('error'!==_0x2a716c['data']['operation']?'review-metadata'!==_0x2a716c['event']?this['_addReviewCheckResult'](_0x2a716c['data']['dataId'],_0x2a716c['data']['textDelta']):this['callId']=_0x2a716c['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(_0x5acdb3){this['_currentError']=_0x5acdb3,kn(_0x5acdb3)?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(_0x19a589,_0x32a218){const _0x47a609=this['_results']['get'](_0x19a589);if(!_0x47a609)return;if(0x0===_0x32a218['length'])return;const _0x25f30d=this['_documentData']['elements']['get'](_0x19a589);if(!_0x25f30d)return;const _0x4969ae=[];_0x32a218['forEach']((_0x455983,_0x2e5e9f)=>{const _0x403be0=new Bh(_0x47a609['id']+'-'+_0x2e5e9f,_0x455983,_0x47a609,_0x25f30d['editor']);_0x403be0['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x403be0,'status':_0x403be0['status']});}),_0x403be0['on']('change:isActivated',()=>{_0x403be0['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x403be0}):this['fire']('reviewCheckResultDeactivated',{'change':_0x403be0});}),this['_changes']['push'](_0x403be0),_0x4969ae['push'](_0x403be0);}),this['fire']('reviewCheckResultReady',{'changes':_0x4969ae,'result':_0x47a609,'source':this});}abort(){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}isChangeActive(_0x30798e){const _0x5c9a53=this['_changes']['find'](_0x4fdba1=>_0x4fdba1['id']===_0x30798e);return!(!_0x5c9a53||'pending'!==_0x5c9a53['status']);}isAnyChangeActivated(){return this['_changes']['some'](_0x250cad=>!0x0===_0x250cad['isActivated']);}getActiveChanges(){return this['_changes']['filter'](_0x3580d3=>'pending'===_0x3580d3['status']);}getChangeById(_0x2337dc){return this['_changes']['find'](_0x27131c=>_0x27131c['id']===_0x2337dc);}markAllChangesAsAccepted(){for(const _0x18a020 of this['_changes'])'pending'===_0x18a020['status']&&(_0x18a020['status']='accepted');this['_checkIfFinished']();}markChangeAsAccepted(_0x4ab2bf){const _0x323770=this['_changes']['find'](_0xc1f4fb=>_0xc1f4fb['id']===_0x4ab2bf);_0x323770&&'pending'===_0x323770['status']&&(_0x323770['status']='accepted'),this['_checkIfFinished']();}markChangeAsRejected(_0x420749){const _0x4a0285=this['_changes']['find'](_0x2db1b5=>_0x2db1b5['id']===_0x420749);_0x4a0285&&'pending'===_0x4a0285['status']&&(_0x4a0285['status']='rejected'),this['_checkIfFinished']();}markChangeAsOutdated(_0x36a007){const _0x2f7a4b=this['_changes']['find'](_0x41a2b8=>_0x41a2b8['id']===_0x36a007);_0x2f7a4b&&'pending'===_0x2f7a4b['status']&&(_0x2f7a4b['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x373b3e){const _0x5d3de0=this['_changes']['find'](_0x29e1e9=>_0x29e1e9['id']===_0x373b3e);_0x5d3de0&&'outdated'===_0x5d3de0['status']&&(_0x5d3de0['status']='pending'),this['_checkIfFinished']();}activateChange(_0x38e955){this['_changes']['filter'](_0x23efc5=>_0x23efc5['isActivated']&&_0x23efc5['id']!==_0x38e955)['forEach'](_0x53f69d=>{_0x53f69d['isActivated']=!0x1;});const _0x1c1396=this['_changes']['find'](_0x32ff78=>_0x32ff78['id']===_0x38e955);_0x1c1396&&'pending'===_0x1c1396['status']&&(_0x1c1396['isActivated']=!0x0);}deactivateChange(){this['_changes']['filter'](_0x17bc2d=>_0x17bc2d['isActivated'])['forEach'](_0x32f488=>{_0x32f488['isActivated']=!0x1;});}forceReadyState(){this['status']='ready';}async sendRating(_0x43c4af){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x10359e;if(_0x43c4af){const _0x3257d2=this['_changes']['find'](_0x4bfe80=>_0x4bfe80['id']===_0x43c4af);if(_0x3257d2&&_0x3257d2['isRated'])return;_0x3257d2&&(_0x10359e=_0x3257d2['parent']['id'],_0x3257d2['isRated']=!0x0);}const _0x3e7127={'positiveCount':this['_changes']['filter'](_0x2726ff=>'accepted'===_0x2726ff['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x3e7127,this['callId'],_0x10359e);}_addReviewCheckResult(_0x592493,_0x3735c8){const _0x363142=this['_documentData']['elements']['get'](_0x592493);if(!_0x363142)return;if(Gs(_0x363142['editor'],_0x363142['rootName'])&&!Ys(_0x363142['editor'],Rs(_0x3735c8)))return void(this['_hasUnsupportedInlineChange']=!0x0);const _0x1d85fa=_0x363142['getContent']();if(_0x1d85fa===_0x3735c8)return;const _0x53d591=new Uh({'id':_0x592493,'contentInitial':_0x1d85fa,'contentNew':_0x3735c8,'documentVersion':_0x363142['documentVersion']});this['_results']['set'](_0x53d591['id'],_0x53d591),this['fire']('reviewCheckResultAdded',{'result':_0x53d591,'source':this,'editor':_0x363142['editor'],'rootName':_0x363142['rootName']});}['_checkIfFinished'](){'finished'===this['status']&&this['_changes']['filter'](_0x38a88d=>'pending'===_0x38a88d['status'])['length']>0x0&&(this['status']='ready'),'ready'===this['status']&&0x0===this['_changes']['filter'](_0x410f07=>'pending'===_0x410f07['status'])['length']&&(this['status']='finished');}},Kh=class extends Fh{get subTitle(){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x1dcd31=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x255e55=0x0;_0x255e55<this['_reviewParams']['length'];_0x255e55++){if(!this['_reviewParams'][_0x255e55]||!this['_sourceCheck']['options'][_0x255e55])continue;const _0x1450f5=this['_sourceCheck']['options'][_0x255e55]['data']?.['find'](_0x190f80=>_0x190f80['id']===this['_reviewParams'][_0x255e55]);_0x1450f5&&_0x1dcd31['push'](_0x1450f5['label']);}return _0x1dcd31['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}_createApiRequest(){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs'],'contexts':this['_contexts']});}_sendRatingRequest(_0x3f65c2,_0x564f47,_0x1818f5){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x564f47,_0x3f65c2,_0x1818f5);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}},Wh=class extends _0x898608{_aiConnector;['_aiReviewCoreUi'];_aiReviewCoreEditing;['_availableReviewChecks'];_reporter;_currentReviewCheckRun;_changeActivationSource=null;static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_initRequiredPlugins'](),this['_initAvailableReviewChecks'](),this['_initUIListeners']();}async _initAvailableReviewChecks(){this['_availableReviewChecks']=await this['_getReviewChecks'](),this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}_initUIListeners(){this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_availableReviewChecks']&&this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',(_0x4fd527,_0x70b29b)=>this['runCheck'](_0x70b29b)),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{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 _0x16ffbe=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x16ffbe['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x16ffbe['map'](_0x2089f0=>_0x2089f0['id']),this['_aiSource']);const _0x1cf8e6=this['_currentReviewCheckRun'];_0x1cf8e6['markAllChangesAsAccepted'](),_0x1cf8e6['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x43a84b,_0x11340a)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x11340a['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x11340a['id']],this['_aiSource']),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x11340a['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x11340a['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x5d9db8,_0x5b2c52)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5b2c52['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x5b2c52['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x5b2c52['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5b2c52['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreUi']['setAcceptAllEnabled'](!0x1),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x5b1289,_0x381622)=>{this['_onActivateChange'](_0x381622);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x2a8287,_0xec569e)=>{this['_onDeactivateChange'](_0xec569e);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x10be03,_0x11f996)=>{this['_onChangeMarkerClicked'](_0x10be03,_0x11f996);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x2ba404,_0x4ec513)=>{this['_onChangeMarkerHovered'](_0x2ba404,_0x4ec513);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x5de019,_0x562468)=>{this['_onChangeMarkerRemoved'](_0x5de019,_0x562468);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x197d86,_0x1ec56c)=>{this['_onChangeMarkerRestored'](_0x197d86,_0x1ec56c);});}async['runCheck'](_0x2b5caf){if(!this['_availableReviewChecks'])return;const _0x4dad9f=this['_availableReviewChecks']['find'](_0x3ca8f2=>_0x3ca8f2['id']===_0x2b5caf['id']);if(!_0x4dad9f)return void this['_logError'](new ct('ai-review-mode-source-check-not-found',this,{'checkId':_0x2b5caf['id']}));this['_onReviewCheckRun'](_0x2b5caf),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_aiReviewCoreUi']['setAcceptAllEnabled'](!0x1);const _0x33b0d5=this['context']['plugins']['get'](fs)['contextLibrary']['resolveContext']({'feature':this['_defaultContextFeature'],'ids':[_0x2b5caf['id']],'context':new Yn()});this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x2b5caf,_0x4dad9f,_0x33b0d5);const _0x22ce61=this['_currentReviewCheckRun'];_0x22ce61['on']('reviewCheckResultChangeStatusUpdated',(_0x49b274,_0x4fb2af)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x4fb2af['change']['id'],_0x4fb2af['status']),this['_pushAcceptAllEnabled'](_0x22ce61);}),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x1e24e2,_0x5d3e92)=>{switch(_0x5d3e92['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x5d3e92);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_currentReviewCheckRun']?.['hasUnsupportedInlineChange']?this['_aiReviewCoreUi']['showUnsupportedInlineChangeView']():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 ct('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new ct('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'!==_0x5d3e92['status']&&'error-chunk'!==_0x5d3e92['status']&&'error-general'!==_0x5d3e92['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x4aa41f,_0x2d87ba)=>{if(!this['_currentReviewCheckRun'])throw new ct('ai-review-mode-no-current-check-run',this);const _0x3b6abc=Gs(_0x2d87ba['editor'],_0x2d87ba['rootName']);let _0x4a4090=_0x2d87ba['result']['contentInitial'],_0x4095bc=_0x2d87ba['result']['contentNew'];_0x3b6abc&&(_0x4a4090=Ws(_0x4a4090),_0x4095bc=Ws(_0x4095bc));const _0x32675a=this['_diffContent'](_0x2d87ba['editor'],_0x4a4090,_0x4095bc);if(_0x3b6abc){const _0x574732=_0x2d87ba['editor']['ui']['getEditableElement'](_0x2d87ba['rootName'])?.['tagName']['toLowerCase']();for(const _0x5c6350 of _0x32675a)_0x5c6350['wrapperTag']=_0x574732;}_0x2d87ba['source']['addResultChanges'](_0x2d87ba['result']['id'],_0x32675a);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x4708f0,_0x3e9d83)=>{for(const _0x16feaf of _0x3e9d83['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x16feaf);this['_pushAcceptAllEnabled'](_0x3e9d83['source']),this['_markChangePositionInEditorContent'](_0x3e9d83['changes'],_0x3e9d83['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x4cac66,_0x4a6728)=>{this['_onReviewCheckResultActivated'](_0x4a6728);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x430521){if(kn(_0x430521))return;_0x430521 instanceof ct?this['_logError'](_0x430521):this['_logError'](new ct('ai-review-mode-check-run-failed',this,void 0x0,_0x430521));}}abort(){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}getAvailableChecks(){return(this['_availableReviewChecks']??[])['slice']();}getCurrentCheckRun(){return this['_currentReviewCheckRun'];}_pushAcceptAllEnabled(_0x2cc22d){this['_aiReviewCoreUi']['setAcceptAllEnabled'](_0x2cc22d['getActiveChanges']()['length']>0x0);}_createReviewCheckRun(_0x4db18e,_0x292d99,_0x3ab97f=new Yn()){return new Kh(this['_aiReviewCoreEditing']['getDocumentData'](),_0x292d99,this['_aiConnector'],_0x4db18e['params'],_0x4db18e['args'],_0x3ab97f['refs']);}['_onChangeMarkerRemoved'](_0x4f50e3,_0x4fa692){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x4fa692['changeId']);}_onChangeMarkerRestored(_0x246173,_0x3ccbc3){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x3ccbc3['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}_initRequiredPlugins(){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_reporter']=this['context']['plugins']['get'](Nn)['createReporter']('aireview');}['_onReviewRunLeave'](_0x3f6b48=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x3f6b48&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x46cf04 of this['_aiReviewCoreEditing']['getEditors']())_0x46cf04['editing']['view']['change'](_0x3f4991=>{for(const _0x3a67cd of _0x46cf04['editing']['view']['document']['getRoots']())_0x3f4991['removeClass']('ck-ai_review-diff',_0x3a67cd),_0x3f4991['removeClass']('ck-ai_review-highlights',_0x3a67cd),_0x3f4991['removeClass']('ck-ai-translate-mode-content',_0x3a67cd);});}['_logError'](_0x26b4c8){this['_reporter']['logError'](_0x26b4c8),'ai-review-mode-models-unable-to-retrieve'===function(_0xc974a3){return _0xc974a3 instanceof yn?_0xc974a3['code']:_0xc974a3 instanceof Error?_0xc974a3['message']['match'](/^\S+/)?.[0x0]:void 0x0;}(_0x26b4c8)?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']();}['_scrollToChange'](_0x1bf7b5){if('content'===this['_changeActivationSource']){const _0x40b389=this['_aiReviewCoreUi']['getChangeElement'](_0x1bf7b5);_0x40b389&&Rt(_0x40b389['closest']('.ck-ai_review__check-run-result')||_0x40b389);}else{if('panel'===this['_changeActivationSource']){const _0x331434=this['_getChangeContentElement'](_0x1bf7b5);if(!_0x331434)return;Ot({'target':_0x331434,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}},Yh=class extends Fh{_prompt;['_model'];constructor(_0x50ccfa,_0x2d6a44,_0x4522c0,_0x21d765,_0xb31fab,_0x4e3e0c){super(_0x4522c0,_0x21d765,_0xb31fab,void 0x0,void 0x0,_0x4e3e0c),this['_prompt']=_0x50ccfa,this['_model']=_0x2d6a44;}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['_contexts']});}_sendRatingRequest(_0x6d5cdd,_0x54af6d,_0x19e71b){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x54af6d,_0x6d5cdd,_0x19e71b);}},$h=class{['id'];['commandId'];title;description;isParameterized;['useArgs'];options;['args'];get['apiId'](){return this['commandId'];}constructor(_0x28734e){this['id']=_0x28734e['id'],this['commandId']=_0x28734e['commandId'],this['title']=_0x28734e['title'],this['description']=_0x28734e['description'],this['isParameterized']=_0x28734e['isParameterized'],this['useArgs']=_0x28734e['useArgs'],this['options']=_0x28734e['options'],this['args']=_0x28734e['args'];}},qh=class extends $h{isExtra=!0x0;prompt;context;['model'];_defaultModel=null;constructor(_0x32ae19,_0x366505,_0x40b8fe){super(_0x32ae19),this['prompt']=_0x32ae19['prompt'],this['context']=_0x32ae19['context'],this['model']=_0x32ae19['model'],this['model']?this['_defaultModel']=_0x366505['find'](_0x19990a=>_0x19990a['id']===this['model'])||null:this['_defaultModel']=_0x40b8fe;}get defaultModel(){return this['_defaultModel'];}},Qh=class extends Yh{get subTitle(){return'';}set prompt(_0xcaafa7){this['_prompt']=_0xcaafa7;}set['model'](_0x295a7c){this['_model']=_0x295a7c;}},Xh=class extends _0x898608{static get requires(){return[Is,Nn];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_cache'];_reporter;init(){this['_reporter']=this['context']['plugins']['get'](Nn)['createReporter']('aireview');}getChecksList(){return this['_cache']||(this['_cache']=this['_loadChecksList']()),this['_cache'];}};const zh=[{'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'}]}]}],jh=/* #__PURE__ -- @preserve */
41
+ At();var Jh=class extends jh{['_checks']=[];setupChecks(_0x206f97){this['_checks']=_0x206f97['map'](_0x9f523d=>new $h(_0x9f523d));}get['checks'](){return this['_checks']['slice']();}getCheckById(_0x45ed69){return this['checks']['find'](_0x31b596=>_0x31b596['id']===_0x45ed69);}['removeCheckById'](_0x4f455c){this['_checks']=this['_checks']['filter'](_0x23a832=>_0x23a832['id']!==_0x4f455c);}},Zh=class extends $h{['_models']=[];_defaultModel=null;constructor(_0x3a2ac6,_0x18311a,_0x30e65c){super(_0x3a2ac6),this['_models']=_0x18311a,this['_defaultModel']=_0x30e65c;}get['models'](){return this['_models']['slice']();}get defaultModel(){return this['_defaultModel'];}},tc=class extends Jh{['_allModels']=[];['_recommendedModels']=[];_defaultModel=null;constructor(_0x12e22f,_0x8f7b2a,_0x32c104){super(),this['_allModels']=_0x12e22f,this['_recommendedModels']=_0x8f7b2a,this['_defaultModel']=_0x32c104;}get['allModels'](){return this['_allModels']['slice']();}setupChecks(_0x5e37fc){this['_checks']=_0x5e37fc['map'](_0x11acf3=>!0x0===_0x11acf3['isExtra']?new qh(_0x11acf3,this['_allModels'],this['_defaultModel']):'custom'===_0x11acf3['id']?new Zh(_0x11acf3,this['_recommendedModels'],this['_defaultModel']):new $h(_0x11acf3));}},ec=class extends Xh{static get['pluginName'](){return'AIReviewModeCheckRegistry';}static get requires(){return[Is,Nn,fs];}['_modelsLoadError']=null;constructor(_0x2dec76){super(_0x2dec76),this['context']['config']['define']('ai.review.extraCommands',[]);}get['modelsLoadError'](){return this['_modelsLoadError'];}getExtraChecks(){return this['context']['config']['get']('ai.review.extraCommands')['map'](_0xab3105=>({'id':_0xab3105['id'],'commandId':_0xab3105['id'],'title':_0xab3105['label'],'description':_0xab3105['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0xab3105['prompt'],'context':_0xab3105['context'],'model':_0xab3105['model']}));}async _loadChecksList(){const _0x580e20=[...zh,...this['getExtraChecks']()]['map'](_0x13a4b5=>_0x13a4b5['isExtra']?_0x13a4b5:this['_translateReviewCheck'](_0x13a4b5)),_0x1002fa=this['context']['plugins']['get'](fs);let _0xb54353;try{_0xb54353=new tc(await _0x1002fa['models']['getAllModels'](),await _0x1002fa['models']['getAvailableModels'](),await _0x1002fa['models']['getDefault']()),this['_modelsLoadError']=null;}catch(_0x1d359d){this['_modelsLoadError']=new ct('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x1d359d),this['_reporter']['logError'](this['_modelsLoadError'],{'context':{'operation':'load-review-models'}}),_0xb54353=new tc([],[],null);}return _0xb54353['setupChecks'](_0x580e20),_0xb54353;}_translateReviewCheck(_0x52311d){const _0x38954a='AI_REVIEW_CHECK_'+_0x52311d['commandId']['toUpperCase']()['replaceAll']('-','_'),_0x4ad601={..._0x52311d,'title':this['_translate'](_0x38954a+'_TITLE',_0x52311d['title']),'description':this['_translate'](_0x38954a+'_DESCRIPTION',_0x52311d['description'])};return _0x52311d['options']&&(_0x4ad601['options']=_0x52311d['options']['map'](_0x50394b=>({..._0x50394b,'label':this['_translate'](_0x38954a+'_OPTIONS_LABEL',_0x50394b['label']||''),'data':_0x50394b['data']?_0x50394b['data']['map'](_0x211fc8=>({..._0x211fc8,'label':this['_translate'](_0x38954a+'_OPTIONS_DATA_'+_0x211fc8['id']['toUpperCase'](),_0x211fc8['label'])})):void 0x0}))),_0x4ad601;}_translate(_0x134a5a,_0x23c7f6){const _0x54e609=Es(this['context']['locale'],_0x134a5a);return _0x54e609===_0x134a5a?_0x23c7f6:_0x54e609;}},ic=class extends Wh{static get['pluginName'](){return'AIReviewModeController';}static get requires(){return[Nn,ec,fs];}get['_aiSource'](){return'review';}get _defaultContextFeature(){return'review';}['_isDiffOn']=!0x1;['_usesAvailableCommandsConfig'];constructor(_0x592661){super(_0x592661),this['_usesAvailableCommandsConfig']=Boolean(this['context']['config']['get']('ai.review.availableCommands')),this['context']['config']['define']('ai.review.availableCommands',zh['map'](_0x58ed76=>_0x58ed76['id']));}init(){super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0xaf273b,_0x28ecfd)=>{this['_isDiffOn']=_0x28ecfd['on'],this['_onDiffChange'](this['_isDiffOn']);});}_initRequiredPlugins(){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}_createReviewCheckRun(_0x6a1c8d,_0x396e6a,_0x3b18c6=new Yn()){if(_0x6a1c8d['isCustom'])return new Yh(_0x6a1c8d['args']['prompt'],_0x6a1c8d['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x396e6a,this['_aiConnector'],_0x3b18c6['refs']);if(_0x396e6a['isExtra']){const _0x1c80e1=_0x396e6a,_0x16a338=_0x1c80e1['context']?_0x3b18c6['cloneWith'](_0x1c80e1['context'])['refs']:_0x3b18c6['refs'];return new Qh(_0x6a1c8d['args']?.['prompt']??_0x1c80e1['prompt'],_0x6a1c8d['args']?.['model']??_0x1c80e1['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x396e6a,this['_aiConnector'],_0x16a338);}return new Kh(this['_aiReviewCoreEditing']['getDocumentData'](),_0x396e6a,this['_aiConnector'],_0x6a1c8d['params'],_0x6a1c8d['args'],_0x3b18c6['refs']);}_onReviewCheckResultActivated(_0x19adb9){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x19adb9['change']['id']),this['_scrollToChange'](_0x19adb9['change']['id']);const _0x3a5161=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x19adb9['change']['id']);if(!_0x3a5161)return;const _0x592a85=this['_aiReviewCoreEditing']['getEditorForChange'](_0x19adb9['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x19adb9['change'],()=>_0x3a5161['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x592a85,_0x3a5161['modelRange']['root']['rootName']),_0x592a85?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x19adb9['change']['id']);}_onReviewCheckResultDeactivated(){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}_onActivateChange(_0xf04681){this['_currentReviewCheckRun']&&'click'===_0xf04681['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0xf04681['id']));}_onDeactivateChange(_0x1d04d6){this['_currentReviewCheckRun']&&'balloon'===_0x1d04d6['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x3f5be8,_0x3db505){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3db505['changeId']);const _0x25fb43=this['_currentReviewCheckRun']['getChangeById'](_0x3db505['changeId']);if(!_0x25fb43)return;const _0x13c6a4=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x3db505['changeId']),_0x7ee0ef=this['_aiReviewCoreEditing']['getEditorForChange'](_0x3db505['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x25fb43,_0x3db505['markerElement'],_0x3db505['domEvent'],'click',this['_getBalloonDomRoot'](_0x7ee0ef,_0x13c6a4?.['modelRange']['root']['rootName']),_0x7ee0ef?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x47a6b4,_0x5a5355){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x101c13=this['_currentReviewCheckRun']['getChangeById'](_0x5a5355['changeId']);if(!_0x101c13)return;const _0x3494f5=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x5a5355['changeId']),_0x480c62=this['_aiReviewCoreEditing']['getEditorForChange'](_0x5a5355['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x101c13,_0x5a5355['markerElement'],_0x5a5355['domEvent'],'hover',this['_getBalloonDomRoot'](_0x480c62,_0x3494f5?.['modelRange']['root']['rootName']),_0x480c62?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']());}_getChangeContentElement(_0x2a66ca){const _0x4a672b=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x2a66ca);return _0x4a672b?_0x4a672b['getElement']():null;}_markChangePositionInEditorContent(_0x2ce39c,_0xc8a4cb){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x2ce39c,_0xc8a4cb);}_diffContent(_0xe45ed4,_0x189896,_0x326b20){return this['_aiReviewCoreEditing']['diffContent'](_0xe45ed4,_0x189896,_0x326b20,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0xe8fe27){_0xe8fe27?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0xf3e5d9 of this['_aiReviewCoreEditing']['getEditors']())_0xf3e5d9['editing']['view']['change'](_0x42a7d2=>{for(const _0x28d44d of _0xf3e5d9['editing']['view']['document']['getRoots']()){for(const _0x313960 of _0x28d44d['getClassNames']())_0x313960['startsWith']('ck-ai_review-')&&_0x42a7d2['removeClass'](_0x313960,_0x28d44d);_0x42a7d2['addClass'](_0xe8fe27?'ck-ai_review-diff':'ck-ai_review-highlights',_0x28d44d);}});}_getBalloonDomRoot(_0x1e77bb,_0x470961){const _0xe99966=_0x1e77bb['editing']['view'];if(_0x470961){const _0x81052a=_0xe99966['getDomRoot'](_0x470961);if(_0x81052a)return _0x81052a;}return _0xe99966['getDomRoot']()??void 0x0;}async _getReviewChecks(){const _0x51303f=this['context']['plugins']['get']('AIReviewModeCheckRegistry'),_0x8d478=await _0x51303f['getChecksList']();_0x51303f['modelsLoadError']&&this['_logError'](_0x51303f['modelsLoadError']);let _0x5e0fc5=_0x8d478['checks'];const _0x2abf74=this['context']['config']['get']('ai.review.availableCommands');return this['_logWarningForNonExistentChecks'](_0x2abf74,_0x5e0fc5),this['_usesAvailableCommandsConfig']&&(_0x5e0fc5=_0x2abf74['map'](_0x272516=>_0x5e0fc5['find'](_0x32ac93=>_0x32ac93['id']===_0x272516))['filter'](_0x6396cf=>!!_0x6396cf)),this['_filterChecksWithMissingModel'](_0x5e0fc5);}_logWarningForNonExistentChecks(_0x3642dc,_0x16a6a2){const _0x307dd8=_0x3642dc['filter'](_0xd4b5ea=>!_0x16a6a2['some'](_0x3cb6f2=>_0x3cb6f2['id']===_0xd4b5ea));_0x307dd8['length']&&this['_reporter']['logError'](new yn({'code':'ai-review-mode-non-existent-commands-used','severity':'warning','context':{'commandIds':_0x307dd8['join'](',\x20')}}));}_filterChecksWithMissingModel(_0x2174cb){const _0x2b9757=[];return _0x2174cb['forEach'](_0xffa6af=>{(_0xffa6af instanceof qh&&!_0xffa6af['defaultModel']||_0xffa6af instanceof Zh&&!_0xffa6af['models']['length'])&&_0x2b9757['push'](_0xffa6af['id']);}),_0x2b9757['length']&&_0x2b9757['forEach'](_0x41cfba=>{_0x2174cb=_0x2174cb['filter'](_0x2a3843=>_0x2a3843['id']!==_0x41cfba),this['_reporter']['logError'](new yn({'code':'ai-review-mode-command-unavailable-due-to-missing-model','context':{'commandId':_0x41cfba}}));}),_0x2174cb;}},sc=class extends _0x898608{static get['pluginName'](){return'AIReviewGateway';}static get requires(){return[Hh,ec,Is,tn,Tn,fs];}get['models'](){return this['context']['plugins']['get'](fs)['models'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async getAllCommands(){return(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['map'](_0x3dd5a0=>{const _0x228fde={'id':_0x3dd5a0['id'],'title':_0x3dd5a0['title'],'description':_0x3dd5a0['description']};return'custom'!==_0x3dd5a0['id']&&_0x3dd5a0['options']?.['length']&&(_0x228fde['parameters']=_0x3dd5a0['options'][0x0]['data']['map'](_0x514866=>({..._0x514866}))),_0x228fde;});}async['runReview'](_0x291ed8,_0x272932){const _0x24f8b1=await this['_resolveReviewCheck'](_0x291ed8),_0x3ed398=this['context']['plugins']['get']('AIReviewCoreEditing'),_0x2598ff=this['context']['plugins']['get']('AIConnector'),_0x1e0da8=_0x3ed398['getDocumentData']({'roots':_0x272932?.['roots']}),_0x2aa800=this['_createReviewCheckRun'](_0x24f8b1,_0x1e0da8,_0x2598ff,_0x272932?.['parameterId'],_0x272932?.['contexts']);return _0x3ed398['runCheck'](_0x2aa800,{'signal':_0x272932?.['signal']});}async runCustomReview(_0x505705,_0x2ec184){const {reviewCheck:_0x84af4b,resolvedModel:_0x45f2cf}=await this['_resolveCustomReviewCheck'](_0x505705,_0x2ec184?.['model']),_0x4b6290=this['context']['plugins']['get']('AIReviewCoreEditing'),_0x12e04c=this['context']['plugins']['get']('AIConnector'),_0x56d972=new Yh(_0x505705,_0x45f2cf,_0x4b6290['getDocumentData']({'roots':_0x2ec184?.['roots']}),_0x84af4b,_0x12e04c,_0x2ec184?.['contexts']);return _0x4b6290['runCheck'](_0x56d972,{'signal':_0x2ec184?.['signal']});}['applyReview'](_0x49ae7c,_0x377d82){this['context']['plugins']['get']('AIGateway')['apply'](_0x49ae7c,{'aiSource':'review',..._0x377d82});}async['_resolveReviewCheck'](_0x234630){const _0x1f1ec4=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x13b686=>_0x13b686['id']===_0x234630);if(!_0x1f1ec4)throw new ct('ai-reviewgateway-unknown-command',this,{'checkId':_0x234630});if(_0x1f1ec4 instanceof Zh)throw new ct('ai-reviewgateway-not-a-system-command',this,{'checkId':_0x234630});if(_0x1f1ec4 instanceof qh&&!_0x1f1ec4['defaultModel']?.['id'])throw new ct('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x234630});return _0x1f1ec4;}async _resolveCustomReviewCheck(_0x412a42,_0x19e39a){const _0x1c86d3='custom',_0xbc0a6e=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x14804d=>_0x14804d['id']===_0x1c86d3);if(!_0xbc0a6e)throw new ct('ai-reviewgateway-unknown-command',this,{'checkId':_0x1c86d3});if(!(_0xbc0a6e instanceof Zh))throw new ct('ai-reviewgateway-not-a-custom-command',this,{'checkId':_0x1c86d3});if(!_0x412a42)throw new ct('ai-reviewgateway-missing-custom-command-prompt',this,{'checkId':_0x1c86d3});const _0x20d7ab=_0x19e39a??_0xbc0a6e['defaultModel']?.['id'];if(!_0x20d7ab)throw new ct('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x1c86d3});return{'reviewCheck':_0xbc0a6e,'resolvedModel':_0x20d7ab};}_createReviewCheckRun(_0x6420dc,_0x2f780c,_0x701d40,_0xecf72e,_0x4072d8=[]){if(_0x6420dc instanceof qh){const _0x477b99=_0x6420dc['context']?[..._0x4072d8,_0x6420dc['context']]:_0x4072d8;return new Qh(_0x6420dc['prompt'],_0x6420dc['defaultModel']['id'],_0x2f780c,_0x6420dc,_0x701d40,_0x477b99);}return new Kh(_0x2f780c,_0x6420dc,_0x701d40,_0xecf72e?[_0xecf72e]:void 0x0,void 0x0,_0x4072d8);}},nc=class extends _0x898608{static get requires(){return[ic,Nh,Hh,sc];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async startReview(_0x5f380b,_0x4402a8){if(this['assertStartReviewPreconditions'](_0x5f380b)instanceof Zh)throw new ct('ai-reviewmode-not-a-system-command',this,{'commandId':_0x5f380b});nh(this['context'],'reviewMode'),await this['context']['plugins']['get']('AIReviewModeController')['runCheck']({'id':_0x5f380b,'params':_0x4402a8?.['parameterId']?[_0x4402a8['parameterId']]:void 0x0});}async startCustomReview(_0x50ba85,_0x13d9bc){if(!_0x50ba85)throw new ct('ai-reviewmode-missing-custom-command-prompt',this);const _0xa41ae2=zh['find'](_0x2eff1b=>'custom'===_0x2eff1b['commandId'])['id'],_0x3d31d7=this['assertStartReviewPreconditions'](_0xa41ae2),_0x52870c=_0x13d9bc?.['model']??_0x3d31d7['defaultModel']?.['id'];if(!_0x52870c)throw new ct('ai-reviewmode-missing-custom-command-model',this);nh(this['context'],'reviewMode'),await this['context']['plugins']['get']('AIReviewModeController')['runCheck']({'id':_0xa41ae2,'isCustom':!0x0,'args':{'prompt':_0x50ba85,'model':_0x52870c}});}getAvailableCommands(){return this['context']['plugins']['get']('AIReviewModeController')['getAvailableChecks']()['map'](_0x7a590c=>{const _0x41beba={'id':_0x7a590c['id'],'title':_0x7a590c['title'],'description':_0x7a590c['description']};return'custom'!==_0x7a590c['id']&&_0x7a590c['options']?.['length']&&(_0x41beba['parameters']=_0x7a590c['options'][0x0]['data']['map'](_0x2e8e2b=>({..._0x2e8e2b}))),_0x41beba;});}assertStartReviewPreconditions(_0x472c6a){const _0x32b416=this['context']['plugins']['get']('AIReviewModeController');if(_0x32b416['getCurrentCheckRun']())throw new ct('ai-reviewmode-review-already-running',this);const _0x639f8c=_0x32b416['getAvailableChecks']()['find'](_0x54d735=>_0x54d735['id']===_0x472c6a);if(!_0x639f8c)throw new ct('ai-reviewmode-unknown-command',this,{'commandId':_0x472c6a});return _0x639f8c;}},rc=class extends Kh{_title;constructor(_0x5a064b,_0x48463d,_0x90b90e,_0x5a5bcf,_0x1c1f6b,_0x3ea3d6,_0x47ac7a){super(_0x5a064b,_0x48463d,_0x90b90e,_0x1c1f6b,_0x3ea3d6,_0x47ac7a),this['_title']=_0x5a5bcf;}get title(){return this['_title'];}get subTitle(){return this['_sourceCheck']['title'];}},oc=class extends $h{get['apiId'](){return'translate';}},ac=class extends Jh{setupChecks(_0x2991b3){this['_checks']=_0x2991b3['map'](_0x5584f8=>new oc(_0x5584f8));}};const hc=[{'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 cc=class extends Xh{static get['pluginName'](){return'AITranslateCheckRegistry';}constructor(_0x62f28c){super(_0x62f28c),this['context']['config']['define']('ai.translate.languages',hc);}async _loadChecksList(){const _0x2f05f3=[],_0x365329=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x51784c of _0x365329)_0x2f05f3['push']({'title':_0x51784c['label'],'id':_0x51784c['id'],'commandId':_0x51784c['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x51784c['id']}});const _0x39a3ed=new ac();return _0x39a3ed['setupChecks'](this['_translateChecks'](_0x2f05f3)),_0x39a3ed;}_translateChecks(_0x52e89a){const _0x5a0f25=this['context']['locale'];return _0x52e89a['map'](_0x588928=>{const _0x4df75c='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x588928['title']['toUpperCase']()['replaceAll']('-','_'),_0x1f4ead=Es(_0x5a0f25,_0x4df75c);return{..._0x588928,'title':_0x1f4ead===_0x4df75c?_0x588928['title']:_0x1f4ead};});}},lc=class extends Wh{static get['pluginName'](){return'AITranslateController';}static get requires(){return[Nn,cc,fs];}get['_aiSource'](){return'translate';}get _defaultContextFeature(){return'translate';}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}_initRequiredPlugins(){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}_createReviewCheckRun(_0x37ff7d,_0x524346,_0x289f66){return new rc(this['_aiReviewCoreEditing']['getDocumentData'](),_0x524346,this['_aiConnector'],Es(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x37ff7d['params'],_0x37ff7d['args'],_0x289f66?.['refs']);}_onReviewCheckResultActivated(_0x558b0c){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x558b0c['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x558b0c['change']['id']);}_onReviewCheckResultDeactivated(){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}_onActivateChange(_0x1505ab){this['_currentReviewCheckRun']&&('hover'===_0x1505ab['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x1505ab['id'])),'click'===_0x1505ab['uiInteraction']&&this['_scrollToChange'](_0x1505ab['id']));}_onDeactivateChange(_0x15fedb){this['_currentReviewCheckRun']&&'panel'===_0x15fedb['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x27d457,_0x59133b){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x59133b['changeId']),this['_scrollToChange'](_0x59133b['changeId']));}['_onChangeMarkerHovered'](_0x343583,_0x13ed24){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x13ed24['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x13ed24['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}_getChangeContentElement(_0x792a0){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x792a0);}_markChangePositionInEditorContent(_0x4f791f,_0x2574f4){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x4f791f,_0x2574f4);}_diffContent(_0x208fe3,_0x105ddf,_0x1d244e){return this['_aiReviewCoreEditing']['diffContent'](_0x208fe3,_0x105ddf,_0x1d244e,!0x0);}['_onReviewCheckRun'](){for(const _0x2a5f86 of this['_aiReviewCoreEditing']['getEditors']())_0x2a5f86['editing']['view']['change'](_0x12953e=>{for(const _0xdad1d8 of _0x2a5f86['editing']['view']['document']['getRoots']())_0x12953e['addClass']('ck-ai-translate-mode-content',_0xdad1d8);});}async _getReviewChecks(){return(await this['context']['plugins']['get']('AITranslateCheckRegistry')['getChecksList']())['checks'];}},uc=class extends fh{constructor(_0x49653d,_0x56cd26){super(_0x49653d,_0x56cd26),this['on']('set:isLoading',(_0x1ea966,_0x2b5638,_0x321337)=>{_0x321337&&(this['headerTitle']=Es(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x2ae03f,_0x5b8aad,_0x118d68)=>{_0x118d68&&(this['headerTitle']=Es(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}_createAcceptAllButtonView(){const _0x1155f0=super['_createAcceptAllButtonView']();return _0x1155f0['set']('label',Es(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x1155f0;}_createExitReviewButtonView(){const _0x165c59=super['_createExitReviewButtonView']();return _0x165c59['set']('label',Es(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x165c59;}},dc=class extends yh{_setupTemplate(){const _0x313b9c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x313b9c['if']('isVisible','ck-hidden',_0x36a5cd=>!_0x36a5cd)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':Es(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':Es(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x313b9c['if']('isVisible','ck-hidden',_0x3b20b0=>!_0x3b20b0)]},'children':this['_checkViews']}]});}},_c=class extends mh{static get['pluginName'](){return'AITranslateUI';}createMainView(){const _0x5916dc=this['context']['plugins']['get']('AITabs'),_0x4d4a6c=this['context']['locale'],_0x7d8c5d=new ua(_0x4d4a6c,{'label':Es(_0x4d4a6c,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x370c5b,'class':'ck-ai-header_review-translate','showResizeButton':_0x5916dc['showResizeButton']});_0x7d8c5d['delegate']('resizeTabs')['to'](_0x5916dc),_0x7d8c5d['bind']('isMaximized')['to'](_0x5916dc['view'],'isMaximized',_0x4144f1=>_0x4144f1);const _0x563849=new wh(_0x4d4a6c,{'header':_0x7d8c5d,'list':new dc(_0x4d4a6c),'results':new uc(_0x4d4a6c,{'generalErrorText':Es(_0x4d4a6c,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new bh(_0x4d4a6c,{'headerText':Es(_0x4d4a6c,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':Es(_0x4d4a6c,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':Es(_0x4d4a6c,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x563849['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x563849;}registerTab(){const _0x40a6f6=this['context']['plugins']['get']('AITabs');_0x40a6f6['view']['on']('activateTab',(_0x458a49,{newTab:_0x197e29,oldTab:_0x917211})=>{'translate'===_0x197e29?this['fire']('getReviewCheckList'):'translate'===_0x917211&&this['fire']('leaveReview');}),_0x40a6f6['view']['addTab']({'id':'translate','buttonLabel':Es(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x370c5b,'order':0x0,'content':this['_mainView']});}},gc=class extends _0x898608{static get['pluginName'](){return'AITranslateGateway';}static get requires(){return[Hh,Is,tn,Tn];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async runTranslate(_0x38549d,_0x11b05c){const _0x4526ac=this['context']['plugins']['get']('AIReviewCoreEditing'),_0x1686ec=this['context']['plugins']['get']('AIConnector'),_0xf2d3b3=new oc({'id':_0x38549d,'commandId':_0x38549d,'title':_0x38549d,'description':'','isParameterized':!0x1}),_0x35e2b7=new Kh(_0x4526ac['getDocumentData']({'roots':_0x11b05c?.['roots']}),_0xf2d3b3,_0x1686ec,void 0x0,{'language':_0x38549d},_0x11b05c?.['contexts']);return _0x4526ac['runCheck'](_0x35e2b7,{'signal':_0x11b05c?.['signal']});}applyTranslate(_0x207de6,_0x44d238){this['context']['plugins']['get']('AIGateway')['apply'](_0x207de6,_0x44d238);}},Ac=class extends _0x898608{static get requires(){return[lc,_c,Hh,gc];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async startTranslate(_0x56065e){const _0x1cd0f6=this['assertStartTranslatePreconditions'](_0x56065e);nh(this['context'],'translate'),await this['context']['plugins']['get']('AITranslateController')['runCheck']({'id':_0x1cd0f6['id'],'args':_0x1cd0f6['useArgs']?_0x1cd0f6['args']:void 0x0});}getAvailableLanguages(){return this['context']['plugins']['get']('AITranslateController')['getAvailableChecks']()['map'](_0x1c503d=>({'id':_0x1c503d['id'],'label':_0x1c503d['title']}));}assertStartTranslatePreconditions(_0x3cb845){const _0x3839a9=this['context']['plugins']['get']('AITranslateController');if(_0x3839a9['getCurrentCheckRun']())throw new ct('ai-translate-translation-already-running',this);const _0x25ce65=_0x3839a9['getAvailableChecks']()['find'](_0x9a8eb7=>_0x9a8eb7['id']===_0x3cb845);if(!_0x25ce65)throw new ct('ai-translate-unknown-language',this,{'languageId':_0x3cb845});return _0x25ce65;}};export{gh as AIActions,Li as AIAdapter,ss as AIAssistant,ts as AIAssistantUI,Va as AIBalloon,ka as AIChat,er as AIChatController,ho as AIChatFeedCustomElementView,va as AIChatHistory,Oa as AIChatHistoryController,Ca as AIChatHistoryUI,Xn as AIChatInteraction,La as AIChatShortcuts,Aa as AIChatUI,xh as AICheckRunSingleRootResult,Is as AIConnector,Yn as AIContext,Cs as AIContextLibrary,fs as AICore,yn as AICoreError,vn as AIDocumentProcessingGateway,Rn as AIDocumentProcessingRunResult,tn as AIEditing,Wa as AIEditorIntegration,xn as AIErrorReporter,Nn as AIErrorSink,Tn as AIGateway,Fn as AIInteraction,Ts as AIModels,Ah as AIQuickActions,ih as AIQuickActionsUI,Vn as AIReply,Pi as AIRequestError,$h as AIReviewCheck,Uh as AIReviewCheckResult,Bh as AIReviewCheckResultChange,Fh as AIReviewCheckRun,sc as AIReviewGateway,nc as AIReviewMode,Wh as AIReviewModeController,Hh as AIReviewModeEditing,Nh as AIReviewModeUI,On as AIRunResult,Sn as AIRunSingleRootResult,gs as AITabs,_s as AITabsMainView,ls as AITabsView,rs as AITextAdapter,Da as AIToggleButtonUI,Ac as AITranslate,lc as AITranslateController,gc as AITranslateGateway,_c as AITranslateUI,as as AWSTextAdapter,os as OpenAITextAdapter,Hi as ShowAIAssistantCommand,Pa as ToggleAICommand,Hn as createResizeButton,ns as getDefaultAICommands,mn as markOperationsAsAI};